MediaWiki:Common.js: Difference between revisions
From Screamer Wiki
imported>Sumpy No edit summary |
imported>Sumpy No edit summary |
||
Line 2: | Line 2: | ||
importScriptPage('MediaWiki:Maintenance.js', 'screamers'); | importScriptPage('MediaWiki:Maintenance.js', 'screamers'); | ||
/* Replaces {{ | /* Replaces {{Username}} with the name of the user browsing the page. | ||
Requires copying Template: | Requires copying Template:Username. */ | ||
function UserNameReplace() { | function UserNameReplace() { | ||
Line 11: | Line 11: | ||
addOnloadHook(UserNameReplace); | addOnloadHook(UserNameReplace); | ||
/* End of the {{ | /* End of the {{Username}} replacement */ |
Revision as of 09:35, 2 January 2016
importScriptPage('MediaWiki:ScreamerWarn.js', 'screamers');
importScriptPage('MediaWiki:Maintenance.js', 'screamers');
/* Replaces {{Username}} with the name of the user browsing the page.
Requires copying Template:Username. */
function UserNameReplace() {
if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;
$("span.insertusername").html(wgUserName);
}
addOnloadHook(UserNameReplace);
/* End of the {{Username}} replacement */