Discussion MediaWiki:Gadget-FlecheHaut.js

Le contenu de la page n’est pas pris en charge dans d’autres langues.
Une page de Wikipédia, l'encyclopédie libre.

Hi!

Could you update the script to use jQuery instead of the deprecated addOnloadHook? The code below should work.

$(function() {
	mw.util.$content.find('h2, h3, h4, h5, h6').each(function(){
		$('<a class="noprint top-link" href="#"> ↑</a>').bind('click', function() {
			window.scrollTo(0,0);
		}).appendTo(this);
	});
});

Best regards, Helder 18 mars 2011 à 00:40 (CET)

Hello Helder,
Thanks a lot for the message!
We're currently talking about the opportunity of such updates before MediaWiki 1.17 is officially released, but I'm sure we'll update the gadget soon.
Thanks again, best regards — Arkanosis 18 mars 2011 à 00:47 (CET)[répondre]
Hello!
Note that all Wikimedia wikis are runing MW 1.17 already. See:
Best regards, Helder 18 mars 2011 à 13:47 (CET)
Yeah, we know Émoticône.
But some of us (not me ; well, I don't know) think it's better to wait for MW 1.17 to be available to anyone before making the gadgets incompatibles with the previous versions.
If you can read French, this is discussed there.
Best regards — Arkanosis 18 mars 2011 à 15:40 (CET)[répondre]
We already discussed about the use of the newest syntax, and we established there is no problem migrating to jQuery methods, document.ready loader amongst others, as this library is implemented in MediaWiki for some time, since 1.16 (1.15?) as I remember. However we'd rather wait before using the mw.util and so objects, at least until the 1.17 package release. Kind regards, od†n ↗blah 19 mai 2011 à 08:03 (CEST)[répondre]

So, We are now using MW 1.18 (and MW 1.19 is coming), but the script still needs to be updated. Could someone edit it and change its definition on MediaWiki:Gadgets-definition to clearly indicate its dependencies, so that it can be loaded via Resource Loader?

* FlecheHaut[ResourceLoader|dependencies=mediawiki.util]|FlecheHaut.js

Helder 31 janvier 2012 à 12:18 (CET)

✔️ For record, done on 6th March: MediaWiki:Gadget-FlecheHaut.jsMediaWiki:Gadgets-definitionod†n ↗blah 8 juin 2012 à 10:47 (CEST)[répondre]