Difference between revisions of "MediaWiki:Common.js"

699 bytes added ,  17:21, 28 October 2014
no edit summary
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. */
/***************************************
/* Automatically add Aboutfile template to file upload description. Source: Porplemontage at khwiki.com (http://www.khwiki.com/MediaWiki:Common.js) */
if (mw.config.get('wgCanonicalSpecialPageName') === 'Upload' && !document.getElementById('wpForReUpload') && !document.getElementsByClassName('warning')[0] && !document.getElementsByClassName('error')[0]) {
function loadAutoAboutfileTemplate() {
uploadDescription = document.getElementById('wpUploadDescription');
var doubleBracket = '{' + '{';
uploadDescription.value = doubleBracket + 'aboutfile\n|description=\n|purpose=\n|game=\n|source=\n}}';
}
addOnloadHook(loadAutoAboutfileTemplate);
}


/***************************************
/***************************************