MediaWiki:Common.js: Difference between revisions
no edit summary
imported>Sumpy No edit summary |
imported>Sumpy No edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | |||
/* 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 {{ | /* End of the {{USERNAME}} replacement */ |