User:Ozuzanna/upload.js

/* Easy licensing/categories on Special:Upload/Special:MultipleUpload */ var page = mw.config.get('wgPageName'), specialpage = mw.config.get('wgCanonicalSpecialPageName'), title = mw.config.get('wgTitle'), namespace = mw.config.get('wgCanonicalNamespace'), action = mw.config.get('wgAction');
 * (function($, mw) {

if (specialpage == "Upload" || specialpage == "MultipleUpload" && $.getUrlVar('wpForReUpload') != 1) { $('#mw-htmlform-source > tbody > .mw-htmlform-field-HTMLInfoField > .mw-label').html('Licenses: Detailed item | Inventory | Scenary | Chathead | Worn equipment | NPC Categories: Scan | Compass'); $('#mw-upload-permitted').remove

function addLicense(type) { if (type == "Scenary") { $('#wpUploadDescription').val('{'+'{trans}}{'+'{'+type+' license|0|-4}}}}'); }   else if (type == "DII") { $('#wpUploadDescription').val('{'+'{trans}}{'+'{'+type+' license|{'+'{su'+'bst:#sub:{'+'{su'+'bst:PAGENAME}}|0|-11}}}}'); }   else if (type == "Chathead" || type == "Worn equipment") { $('#wpUploadDescription').val('{'+'{trans}}{'+'{'+type+' license|{'+'{su'+'bst:#sub:{'+'{su'+'bst:PAGENAME}}|0|-13}}}}'); }   else { $('#wpUploadDescription').val('{'+'{trans}}{'+'{'+type+' license|{'+'{su'+'bst:#sub:{'+'{su'+'bst:PAGENAME}}|0|-4}}}}'); } }

function addCategory(type) { $('#wpUploadDescription').val('['+'[Category:Treasure trail '+type+' images]]'); }

$('#DII-license').click(function {   addLicense('DII');  });

$('#Inv-license').click(function {   addLicense('Inventory');  });

$('#Scen-license').click(function {   addLicense('Scenery');  });

$('#Chat-license').click(function {   addLicense('Chathead');  });

$('#Worn-license').click(function {   addLicense('Worn equipment');  });

$('#NPC-license').click(function {   addLicense('NPC');  });

$('#Scan-cat').click(function {   addCategory('scan');  });

$('#Compass-cat').click(function {   addCategory('compass');  });

}

}) (this.jQuery, this.mediaWiki);