Jump to content

User:Winhunter/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Winhunter (talk | contribs) at 04:13, 8 April 2007 (update). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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.
 //<nowiki> Admin tools
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/admin/monobook.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

//</nowiki> [[Category:Wikipedia administrators who use VoA script|{{PAGENAME}}]]

 //<nowiki>Please leave the following line [[user:Where/usertabs]]
 
 addOnloadHook(function() {
   if (document.title.search("/") != -1 || document.title.search("- History -") != -1) { //no subpages or history
      return;
   }
   if (document.title.indexOf("User:") == 0 || document.title.indexOf("User talk:") == 0) {
      username_a = document.URL.match(/:.*:(.*)/);
      username=username_a[1];
      addTab("http://en.wikipedia.org/wiki/Special:Contributions/" + username, "contrib", "ca-contrib", "contribs", "");
      addTab("http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=move&user=" + username, "page moves", "ca-pagemoves", "page moves", "");
      addTab("http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=&page=User:" + username, "block log", "ca-blog", "blog", "");
      addTab("http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user=" + username, "edit count", "ca-kate", "kate", "");
   }
 });

//</nowiki>

//<nowiki> ======== QuickBlocks =======
function QuickBlock (expiry,reason,ao,autob) {
  blockForm = document.getElementById('blockip');
  inputs = blockForm.getElementsByTagName('input');
  for (i=0; i<inputs.length; i++) {
    if (inputs[i].name == 'wpBlockOther') {
      inputs[i].value = expiry;
      continue;
    }
    if (inputs[i].name == 'wpBlockReason') {
      inputs[i].value = reason;
      continue;
    }
    if (inputs[i].name == 'wpAnonOnly') {
      if (ao==1) {
        inputs[i].checked = 'checked';
      }
      if (ao==0) {
        inputs[i].checked=false;
      }
      continue;
    }
    if (inputs[i].name == 'wpEnableAutoblock') {
      if (autob==1) {
        inputs[i].checked = 'checked';
      }
      if (autob==0) {
        inputs[i].checked=false;
      }
      continue;
    }
  }
  blockForm.submit();
}

addOnloadHook(function(){
  if (document.title.indexOf("Block user") == -1) return;
addTab('javascript:('+QuickBlock+')("indefinite","{{usernameblocked}} Please read our [[WP:U|our username policy]] and choose another name",0,0)','Username','p-block-user');
  addTab('javascript:('+QuickBlock+')("indefinite","{{test5i}} vandal account",0,1)','Vandal acc','p-block-vandalism');
  addTab('javascript:('+QuickBlock+')("indefinite","Similar to existing user or recent meme: please [[Special:Emailuser/Luna Santin|Email me]] if you are a legitimate editor.",0,1)','sockpuppet','p-block-sock');
  addTab('javascript:('+QuickBlock+')("31 hours","{{test5}} Recent vandalism.",0,1)','31 hours','p-block-31h');
  addTab('javascript:('+QuickBlock+')("1 week","{{test5}} Repeat vandalism.",0,1)','Week','p-block-school');
  addTab('javascript:('+QuickBlock+')("1 month","{{test5}} Chronic vandalism.",0,1)','Month','31-days');
  addTab('javascript:('+QuickBlock+')("31 hours","Trolling. If this is a shared address, please register an account to avoid collateral damage.",0,1)','Troll-31','p-block-troll-31');
  addTab('javascript:('+QuickBlock+')("indefinite","Trolling",0,1)','Troll-indef','p-block-troll-indef');
});
//</nowiki>************

// Proxy Check
addOnloadHook(function () {
    var href = document.getElementById('t-contributions');
    if (href) href = href.getElementsByTagName('a');
    if (href) href = href[0];
    if (href) href = href.href;
    else href = window.location.href;

    var addr = /(\/wiki\/|[?&]title=)Special:Contributions(\/([^\/?&#]*)|[?&#]|$)/.exec(href);
    if (!addr) return;
    addr = addr[3];
    if (!addr) {
        addr = /^[^?#]*\?([^&#]*&)*target=([^&#]*)/.exec(href);
        if (!addr) return;
        addr = addr[2];
    }
    if (!/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/.test(addr)) return;

    addLink('p-tb', 'http://www.robtex.com/rbls/'+addr+'.html', 'RBL check', 't-rblcheck', 'Multi-RBL check', null, 't-contributions');
});