Jump to content

MediaWiki:Common.js: Difference between revisions

From WikiCyber
Created page with "Any JavaScript here will be loaded for all users on every page load.: mw.loader.using( [ 'mediawiki.util', 'mediawiki.Title' ] ).done( function () { var title = new mw.Title( 'Special:MyPage/sandbox' ); var url = title.getUrl(); mw.util.addPortletLink( 'p-personal', url, 'Sandbox', 'pt-sandbox', 'Go to your sandbox', null, '#pt-preferences' ); } );"
 
Remove duplicate Sandbox link: now added server-side (with icon) by the SandboxAccess extension
 
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */


mw.loader.using( [ 'mediawiki.util', 'mediawiki.Title' ] ).done( function () {
/* The personal-menu "Sandbox" link (with icon) is now added server-side by the SandboxAccess extension.
var title = new mw.Title( 'Special:MyPage/sandbox' );
  The previous JavaScript version (Special:MyPage/sandbox via mw.util.addPortletLink) was removed to avoid a duplicate link;
var url = title.getUrl();
  restore it from this page's history if the extension is ever disabled. */
mw.util.addPortletLink(
'p-personal',
url,
'Sandbox',
'pt-sandbox',
'Go to your sandbox',
null,
'#pt-preferences'
);
} );

Latest revision as of 22:14, 18 September 2026

/* Any JavaScript here will be loaded for all users on every page load. */

/* The personal-menu "Sandbox" link (with icon) is now added server-side by the SandboxAccess extension.
   The previous JavaScript version (Special:MyPage/sandbox via mw.util.addPortletLink) was removed to avoid a duplicate link;
   restore it from this page's history if the extension is ever disabled. */