User:Lost Labyrinth/general/quicklicense.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
imported>Lost Labyrinth
(Let's all thank Wikia :|)
imported>Lost Labyrinth
No edit summary
Line 42:
'== Licensing ==\n{{PD}}': 'Public domain',
'== Licensing ==\n{{No license}}': 'License unknown'
};
var optstr = '';
for ( i in options ) {
if ( options.hasOwnProperty( i ) ) {
optstr += '<option value="' + i + '" style="text-align:center;">' + options[i] + '</option>';
}
}
 
var html = '<p style="text-align:center;"><select id="QLicenseSelect">' + optstr + '</select>&nbsp;<a class="wikia-button" style="margin:0 1em; cursor:pointer;" id="aSubmit">Add license</a>';
if($('#LicensedFile').length || $('#Licensing').length) {
Line 57 ⟶ 59:
$('#aSubmit').click( function(event) {
this.innerHTML = '<img src="http://images2.wikia.nocookie.net/dev/images/8/82/Facebook_throbber.gif" style="vertical-align: baseline;" border="0" />';
$.post("/api.php", {action: "edit", title: mw.config.get("wgPageName"), token: mw.user.tokens.values.editToken, bot: true, appendtext: $("#QLicenseSelect").val(), summary: "Licensing image."}, function (result) {
window.location = wgServer + '/index.php?title=' + mw.config.get("wgPageName") + '&action=purge';
});
});
}
 
if (wgCanonicalNamespace == 'File') {
addOnloadHook(QLicenseUI);
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu