MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
function preloadUploadDesc() { | function preloadUploadDesc() { | ||
if (wgPageName.toLowerCase() != 'special:upload' && wgPageName.toLowerCase() != 'special:multipleupload') { | if (mw.config.get('wgPageName').toLowerCase() != 'special:upload' && mw.config.get('wgPageName').toLowerCase() != 'special:multipleupload') { | ||
return; | return; | ||
} | } | ||
Line 30: | Line 30: | ||
function UserNameReplace() { | function UserNameReplace() { | ||
if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return; | if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || mw.config.get('wgUserName') == null) return; | ||
$("span.insertusername").html(wgUserName); | $("span.insertusername").html(mw.config.get('wgUserName')); | ||
} | } | ||
addOnloadHook(UserNameReplace); | addOnloadHook(UserNameReplace); | ||
Line 65: | Line 65: | ||
/* Link to Game Download */ | /* Link to Game Download */ | ||
$('div#p-tb div.mw-portlet-body ul li:first-child').after('<li><a href="http://katawa-shoujo.com/download | $('div#p-tb div.mw-portlet-body ul li:first-child').after('<li><a href="http://katawa-shoujo.com/download">Download Katawa Shoujo</a></li>'); | ||
/**** function displayTimer.js | /**** function displayTimer.js | ||
Line 81: | Line 80: | ||
var timerLink = document.createElement( 'a' ); | var timerLink = document.createElement( 'a' ); | ||
var timerObj = document.createElement( 'li' ); | var timerObj = document.createElement( 'li' ); | ||
timerLink.href = '/wiki/' + wgPageName + '?action=purge'; | timerLink.href = '/wiki/' + mw.config.get('wgPageName') + '?action=purge'; | ||
timerLink.title = 'Purge the server cache and update the contents of this page.' | timerLink.title = 'Purge the server cache and update the contents of this page.' | ||
timerObj.id = 'pt-timer'; | timerObj.id = 'pt-timer'; | ||
Line 120: | Line 119: | ||
} | } | ||
} | } | ||
addOnloadHook(displayTimer); |