Page MenuHomePhabricator

nuxedtoolkit is not defined
Closed, DeclinedPublic

Description

Hi, It seems there is JS loading issues on the French Wikisource.

In the console, I get the following messages:

 Use of "mwCustomEditButtons" is deprecated. Use mw.toolbar instead.
 Use of "addOnloadHook" is deprecated. Use jQuery instead.
 Use of "hookEvent" is deprecated. Use jQuery instead.
 Use of "wgAction" is deprecated. Use mw.config instead.
 Use of "wgNamespaceNumber" is deprecated. Use mw.config instead.
 Use of "$j" is deprecated. Use $ or jQuery instead.
 Use of "write" is deprecated. Use jQuery or mw.loader.load instead.
 Use of "importScriptURI" is deprecated. Use mw.loader instead.
``

And when the toolbar doesn't load properly, I get:

index.php?action=raw&ctype=text/javascript&title=Wikipedysta%3ANux%2FSearchBox.js:283 Uncaught ReferenceError: nuxedtoolkit is not defined

nuxsr.init	@	index.php?action=raw&ctype=text/javascript&title=Wikipedysta%3ANux%2FSearchBox.js:283
fire	@	load.php?debug=false&lang=fr&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=f47W3i0j:45
self.add	@	load.php?debug=false&lang=fr&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=f47W3i0j:45
jQuery.fn.ready	@	load.php?debug=false&lang=fr&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=f47W3i0j:49
jQuery.fn.init	@	load.php?debug=false&lang=fr&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=f47W3i0j:41
jQuery	@	load.php?debug=false&lang=fr&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=f47W3i0j:1
(anonymous function)	@	index.php?action=raw&ctype=text/javascript&title=Wikipedysta%3ANux%2FSearchBox.js:370

Event Timeline

Yann created this task.Jun 3 2016, 10:04 AM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 3 2016, 10:04 AM
Yann updated the task description. (Show Details)Jun 3 2016, 10:06 AM

@Yann: What are exact steps to reproduce the problem? Go to any page? Go to edit any page?

This is also mentioned in https://fr.wikisource.org/wiki/Discussion_utilisateur:JackPotte#Quatre_boutons_.C3.A9vapor.C3.A9s_.3F

Aklapper added a subscriber: Nux.Jun 3 2016, 10:24 AM

I guess this comes from line 283 in https://pl.wikipedia.org/wiki/Wikipedysta:Nux/SearchBox.js where it says:

nuxedtoolkit.prepare();

Yann added a comment.EditedJun 3 2016, 11:35 AM

I get this about once every 2 pages I edit in the Page: namespace (but it looks random).
Also mentioned in https://fr.wikisource.org/w/index.php?title=Wikisource:Scriptorium/Juin_2016&oldid=5943420#Bandeau_.22wikisource.22_ne_fonctionne_plus

Nux added a comment.EditedJun 4 2016, 10:06 AM

This is caused by the fact that Resource Loader broken compatibility with old scripts (mostly because making order of custom scripts completely unpredictable). This is supposed to be fixed with Gadgets 2.0 also allowing creation of custom (user) gadgets. I'm not sure when is this coming and if it will deliver...

In the mean time - if you are an administrator - please add a gadget to your wiki and use this instead.

The gadget defintion is:
searchbox [ResourceLoader | dependencies=ext.gadget.lib-toolbar, ext.gadget.lib-sel_t ] | searchbox.css | searchbox.js

So you need 4 files.
https://pl.wikipedia.org/wiki/MediaWiki:Gadget-searchbox.js
https://pl.wikipedia.org/wiki/MediaWiki:Gadget-searchbox.css
https://pl.wikipedia.org/wiki/MediaWiki:Gadget-sel_t.js
https://pl.wikipedia.org/wiki/MediaWiki:Gadget-lib-toolbar.js

If you would like to complain that this is overly complicated - please do... But not to me ;-)

Aklapper closed this task as Declined.Jul 25 2016, 2:37 PM

Thanks to Nux for explaining and how this can be fixed by wiki admins.

User scripts, gadgets and templates are local features and managed independently on each wiki. Phabricator/Maniphest is used for MediaWiki, MediaWiki extensions, or server configuration. In general this is a matter to discuss and fix on the local wiki and not really handled in Phabricator/Maniphest until https://phabricator.wikimedia.org/T121470 gets solved. Hence closing this task as declined here in Phabricator.