Description
You can toggle line numbers in print preview.
1 ...
And what's the bug exactly?
- I guess that you should not have UI / navigational elements in the print view at all.
- And then the people will report a bug who want to have it there, to toggle line numbers?
Yes, but Toggle Line could be probably exchanged to a small sign in print mode, e.g. what is if a click on the border will toggle?
- And then the people will report a bug who want to have it there, to toggle line numbers?
Details
This Wiki.
Discussion
-- OliverSiemoneit 2006-11-19 12:27:34 :
- To comment the discussion above I would say: we should have navigation elements in printview but not in print (or the built-in printpreview function of the browsers) itself!
- This statement is only true for modern browsers which interpret different css-mediatypes depending on the target media.
I have added .codenumbers { display: none;} to print.css (moin 1.5.4-1).
- I think some people might want to have linenumbers in printout.
- They have! Class "codenumbers" is only the text "toggle line-numbers". The line-numbers itself are not affeted by that.
I have assured that when changing to action=print also screen.css an common.css is included into the html page code (by some changes to ThemeBase.html_stylesheets, i.e. taking out the check mode and inserting always all media css)
- That's maybe not the way it is intended to work...
- Yes, you are right. The above solution does onyl work for modern browsers which do make a difference between the outputmedias. On old, buggy browsers there will be no way to toggle linenumbers anymore since the text "toggle line-numbers" in print.css is not displayed, print.css is the only css included and you can't give these browsers also screen.css and projection.css because they are confused by that. I guess that's the reason why we have the current solution.
- Result: On the screen you can still toggle linenumbers in printview now but the line "toggle line numbers" is not printed out itself.
- That's ok if you are happy with the default view (see above). If not, you have no way toggling it.
- That's only true for old browsers which don't automatically choose the right css depending on the ouput media. It worked for me on my browsers: still able to choose in printview whether to have linenumbers or not but the text "toggle line numbers" is missing now in print on paper. And that's what I wanted. Try it out with your browser.
- Remaining problems:
- Toggling line numbers does have no effect on printing in IE7 (Firefox is ok): the line numbers are always printed out! I don't know why. But that's not a problem of the above solution. It's also a problem of this wiki. Maybe I should write a separate "bug" report for that.
- There also seems to be some conflicts having print.css, screen.css and common.css now in printview on screen - at least on IE7. Screen display isn't correct anymore. There are only minor issues on Firefox
- Maybe it is worth a think if we should also add a link "Return to screen view" (?action=show) to the printview so as to ease navigation for the users. This link could also be hidden in print by the same technique as explained above.
- Ok. That's affected of the same problems as above.
- Or even more radical: Why do we need to have an action=print at all? Isn't it enough to use the browser-built-in print preview function to see the page in print.css (works with IE7, Firefox 1.5.0.8 and Opera 9.02 on XP)? Is this some reminiscence to some out-dated browsers which do not support printpreview with print.css? Wouldn't it be less confusing for users to drop the menu item printview therefore but leave the action=print documented in the helpfiles for people with that archaic, buggy browsers?
- Yes, reason is archaic browsers (or archaic users maybe too).
Which browsers do still not interpret the different mediatype-css so that they need a separate "print.css" without any other css like screen or projection so as not to be confused? How about having two print.css like print_ob.css and print_nb.css? print_ob.css is still like it is and only used by action=print to support these old browsers. For modern browsers it should not be a problem to have all css included in the htmlcode of a page since they choose the right css depending on the mediatpye. Here we could have - besides the others - print_nb.css included with the solution mentioned above with .codenumbers { display: none;} so that line-numbers are printed out or not - as the user has choosen - but wihtout the annoying text "toggle linenumbers". Or am I making some mistake in my thoughts?
Sometimes someone wants to embed rendered markup into an other application.
Patch
-- OliverSiemoneit 2006-11-19 20:44:39 : If you use some up-to-date-browser and you are annoyed that "toogle line numbers" is still printed out, try this:
Patch MoinMoin/theme/__init__.py (moin 1.5.4-1) as follows:
--- old__init__.py 2006-11-19 21:06:52.000000000 +0100 +++ __init__.py 2006-11-19 20:56:30.000000000 +0100 @@ -83,7 +83,7 @@ stylesheets_print = ( # media basename ('all', 'common'), - ('all', 'print'), + ('all', 'print_ext'), ) # Used in slide show mode
Make a copy of print.css and rename it to print_ext.css. You should now have common.css, screen.css, print.css, print_ext.css and projection.css in your themes css folder.
Add to print_ext.css the following lines:
.codenumbers { display: none; }
Note: you have to do that for all the themes you intend to use.
Now you can start. E.g. go to SyntaxReference and toggle line numbers as you want. Instead of choosing "printview" in the actions menu, choose print or printpreview in your browsers menu (on most modern browser [not IE] you do not need to call action=print! as far as I can see). In print or printpreview you can now see: There is no text "toggle line numbers" anymore and line numbers a printed out or not as you have choosen on the screen view (Note: This does not work with IE7. Here line numbers are always printed. Thanks MS-guys for that. Works great on Opera and Firefox!)
If you have an archaic browser, you have to use the action=print to get the print view. There is no way to prevent the text "toggle line numbers" from getting printed out. But at least you are able to choose whether to have line numbers or not.
Annotation: You can do the same for the "Show top/bottom links in headings". Therefore you have to provide a css class for the up and down arrows (e.g. css="updown_arrows") in formatter/text_html.py
# TODO: convert this to readable code if self.request.user.show_topbottom: # TODO change top/bottom refs to content-specific top/bottom refs? result = ("%s%s%s%s%s%s%s%s" % (result, kw.get('icons', ''), self.url(1, url="#bottom", css="updown_arrows", do_escape=0), self.icon('bottom'), self.url(0), self.url(1, url="#top", css="updown_arrows", do_escape=0), self.icon('top'), self.url(0))) return "%s%s%s" % (result, kw.get('icons', ''), number)show_
In print_ext.css you can then deactivate them by:
.updown_arrows { display: none; }
Plan
- Priority:
- Assigned to:
- Status: