Jump to content

User:Iamunknown/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:Iamunknown/image-templates.js');
importScript('User:Lupin/popups.js'); // [[User:Lupin/popups.js]] - As I remember, Lupin wanted links to his popups script so that a list could be made of people to contact pending updates
importScript('Wikipedia:WikiProject User scripts/Scripts/Time');
importScript('Wikipedia:WikiProject User scripts/Scripts/Add purge to tabs');

function stopRedlinksEditing(){ 
    var len=document.links.length;
    for(var i=0; i<len; ++i) {
        var l=document.links[i];
        if (l.className=='new') {
            l.href=l.href.replace('&action=edit', '');
        }
    }
}
addOnloadHook(stopRedlinksEditing);

if (wgNamespaceNumber == 0)
 {
  importScript('User:AndyZ/peerreviewer2.js');
  toolbarLink_PR = true;
 }
else
if (wgNamespaceNumber == 6)
 {
  mwCustomEditButtons[mwCustomEditButtons.length] =
   {
    "imageId":    "mw-editbutton-info", 
    "imageFile":  "/media/wikipedia/commons/thumb/2/21/Info_Sign.svg/23px-Info_Sign.svg.png", 
    "speedTip":   "Information template", 
    "tagOpen":    "", 
    "tagClose":   "", 
    "sampleText": "\n{{Information\n" 
                  + "|Description = \n" 
                  + "|Source      = \n" 
                  + "|Date        = \n" 
                  + "|Author      = \n" 
                  + "|Permission  = \n" 
                  + "|other_versions = \n}}\n"
   };
 }

/**
 * In the "Revision history of ..." on history pages, 
 * add quotation marks around the title.
 */
if(window.location.toString().match(/(?:\?|&)action=history/)) {
 addOnloadHook(function() {
  
  var i, header, headerList, prefix
  
  headerList = document.getElementsByTagName("h1");
  prefix = "Revision history of ";
  
  for(i=0; i<headerList.length; i++) {
   if (headerList[i].className == "firstHeading") {
    header = headerList[i];
   }
  }
  
  header.innerHTML = header.innerHTML.substr(0, prefix.length) 
                   + "“" 
                   + header.innerHTML.substr(prefix.length, header.innerHTML.length) 
                   + "”";
  
 });
}