MediaWiki:Delete.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
 // <nowiki>
 
 var deletewithoutlinking3 = true;
 var deletewithlinking3 = (deletewithlinking3 ? true : false);
 var deletekeep3 = (deletekeep3 ? true : false);
 var duplicate3 = (duplicate3 ? true : false);
 
 var deletereasons = "copyright violation, see [[Commons:Licensing]]|copyvio; fair use, see [[Commons:Licensing]]|fair use; copyrighted logo, see [[Commons:Licensing]]|logo; duplicate; [[Commons:Derivative works]]: copyright violation, it depicts a copyrighted work which is not published under a free license]]|derivative work; see request for deletion|regular deletion; see [[Commons:Project scope]]|project scope; vandalism or spam; replaced by template, orphaned|replaced; incompatible flickr image, see [[Commons:Licensing]]|flickr ink; no proper source|no source; no license; no permission; no [[Commons:Freedom of panorama]] in origin country|no FOP"  // Delete without linking
 
 var getParamValue = mw.util.getParamValue;
 function fillActionPageDeleteWithoutLinking() {
   if (getParamValue("action") == "delete") {
     if ((document.getElementsByTagName("h1")[0].childNodes[0].nodeValue == 'Action complete')) {
       if(mw.config.get('wgUserName') != 'ABF') window.close();
     }
   }
   if (getParamValue("deletereason") > "") {
     document.forms[0].wpReason.value = getParamValue("deletereason");
     if (mw.config.get('wgNamespaceNumber') != 6) {
       window.setTimeout(function() { document.getElementById("deleteconfirm").wpConfirmB.click(); }, 100);
     } else {
      window.setTimeout(function() { document.getElementById('mw-filedelete-submit').click(); }, 100);
     }
   }
 }
 
 if ( (getParamValue("action") == "delete") || ( (getParamValue("deletereason") > "") && (getParamValue("linking") == '') ) ) {
   $(document).ready(fillActionPageDeleteWithoutLinking);
 }
 
 // </nowiki>