​Hi, 
​Thanks for the reply.​

On Mon, May 25, 2015 at 6:31 PM, Isaac Bennetch <bennetch@gmail.com> wrote:
Hi,

Sorry for my delayed response; it's a holiday weekend here and I was
away from the internet all day yesterday.

On 5/23/15 6:29 AM, Deven Bansod wrote:
> Hi,
>
> RFE #701 proposes that we should replace the 'Print View' and 'Print
> View (with Full Texts)' with a 'Print View' Option which should print
> out the CSS of the page only (i.e. whatever exactly is currently
> displayed on the page itself).
>
> /I had something in mind about the implementation, but am not able to
> figure some details. Any help in this regard would be appreciated. /

My first thought when I saw the initial feature request years ago was to
make a print view stylesheet (such as [0])that hides the navigation
frame, menu bar, etc. At the time, that wasn't a viable option because
of the frameset, but with the move to a single page for display it might
be possible now. I did not test whether this would actually work for us,
but if it does the "Print" button can simply become a javascript
function to tell the browser to print rather than opening a whole new
plain-formatted page with different rendering. For me, this certainly
would be the preferred method if it works.


​Thanks for the link. I will look into it and explore.​

 
> *Details of implementation:*
> On clicking the 'Print View' link, it will call a click-handler JQuery
> function which will get the HTML for the table from the current page,
> traverse through the HTML.
>
> Then, make a JSON of relevant information such as SQL Query, No. of
>  Rows, Column Heads and then arrays of values in each row *for SQL
> results* and information such as Table Name, Rows, Type, Collation,
> Size, Overhead, Comment for *db_structure.php and tbl_structure.php*.

This seems like quite an original idea, I like it so far.

> Now, send a POST Request to a PHP file and get the $response
> (PMA_Response) after making a output with good-looking table and other
> details and the 'Print' Button.
>
> The main problem I am facing here is that, how should I output the
> $response ?
>
> I thought of a very-unlike-PMA way:
> Open a new tab with JS and add HTML to it as
>
>     var w = window.open();
>
>     $(w.document.body).html($html);

I don't see a problem with that.

> ​But here I guess there will be difficulty to use PMA_Response with its
> headers(and do I actually need to use PMA_Response or can I just print
> the $html_output recieved from PHP file).

For print view, avoiding PMA_Response might be okay, especially since I
don't see a way to do it with the code you've proposed above.

> or Can I somehow use 'target="print_view" ' and get the $response to be
> shown onto it ?

Hopefully someone else has some thought on this because if it's
possible, I don't know off hand.

> Also, please suggest any flaws/ possible problems that I may have missed
> or if you would suggest a different way.

I don't see any shortcomings or obstacles that you haven't already
addressed; the javascript code to add HTML makes sense and so
on...processing should be fast since we already have the data and are
just passing it around as JSON.

I'd love if some other developer has additional thoughts, but so far it
sounds pretty good to me.


​Thanks for your insight. I have worked out a few things on this lines,
will submit a pull request soon and then you can review it.​

I am currently using target attribute of form tag. It is deprecated in HTML4
but is re-introduced in HTML5. Till now working fine. Will update you in the PR.

 
> Thanks.

0 -
http://www.smashingmagazine.com/2011/11/24/how-to-set-up-a-print-style-sheet/

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Phpmyadmin-devel mailing list
Phpmyadmin-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel



--
Regards,
Deven Bansod