Forum:Wikipedia-style reference popups

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search
Forums: Yew Grove > Wikipedia-style reference popups
Archive
This page or section is an archive.
Please do not edit the contents of this page.
This thread was archived on 23 June 2013 by Suppa chuppa.

This should be a fairly straightforward thread.

Check out Wikipedia:RuneScape. Hover over any superscript and bracketed number. What do you notice?

I think that's pretty neat and that maybe we should try doing something like. Sadly, I can't say I know where WP keeps the code for these hovers, but I'm sure someone out there knows and if not, I'll find it if it looks like we like the idea.

So what would this mean for syntax changes? Well nothing too drastic. I guess the change is easily summarized in this edit. Any references done the old way will be fine, just no helpful popup that keeps you from having to change where you are on the page. It would also be nice to force all of our bibliographies to the same are because having them all in the body of the article is kinda messy.

Anyways, thoughts?

Discussion

I'm here. I'm clear. Get used to it. MolMan 22:34, June 3, 2013 (UTC)

Comment - [[w:c:dev:ReferencePopups|Already created]] — Jr Mime (talk) 22:40, June 3, 2013 (UTC)

Cool, saves me the trouble of trying to find the code. But actually, from the looks of it, you are required to use a template. I prefer whatever WP does, it allows use of the tags as well. MolMan 22:41, June 3, 2013 (UTC)

Support - Seems good, no harm intended. — Jr Mime (talk) 22:43, June 3, 2013 (UTC)

Wikipedia's script/Added to gadgets - wikipedia:User:Yair rand/ReferenceTooltips. It's a gadget enabled by default, hence you won't find it (or probably most of the scripts on wikipedia) in their Common.js. I remember testing it here a few months back, it largely works, but the config options aren't compatible with Oasis. It shouldn't be too hard to fix though. It can be enabled through Special:Preferences, should you wish to try it out. cqm 23:47, 3 Jun 2013 (UTC) (UTC)

You're a baws, Cåm. It also appears to work no matter how the references are cited. This didn't appear to be the case when I looked at multiple WP pages (maybe I'm just broken), but either way, it'd still be nice to change our bibliography format. MolMan 12:41, June 4, 2013 (UTC)
Because I was having issues trying to update Wikipedia's script, I've started rewriting the script from scratch trying to make it work as close as possible to the original. If anyone wants extra features for the script I'll try to implement them. cqm 09:11, 6 Jun 2013 (UTC) (UTC)

Comment - Nothing would change to the way we use the reflist or cite templates, right? Just to make sure... Oh, and I didn't get the last sentence, with the Drakan link. Care to elaborate plox? User_talk:Fswe1 Fswe1 Brassica Prime symbol.png 05:44, June 4, 2013 (UTC)

Do you not see how all of the citations are inside the text of the article? It'd be better to replace that with a little <ref name="ref#"> or something of the sort to help with readability of the source. MolMan 12:35, June 4, 2013 (UTC)
Wouldn't that kill the point of detailed citing templates? Or am I missing something? User_talk:Fswe1 Fswe1 Brassica Prime symbol.png 13:05, June 4, 2013 (UTC)
We might need to change the templates, but that's not a problem. This is an idea of what the change is. Sorry for not getting it right, it's probably something with the templates, but that edit is pretty much what the proposed change in bibliographies is. MolMan 13:24, June 4, 2013 (UTC)
It's fairly broken, yeah. :P Anyway, I get the idea. The popups are quite handy, but the references being stuffed together in a list at the bottom to make the references near their respective phrases shorter seems a bit superfluous to me... User_talk:Fswe1 Fswe1 Brassica Prime symbol.png 14:49, June 4, 2013 (UTC)
It looks a lot neater. I only brought it up because it looked like references had to be done that way. Citations on other WP pages I looked at didn't have the popup when done other ways. Seems that's not the case with the gadget cam imported. It'd be nice to change our citation methods, but that's not the point of this thread. MolMan 14:51, June 4, 2013 (UTC)
I think it's broken because there's no closing </references> tag. Using named refs like that is a much cleaner way of doing it. cqm 17:38, 7 Jun 2013 (UTC) (UTC)
Goodness, people. There is a |name= parameter in all the cite templates for a reason. Hair 15:43, June 11, 2013 (UTC)
Yes, but my change to reference templates involves moving the actual bibliography to the end of a page. MLA format man. MolMan 15:45, June 11, 2013 (UTC)
That seems silly to me. Declaring the references at the bottom of the page, just to have them in the article through {{NamedRef}} again. Either way something's going to be there in the artcile and either way they'll be listed at the bottom. Hair 15:51, June 11, 2013 (UTC)
I personally feel it's cluttered, but again, if I ever feel I care enough, I'll bring it up in a new forum. This pop-up actually came to mind for the notes we have in drop tables, etc. Wasn't thinking much about actual citations :P. MolMan 15:53, June 11, 2013 (UTC)

Comment - We kind of already have it, just minus the little "examine" description, and not so much of a confusing list of references at the bottom.Ice Rush12Zaros symbol.pngTalkHiscores 06:34, June 4, 2013 (UTC)

What are you talking about? We don't have it at all... MolMan 12:37, June 4, 2013 (UTC)
The references are easy to read, yes. This is to add nothing more than clarity and functionality for our visitors. Hair 16:22, June 5, 2013 (UTC)
I think [[mw:Reference Tooltips]] sums up why this is a good idea. cqm 17:38, 7 Jun 2013 (UTC) (UTC)

Support - Per Jr Mime. Temujin 11:16, June 4, 2013 (UTC)

Support - Hair 16:22, June 5, 2013 (UTC)

Support - This would be a nice little addition :). MahjarratInfo101 (talk) 06:57, June 7, 2013 (UTC)

Support - If it can be done, then it would be a nice addition to articles without going back and forth between sections. Ryan PM 16:37, June 7, 2013 (UTC)

The wikipedia script relies on a later version of jQuery, which Wikia haven't updated to (the last update was probably since the 1.19 MediaWiki upgrade last summer). It is worsened by the fact that Monobook and Oasis have different versions of jQuery ported with them, I imagine because Monobook came with whatever was ported with it and Oasis was updated to use a later version.
I've decided to remove certain functionalities like the configuration form being resizable and movable as I'd have to code these in myself, but I can try to add them in at a later date. I'm also a little hesitant to move from jQuery to native javascript on the basis that I really don't know what browser our readers use. Wikia don't support actively support IE 8 or earlier, but I don't really want to risk it with a script enabled by default. cqm 17:38, 7 Jun 2013 (UTC) (UTC)

Support - 5-x Talk 17:13, June 7, 2013 (UTC)

Redundant support - 222 talk 01:20, June 8, 2013 (UTC)

Reduntant redundant support - JOEYTJE50TALKpull my finger 21:11, June 8, 2013 (UTC)

Update - I have a working (unfinished) script; js can be found here, css here. If you'd like to test it for yourself, simply add:

mw.loader.load('https://raw.github.com/onei/script/master/ReferenceTooltips/referenceTooltips.js');
mw.loader.load('https://rawgithub.com/onei/script/master/ReferenceTooltips/referenceTooltips.css', 'text/css');

to the bottom of your common.js. Alternatively you can use a skin specific variant if you don't want to enable it on both skins or if your kermit. You can alter the settings through a link found at the bottom of every mainspace and project page.

I have yet to write any proper documentation on how it works, but I've tried to keep the same functionality and user config options as found on wikipedia's version. There are still a few bugs I'm working on, the major one is for tooltips activated with hover. Others are largely to do with logic for where tooltips are positioned. Let me know what you think. cqm 22:28, 16 Jun 2013 (UTC) (UTC)

What is the eventual difference in this script versus the script found on the dev wiki? Hair 13:52, June 17, 2013 (UTC)
If the one found on dev wiki is what mime showed us (meaning there's no other script on dev), then we're forced to use templates to actually see these. No thank you on that. MolMan 13:54, June 17, 2013 (UTC)
Then what about this - http://en.wikipedia.org/wiki/User:Yair_rand/ReferenceTooltips ? Hair 16:50, June 17, 2013 (UTC)
IDK, ask Cam. MolMan 16:52, June 17, 2013 (UTC)
Dev wiki (Lunarity's) script: Dev wiki's version includes various functions and an import of a library designed to detect colours used in ThemeDesigner, all used to allow it to function on every Wikia wiki, as all dev wiki scripts should. My version can cut all that out knowing it doesn't need to work on any other wiki. Lunarity's version is probably better, but it's largely unsupported based on how little I've seen of Lunarity recently. It does work without the template mentioned (the template is for a customised version), but honestly I prefer the feel of the version found on wikipedia.
Wikipedia's script: It's not maintainable. Take a look over wikipedia's script; it's a nightmare to work from. I had around a dozen attempts at trying to get it to a point where code validation sites didn't scream and hide in a cave in fear, each time something in it broke and I failed miserably. When I showed it to Matthew, he more or less went "it's horrible". The code structure is beyond difficult to follow. It is outdated in various parts and may be susceptible to XSS. There are also issues with it integrating into Oasis (it's been designed for monobook along with vector, so should work fine there) and contains dependencies not supported by Wikia.
If Wikipedia's version worked fine with minimal tweaks and was maintainable I'd take it every time. With that in mind, I've tried to replicate it as much as possible. It lacks the gloss of wikipedia's version, but it's minor things that take minimal effort to add in. cqm 23:12, 17 Jun 2013 (UTC) (UTC)
Oh, I was unaware that it wasn't working in oasis properly. I assumed that this was created in jQuery (onHover/onClick) and was only dependent on a few classes/ids. If only the wiki could be in monobook... anyways, thank you for clearing that up. Hair 00:37, June 18, 2013 (UTC)
Essentially, it is just jQuery's hover and click functions. In very basic terms:
  • It takes the event's target (click or mouseover) and retrieves the href of the anchor tag found within the superscript reference.
  • This href is then used to locate the relevant reference and clone the part we want to show in the tooltip.
  • The text pops up next to the reference.
  • When you click away or move away from it the tooltip disappears.
It looks so simple when I put it like that Wink I really wish it were.... cqm 00:55, 18 Jun 2013 (UTC) (UTC)

Closed - The proposal will be implemented once Cam manages to get the script fully working. Suppa chuppa Talk 20:52, June 23, 2013 (UTC)