Jump to content

Talk:Reference Tooltips

Add topic
From mediawiki.org
Latest comment: 1 year ago by JWBTH in topic Tooltip style is outdated, please update


Some comments, +prototype

[edit]

Interesting idea. I've made a sort-of working version at User:Yair rand/ReferenceTooltips.

A few points:

  • In cases where the reference is very close to the reference section (both on the screen at the same time), duplicating the reference content in the tooltip probably isn't the best option. Maybe just give the reference the "targeted" color, or otherwise draw attention to it?
  • This could get very annoying when users are just using their mouse to read through the text quickly, and the tooltips keep popping up... Yair rand 05:45, 30 November 2011 (UTC)Reply
Would it be a okay if I just went ahead and proposed that Reference Tooltips be enabled (maybe first as just a gadget) on a Wikipedia, or would I be messing up some kind of official WMF process that ends in a much better version of RT being added straight into Mediawiki (or something like that)? Yair rand 21:16, 6 December 2011 (UTC)Reply
Go right ahead. It's not an official project; just something I threw together one day. Jorm (WMF) 21:39, 6 December 2011 (UTC)Reply
Reference Tooltips is now available as a gadget on the English Wikipedia. :) Yair rand (talk) 18:23, 4 April 2012 (UTC)Reply
And also on the Serbian Wikipedia. micki 22:11, 7 April 2012 (UTC)Reply
And now on Polish Wikipedia too. (As well as on Catalan, I think.) Matma Rex (talk) 09:35, 1 September 2012 (UTC)Reply
...and Portuguese. Helder 19:54, 2 September 2012 (UTC)
Count the Bulgarian one in as well. ;) — Luchesar • T/C 13:51, 27 October 2012 (UTC)Reply

an alternative implementation

[edit]

so an alternative implementation is available (and actually also enabled by default, so used by anons also) on hewiki for some time now (it's available as a gadget since feb 2012, and is on by default after some user feedback since march). for actual implementation please see he:Mediawiki:Gadget-CiteTooltip.js. it uses jquery.tipsy, so if you want to use it, add dependency for jquery.tipsy in your gadget-definition page. it also contains some code to deal with RTL vs. LTR cite-notes. if your wiki does not support cite-notes directionality, it can be simplified a bit. קיפודנחש (talk) 21:57, 19 April 2012 (UTC)Reply

very good--Shizhao (talk) 14:17, 31 July 2012 (UTC)Reply

Well done!

[edit]

Not sure whether this is the appropriate forum, but I just wanted to say what a great addition the hovering references are. Well done!! MeegsC (talk) 22:42, 18 July 2012 (UTC)Reply

Completely agree! Awesome functionality!
Is there a guide to enable Reference Tooltips in Wikipedia Pages that do not have them enabled yet? (found several in English Wikipedia and other languages) 2001:4898:0:FFF:0:5EFE:A50:F942 02:45, 22 August 2012 (UTC)Reply
There is discussion at en:User talk:Yair rand/ReferenceTooltips.
See the "Reference Tooltips" checkbox on the gadget tab (browsing section) in My Preferences:
The Reference Tooltips checkbox is filled in by default. That means it is enabled by default on English Wikipedia for both registered and unregistered users. Timeshifter (talk) 18:04, 22 August 2012 (UTC)Reply

Using the same interface for a reference summary gadget.

[edit]

I would be delighted if this interface could be used in the wikipedia text to summarize references to other articles. If I could use this tool to view the summary of the references I could easily get the gist of the thing the article is referencing and move on in the current article without navigating elsewhere(to the referenced article) and back. Is there any interest in creating this? I understand that if would be difficult to summarize an article such as "Japan", but still it would be incredibly useful. TheKaramanukian (talk) 08:37, 31 July 2012 (UTC)Reply

Do you know w:Wikipedia:Tools/Navigation popups? It seems that is what you are looking for ;-) Helder 13:38, 7 August 2012 (UTC)

Fantastic tool but please be more open about big changes

[edit]

This tool is fantastic. It really makes Wikipedia better because it encourages users to think about the references used. With good references using the "quote" parameter it even seamlessly allows readers to check that the reference was taken in context. All in all this projects is a leap forward in experience. That said, I was disappointed that, even as a daily and experienced user and frequent reader of Signpost, I did not find out about this tool until after it was deployed. The developers need to learn to engage the readers and editors in major changes to the encyclopedia and not do things in back rooms. Just a heads up with a place to provide feedback is all that is required, and I'm not talking about some obscure place where no editors are likely to find it. Anyway, this time, backroom development seems to have worked. Too bad it sometimes doesn't.

PS Could somebody please add some links to the project page where actual discussion is going on? It appears that the Mediawiki Bugzilla number is 7908. Are there any more spots? Jason Quinn (talk) 18:29, 9 August 2012 (UTC)Reply

There is discussion at en:User talk:Yair rand/ReferenceTooltips. Timeshifter (talk) 13:46, 21 August 2012 (UTC)Reply
I agree about needing more info for readers.. I too didn't learn about this until it was deployed, and even then, didn't know *what* it was, just appreciated that it was there. I only found this page after I (somehow) brought up the preferences box and turned it OFF, and couldn't figure out how to get BACK to the preferences box. (I finally found the "Gadgets" page, but the tooltips still seem to be off for some reason) Jimw338 (talk) 03:24, 23 August 2012 (UTC)Reply
Put a check mark in the Reference Tooltips box here:
Then click "Save" at the bottom of the page. Timeshifter (talk) 12:42, 23 August 2012 (UTC)Reply
If you disabled ReferenceTooltips through the "Tooltip settings" box, you can re-enable it by clicking the "Enable Reference Tooltips" button in the footer of the page, as explained in the settings box. Yair rand (talk) 06:05, 27 August 2012 (UTC)Reply
You read the Signpost and you didn't find out about the tool until it was deployed? It was covered in the Signpost twice, and was at VPR (and central discussion) for months. I don't think this can really be considered "backroom development". The enabling of the tool was a community decision. Yair rand (talk) 06:02, 27 August 2012 (UTC)Reply

Implementation in other wikis

[edit]

Hi,

I'm not sure if I'm missing something here, but I want this behaviour in my own wiki. How would I get this to work?

Thanks in advance. Heinrich Krebs Heinrich krebs (talk) 16:19, 2 January 2013 (UTC)Reply

Compatibility with w:en:Wikipedia:Tools/Navigation popups

[edit]

When using this with w:en:Wikipedia:Tools/Navigation popups, Reference Tooltips are not shown.--Nenntmichruhigip (talk) 16:41, 16 April 2013 (UTC)Reply

That's exactly what Yusuf 506 (talk) 18:24, 4 August 2016 (UTC)Reply

[ResourceLoader|default] Not working on my wiki

[edit]

I'm scratching my head as to why [ResourceLoader|default] breaks this on my wiki. The .css is showing loaded by the ResourceLoader, but the .js isn't. If I eliminate [ResourceLoader|default] and make it something the user has to enable it works great. Other gadgets using [ResourceLoader|default] load and work just fine. Any ideas or suggestions greatly appreciated. Hutchy68 (talk) 17:25, 9 August 2013 (UTC)Reply

Could you perhaps provide a link to your wiki?
Note that it is possible to enable it by default without having it use the ResourceLoader by just having [default] set by itself. Yair rand (talk) 00:37, 12 August 2013 (UTC)Reply
Hi, thanks for answering. Yes, I just used [default] which loads it just fine raw and it is working for users and anonymous users. Link is http://www.isogg.org/wiki/, thanks for taking a look. I guess I log debug to ResourceLoader and see what is going on. Hutchy68 (talk) 01:36, 13 August 2013 (UTC)Reply

Tooltiips stopped appearing for no apparent reason

[edit]

Hello,

I'm running a MW 1.21 wiki and I have installed Cite and Gadgets extensions. Then, after exporting Reference Tooltips from Wikipedia, I proceeded to import the file to my wiki and enable the dadget. For a brief period of time everything worked fine. However, now no tooltips appear when I hover over a reference number.

Could anyone please help me find the reason for this behaviour (or lack thereof)?

Thank you! 79.100.37.22 18:13, 31 December 2013 (UTC)Reply

I'd suggest asking at en:User talk:Yair rand/ReferenceTooltips where your question is more likely to be seen than here. :)
(Note: MW1.22 is the current Stable version. It might help to upgrade to that (see Manual:Upgrading), but I'm not a dev, so can't say for sure.) –Quiddity (talk) 23:47, 31 December 2013 (UTC)Reply

Doesn't work in Talk namespaces

[edit]

This gadget works in the Main: namespace and the Wikipedia: namespace (at en.wikipedia.org), but it doesn't work on Talk: or User_talk: namespaces. Is that a feature or a bug? Sparkie82 (talk) 18:30, 25 January 2015 (UTC)Reply

It's a feature, or at least deliberate. References rarely appear on talk pages, so the script doesn't run there to help performance a bit. Yair rand (talk) 23:12, 3 June 2015 (UTC)Reply

I disabled it. How to enable it?

[edit]

I disabled it. How to enable it? Константин Конь (talk) 04:54, 21 March 2015 (UTC)Reply

There should be a link in the page footer named "Enable Reference Tooltips": click on it. Ricordisamoa 22:55, 21 March 2015 (UTC)Reply
Hm, this feature kind of working after I turned it on. Good enough, but a bit strange. Alpha-version, I suppose. Thank you. Константин Конь (talk) 18:10, 26 March 2015 (UTC)Reply

Font change?

[edit]

Did the font or size of the text just change? It seems to be smaller and harder to read. SlimVirgin (talk) 23:22, 29 May 2015 (UTC)Reply

Nothing has changed recently at w:MediaWiki:Gadget-ReferenceTooltips.js or w:MediaWiki:Gadget-ReferenceTooltips.css so everything should still be the same?
You could forcibly increase the font-size for yourself via w:Special:MyPage/skin.css, adding something to override the default 10px -- perhaps something like:
.referencetooltip {font-size: 14px !important;} Quiddity (WMF) (talk) 22:09, 3 June 2015 (UTC)Reply

Tooltips break when browser zoomed in/out

[edit]

They work fine with zoom at 100% but break at other zoom levels (have tested 90%, 110%, 125%). Mainly tested in Chrome (windows and mac) but I have also tested and seen it in Firefox and Safari as well. I have images and better description posted here: https://phabricator.wikimedia.org/T100952 Wicklet (talk) 20:55, 31 May 2015 (UTC)Reply

Does this only happen if you zoom in while the popup is currently visible, or also to later popups after you zoom? If only the former, I don't think there's anything I can do. There's no way for javascript to pick up on a changing zoom level so that it can be re-positioned correctly. Sorry. Yair rand (talk) 23:12, 3 June 2015 (UTC)Reply
The latter, this happens after the page is already zoomed. I am usually zoomed in a bit on my mac because the font is a bit small by default, and I see this issue all the time without adjusting the zoom (i.e. it's already at 110% or so). Wicklet (talk) 22:47, 26 July 2015 (UTC)Reply

Tooltips doesn't show on hover

[edit]

such as chrome ,IE, Firefox, What could cause the problem? UselessPerson2020 (talk) 03:03, 7 August 2015 (UTC)Reply

Tooltips don't work on userpage subpage

[edit]

Hello

On my wiki, Tooltips works on main pages, such as:

https://www.credulism.com/wiki/The_theoretical_argument_for_credulism

but not on this subpage of my userpage:

https://www.credulism.com/wiki/User:Derrick_Farnell/Communicating_with_aliens

Any ideas? Derrickfarnell (talk) 15:47, 20 January 2016 (UTC)Reply

The script is specifically set up to only show in certain namespaces by default. If you change ['' , 'Project' , 'Help' ] to ['' , 'Project' , 'Help', 'User' ] in your Mediawiki:Gadget-ReferenceTooltips.js then it will also work in your userspace. Yair rand (talk) 22:05, 20 January 2016 (UTC)Reply
Thanks very much, Yair.
When I try to save the change, I get a completely blank page, except for the message 'Access denied' in the top-left. I'm the site owner, and can edit 'normal' pages. Any ideas? Derrickfarnell (talk) 22:18, 20 January 2016 (UTC)Reply
I've found that this is a problem with the set-up of my server. Derrickfarnell (talk) 17:33, 21 January 2016 (UTC)Reply
OMG Yair rand you saved my personal wiki!!! I've found how to show reference tooltip almost 1 month, and finally I solved this problem with your answer! Thank you so much :-) HDNua (talk) 17:40, 30 March 2016 (UTC)Reply

I disabled it on Wikipedia

[edit]

Hi, I'm active user of Finnish Wikipedia. I was scrolling down some article on English Wikipedia. I disabled tooltip from the "bubble". I returned to my settings but I could not find the setting where I could have enable it back

Thank you for your time and help! Hedelmätiski (talk) 12:18, 3 April 2016 (UTC)Reply

It seems that in the Finnish Wikipedia version, the link to re-enable it is in the sidebar, titled "Ota viitepuhekuplat käyttöön". This is different from the regular location in the footer of the page. Yair rand (talk) 13:23, 3 April 2016 (UTC)Reply
Where is it located in English Wikipedia? Hedelmätiski (talk) 20:48, 6 April 2016 (UTC)Reply
In the footer, next to the "Mobile view" link. Yair rand (talk) 21:01, 6 April 2016 (UTC)Reply
Thank you! Hedelmätiski (talk) 21:02, 6 April 2016 (UTC)Reply

Activating reference tooltips in a MediaWiki installation?

[edit]

I'm attempting to configure a mediawiki installation so that it fully mimics Wikipedia.  Any suggestions as to how I might be able to configure my installation so that my users can utilize the same functionality, where hovering over a "reference number" in the text of an article generates a small pop-up box with the pertinent reference info and links in the box?

Thanks, Scottperry (talk) 16:38, 21 May 2016 (UTC)Reply

After a little searching, here is the answer to my own question:
This tool is a gadget. First install the Gadgets extension[1], then import it e.g. from the English Wikipedia[2]. 
[1] https://www.mediawiki.org/wiki/Extension:Gadgets
 
[2] https://en.wikipedia.org/wiki/Special:Gadgets/export/ReferenceTooltips
 
Good luck Scottperry (talk) 17:25, 21 May 2016 (UTC)Reply

Tooltips don't work

[edit]

Reference Tooltips don't work? Yusuf 506 (talk) 16:32, 8 August 2016 (UTC)Reply

Hmm, I can confirm this is erratically functioning at this Trwiki article: tr:Mahatma Gandi. It didn't work at first, but after reloading I cannot reproduce... (the tooltips are now popping up, but there is a webconsole error TypeError: onSuccess is not a function)
I'm not proficient at JavaScript - I'd suggest asking the local Tr code expert to take a look at the differences between tr:MediaWiki:Gadget-ReferenceTooltips.js and en:MediaWiki:Gadget-ReferenceTooltips.js (perhaps using http://www.quickdiff.com/), in case they can see what needs to be updated. Quiddity (WMF) (talk) 17:36, 8 August 2016 (UTC)Reply
I'm not seeing any issues on that article. Is the error still showing up? Which browser are you using? Yair rand (talk) 03:17, 9 August 2016 (UTC)Reply
I can't reproduce at all, since seeing it briefly when I first tested at a few random articles. I'm now wondering if I was mistaken or testing too quickly. You'll have to wait for Yusuf 506 to confirm if he's still experiencing it. Sorry. Quiddity (WMF) (talk) 06:08, 9 August 2016 (UTC)Reply

Working on IE and Firefox but not Chrome

[edit]

I'm working on windows 10 and am using this gadget on english wikipedia and when I use it on internet explorer or firefox it works as intended but on chrome it doesn't show on hover and on a click instead of sending to the reference link it shows you the tooltip. Any ideas? Ikesultan (talk) 00:51, 23 August 2016 (UTC)Reply

My guess is that there's a touch screen which is for some reason only being recognized by Chrome. There's no way for Javascript to reliably detect whether the user has a mouse, so the script defaults to only reacting to clicks for users with touch screens (even if there also is a mouse available), so that the touchscreen-only users can still access the tooltips like that. Yair rand (talk) 16:13, 23 August 2016 (UTC)Reply

"Double toolsip" for bibliography-style referenced articles/books?

[edit]

Could the tool be easily modified to allow it to display a "second" level for articles that use the "bibliography style" reference list (example En:Long non-coding RNA )? Or to automatically do this, if there is only a single "author/date pair" listed in the actual reference? Or even for a list, but that could get unwieldy for the user. 2601:801:101:9C00:5549:9FA:7BC1:496C (talk) 14:46, 24 August 2016 (UTC)Reply

Double loading styles

[edit]

Found this in console on simplewiki: Gadget "ReferenceTooltips" styles loaded twice. Migrate to type=general. See <https://phabricator.wikimedia.org/T42284>. TerraCodes (talk) 03:20, 26 October 2016 (UTC)Reply

That should be fixed locally on simplewiki (see en:Special:Diff/747172203 as an example). Helder 11:42, 28 November 2016 (UTC)Reply

Ability to set 'hover' globally?

[edit]

I'm using this mainly in qupzilla 1.8.9 (a linux browser) where I have to click on the link to enable seeing the reference. When I try to change it to 'hover' I'm not able to change it as it seems to be locked onto 'click'.

However, when i look at the same page and reference in firefox, its showing as 'hover'!

Is it possible that this can be set globally in some form of configuration script or css such that you can set it to hover for every user please? Sharonmk (talk) 11:31, 7 April 2017 (UTC)Reply

Unfortunately, there is no way for the script to determine whether the user has a mouse, so it defaults to "click" if the user has a touchscreen (as determined by presence of ontouchstart) even if the user also has a mouse. If the user only had a touchscreen, setting it to "hover" would make both the tooltips themselves and the settings menu inaccessible, so that's not given as an option when a touchscreen is detected. Yair rand (talk) 20:33, 9 April 2017 (UTC)Reply

Touch screens

[edit]

How does one "hover" on a touch screen (e.g., iPad)? Thanks! — SpikeToronto 10:41, 15 May 2017 (UTC)Reply

Not able to get script functioning

[edit]

Hi, on a 3rd party mediawiki site I have installed the script as per the instructions (as far as I can tell) but I am not able to get the pop-up functionality working. I would really appreciate some assistance please.

I have installed both manually (according to the instructions) and via export and special page import from here: https://en.wikipedia.org/wiki/Special:Gadgets/export/ReferenceTooltips

In total I now have relevant script on all the following pages:

https://www.domain.com/x/User:Yair_rand/ReferenceTooltips.js

https://www.domain.com/x/User:Yair_rand/ReferenceTooltips.css

https://www.domain.com/x/User:Louisa/common.js

[On the above page have tried: importStylesheet('User:Yair rand/ReferenceTooltips.css');

and:

/* Reference Tooltips. Version for testing before adding to gadget */

/* See en.wikipedia.org/wiki/User:Yair_rand/ReferenceTooltips */

/* Discussion: en.wikipedia.org/wiki/User_talk:Yair_rand/ReferenceTooltips */

importScript('User:Yair rand/ReferenceTooltips.js'); importStylesheet('User:Yair rand/ReferenceTooltips.css');

]

https://www.domain.com/x/User:Louisa/monobook.js

contains: importScript('User:Yair rand/ReferenceTooltips.js');

https://www.domain.com/x/MediaWiki:Common.js (just in case required)

[The following two urls contain the same code as their matching pages above.]

https://www.domain.com/x/MediaWiki:Gadget-ReferenceTooltips.js

https://www.domain.com/x/MediaWiki:Gadget-ReferenceTooltips.css

https://www.domain.com/x/MediaWiki:Gadgets-definition

The script appears as a gadget in preferences > gadgets.

I have cleared the browser cache by various methods.

The "Navigation popups" script is not installed on the server. coyotegirl (talk) 21:14, 13 February 2018 (UTC)Reply

@Coyote897 Is the site publicly visible? If so, could you provide a link?
Also, does the javascript console show any errors? Yair rand (talk) 21:55, 14 February 2018 (UTC)Reply
@Coyote897 The JS console is showing "ReferenceError: importScript is not defined". Seems as though "importScript" is no longer always available at the start, so that line is breaking things. You could wrap it in mw.loader.using( 'mediawiki.legacy.wikibits', function () {} );, but since this is a gadget anyway, I think it would just work if you removed the importScript/importStylesheet lines from Common.js and the user js pages. Yair rand (talk) 03:31, 15 February 2018 (UTC)Reply
@Yair rand Thankyou. Though do not seem to be getting a console error (at least with FF 52.0.2) I am still not able to get the script working. Please see here for a screenshot of the console while cursor is over a reference number.
I have tried the following:
a) Removing the importscript lines
b) Enclosing the importscript lines with the following:
mw.loader.using( 'mediawiki.legacy.wikibits', function () {
/* importscript line here */
} );
and the following variant (using the format of the line from the main wiki common.js)
mw.loader.using( ['mediawiki.legacy.wikibits'] ).done( function () {
/* Begin of mw.loader.using callback */
/* importscript line here */
/* End of mw.loader.using callback */
} );
c) And I have removed the full url in the importscript lines - so that it is back to the format in the instructions.
Is there anything I can set access wise, for the account I listed above - which would help you ascertain more. If so, please if you could copy the credentials so that I can delete them from the above post. coyotegirl (talk) 06:16, 15 February 2018 (UTC)Reply
@Coyote897 Ah, the issue is that that page is in the userspace. By default, the script only runs in the main namespace, and the project, help, and draft namespaces. You can change this by modifying the line containing the text [ "", "Project", "Help", "Draft" ] in the JS code. The gadget seems to be working as expected in the main namespace of the site.
I've removed the credentials from your post and "deleted" the old revision, making it only visible to mediawiki.org administrators (which includes myself). If you want to further remove the content, the only people with the ability to do that here are Wikimedia Stewards (see m:Stewards). Yair rand (talk) 15:32, 15 February 2018 (UTC)Reply
@Yair randThankyou so much for your generous attention in identifying what the issue was. I am so pleased to get the script working :) :) :)
As you wrote, I just needed to add "User" to the relevant line so as to add that namespace.
The script is working perfectly now. coyotegirl (talk) 17:50, 15 February 2018 (UTC)Reply

Activating on Wikiversity

[edit]

Hello,

I'd like to add this extension to Wikiversity. What are the steps to add it? T.Shafee(Evo﹠Evo)talk 03:33, 30 May 2018 (UTC)Reply

A local administrator can copy the pages w:MediaWiki:Gadget-ReferenceTooltips, w:MediaWiki:Gadget-ReferenceTooltips.js, and w:MediaWiki:Gadget-ReferenceTooltips.css over to Wikiversity, and then add the line "ReferenceTooltips[ResourceLoader|default|type=general]|ReferenceTooltips.js|ReferenceTooltips.css" to MediaWiki:Gadgets-definition. The gadget will then be loaded by default on the wiki. Yair rand (talk) 04:05, 30 May 2018 (UTC)Reply

References Tooltips reworked; feel free to update!

[edit]

Hi, I'm a developer active in Russian Wikipedia. We've reworked ReferenceTooltips significantly in our wiki, and I would like to suggest other wikis to update to our version. (Maybe a global gadget would be a better solution, I would welcome such an initiative if the community agrees.) It was developed by me; Facenapalm, Serhio Magpie, IKhitron, Iniquity, Saint Johann helped in testing.

Here it is: w:en:User:Jack who built the house/Gadget-referenceTooltips.js (English translation) / w:ru:MediaWiki:Gadget-referenceTooltips.css.

Changes list:

  • Tooltips inside tooltips are now working properly (they did work before, but there were bugs associated with this behaviour). See the animation.
  • An option is added that allows to convert native browser tooltips for titled <abbr> tags and such into gadget tooltips. It is default on touch devices, allowing users of the desktop version on such devices to see them.
  • The settings dialog is rewritten using OOUI (its modules are loaded on demand) and looks similar to the Page Previews settings dialog.
  • Saving settings doesn't require page reload anymore.
  • The code is refactored. Tooltips & elements having them are objects now. The script used jQuery and pure JavaScript inconsistently – now it uses the first everywhere where appropriate (performance losses are negligable).
  • Old IE support is removed (JavaScript isn't loaded to them anyway).
  • The coding conventions are applied. Jack who built the house (talk) 19:05, 9 June 2018 (UTC)Reply
Some details about installation:
  • You will need to translate interface messages to your wiki language.
  • Every wiki can have its own set of elements for which tooltips are applicable (for example, harvard-style links in enwiki & ruwiki have "CIREREF" prefix in fragment links, but this can be not universal). You can set custom CSS selectors for regular tooltips and for tooltips converted from native tooltips in corresponding variables.
  • Every wiki can have its own set of namespaces where reference tooltips are appropriate (tooltips for <abbr> tags are considered appropriate everywhere if switched on). (Removed the namespace check for now.)
  • The gadget is dependent upon Page Previews' classes to show/hide tooltips: .mwe-popups-fade-in-down and such. The code is not so short, so they weren't incorporated into the gadgets. If the classes would be renamed/removed some time, you would have to add them manually. (The animation doesn't work with Page Previews off, so I added them to the CSS.) Jack who built the house (talk) 20:18, 9 June 2018 (UTC)Reply
Looks good. I notice a few bugs that were introduced:
  • The space to the sides of the popup's "tail" is no longer counted as part of the popup for mouseover purposes. This causes the popup to frequently disappear before the user can move their mouse towards it, especially in cases where the "tail" isn't immediately above where the mouse started, meaning that if the gap isn't covered quickly enough, there will be a frustrating disappearance.
  • This isn't so important, but if the user clicks the settings button in the demo popup within the settings menu itself, there's no way to exit the menu, no matter how many times the "Cancel" button is clicked.
Note that the gadget still works, but without the animation, when Page Previews is disabled via preferences. Yair rand (talk) 08:30, 11 June 2018 (UTC)Reply
@Yair rand: thank you for the original version of the gadget and thank you for the notes. The first one seems legit, although it is the case for Page Previews also. I fixed it. The demo tooltip bug is fixed too. As to the animation, I checked it some time ago and found that the classes work no matter Page Previews is enabled or disabled. Now it changed apparently, so I added the classes to the gadget's CSS. Jack who built the house (talk) 11:42, 13 June 2018 (UTC)Reply
One question: in your version there is a namespace check. Is it there because in some namespaces the gadget is undesirable, or is it there because in most namespaces there is just no need for it? If it is the second, I don't see good reasons for that restriction as references appear from time to time in much more namespaces than the main namespace, "Project", "Help" and "Draft". I removed the namespace check for now. Jack who built the house (talk) 11:58, 13 June 2018 (UTC)Reply
@Jack who built the house: The namespace check was added in 2011 by @Kaldari, with the intention of "trying to cut down js bloat for other pages", which seems reasonable. It might be preferable to add some more namespaces to the list, but the gadget certainly doesn't need to run in the Special namespace or Module namespace, for example. Or maybe it should be changed from a whitelist to a blacklist? Yair rand (talk) 22:19, 13 June 2018 (UTC)Reply
In the Module namespace, refs may appear in docs, and they do. As for the Special namespace, you are probably right. A check for the wgIsArticle wgAction config value could also be useful. Nevertheless I don't really see much gain here as it will only save us a time needed for running 2 selectors (by default). Jack who built the house (talk) 23:36, 13 June 2018 (UTC)Reply
On my old notebook in the watchlist with 500 last changes the script runs with no effect for 8ms. On modern machines it's even quicker. So I guess the gain of the script not running where it has no effect is comparable to the price of loading additional lines of code (and for most users who only read Wikipedia, which means they don't visit special pages or page history, it has no effect). So I don't see any clear benifits and will leave the code unchanged for now. Jack who built the house (talk) 13:54, 14 June 2018 (UTC)Reply
It looks great, thanks for the update and the support of Harvard-style citations!
While translating it, I noticed an orphan bracket at the end of 'rt-tooltipsForComments'.
If possible, it would make the translation easier to keep the translation text at the beginning of the code, like in the original Reference Tooltips code.
Could it be made so that it shows on the bottom of the ref like Page Previews (see meta:WMDE Technical Wishes/ReferencePreviews) (an advantage is that it doesn't hide the text of the sentence) and with the same exact animation? The RedBurn (talk) 06:54, 18 July 2018 (UTC)Reply
@The RedBurn: > While translating it, I noticed an orphan bracket at the end of 'rt-tooltipsForComments'.
That's a Google Translate bug.
> If possible, it would make the translation easier to keep the translation text at the beginning of the code, like in the original Reference Tooltips code.
Done.
> Could it be made so that it shows on the bottom of the ref like Page Previews (see meta:WMDE Technical Wishes/ReferencePreviews) (an advantage is that it doesn't hide the text of the sentence) and with the same exact animation?
I'm afraid I can't understand what you mean here. Jack who built the house (talk) 12:48, 29 July 2018 (UTC)Reply
@Jack who built the house
> That's a Google Translate bug.
Indeed, my bad.
> Done.
Thanks!
> I'm afraid I can't understand what you mean here.
Yes, I should have said "below": the Page Previews pop-up shows up below the link, as you can see here. Could the same thing be achieved with Reference Tooltips, since it's mentioned on meta:WMDE_Technical_Wishes/ReferencePreviews#Requirements_for_a_solution? The RedBurn (talk) 19:19, 29 July 2018 (UTC)Reply
Page Previews are shown above the link by default as well. They are shown below only when there isn't enough space above. To make them appear below you could change the following condition: teOffset.top < this.$element.outerHeight() + $window.scrollTop() + 6. Jack who built the house (talk) 19:42, 29 July 2018 (UTC)Reply
Indeed, so Reference Tooltips already meets that requirement. :-) The RedBurn (talk) 20:42, 29 July 2018 (UTC)Reply
@Jack who built the house
Could you make an English version? I don't think translating with Google Translate is enough. PlavorSeol (talk) 19:03, 1 September 2018 (UTC)Reply
If it's any help to you, Jack who built the house or anyone, here's the French translation I made: Utilisateur:The_RedBurn/ReferenceTooltips-fr.js The RedBurn (talk) 21:57, 1 September 2018 (UTC)Reply
Can you also make English translation? PlavorSeol (talk) 06:01, 2 September 2018 (UTC)Reply
English translation: en:User:Jack who built the house/Gadget-referenceTooltips.js. Feel free to improve by posting better translations here. Jack who built the house (talk) 10:32, 29 December 2018 (UTC)Reply
It looks great! Is it possible to put mw.util.addCSS below the translation text to make translations easier? The RedBurn (talk) 10:52, 29 December 2018 (UTC)Reply
You're right: I changed the link to only-JS version. CSS needs no changes. Jack who built the house (talk) 10:59, 29 December 2018 (UTC)Reply
Perfect, thanks! The RedBurn (talk) 11:19, 29 December 2018 (UTC)Reply

Regression: conflict with Wikipedia:Tools/Navigation popups

[edit]

I understand this does not work together with Navigation popups.

But before, if you enabled both, Navigation popups will simply override Reference Tooltips. But currently, if you leave Reference Tooltips on (with default setting, "Click") and then enable Navigation popup, it causes a bug that, if you want to jump to the reference by clicking the reference number, you have to CLICK TWICE.

This doesn't happen a few months ago. So I mark it as a regression bug. fireattack (talk) 20:40, 3 October 2019 (UTC)Reply

Both of my sites are active. But on one of my sites, only one opens. Normal. On my other site, they both open at once. This is certainly bad (Google Chrome). What should I do to be normal on the second site? I don't want to give up the Navigation popups. Tofiq Kərimli (talk) 11:43, 27 October 2019 (UTC)Reply
I solved the problem. I replaced "Popups 1_33" with "Popups 1_32". Now everything is exactly what I want. The latest version does not have "Popups.php" and "package-lock.json" files. It is possible that this was the cause of the problem. Tofiq Kərimli (talk) 10:42, 29 October 2019 (UTC)Reply

Help disabling

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


When I navigate to Special:Preferences#mw-prefsection-gadgets, I can't see where to disable Reference Tooltips. Thank you for looking into this! Daylen (talk) 06:46, 21 March 2020 (UTC)Reply

What wiki are you on? If you go to MediaWiki:Gadget-ReferenceTooltips on your wiki you will see what label this option has and you should be able to look for that label in your Preferences. Þjarkur (talk) 09:52, 21 March 2020 (UTC)Reply
Thank you! I thought that it was a global setting and was trying to change it on MediaWiki to take effect on my enwiki account. Daylen (talk) 22:06, 23 March 2020 (UTC)Reply
You might also be looking for "Reference Previews", which is a different thing. That can be found under the "Preferences -> Beta Features" tab. Quiddity (WMF) (talk) 20:33, 23 March 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Pop-up window does not render wide enough for long equations

[edit]

Copied from WP:VPT on en.WP: The tooltip for reference [a] in en:Clearing_the_neighbourhood#Margot's_Π is too narrow to accommodate the equations. Jonesey95 (talk) 20:53, 30 April 2020 (UTC)Reply

.rt-tooltip has a max-width: 350px;. Would require some additional code to check what the overflow is and then overwrite the max-width value. How about just adding word breaks inside the math equations? Þjarkur (talk) 21:03, 30 April 2020 (UTC)Reply
.rt-tooltip img { max-width: 100%; } would also solve this (for when people are using the default image renderer and not MathML) Þjarkur (talk) 21:12, 30 April 2020 (UTC)Reply

beta feature

[edit]

there's a beta feature called "Reference Previews". didn't see it here, but ATM, it exists in beta preferences on enwiki and hewiki, and probably most wikimedia wikis.

presumably not a "gadget", but part of core.

these two features "collide" - both show the cite note in two separate popups.

one of them should check if the other is on and disable itself. i think this one already self-disable when the old "popup" enwiki gadget is on, and something similar should be done WRT the beta feature too.


peace. קיפודנחש (talk) 21:27, 9 May 2020 (UTC)Reply

Not clear how to install and enable Reference Tooltips

[edit]

Where are ReferenceTooltips.js and ReferenceTooltips.css meant to go?

I have a Debian package installation and there are a whole load of file links between /etc/www/mywiki/w and /usr/share/mediawiki/extensions-core/Gadgets and /var/lib/mediawiki. Unfortunately the document writer's assumption that I should know is just overoptimistic.

Does it matter if I called the JS and CSS files something different? The only place they are referenced is in MediaWiki:Gadgets-definition, is that right?

I've just got this in my LocalSettings.php:

$wgGadgetsRepoClass = "MediaWikiGadgetsDefinitionRepo"

wfLoadExtension( 'Gadgets' );


And is this good:

ReferenceTooltips[ResourceLoader|default|type=general|dependencies=mediawiki.cookie,jquery.client]|Gadget-ReferenceTooltips.js|Gadget-ReferenceTooltips.css


or will those dependencies foobar It? I took that off wikipedia.org. Being a noob, I don't even know how to confirm if those 2 dependencies are present. Anbh42 (talk) 23:23, 9 January 2021 (UTC)Reply

They are not kept as files on a server, instead you only need to add some pages to your wiki. So you have to create a page in your wiki named "MediaWiki:Gadget-ReferenceTooltips.js" and so on for all of the steps. Þjarkur (talk) 23:27, 9 January 2021 (UTC)Reply
Hit the next issue - not sure if this is a foobar that I sneaked in with my fat fingers or a real problem:
Fatal error: Uncaught Exception: /usr/share/mediawiki/extensions/Gadgets/extension.json does not exist!
It's obviously having a problem because that file is at /usr/share/mediawiki/extensions-core/Gadgets
I put:
wfLoadExtension( 'Gadgets' );
in my LocalSettings.php - is that wrong? Anbh42 (talk) 23:53, 9 January 2021 (UTC)Reply
Can you move the extension to the "extensions" folder instead of "extensions-core"? Þjarkur (talk) 23:55, 9 January 2021 (UTC)Reply
Ah, I see. Yes. Even simpler, I just created a link like many of the other packages had. Obviously the Debian Gadgets package is way behind. However, now mediawiki is happy, but although I see the Gadgets entry on Special:Version, Gadgets isn't loading somehow:
- it doesn't have any entries in Special:Gadgets
- it doesn't show up as a tab in my Preferences
- the ReferencesTooltip functionality isn't present. Anbh42 (talk) 00:16, 10 January 2021 (UTC)Reply
OK - panic over. I hadn't called the two files "MediaWiki:Gadget-ReferenceTooltips.js/css" - stupidly confused. It's probably worth making a small edit to the setup doc to clarify this point. In my first attempt, I put them on the file system - doh!
On my second attempt, I called them "MediaWiki:ReferenceTooltips.js" and in my Gadgets-definition page, I referred to them as "ReferenceTooltips.js".
On my third attempt I renamed them to "MediaWiki:Gadget-ReferenceTooltips.js" but I haven't changed the names in Gadgets-definition so that is in contrast to the instructions here, yet it works. Anbh42 (talk) 13:55, 10 January 2021 (UTC)Reply
On page MediaWiki:Gadgets-definition there must be an "* " (asterix space) bevor each description for the gadget, otherwise it wount show up as a gadget on user preference page Quīlubet (talk) 12:37, 16 October 2023 (UTC)Reply

Tooltip style is outdated, please update

[edit]

Initially the gadget used Page Preview's classes to show tooltip and later changed to its own copies of them. However, after that, there were some visual changes to Page Preview's classes including changing border colors which didn't reflect on reference tooltips.

I hope these changes will be applyed to reference tooltips. Thanks! Diskdance (talk) 11:33, 5 May 2021 (UTC)Reply

I was too lazy to take on this for 3 years (hehe), but now I'm wondering does it make sense to try and match Page Previews since Reference Previews are best suited for this job. Page/Reference Previews currently use some styles that divert from Codex (including border styles you mentioned and box-shadow). I'm leaning towards updating this to Codex styles inasmuch as reasonable. JWBTH (talk) 01:42, 9 July 2024 (UTC)Reply

"does not work if 'Navigation popups' is enabled above".

[edit]

In Wikipedia preferences it says: "does not work if 'Navigation popups' is enabled above".

They both work for me. I am using Firefox on a desktop PC. Timeshifter (talk) 02:27, 26 December 2022 (UTC)Reply