[Textbook-l] Re: disappearing/reappearing column side-notes

Geoffrey Thomas geoffreyerffoeg at yahoo.com
Sat Aug 9 20:09:30 UTC 2003


Brion Vibber saith:
> 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.

Only in CSS but not JS browsers; it shows in text (non-CSS) browsers.

(Currently in Mozilla 1.4 with JavaScript disabled, the sidenote is hidden as an
annoyingly tiny purple box. Currently in Lynx 2.8.4 (or whatever came
with Cygwin) the text appears and is not delimited as a sidenote at all - it
appears as another paragraph. How do you mark this up to be set off as a
sidenote in Lynx?)

Code changes:
Changed showNoteToggle() to make "show" the default, but immediately call
toggleNote(). We can't use onLoad because a single page can have many notes
on it. In Mozilla without JS this shows the note without the showlink;
with JS it works the same as before. Also moved width:300px to a class
(.notetext).

This means that the default for scripted browsers is hidden - this is
what we want, right?

tocWas is a single global, and I presume the purpose of it was to keep
display: list-item, inline, block, etc. info. It seems to work when both
notes have the same display, but for good measure there's now an array
notesWere, indexed by ID.

How to put this in Wikipedia:
In wikibits.js add the Note functions - or better yet replace the Toc
functions with them, passing "tocinside" as the ID. Add the note
classes to the style sheet. Parse <note>text</note> as
 <table class="sidenote"><tr><td id="xx" class="notetext">
  text
 </td><td valign="top">
  <script type="text/javascript">
   showNoteToggle("Show sidenote", "Hide", "xx");
  </script>
 </td></tr></table>
where xx could be, say, note0, note1, note2... The valign-ment is
necessary to keep the [Hide] link from jumping from top to middle.

I made updates on my local copy,

  http://geoffrey.homeip.net:8080/sidenote.html

The uploaded sample, [[Image:Sidenote.html]] or

  http://www.wikipedia.org/upload/a/a2/Sidenote.html

was not intentionally updated yet, but it seems to be the new
version (I don't know how or why). The new version has two sidenotes.

=====
-Geoffrey Thomas
geoffreyerffoeg at yahoo.com

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the Textbook-l mailing list