User:Carbonite 0/wikia.js

/* * QLicense.js, [originally] by User:Cakemix, decoded and formatted. * Decoded, formatted, and shortened by Monchoman45. */ function QLicenseUI { window.qapi = new APIQuery; var options = { '': 'Public domain', '': 'Game Screenshot', '': 'Fair use' };	var optstr = ''; for(i in options) {optstr += '' + options[i] + ' ';}

var html = '' + optstr + ' Add license'; if(document.getElementById('LicensedFile') || document.getElementById('Copyright')) {html += ' This file is licensed. ';}	else {html += ' This file is not licensed. ';}	$('#filetoc').append(html);

document.getElementById('aSubmit').onclick = function(event) { qapi.send(new qapi.Query(qapi, 'POST', 'action=edit&title=' + wgPageName + '&appendtext=' + document.getElementById('QLicenseSelect').value + '&summary=Licensing image', function(result) { if(result.edit.result == 'Success') {window.location = wgServer + '/index.php?title=' + wgPageName + '&action=purge';} else {alert('An error occurred while submitting the edit.');} }));		this.innerHTML = ''; } }

if(wgCanonicalNamespace == 'File') { addOnloadHook(QLicenseUI); importScriptPage('MediaWiki:APIQuery.js', 'monchbox'); }

// ******************* // Custom edit buttons // ******************* if (wgAction == "edit" || wgAction == "submit") { /***** Custom edit buttons *****/ if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/__cb20120128095141/callofduty/images/2/2c/CreeperForEmote.jpg", "speedTip": "Welcome user (TF141)", "tagOpen": "", "tagClose": "", "sampleText": wgUserName}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/__cb20120128095141/callofduty/images/2/2c/CreeperForEmote.jpg", "speedTip": "Welcome user (Price)", "tagOpen": "", "tagClose": "", "sampleText": wgUserName}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/__cb20120128095141/callofduty/images/2/2c/CreeperForEmote.jpg", "speedTip": "Vandalism Template", "tagOpen": "", "tagClose": "", "sampleText": "PAGE"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/__cb20120128095141/callofduty/images/2/2c/CreeperForEmote.jpg", "speedTip": "Banned from chat", "tagOpen": "", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/__cb20120128095141/callofduty/images/2/2c/CreeperForEmote.jpg", "speedTip": "Signature", "tagOpen": " ~"+""+"", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/__cb20120128095141/callofduty/images/2/2c/CreeperForEmote.jpg", "speedTip": "Redirect", "tagOpen": "#redirect",               "tagClose": "", "sampleText": "PAGE"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/__cb20120128095141/callofduty/images/2/2c/CreeperForEmote.jpg", "speedTip": "Bad Edit Template", "tagOpen": "", "tagClose": "", "sampleText": "PAGE"}; } }

// *********************** // End custom edit buttons // ***********************