Difference between revisions of "MediaWiki:Common.js"

From Digital Sinology
Jump to: navigation, search
(Created page with "Any JavaScript here will be loaded for all users on every page load.: if ( mw.config.get("wgPageName") == "Special:Upload" ) { $('input[name="wpUpload"][type="submit"]'...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
+
if(document.getElementById("wpLicense")) {
if ( mw.config.get("wgPageName") == "Special:Upload" ) {
+
  document.onLoad = function() {document.getElementById("wpLicense").value="self-cc-by-4.0"};
$('input[name="wpUpload"][type="submit"]').mousedown(function() {
 
if ( $("#wpLicense").val() == "No license" ) {
 
$(this).attr("disabled","disabled").attr("title","Please select a license before uploading").css("cursor","disabled");
 
}
 
});
 
 
}
 
}

Latest revision as of 19:27, 22 April 2018

/* Any JavaScript here will be loaded for all users on every page load. */
if(document.getElementById("wpLicense")) {
  document.onLoad = function() {document.getElementById("wpLicense").value="self-cc-by-4.0"};
}