MediaWiki:Common.js/addLicense.js

/* * QLicense.js, * [originally] by User:Cakemix, decoded and formatted, * decoded, formatted, and shortened by Monchoman45, */ function QLicenseUI { window.qapi = new APIQuery; var options = { '': 'Image copyrighted by Arc System Works', '': 'Creative Commons License', '': 'Copyrighted image' };	var optstr = ''; for(i in options) {optstr += '' + options[i] + ' ';} var html = '' + optstr + ' Add license'; 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('Error.');} }));		this.innerHTML = ''; } } if(wgCanonicalNamespace == 'File') { addOnloadHook(QLicenseUI); importScriptPage('MediaWiki:APIQuery.js', 'monchbox'); }