Karl Wick saith:
Here is a technical question: in the same way that the table of contents feature can be opened and collapsed with a click apparently wihout reloading the whole page (which IMHO is a very cool feature !), could we have collapseable notes for the edge of a document ?
We can easily use the same (or almost the same) code for hiding/showing sidenotes as we already do for hiding/showing the table of contents. I made a sample at
http://www.wikipedia.org/upload/a/a2/Sidenote.html
with JavaScript code based on the wikibits.js ToC code. The changes are to allow the ToC/note functions to operate on any ID, not tocinside, and for the default to be hidden notes. (Hmm...one could add another feature that allows selectable default...another parameter...and then showTocToggle(...) could be showNoteToggle(..., 'tocinside', true)...)
The code requires a simple one-row floating table, with one cell being display: hidden and having an ID, and the other cell calling showNoteToggle() instead of showTocToggle() with parameters "Show", "Hide", and the first cell's ID. I'm sure if one really wanted that one could use a floating div within a floating div so the [hide] link looks like a section [edit] link and doesn't take up vertical space.
How to put this in Wikipedia code: maybe use a <sidenote> tag. <sidenote id="x">text</sidenote> expands to <table class="sidenote"> <tr> <td id="x" style="display: none; width: 300px;">text</td> <td><script>showTocToggle('Show', 'Hide', 'x'</script></td> </tr></table>. I don't know PHP, else I would have helped add this to the Wikipedia source.
The sample page has been tested in Mozilla 1.4 and Internet Explorer 6.0. It fails in Opera 6.0 - but so does the ToC.
===== -Geoffrey Thomas geoffreyerffoeg@yahoo.com
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
On Fri, Aug 08, 2003 at 06:26:42PM -0700, Geoffrey Thomas wrote:
Karl Wick saith:
Here is a technical question: in the same way that the table of contents feature can be opened and collapsed with a click apparently wihout reloading the whole page (which IMHO is a very cool feature !), could we have collapseable notes for the edge of a document ?
We can easily use the same (or almost the same) code for hiding/showing sidenotes as we already do for hiding/showing the table of contents. I made a sample at
http://www.wikipedia.org/upload/a/a2/Sidenote.html
with JavaScript code based on the wikibits.js ToC code. The changes are to allow the ToC/note functions to operate on any ID, not tocinside, and for the default to be hidden notes.
Hold on a second. Such a default makes sidenotes completely unavailable for text browsers, not ? Please make sure your code also works with Javascript turned off.
Tomasz Wegrzanowski wrote:
On Fri, Aug 08, 2003 at 06:26:42PM -0700, Geoffrey Thomas wrote:
...and for the default to be hidden notes.
Hold on a second. Such a default makes sidenotes completely unavailable for text browsers, not ?
Or any browser that knows CSS but not JavaScript (or has JavaScript disabled!).
Simplest way around that is to do the hiding in the page's onLoad event handler; the JavaScript-less or CSS-less will see the things always, which is probably better than never.
-- brion vibber (brion @ pobox.com)
Very cool ! -Karl
--- Geoffrey Thomas wrote: http://www.wikipedia.org/upload/a/a2/Sidenote.html
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
textbook-l@lists.wikimedia.org