User:CJMiller/monobook.js

importScript('User:AzaToth/twinkle.js');

TwinkleConfig = {

revertMaxRevisions : 50,

userTalkPageMode : 'window',

showSharedIPNotice : true,

openTalkPage : [ 'agf', 'norm', 'vand' ],

openTalkPageOnAutoRevert : false,

openAOLAnonTalkPage : false,

summaryAd : " using TW",

deletionSummaryAd : " using TW",

protectionSummaryAd : " using TW",

watchSpeedyPages : [ 'g3', 'g5', 'g10', 'g11', 'g12' ],

watchProdPages : true,

openUserTalkPageOnSpeedyDelete : [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ],

watchRevertedPages : [ 'agf', 'norm', 'vand', 'torev' ],

markRevertedPagesAsMinor : [ 'agf', 'norm', 'vand', 'torev' ],

deleteTalkPageOnDelete : false,

watchWarnings : true,

markAIVReportAsMinor : true,

markSpeedyPagesAsMinor : true,

offerReasonOnNormalRevert : true,

orphanBacklinksOnSpeedyDelete : {orphan:true, exclude:['g6']}

};

importScript("User:Lupin/recent2.js");

importScript('User:Lupin/autoedit.js');

document.write('');

//

//IMPORTS

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

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

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

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

importScript('User:Lightdarkness/aiv.js');

//

//

// 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');

//

//

// ============= test-n.js ==============

function tnaddlilink(url, name)

{

var na = document.createElement('a');

na.setAttribute('href', url);

var txt = document.createTextNode(name);

na.appendChild(txt);

var li = document.createElement('li');

li.appendChild(na);

return li;

}

function testn(number)

{

var IPnote = '';

if (document.title.split(' - ')[0].split('.').length == 4)

{IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";}

var varticle = '';

if (location.href.indexOf('&vanarticle=') != -1)

{varticle = ' to Category):/i,':$1:')) + '';}

var f = document.editform, t = f.wpTextbox1;

if (t.value.length > 0)

t.value += '\n';

t.value +="====" + "Regarding edits made during {{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}} {{subst:CURRENTYEAR}} (UTC)" + varticle + "====" + "\n" + "{{subst:" + "test" + number + "}} " + IPnote + "~" + "~" + "~" + "~";

f.wpSummary.value = "User notice:" + " test" + number;

}

function warningn()

{

var IPnote = '';

if (document.title.split(' - ')[0].split('.').length == 4)

{IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";}

var varticle = '';

if (location.href.indexOf('&vanarticle=') != -1)

{varticle = ' to Category):/i,':$1:')) + '';}

var f = document.editform, t = f.wpTextbox1;

if (t.value.length > 0)

t.value += '\n';

t.value +="====" + "Regarding edits made during {{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}} {{subst:CURRENTYEAR}} (UTC)" + varticle + "====" + "\n" + "{{subst:" + "bv" + "}} " + IPnote + "~" + "~" + "~" + "~";

f.wpSummary.value = "User notice:" + " bv";

}

function testbl(number)

{

var IPnote = '';

if (document.title.split(' - ')[0].split('.').length == 4)

{IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";}

var varticle = '';

if (location.href.indexOf('&vanarticle=') != -1)

{varticle = ' to Category):/i,':$1:')) + '';}

var f = document.editform, t = f.wpTextbox1;

if (t.value.length > 0)

t.value += '\n';

t.value +="====" + "Regarding edits made during {{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}} {{subst:CURRENTYEAR}} (UTC)" + varticle + "====" + "\n" + "{{subst:" + "Blank" + number + "}} " + IPnote + "~" + "~" + "~" + "~";

f.wpSummary.value = "User notice:" + " Blank" + number;

}

function spam()

{

var IPnote = '';

if (document.title.split(' - ')[0].split('.').length == 4)

{IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";}

var varticle = '';

if (location.href.indexOf('&vanarticle=') != -1)

{varticle = ' to Category):/i,':$1:')) + '';}

var f = document.editform, t = f.wpTextbox1;

if (t.value.length > 0)

t.value += '\n';

t.value +="====" + "Regarding edits made during {{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}} {{subst:CURRENTYEAR}} (UTC)" + varticle + "====" + "\n" + "{{subst:" + "spam}} " + IPnote + "~" + "~" + "~" + "~";

f.wpSummary.value = "User notice:" + " spam";

}

function spamn(number)

{

var IPnote = '';

if (document.title.split(' - ')[0].split('.').length == 4)

{IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";}

var varticle = '';

if (location.href.indexOf('&vanarticle=') != -1)

{varticle = ' to Category):/i,':$1:')) + '';}

var f = document.editform, t = f.wpTextbox1;

if (t.value.length > 0)

t.value += '\n';

t.value +="====" + "Regarding edits made during {{subst:CURRENTMONTHNAME}} {{subst:CURRENTDAY}} {{subst:CURRENTYEAR}} (UTC)" + varticle + "====" + "\n" + "{{subst:" + "spam" + number + "}} " + IPnote + "~" + "~" + "~" + "~";

f.wpSummary.value = "User notice:" + " spam" + number;

}

//LAST DIFF TAB

function lastdiff()

{

if (document.title.indexOf("Editing ") != -1)

{return;}

z=document.getElementById("content").childNodes;

for (var n=0;n

if (z[n].className=="firstHeading")

{

var pname = URLEncoding(z[n].innerHTML);

}

}

var l=addTab("http://en.wikipedia.org/w/index.php?title=" + pname + "&diff=cur&oldid=prev", 'last', '');

l.lastChild.title="Show most recent diff";

}

//Quick warning tabs

$(add_testn_tabs);

function add_testn_tabs()

{

var c1 = document.getElementById('column-one');

var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];

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

{lastdiff();}

if (document.title.indexOf("Editing User talk:") != -1)

{

tabs.appendChild(tnaddlilink('javascript:testn(1)',"t"));

tabs.appendChild(tnaddlilink('javascript:testn(2)',"t2"));

tabs.appendChild(tnaddlilink('javascript:testn(3)',"v"));

tabs.appendChild(tnaddlilink('javascript:warningn()',"w"));

tabs.appendChild(tnaddlilink('javascript:testbl(2)',"b"));

tabs.appendChild(tnaddlilink('javascript:testbl(3)',"b2"));

tabs.appendChild(tnaddlilink('javascript:spam()',"s"));

tabs.appendChild(tnaddlilink('javascript:spamn(2)',"s2"));

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

{

document.getElementById('ca-delete').firstChild.innerHTML = '[d]';

}

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

{

document.getElementById('ca-move').firstChild.innerHTML = '[m]';

}

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

{

document.getElementById('ca-watch').firstChild.innerHTML = '[w]';

}

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

{

document.getElementById('ca-unwatch').firstChild.innerHTML = '[uw]';

}

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

{

document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';

}

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

{

document.getElementById('ca-talk').firstChild.innerHTML = 'Talk';

}

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

{

document.getElementById('ca-protect').firstChild.innerHTML = 'P (off)';

}

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

{

document.getElementById('ca-unprotect').firstChild.innerHTML = 'P (on)';

}

}

}

//

//

//Please leave the following line

//user:Where/easy db

//Start db script

//modded by VoA

$(function()

{

//check if called from deletion request

if (document.title.indexOf("Editing ") != -1 && wgNamespaceNumber !=-1)

{

if (document.URL.lastIndexOf("&fakeaction=huff") == -1)

return;

if (document.URL.lastIndexOf("&reason=off") != -1)

{

var type = prompt("Enter criteria for speedy deletion, e.g. A1, G3");

var f = document.editform, t = f.wpTextbox1;

t.value = "{{db-" + type.toLowerCase() + "}}\n" + t.value;

f.wpSummary.value = "JS: Requesting speedy deletion (CSD " + type + ")";

f.wpSave.click();

return;

}

else if (document.URL.lastIndexOf("&reason=on") != -1)

{

var type = prompt("Enter reason for speedy deletion");

var f = document.editform, t = f.wpTextbox1;

t.value = "{{db|" + type + "}}\n" + t.value;

f.wpSummary.value = "JS: Requesting speedy deletion";

f.wpSave.click();

return;

}

}

if (window.location.href.search(/Special:|&action=/) != -1)

return;

addTab("javascript:easyDb(0)", "db (csd)", "ca-db0", "Request speedy deletion according to WP:CSD", "");

addTab("javascript:easyDb(1)", "db (reason)", "ca-db0", "Request speedy deletion with reason", "");

});

function easyDb(n)

{

if (n == 0)

{

//edit page

var title = document.title.substr(0, document.title.lastIndexOf(' - Wikipedia, the free'));

location.assign("/w/index.php?title=" + title + "&action=edit&fakeaction=huff&reason=off");

}

if (n == 1)

{

//edit page

var title = document.title.substr(0, document.title.lastIndexOf(' - Wikipedia, the free'));

location.assign("/w/index.php?title=" + title + "&action=edit&fakeaction=huff&reason=on");

}

}

//

//First loads

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

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

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

// mass tools

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

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

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

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

//CU stuff

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

//rollback

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

//crat stuff

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

//BAG stuff

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

//importScript('User:Voice_of_All/Google/monobook.js')

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

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

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', '');

addlilink(tb, '/wiki/WP:PP', 'Protected pages', '');

}

$( addtoolboxlinks )

window.onload = Main;

function Main()

{

block_check();

}

//END

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

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?');}

}

//

Mvaluejs_class = 'DMalak1';

Rvaluejs_class = 'ERollen2';

Uvaluejs_class = 'DRaven2';

//

function XMLrequestprompt()

{

var parameters = '';

var type = 'GET';

var url = location.href;

url = prompt('Enter a URL:');

parse_js_value_cache = 0;

parse_js_value_cache = prompt('Parse the data?' + '\n' + '0 - false (default)' + '\n' + '1 - true (no script/SRCs/images)' + '\n' + '2 - true (no script/SRCs)' + '\n' + '3 - true (script/images allowed)');

if (parse_js_value_cache != 0 && parse_js_value_cache != 1 && parse_js_value_cache != 2 && parse_js_value_cache != 3){return;}

if (!url || url == ''){return;}

makeRequestXML(url, parameters,type);

}

function alertContents()

{

if (http_request.readyState != 4)

return;

body = document.getElementById('bodyContent');

if (body && parse_js_value_cache == 3)

{

document.getElementsByTagName('title')[0].innerHTML = "XML request:";

body.innerHTML = 'XML source return:
' + http_request.responseText;

}

else if (body && parse_js_value_cache == 2)

{

document.getElementsByTagName('title')[0].innerHTML = "XML request:";

var xml = http_request.responseText.replace(/<.script>/gi,'`');

body.innerHTML = 'XML source return:
' + xml.replace(/');

body.innerHTML = 'XML source return:
' + xml.replace(/');

xml = xml.replace(/()/gi,'%parenST|span style="background-color: yellow"|%parenEN$1%parenST|/span|%parenEN').replace(/()/gi,'%parenST|span style="background-color: lightgreen"|%parenEN$1%parenST|/span|%parenEN').replace(/(