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

From The Sims Wiki, a collaborative database for The Sims series
Jump to navigation Jump to search
Content added Content deleted
imported>Lost Labyrinth
(now it /should/ work)
imported>Lost Labyrinth
(restoring the last little thing - this should be flawless now)
Line 37: Line 37:
'{{Copyrighted by Wikia|obj}}': 'Something part of the Wikia interace',
'{{Copyrighted by Wikia|obj}}': 'Something part of the Wikia interace',
'{{Fairuse}}': 'Fair use',
'{{Fairuse}}': 'Fair use',
'{{cc-by-sa-3.0}}': 'This is licensed under Creative Commons Attribution 3.0 (free license)',
'{{GFDL}}': 'This is licensed under GFDL (free license)',
'{{GFDL}}': 'This is licensed under GFDL (free license)',
'{{PD}}': 'Public domain',
'{{PD}}': 'Public domain',

Revision as of 12:00, 5 September 2012

/* Quick image license - contains the most commonly used licensing criteria */
function QLicenseUI() {
	var options = {
		'{{Copyright by EA|fanon}}': 'Fanon image',
		'{{Copyright by EA|sim1}}': 'Sim from TS1',
                '{{Copyright by EA|ss1}}': 'Screenshot from TS1',
                '{{Copyright by EA|lot1}}': 'Lot from TS1',
                '{{Copyright by EA|sim2}}': 'Sim from TS2',
                '{{Copyright by EA|ss2}}': 'Screenshot from TS2',
                '{{Copyright by EA|lot2}}': 'Lot from TS2',
		'{{Copyright by EA|sim3}}': 'Sim from TS3',
                '{{Copyright by EA|ss3}}': 'Screenshot from TS3',
                '{{Copyright by EA|lot3}}': 'Lot from TS3',
                '{{Copyright by EA|simls}}': 'Sim from Life Stories',
                '{{Copyright by EA|lotls}}': 'Lot from Life Stories',
                '{{Copyright by EA|ssls}}': 'Screenshot from Life Stories',
                '{{Copyright by EA|simps}}': 'Sim from Pet Stories',
                '{{Copyright by EA|lotps}}': 'Lot from Pet Stories',
                '{{Copyright by EA|ssps}}': 'Screenshot from Pet Stories',
                '{{Copyright by EA|lotcs}}': 'Lot from Castaway Stories',
                '{{Copyright by EA|sscs}}': 'Screenshot from Castaway Stories',
                '{{Copyright by EA|simcon}}': 'Sim from a console game',
                '{{Copyright by EA|sscon}}': 'Screenshot from a console game',
                '{{Copyright by EA|obj}}': 'An object',
                '{{Copyright by EA|pet}}': 'A pet',
                '{{Copyright by EA|box}}': 'Box art',
                '{{Copyright by EA|obj}}': 'An object',
                '{{Copyright by EA|mem}}': 'A memory',
                '{{Copyright by EA|mood}}': 'A moodlet',
                '{{Copyright by EA|moodnf}}': 'A moodlet with no frame',
                '{{Copyright by EA|trait}}': 'A trait',
                '{{Copyright by EA|zodiac}}': 'A zodiac sign',
                '{{Copyright by EA|logo}}': 'A game logo or icon',
                '{{Copyright by EA|waf}}': 'A want or fear',
                '{{Copyright by EA|interface}}': 'Something from the game interface',
                '{{Copyright by EA}}': 'Something else from The Sims series/other EA-copyrighted image',
                '{{Copyrighted by Wikia|obj}}': 'Something part of the Wikia interace',
		'{{Fairuse}}': 'Fair use',
                '{{cc-by-sa-3.0}}': 'This is licensed under Creative Commons Attribution 3.0 (free license)',
                '{{GFDL}}': 'This is licensed under GFDL (free license)',
                '{{PD}}': 'Public domain',
                '{{No license}}': 'License unknown'
	};
	var optstr = '';
	for(i in options) {
		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 || $('#License').length) {
		html += '&nbsp;<span style="color:red; font-weight:bold; text-align:center;">This file is licensed.</span></p>';
	} else {
		html += '&nbsp;<span style="color:green; font-weight:bold; text-align:center;">This file is not licensed.</span></p>';
	}
	$('#filetoc').append(html);
	$('#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: wgPageName, token: mw.user.tokens.values.editToken, appendtext: $("#QLicenseSelect").val(), summary: "Licensing image."}, function (result) {
			window.location = wgServer + '/index.php?title=' + wgPageName + '&action=purge';
		});
	});
}
 
if (wgCanonicalNamespace == 'File') {
	addOnloadHook(QLicenseUI);
}