User:C.Syde65/common.js

// 08:11, May 30, 2019 (UTC) // 

/* Quick image licence - contains the most commonly used licencing criteria - fixed for Oasis */ function QLicenseUI { var options = { : ,		'\n== Licensing ==\n': 'Fair use', '\n== Licensing ==\n': 'This is licenced under Creative Commons Attribution 3.0 (free licence)', '\n== Licensing ==\n': 'This is licenced under GFDL (free licence)', '\n== Licensing ==\n': 'Public domain', '\n== Licensing ==\n': 'Licence unknown' };	var optstr = ''; for ( i in options ) { if ( options.hasOwnProperty( i ) ) { optstr += '' + options[i] + ' '; }	}	var html = '' + optstr + ' Add license'; if($('#LicensedFile').length || $('#Licensing').length) { html += ' This file is licensed. ';	} else { html += ' This file is not licensed. ';	}	$('#WikiaPageHeader').append(html); $('#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: $("#QLicenseSelect").val, summary: "Licensing image."}, function (result) { window.location = wgServer + '/index.php?title=' + mw.config.get("wgPageName") + '&action=purge'; });	}); } if (wgCanonicalNamespace == 'File') { addOnloadHook(QLicenseUI); }