MediaWiki:Common.js/addLicense.js

/* Any JavaScript here will be loaded for all users on every page load. */

/* * QLicense.js, * [originally] by User:Cakemix, decoded and formatted, * decoded, formatted, and shortened by Monchoman45, * translated by MarkosBoss (polish). */ function QLicenseUI { window.qapi = new APIQuery; var options = { '': 'I don't know the license', '': 'I took this photo myself', '': 'I got this from Wikipedia or another Wikimedia project', '': 'This is licensed under the Creative Commons Attribution-Share Alike', '': 'This is licensed under another free license', '': 'This is in the public domain', '': 'This will be used in a way that qualifies as fair use under US law', '': 'This is copyrighted, but use is permitted by the copyright holder', '': 'This is a picture of an Adventure Time staff member', };	var optstr = ''; for(i in options) {optstr += '' + options[i] + ' ';} var html = '' + optstr + ' Add License (if it does not exist)'; if(document.getElementById('LicensedFile') || document.getElementById('Copyright')) {html += ' ';} else {html += ' ';} $('#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.');} }));		this.innerHTML = ''; } } if(wgCanonicalNamespace == 'File') { addOnloadHook(QLicenseUI); importScriptPage('MediaWiki:APIQuery.js', 'monchbox'); }