Page when printed shows entire page, not just content
-----------------------------------------------------

                 Key: JSPWIKI-650
                 URL: https://issues.apache.org/jira/browse/JSPWIKI-650
             Project: JSPWiki
          Issue Type: Bug
          Components: Default template
    Affects Versions: 2.8.3
         Environment: Ubuntu 9.10+ Jetty 6. Viewing in Firefox and Chrome on 
both Ubuntu and Windows XP.
            Reporter: Chris Haynes


When a page is printed only the central content should be printed. There is a 
bug which results in the entire page, as displayed in the browser, being 
printed.

I have taken as authoritative  Janne's 'Default Way' entry in 
http://www.jspwiki.org/wiki/HowToCreatePrinterFriendlyPage for how printing is 
supposed to work. It does, indeed, work like this after I apply the patch below.

The bug is that in templates/default/commonheader.jsp, between lines 23 and 28, 
the link to the style sheet 'jspwiki_print.css' is emitted BEFORE the 
stylesheet 'jspwiki.css'. This is wrong. The print-specific sheet should come 
second (it overwrites settings made by 'jspwiki.css').

The fix is to reverse the order of these two links (and remove the duplication 
detailed below).

The stylesheet links are emitted AGAIN between lines 79 and 82, again in the 
wrong order. In my fix I have patched these duplicates out, but someone who 
understands the logical flow of this template ought to check to see if there 
was a reason for duplicating them, or if it is the first pair of links that are 
at lines 23 - 28 that are redundant.

A quick way to convince yourself that two copies of each stylesheet are being 
emitted is to use the Firebug CSS tab then open the file selector, which shows 
that two copies of both templates have been downloaded. As at the date of this 
submission this can quickly be seen at the home site http://www.jspwiki.org/ .


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to