Permanently protected page

MediaWiki:Common.js: Difference between revisions

From Screamer Wiki
Jump to: navigation, search
imported>Sumpy
No edit summary
imported>Sumpy
No edit summary
Line 1: Line 1:
importScriptPage('MediaWiki:ScreamerWarn.js', 'screamers');
/* Any JavaScript here will be loaded for all users on every page load. */
importScriptPage('MediaWiki:Maintenance.js', 'screamers');
 
/* Replaces {{Username}} with the name of the user browsing the page.
/* Replaces {{Username}} with the name of the user browsing the page.
   Requires copying Template:Username. */
   Requires copying Template:Username. */
 
function UserNameReplace() {
function UserNameReplace() {
     if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;
     if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;
Line 10: Line 8:
  }
  }
  addOnloadHook(UserNameReplace);
  addOnloadHook(UserNameReplace);
 
/* End of the {{Username}} replacement */
/* End of the {{USERNAME}} replacement */

Revision as of 18:17, 2 January 2016

/* Any JavaScript here will be loaded for all users on every page load. */
/* 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 */