User:Luna Santin/monobook.js

// ======== QuickBlocks =======

function QuickBlock (expiry,reason,hardblock,autob,accfreeze,emailblock,talkblock)

{

//cache reference to block form, inputs list

blockForm = document.getElementById('blockip');

inputs = blockForm.getElementsByTagName('input');

//fill out the form fields

for (i=0; i

{

switch (inputs[i].name)

{

case 'wpBlockOther':

inputs[i].value = expiry;

break;

case 'wpBlockReason':

inputs[i].value = reason;

break;

case 'wpAnonOnly':

inputs[i].checked = !hardblock;

break;

case 'wpEnableAutoblock':

inputs[i].checked = autob;

break;

case 'wpCreateAccount':

inputs[i].checked = accfreeze;

break;

case 'wpEmailBan':

inputs[i].checked = emailblock;

break;

case 'wpAllowUsertalk':

inputs[i].checked = !talkblock; //this one's flipped

break;

} //switch

} //for

//submit the form :D

if (document.getElementById('Already_blocked') != null)

{

alert('User is already blocked. Submit manually to update settings.');

}

else

{

blockForm.submit();

}

}

addOnloadHook(function(){

if (document.title.indexOf("Block user") == -1) return;

else {

addTab('javascript:('+QuickBlock+')("1 hour","Blocked for one hour, due to recent abuse. To appeal or request help, please contact me or follow the instructions below.",false,true,true,false,false)','hour','p-block-ab-1h');

addTab('javascript:('+QuickBlock+')("24 hours","Blocked for 24 hours, due to recent abuse. To appeal or request help, please contact me or follow the instructions below.",false,true,true,false,false)','24h','p-block-ab-24h');

addTab('javascript:('+QuickBlock+')("48 hours","Blocked for 48 hours, due to recent abuse. To appeal or request help, please contact me or follow the instructions below.",false,true,true,false,false)','48h','p-block-ab-48h');

addTab('javascript:('+QuickBlock+')("1 week","Blocked for one week, due to repeat abuse. To appeal or request help, please contact me or follow the instructions below.",false,true,true,false,false)','week','p-block-ab-1w');

addTab('javascript:('+QuickBlock+')("1 month","Blocked for one month, due to repeat abuse. To appeal or request help, please contact me or follow the instructions below.",false,true,true,false,false)','month','p-block-ab-1m');

addTab('javascript:('+QuickBlock+')("indefinite","Blocked indefinitely, due to abuse. To appeal or request help, please contact me or follow the instructions below.",false,true,true,false,false)','indef','p-block-ab-ind');

addTab('javascript:('+QuickBlock+')("6 months","{{anonblock}}",false,false,true,false,false)','anon-6m','p-block-anon-6m');

//{{anonblock}}

addTab('javascript:('+QuickBlock+')("48 hours","This IP address has recently been used abusively. To appeal or request help, please contact me or follow the instructions below.",true,true,true,false,false)','48h-hard','p-block-ab-48-hard');

addTab('javascript:('+QuickBlock+')("1 year","{{openproxy}}",true,true,true,false,false)','proxy','p-block-proxy');

//{{openproxy}}

addTab('javascript:('+QuickBlock+')("indefinite","Similar to existing user or recent meme. To appeal or request help, please contact me or follow the instructions below.",true,true,true,false,false)','sock','p-block-sock-ind');

addTab('javascript:('+QuickBlock+')("indefinite","{{usernameblocked}}",true,false,false,false,false)','name','p-block-username');

//{{Usernameblocked}}

addTab('javascript:('+QuickBlock+')("indefinite","abuse",true,true,true,true,true)','grawp','p-block-grawp');

}

});

//************

// CSD AutoReason

importScript('User:^demon/csd.js');

//Some of VoA's stuff

importScript('User:Voice_of_All/Addtabs/monobook.js');

importScript('User:Voice of All/Adminwarnings/monobook.js');

importScript('User:Voice_of_All/UTCclock.js');

importScript('User:Voice of All/History/monobook.js');

function changelinks()

{

if(!document.getElementById) return;

var toplinks = document.getElementById('p-personal').getElementsByTagName('ul')[0];

var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;

document.getElementById('pt-mytalk').firstChild.innerHTML = 'my Talk page';

document.getElementById('pt-preferences').firstChild.innerHTML = 'Change Preferences';

document.getElementById('pt-watchlist').firstChild.innerHTML = 'Check my Watchlist';

document.getElementById('pt-mycontris').firstChild.innerHTML = 'My Contributions';

document.getElementById('pt-logout').firstChild.innerHTML = 'Log out';

if(document.getElementById('ca-delete'))

{document.getElementById('ca-delete').firstChild.innerHTML = 'delete';}

if(document.getElementById('ca-addsection'))

{document.getElementById('ca-addsection').firstChild.innerHTML = '+';}

}

function navigationlinks()

{

addnavbox_link('/wiki/Wikipedia:Administrator_intervention_against_vandalism','Vandalism','aiv-ln');

addnavbox_link('/wiki/Category:Candidates_for_speedy_deletion','Speedy deletions','speedy-ln');

addnavbox_link('/wiki/Wikipedia:Requests for page protection','Protection requests','rfpp-ln');

addnavbox_link('/wiki/Wikipedia:Administrators%27_noticeboard','Noticeboard','AN-ln');

}

function addtoolboxlinks()

{

var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];

addlilink(tb, '/wiki/Special:Newpages', 'New pages', '');

addlilink(tb, '/wiki/Special:Log/newusers', 'New users', '');

}

function userlogs()

{

//no subpages or history

if (document.title.search("/") != -1 || location.href.search(/Special:|&action=[^p]|&diff=/) !=-1)

{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/w/index.php?title=Special%3ALog&type=block&user=&page=User:" + username, "log", "ca-blog", "block log", "");

}

}

function block_check()

{

if (document.title.indexOf('Block user') !=0){return;}

//monobook

if (document.getElementById('pt-userpage'))

{var user_name = document.getElementById('pt-userpage').getElementsByTagName('a')[0].innerHTML;}

//cologneblue

else if (document.getElementById('quickbar') && document.getElementById('quickbar').getElementsByTagName('h6')[0])

{

var toplinks = document.getElementById('quickbar');

var user_name = toplinks.innerHTML.split('

My pages
')[1].split('title="User:')[1].split('"')[0];

}

if (document.getElementsByTagName('input')[0].value == user_name)

{alert('Are you sure you want to block yourself?');}

else if (document.getElementsByTagName('input')[0].value == user_name.replace(/ /g,'_'))

{alert('Are you sure you want to block yourself?');}

}

addOnloadHook(Mainfast)

function Mainfast()

{

userlogs();

changelinks();

navigationlinks();

addtoolboxlinks();

block_check();

}

//Category:Wikipedians who use VoA script

//************

//Lupin's tools

//************

//Filter changes live Category:Wikipedians who use VoA script

//User:Lupin/recent2.js - please include this line

mw.loader.load(

'https://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js'

+ '&action=raw&ctype=text/javascript&dontcountme=s');

//User:Lupin/popupsdev.js - please include this line

document.write('');

popupShortcutKeys=true; // optional: enable keyboard shortcuts

popupAdminLinks=true; // optional: enable admin links Category:Wikipedians who use VoA script

popupSubpopups=false;

popupOnEditSelection=false;

popupStructure='shortmenus';

//END

//************

// X! made a handy userrights ditty

importScript('User:X!/userrights.js');