Extension talk:Gadgets/Scripts/SubPages.js

From mediawiki.org
Latest comment: 6 months ago by Pppery in topic Legacy JavaScript

Legacy JavaScript[edit]

Hello! This script has been detected as using deprecated parameters that need to be replaced with the updated version. Examples include addOnloadHook() needs to be replaced with $(); all wgGlobalVariables need to be properly gotten with mw.config.get( 'wgGlobalVariable' ); and addPortletLink needs to be called with mw.util.addPortletLink. Please see MW:ResourceLoader/Legacy JavaScript for details. Thank you. Technical 13 (talk) 18:12, 18 January 2015 (UTC)Reply

@Technical 13: the page is not protected, you can edit it. I tested your migration recipes on a simplified version, apparently it worksː
$( function()
{	if ( document.getElementById( 'p-tb' ) && 0 <= mw.config.get( 'wgNamespaceNumber' ))
		mw.util.addPortletLink( 'p-tb', 
                        '/wiki/Special:PrefixIndex/' + mw.config.get( 'wgPageName' ) + '/?stripprefix=1', 
		        'Subpages', 't-subpages', 'Subpages of this page' );
}	);
Be..anyone (talk) 12:37, 29 April 2015 (UTC)Reply
Was done by Fomafix. * Pppery * it has begun 16:50, 16 September 2023 (UTC)Reply