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

update
imported>Lost Labyrinth
(restoring the last little thing - this should be flawless now)
imported>K6ka
(update)
 
(18 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|ss1}}': 'Screenshot from TS1',
'== Licensing ==\n{{Copyright by EA|lot1}}': 'Lot from TS1',
'== Licensing ==\n{{Copyright by EA|sim2}}': 'Sim from TS2',
'== Licensing ==\n{{Copyright by EA|ss2}}': 'Screenshot from TS2',
'== Licensing ==\n{{Copyright by EA|lot2}}': 'Lot from TS2',
'== Licensing ==\n{{Copyright by EA|sim3}}': 'Sim from TS3',
'== Licensing ==\n{{Copyright by EA|ss3}}': 'Screenshot from TS3',
'== Licensing ==\n{{Copyright by EA|lot3}}': 'Lot from TS3',
'== Licensing '==\n{{Copyright by EA|simlssim4}}': 'Sim from Life StoriesTS4',
'== Licensing ==\n{{Copyright by EA|lotlsss4}}': 'LotScreenshot from Life StoriesTS4',
'== Licensing ==\n{{Copyright by EA|sslslot4}}': 'ScreenshotLot from Life StoriesTS4',
'== Licensing ==\n{{Copyright by EA|simpssimls}}': 'Sim from PetLife Stories',
'== Licensing ==\n{{Copyright by EA|lotpslotls}}': 'Lot from PetLife Stories',
'== Licensing ==\n{{Copyright by EA|sspsssls}}': 'Screenshot from PetLife Stories',
'== Licensing ==\n{{Copyright by EA|lotcssimps}}': 'LotSim from CastawayPet Stories',
'== Licensing ==\n{{Copyright by EA|sscslotps}}': 'ScreenshotLot from CastawayPet Stories',
'== Licensing ==\n{{Copyright by EA|simconssps}}': 'SimScreenshot from a consolePet gameStories',
'== Licensing ==\n{{Copyright by EA|ssconlotcs}}': 'ScreenshotLot from a consoleCastaway gameStories',
'== Licensing ==\n{{Copyright by EA|objsscs}}': 'AnScreenshot from Castaway objectStories',
'== Licensing ==\n{{Copyright by EA|petsimcon}}': 'ASim from a console petgame',
'== Licensing ==\n{{Copyright by EA|boxsscon}}': 'BoxScreenshot from a console artgame',
'== Licensing ==\n{{Copyright by EA|obj}}': 'An object',
'== Licensing ==\n{{Copyright by EA|mempet}}': 'A memorypet',
'== Licensing ==\n{{Copyright by EA|moodbox}}': 'ABox moodletart',
'== Licensing ==\n{{Copyright by EA|moodnfobj}}': 'A moodlet with noAn frameobject',
'== Licensing ==\n{{Copyright by EA|traitmem}}': 'A traitmemory',
'== Licensing ==\n{{Copyright by EA|zodiacmood}}': 'A zodiac signmoodlet',
'== Licensing ==\n{{Copyright by EA|logomoodnf}}': 'A gamemoodlet logowith orno iconframe',
'== Licensing ==\n{{Copyright by EA|waftrait}}': 'A want or feartrait',
'== Licensing ==\n{{Copyright by EA|interfacezodiac}}': 'Something from theA gamezodiac interfacesign',
'== Licensing ==\n{{Copyright by EA|logo}}': 'SomethingA elsegame fromlogo The Sims series/other EA-copyrightedor imageicon',
'== Licensing ==\n{{CopyrightedCopyright by WikiaEA|objwaf}}': 'Something part ofA thewant Wikiaor interacefear',
'== Licensing ==\n{{Copyright by EA|interface}}': 'Something from the game interface',
'{{Fairuse}}': 'Fair use',
'== Licensing ==\n{{cc-Copyright by-sa-3.0 EA|promo}}': 'This is licensed under Creative Commons Attribution 3.0A (freepromotional license)image',
'== Licensing ==\n{{GFDLCopyright by EA}}': 'ThisSomething else isfrom licensedThe underSims GFDLseries/other (freeEA-copyrighted license)image',
'== Licensing ==\n{{PDCopyrighted by Wikia|obj}}': 'PublicSomething part of the Wikia domaininterace',
'== Licensing ==\n{{Fairuse}}': 'Fair use',
'{{No license}}': 'License unknown'
'== 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',
'== 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 || $('#LicenseLicensing').length) {
html += '&nbsp;<span style="color:red; font-weight:bold; text-align:center;">This file is licensed.</span></p>';
} else {
Line 56 ⟶ 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);
Anonymous user