Anonymous user
User:Lost Labyrinth/general/quicklicense.js: Difference between revisions
User:Lost Labyrinth/general/quicklicense.js (view source)
Revision as of 17:04, 2 May 2015
, 9 years agoupdate
imported>Lost Labyrinth (This has been broken for a week. One last fix attempt before I revert to the working version) |
imported>K6ka (update) |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1:
/* Quick image license - contains the most commonly used licensing criteria */
/* THIS SCRIPT IS CURRENTLY NOT WORKING IN OASIS - blame Wikia's file page layout adjustments. Still works in Monobook though. */
function QLicenseUI() {
var options = {
'== Licensing ==\n{{Copyright by EA|fanon}}': 'Fanon image',
'== Licensing ==\n{{Copyright by EA|sim1}}': 'Sim from TS1',
'== Licensing ==\n{{Copyright by EA|
'== Licensing ==\n{{Copyright by EA|lot1}}': 'Lot from TS1',
'== Licensing ==\n{{Copyright by EA|sim2}}': 'Sim from TS2',
'== Licensing ==\n{{Copyright by EA|
'==
'== Licensing ==\n{{Copyright by EA|sim3}}': 'Sim from TS3',
'== Licensing ==\n{{Copyright by EA|
'==
'== Licensing ==\n{{Copyright by EA|sim4}}': 'Sim from TS4',
'== Licensing ==\n{{Copyright by EA|
'==
'== Licensing ==\n{{Copyright by EA|simls}}': 'Sim from Life Stories',
'== Licensing ==\n{{Copyright by EA|
'==
'== Licensing ==\n{{Copyright by EA|simps}}': 'Sim from Pet Stories',
'== Licensing ==\n{{Copyright by EA|
'==
'== Licensing ==\n{{Copyright by EA|lotcs}}': 'Lot from Castaway Stories',
'== Licensing ==\n{{Copyright by EA|
'== Licensing ==\n{{Copyright by EA|simcon}}': 'Sim from a console game',
'== Licensing ==\n{{Copyright by EA|sscon}}': 'Screenshot from a console game',
'== Licensing ==\n{{Copyright by EA|
'==
'== Licensing ==\n{{Copyright by EA|box}}': 'Box art',
'== Licensing ==\n{{Copyright by EA|
'==
'== Licensing ==\n{{Copyright by EA|mood}}': 'A moodlet',
'== Licensing ==\n{{Copyright by EA|
'==
'== Licensing ==\n{{Copyright by EA|zodiac}}': 'A zodiac sign',
'== Licensing ==\n{{Copyright by EA|
'==
'== Licensing ==\n{{Copyright by EA|interface}}': 'Something from the game interface',
'== Licensing ==\n{{Copyright by EA|
'== Licensing ==\n{{Copyright by EA}}': 'Something else from The Sims series/other EA-copyrighted image',
'== Licensing ==\n{{Copyrighted by Wikia|obj}}': 'Something part of the Wikia interace',
'== Licensing ==\n{{Fairuse}}': 'Fair use',
'== Licensing ==\n{{cc-by-sa-3.0}}': 'This is licensed under Creative Commons Attribution 3.0 (free license)',
'== Licensing ==\n{{GFDL}}': 'This is licensed under GFDL (free license)',
'== Licensing ==\n{{PD}}': 'Public domain',
'==
};
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> <a class="wikia-button" style="margin:0 1em; cursor:pointer;" id="aSubmit">Add license</a>';
if($('#LicensedFile').length || $('#
html += ' <span style="color:red; font-weight:bold; text-align:center;">This file is licensed.</span></p>';
} else {
Line 134 ⟶ 63:
$('#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);
|