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' ); } );"
 
Restore default Vector styling; preserve branded emails
 
(11 intermediate revisions by 2 users not shown)
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',
/* Native CC BY-SA footer badge: repair an empty configured image source. */
url,
$(function () {
'Sandbox',
    var badge = document.querySelector('#footer-copyrightico img');
'pt-sandbox',
    if (badge && !badge.getAttribute('src')) badge.src = '/resources/assets/licenses/cc-by-sa.png';
'Go to your sandbox',
});
null,
'#pt-preferences'
);
} );

Latest revision as of 04:25, 17 October 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. */

/* Native CC BY-SA footer badge: repair an empty configured image source. */
$(function () {
    var badge = document.querySelector('#footer-copyrightico img');
    if (badge && !badge.getAttribute('src')) badge.src = '/resources/assets/licenses/cc-by-sa.png';
});