Jump to content

MediaWiki talk:Gadget-ShowMessageNames.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

jQuery3 deprecation warning

There's a new warning in webconsole for this gadget (that inconsistently appears - I can only reproduce it occasionally with full-reloads) :

jQuery.Deferred exception: mw.util is undefined @https://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-ShowMessageNames.js&action=raw&ctype=text/javascript:14:3
mightThrow@https://www.mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=1b6aucj:49:590
resolve/</process<@https://www.mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=1b6aucj:50:269
undefined  load.php:52:398

and

JQMIGRATE: jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos

I'm not sure what needs to be changed. Perhaps mw:ResourceLoader/Core_modules#addPortletLink explains it? (or possibly that section is now outdated?). Quiddity (WMF) (talk) 19:26, 26 September 2017 (UTC)[reply]

  1. You should not load this gadget manually, it is to be enabled as a gadget (see Special:Preferences#mw-prefsection-gadgets). If you load it somewhere else than Wikipedia, you should enclose the loading command with mw.loader.using( 'mediawiki.util', function () { ... } );.
  2. This seems not to be related to this gadget: it doesn’t use any jQuery directly at all, not to speak about pseudo-classes. —Tacsipacsi (talk) 15:48, 27 September 2017 (UTC)[reply]
Perfect, fixed. Thank you! (I do a lot of testing and bug-investigation at various wikis, so this tool helps me a lot globally). Quiddity (WMF) (talk) 17:32, 27 September 2017 (UTC)[reply]

Protected edit requests

Please replace

$( document ).ready( function() {

with

$(() => {

".ready" is deprected. As of jQuery 3.0, only the first syntax is recommended; the other syntaxes still work but are deprecated. (jquery.com) See also on English Wikisource. --Namoroka (talk) 12:06, 25 January 2025 (UTC)[reply]

I guess the more important question to ask here is, "are both syntax equivalent" in terms of behaviour. Based on a quick reading of the page, it appears to be so ? Sohom (talk) 03:17, 27 January 2025 (UTC)[reply]
 Done Sohom (talk) 01:41, 28 January 2025 (UTC)[reply]