Last modified: 2014-09-24 13:25:25 UTC
The content of a footnote (or the beginning of it, until XX characters) could appear in a tooltip when the mouse pointer is over the reference link : this way, short notes are visible while reading, which is better for the reader.
I might have a look at this one, I'm busy revamping cite.php anyway (see http://bugzilla.wikimedia.org/show_bug.cgi?id=423)!
When assigning bugs, please *do it right*. Thanks.
Created attachment 3013 [details] Reference in tooltip Added a bit of javascript which adds a title to the id of the reference.
Created attachment 3018 [details] new patch This patch puts the text of the reference into the title-field of the tooltip. In this way people will be able to see the text of the reference by hovering over the reference, and they do not need to scroll all the way down (which is distracting when reading the document). A demo is running on chemistry.poolspares.com, though it is there combined with the patch on bug 423.
Created attachment 3019 [details] reference in tooltip cleaner references, for comments see previous patch
Created attachment 3028 [details] new patch updated patch, remove an error
Created attachment 3032 [details] tooltip patch (previous patch was broken)
Commited as r19202
Reverted; this needs work. A few notes: * Raw HTML code in messages seems rather... icky. Fragile and likely to fail due to mistakes or customization gone awry. :) * When generating JavaScript literal strings, you should probably use Xml::escapeJsString rather than trying to roll your own escape function; this keeps things consistent and is probably safer (eg newlines and escapes are already handled in a common place) * Don't forget to run the parser tests, and update them if necessary. This patch breaks 10 test cases. * The use of JavaScript seems pretty weird here to begin with. Why use JS at all? It harms compatibility and is probably more fragile than simply putting the title attribute where it belongs in the first place.
I'll quick-reply to this. * Understood, they have to move to the main code. Don't need customisation, anyway. * I'll look into the documentation for that. * Ke, asked for testing, but will try to run them myself as well. * Nope, doesn't work, references are not by definition known at the moment the HTML of the inline reference mark is generated, so have to be supplied later anyway. Another problem there is that it is wikitext, which does not have the possibility to add a custom title.
Created attachment 3071 [details] refs in tooltip Added tooltips and adapted citeparsertests.txt Re previous comments: * Changed rendering of javatext title parameter * Parsertests.php does not give more errors than before. * internationalisation removed (these parameters do not require customisation/internationalisation) * Added comment in code on why Java and why there Please test and check, this is my first Javascript addition. Hope this is all correct.
Created attachment 3918 [details] refs in tooltip updated I updated the patch to make it working on the latest revision. There's a big problem with this implementation : tooltip content is displayed in raw HTML. If there's a link, bold or anything in the ref tag, HTML tags are included in the tooltip. I see two ways to avoid that : * Remove HTML tags and only display content (probably error prone). * Replace the tooltip with real HTML rendered by the browser (probably complex javascript code).
Hmmmm, it might be cleaner to do a ful display in client-side JS. Since the reference's contents get rendered later on the page, they can be fairly straightforwardly retrieved at display time by JS and copied into a floating box which is shown on mouseover. Using a trimmed and HTML-stripped text for a 'title' attribute might also be a little extra helper suitable for browsers with JS disabled or unavailable.
*** Bug 11515 has been marked as a duplicate of this bug. ***
I am not quite sure "tooltip" is the right wording. I would rather call it a "pop up". They have it on an internet site I know, for example on that page : http://www.nonfiction.fr/article-171-hobsbawm_et_le_bicentenaire_de_la_revolution.htm I find it convenient and, well... "cool".
There is a possibility in JavaScript on http://fr.wikipedia.org/wiki/Utilisateur:Deep_silence/ReferencesPopup.js
The Cite extension is not really the place to implement this. As user javascript, it is stable and well implemented (see [[Wikipedia:Tools/Navigation popups]]). If you have no intention of fixing the code, this could be closed on the basis of being already fixed there.
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Mike, thanks for the patch. (In reply to comment #13) > Hmmmm, it might be cleaner to do a ful display in client-side JS. Since the > reference's contents get rendered later on the page, they can be fairly > straightforwardly retrieved at display time by JS and copied into a floating > box which is shown on mouseover. > > > Using a trimmed and HTML-stripped text for a 'title' attribute might also be a > little extra helper suitable for browsers with JS disabled or unavailable. Per this review by Brion, I'm marking this patch as reviewed. Do you have time and/or interest in revising your patch? Thanks again!
For the record, this was implemented as a default gadget on English Wikipedia. See: * [[Special:PrefixIndex/Mediawiki:Gadget-ReferenceTooltips]] * https://en.wikipedia.org/wiki/WP:Village_pump_(miscellaneous)?oldid=503078267#ReferenceTooltips * https://en.wikipedia.org/wiki/WP:Village_pump_(proposals)/Archive_89#Reference_Tooltips
There is discussion here: *http://en.wikipedia.org/wiki/User_talk:Yair_rand/ReferenceTooltips
Updating summary. Should this become the new default or just an option? Would making it the default save parsing time? If default, does having the notes render in HTML in the same point where they are in wikitext save parsing time? From hearsay: the parser doesn't enjoy fetching the last chunk of the HTML from all over the wikitext of the page, right?
I like the idea of having the ReferenceTooltips as default. Maybe it should be integrated with Extension:Cite. However, I'd like the title attribute of the <sup>'d reference links to be generated in HTML, for maximum compatibility and accessibility. These could then be removed by JS as it dynamically adds the rich tooltip (the progressive enhancement pattern). Interestingly, pure-html toolstips can even be slighly formatted with control characters such as line breaks and tabs (see http://stackoverflow.com/a/12486358/266309)
It looks like some experimental tooltip code was added to cite.php but recently removed. We now have the experimental HoverCards which works pretty well for reference tooltips.