MediaWiki:Fandomdesktop.js/quicklicence.js

/*Quick image licence - contains the most commonly used licencing criteria*/ if (wgUserGroups.indexOf('autoconfirmed') != -1) { function QLicenceUI { var options = { ' ': 'Select a licence', '==Licencing==\n': 'This is used in a way that qualifies as fair use under US law', '==Licencing==\n': 'This was created by the uploader', '==Licencing==\n': 'This is from Wikipedia or another Wikimedia project', '==Licencing==\n': 'This is licenced under Creative Commons Attribution 3.0 (free licence)', '==Licencing==\n': 'This is licenced under Creative Commons Attribution-Share Alike Licence', '==Licencing==\n': 'This is licenced under another free licence', '==Licencing==\n': 'This is part of the interface on a wiki hosted by Fandom', '==Licencing==\n': 'This is in the public domain', '==Licencing==\n': 'This is copyrighted, but use is permitted by the copyright holder', '==Licencing==\n': 'Licence unknown' };	var optstr = ''; for (var i in options ) { if ( options.hasOwnProperty( i ) ) { optstr += '' + options[i] + ' '; }	}	var html = '' + optstr + ' Add licence'; if($('#LicencedFile').length || $('#Licencing').length) { html += ' This page has a licence template. (help) '; } else { html += ' This page does not have a licence template! Consider adding one. (help) '; }	$(html).insertBefore('#WikiaMainContent'); $('#aSubmit').click( function(event) {		this.innerHTML = '';		$.post("/api.php", {action: "edit", title: mw.config.get("wgPageName"), token: mw.user.tokens.values.editToken, bot: true, appendtext: $("#QLicenceSelect").val, summary: "Adding licence template using Quick licence"}, function (result) { window.location = wgServer + '/index.php?title=' + mw.config.get("wgPageName") + '&action=purge'; });	}); } if (mw.config.get('wgNamespaceIds').file === mw.config.get('wgNamespaceNumber') && mw.config.get('wgAction') === 'view' && !window.QLicenceLoaded) { window.QLicenceLoaded = true; addOnloadHook(QLicenceUI); } } //