Misplaced Pages

User:RenamedUser jaskldjslak901/monobook.js: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< User:RenamedUser jaskldjslak901 Browse history interactivelyContent deleted Content added
Revision as of 03:37, 19 October 2007 view sourceRenamedUser jaskldjslak903 (talk | contribs)9,168 edits create  Latest revision as of 20:32, 26 March 2022 view source Ladsgroup (talk | contribs)Extended confirmed users, IP block exemptions, Pending changes reviewers, Rollbackers20,548 editsm Maintenance: Replacing document.write with mw.loader.load (mw:ResourceLoader/Migration_guide_(users)#Avoid_document.write() - phab:T130879
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
/*** BEGIN WIKIBREAK ENFORCER ***/
// ADD TAB
$(document).ready(function() {
/*** Start editing here ***/
// When you want to end your break?
// no leading zeroes. (example: 7 - correct, 07 - incorrect)
var date = { year: 2017, month: 1, day: 1};
var time = { hours: 00, minutes: 00, seconds: 01 };
/*** Stop editing here ***/
var currentDate = new Date();
var enforcedBreakEnd = new Date(
date.year,date.month-1,date.day,time.hours,time.minutes,time.seconds);
if (currentDate <= enforcedBreakEnd) {
alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString()
+ "\n(now is "+currentDate.toLocaleString()+")\n\nBye!");
location = "//"+location.host+"/search/?title="
+ "Special:Userlogout&returnto=Main_Page";
}
});
/*** END WIKIBREAK ENFORCER ***/


// Filter changes live
function addTab(url, name, id, title, key){
// ] - please include this line
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul');
mw.loader.load(
return addlilink(tabs, url, name, id, title, key);
'https://en.wikipedia.org/search/?title=User:Lupin/recent2.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');

// ] - please include this line

mw.loader.load(
'https://en.wikipedia.org/search/?title=User:Lupin/popups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
popupImages=false;
popupStructure='menus';
popupFixRedits = true;
popupFixDabs = true;
popupAdminLinks = true;
simplePopups = false;

//<nowiki>

//From somewhere
function hideafd(){
var divs = document.getElementsByTagName("div");
for(var x = 0; x < divs.length; ++x)
if(divs.className.indexOf("afd") != -1)
divs.style.display = "none";
document.getElementById('footer').style.display = 'none';
} }


function showafd(){
// ADD LI LINK
var divs = document.getElementsByTagName("div");
for(var x = 0; x < divs.length; ++x)
if(divs.className.indexOf("afd") != -1)
divs.style.display = "";
document.getElementById('footer').style.display = '';
}


function addlilink(tabs, url, name, id, title, key){ function addlilink(tabs, url, name){
var na = document.createElement('a'); var na = document.createElement('a');
na.href = url; na.href = url;
na.appendChild(document.createTextNode(name)); na.appendChild(document.createTextNode(name));
var li = document.createElement('li'); var li = document.createElement('li');
if(id) li.id = id;
li.appendChild(na); li.appendChild(na);
tabs.appendChild(li); tabs.appendChild(li);
if(id) return li;
}


//Hybirdization of ABCD afd closer

function closeafd(bold, notbold){
var form = document.editform;
var txt = form.wpTextbox1;
txt.value = "{{subst:at}} '''" + bold + "'''" + notbold + ". ~~~~\n" + txt.value + "\n{{subst:ab}}\n";
form.wpSummary.value = "close discussion: " + bold + notbold;
form.wpWatchthis.checked = false;
}

function afdresult(){
var res = prompt("Result?");
if(!res) return;
var form = document.editform;
form.wpSummary.value = 'AFD result';
var txt = form.wpTextbox1;
txt.value += '{{oldafdfull|date=] ]|result=' + res + '|votepage={{subst:PAGENAME}}}}';
txt.focus();
}

function afddelete(){
document.forms.deleteconfirm.wpReason.value = '+)&action=delete.*$/, '$1').replace(/_/g, ' ')).replace(/^(Talk|Misplaced Pages( talk)?):/, '') + ']]';
}

function replace(){
var s = prompt("Search regexp?");
if(s){
var r = prompt("Replace regexp?");
if(!r && r != '') return;
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(new RegExp(s, "g"), r);
}
}

function afdresult(){
var res = prompt("Result?");
if(!res) return;
var form = document.editform;
form.wpSummary.value = 'AFD result';
var txt = form.wpTextbox1;
txt.value += '{{oldafdfull|date=] ]|result=' + res + '|votepage={{subst:PAGENAME}}}}';
txt.focus();
}

//////////////////////////////////////////
// Tabs by Korath
// returns <li><a href="url">name</a></li>
/////////////////////////////////////////
function addlilink(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;
}

// appends msg to the currently-editted page, sets the summary to summ,
// and marks or unmarks the Watch this page checkbox according to watch.
function edit_summary_watch(msg, summ, watch)
{
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value += msg;
f.wpSummary.value = summ;
}

function testn(number)
{
var page = prompt("Vandalism to which article?")
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value += "{{subst:" + "test" + number + "-n|" + page + "}} ~" + "~" + "~" + "~";
if (t.value > 2)
f.wpSummary.value = "Vandalism to ] - warning " + number;
else
f.wpSummary.value = "Regarding ]";
}

function blankwarn(number)
{
var page = prompt("Vandalism to which article?")
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value += "{{subst:" + "test2a-n|" + page + "}} ~" + "~" + "~" + "~";
f.wpSummary.value = "regarding ]";
}

function bvn(number)
{
var page = prompt("Vandalism to which article?")
var f = document.editform, t = f.wpTextbox1;
if (t.value.length > 0)
t.value += '\n';
t.value += "{{subst:" + "bv-n|" + page + "}} ~" + "~" + "~" + "~";
f.wpSummary.value = "comment on ]";
}

// adds various tabs to call the above
function add_tabs()
{
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul');

// Only add for pages with "Editing User talk:" somewhere in the title
if (document.title.indexOf("Editing User talk:") != -1)
{ {
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:User:Shanel/welcome}} ~" + "~" + "~" + "~", "Welcome!", false, 0)',"Welcome!"));
if(key && title)

tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test}} ~~" + "~~", "About your test...", true, 1)',"t1"));
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test2}} ~~" + "~~", "About your edits...", true, 1)',"t2"));
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test2a}} ~~" + "~~", "About your content removal...", true, 1)',"t2a"));
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test3}} ~~" + "~~", "Warning...", true, 1)',"t3"));
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test4}} ~~" + "~~", "Last Warning...", true, 1)',"t4"));
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:User:Shanel/block|~~"+"~~}}", "You have been blocked!", true, 1)',"t5"));
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:User:Shanel/bv|~~"+"~~}}", "Please stop!", true, 1)',"bv"));
}
if (document.title.indexOf("Editing Misplaced Pages:Articles for deletion") != -1)
{
tabs.appendChild(addlilink('javascript:closeafd("keep", "")', 'Keep', ''));
tabs.appendChild(addlilink('javascript:closeafd("delete", "")', 'Delete', ''));
tabs.appendChild(addlilink('javascript:closeafd(prompt("Result?"), "")', 'Other', ''));
}

if(document.title.indexOf("Confirm delete") != -1)
{
tabs.appendChild(addlilink('javascript:afddelete()', 'AFD', ''));
}

if(document.title.indexOf("Editing ") != -1){
tabs.appendChild(addlilink('javascript:replace()', 'Replace', ''));
}

if(document.title.indexOf("Editing Talk:") != -1){
tabs.appendChild(addlilink('javascript:afdresult()', 'AFDr', ''));
}


}

if (window.addEventListener)
window.addEventListener("load", add_tabs, false);
else if (window.attachEvent)
window.attachEvent("onload", add_tabs);

///////////////////////////////////////////////////////////////////
// AutoAFD by Korath
// This needs to change depending on skin used.
//////////////////////////////////////////////////////////////////
function add_link2(url, name)
{
var na = document.createElement('a');
na.setAttribute('href', url);
na.appendChild(document.createTextNode(name));

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

var tabs = document.getElementById('p-cactions').getElementsByTagName('ul');
tabs.appendChild(li);
}

function strip_namespace(target)
{
var colon = target.indexOf(':');
if (colon != -1)
{
var spaces = new Array('User', 'Misplaced Pages', 'Image', 'MediaWiki', 'Template', 'Help', 'Category');
var ns = target.substring(0, colon);
if (ns == '' || ns == 'Talk')
return target.substring(colon + 1);
else
for (var i = 0; i < spaces.length; ++i)
{
if (ns == spaces
|| ns == spaces + '_talk')
return target.substring(colon + 1);
}
}

return target;
}

function afd()
{
document.editform.wpTextbox1.value = '{' + '{' + 'subst:afd}}\n' + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = 'afd';

var target = document.editform.action;
target = target.substring(target.indexOf('title=') + 6,
target.lastIndexOf('&action=submit'));

var months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
var date = new Date();
date = date.getUTCFullYear() + '_' + months + '_' + date.getUTCDate();

var pagename = strip_namespace(target);

window.open('/search/?title=Misplaced Pages:Articles_for_deletion/' + pagename + '&action=edit&fakeaction=afdsub&faketarget=' + target,
'Afd ' + unescape(target),
'status,toolbar,location,menubar,directories,resizeable,scrollbars');
window.open('/search/?title=Misplaced Pages:Articles_for_deletion/Log/' + date + '&action=edit&fakeaction=afdlist&faketarget=' + pagename,
'AfdLog ' + unescape(target),
'status,toolbar,location,menubar,directories,resizeable,scrollbars');
}

function autoafd()
{
if (document.title.indexOf('Editing ') == 0)
{
var action = '';
var target = '';
if (location.search)
{ {
ta = ; var l = location.search.substring(1).split('&');
for (var i = 0; i < l.length; ++i)
{
var eq = l.indexOf('=');
var name = l.substring(0, eq);
if (name == 'fakeaction')
action = l.substring(eq + 1);
else if (name == 'faketarget')
target = unescape(l.substring(eq + 1)).replace(/_/g, ' ');
}
} }

else if(key)
if (action == 'afdlist')
{ {
document.editform.wpTextbox1.value += '{{' + 'subst:afd3|pg=' + target + '}}\n';
ta = ;
document.editform.wpSummary.value = ']';
} }
else if(title) else if (action == 'afdsub')
{ {
if (document.editform.wpTextbox1.value.length > 0)
ta = ;
{
target = document.editform.action;
target = unescape(target.substring(target.indexOf('title=') + 6, target.lastIndexOf('&action=submit'))).replace(/_/g, ' ');
window.alert("There's an old afd at the default location already.\n\n" +
'Please either move it out of the way (and update existing links to it), or file the Afd by hand in another location (such as ]).');
}
else
document.editform.wpTextbox1.value += '{' + '{' + 'subst:afd2|pg=' + target + '|text=' + '}' + '}' +
'-- ~' + '~' + '~' + '~\n' +
'\n*\'\'\' \'\'\'\n*\'\'\' \'\'\'\n*\'\'\' \'\'\'\n';
} }
else
add_link2('javascript:afd()', 'Afd');
} }
// re-render the title and accesskeys from existing code in wikibits.js
akeytt();
return li;
} }


if (window.addEventListener)
// ADD LINK
window.addEventListener('load', autoafd, false);
else if (window.attachEvent)
window.attachEvent('onload', autoafd);


// Returns <li><a href="url">name</a></li>
function addLink(where, url, name, id, title, key, after){
function addlilink(url, name)
//* where is the id of the toolbar where the button should be added;
{
// i.e. one of "p-cactions", "p-personal", "p-navigation", or "p-tb".
var na = document.createElement('a');
//
na.setAttribute('href', url);
//* url is the URL which will be called when the button is clicked.

// javascript: urls can be used to do more complex things.
var txt = document.createTextNode(name);
//
na.appendChild(txt);
//* name is what will appear as the name of the button.

//
var li = document.createElement('li');
//* id is the id of the button; it's best to define one.
li.appendChild(na);
// Use a prefix to make sure its unique. Optional.
// return li;
}
//* title is the tooltip title that gives a longer description

// of the button; if you define a accesskey, mention it here. Optional.
// Adds a "blocklog" tab and fills in the username field on Special:Blockip, if a "&faketarget=username" is present.
//
function do_blockip_stuff()
//* key is the char you want for the accesskey. Optional.
{
//
// focus on Reason field
//* after is the id of the button you want to follow this one. Optional.
document.getElementsByName('wpBlockReason').focus();
//

var na = document.createElement('a');
// Look for a &faketarget= for the username/ip
na.href = url;
var l = location.search.substring(1).split('&');
na.appendChild(document.createTextNode(name));
var li = document.createElement('li'); var target = '';
if(id) li.id = id; for (var i = 0; i < l.length; ++i)
{
li.appendChild(na);
var tabs = document.getElementById(where).getElementsByTagName('ul'); var n = l.indexOf('=');
if (l.substring(0, n) == 'faketarget')
if(after) {
{
tabs.insertBefore(li,document.getElementById(after));
target = l.substring(n + 1);
} else {
break;
tabs.appendChild(li);
}
} }

if(id) {
if (target == '')
if(key && title) { ta = ; }
return;
else if(key) { ta = ; }

else if(title) { ta = ;}
// put account name in "IP Address/username" field
}
var addr = document.getElementsByName('wpBlockAddress');
// re-render the title and accesskeys from existing code in wikibits.js
akeytt(); addr.value = unescape(target);

return li;
// add "blocklog" tab
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul');
tabs.appendChild(addlilink('/search/?title=Special%3ALog&type=block&user=&page=User%3A' + target, 'blocklog'));
} }
// Add a link to User logs to the p-tb bar.
addOnloadHook(function () {
// Skip non-user pages
if (!/^User/.test(wgCanonicalNamespace)) return;


// Opens the block log in the current window, and Special:Blockip in a popup.
// Skip user subpages
// Width, height, top, and left are chosen for a 1600x1200 display.
if (wgTitle.indexOf("/") != -1) return;
//function blockpage_and_log(target)
//{
// window.open('Special_Blockip.html?foo=blarg&faketarget=' + target, 'Block', 'width=1600,height=600,top=600,left=0');
// document.location.href = 'http://en.wikipedia.org/search/?title=Special%3ALog&type=block&user=&page=User%3A' + target;
//}


// Adds "block" and "blocklog" tabs to User: and User talk: pages.
var url = wgArticlePath.replace(/\$1/, 'Special:Log');
function add_block_tab()
url += "?user=" + encodeURIComponent(wgTitle);
{
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul');


// use the "edit this page" tab to get already-tidied url
addPortletLink('p-tb', url, 'User logs', 't-logs',
var editlk = document.getElementById('ca-edit').getElementsByTagName('a').href;
"View this user's logs", null,
// cut everything up to "title=" from the start and everything past "&action=edit" from the end
document.getElementById('t-editcount'));
editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit'));
});
editlk = editlk.substring(editlk.indexOf(':') + 1);
var slloc = editlk.indexOf('/');
if (slloc > 0)
editlk = editlk.substring(0, slloc);


// add "block" tab
tabs.appendChild(addlilink('/search/?title=Special%3ABlockip&faketarget=' + editlk, 'block'));


// To open the block page and block log simultaneously, replace the above line with:
// Add a link to User_talk:^demonBot2 to the p-personal bar.
// tabs.appendChild(addlilink('javascript:blockpage_and_log("' + editlk + '")', 'Block'));
addOnloadHook(function () {
// and uncomment the blockpage_and_log() function above.
addPortletLink('p-personal', wgArticlePath.replace(/\$1/, 'User_talk:^demonBot2'),
'bot talk', 'pt-mybottalk', 'bot talk', null, document.getElementById('pt-preferences'));
});


// add "blocklog" tab
// Add a link to User:^demonBot2 to the p-personal bar.
tabs.appendChild(addlilink('/search/?title=Special%3ALog&type=block&user=&page=User%3A' + editlk, 'blocklog'));
addOnloadHook(function () {
addPortletLink('p-personal', wgArticlePath.replace(/\$1/, 'User:^demonBot2'),
'bot', 'pt-mybot', 'bot', null, document.getElementById('pt-mybottalk'));
});


}
// Add a link to Special:Log&user=^demon to the p-personal bar.
addOnloadHook(function () {
addPortletLink('p-personal', wgArticlePath.replace(/\$1/, 'Special:Log?user=^demon'),
'my logs', 'pt-mylogs', 'my logs', null, document.getElementById('pt-logout'));
});


function do_onload()
// addPurge
{
addOnloadHook(function () {
if (document.title.indexOf('User:') == 0
var hist; var url;
if (!(hist = document.getElementById('ca-history') )) return; || document.title.indexOf('User talk:') == 0)
add_block_tab();
if (!(url = hist.getElementsByTagName('a') )) return;
else if (document.title.indexOf('Block user') == 0) // could stand to be more robust
if (!(url = url.href )) return;
do_blockip_stuff();
addPortletLink('p-cactions', url.replace(/(action=)history(|$)/, '$1purge$2'),
}
'purge', 'ca-purge', 'Purge server cache for this page', '0');
});


//From User:Func
// CSD AutoReason
if (window.addEventListener)
importScript('User:^demon/csd.js');
window.addEventListener("load", do_onload, false);
importScript('User:Steel359/^demon.js');
else if (window.attachEvent)
window.attachEvent("onload", do_onload);


if ( document.createElement && window.addEventListener )
{
function SoFixItInit() // pre-load, (don't want to slow down loading of article's content, though)
{


}
importScript('User:AzaToth/morebits.js');
importScript('User:AzaToth/twinklefluff.js');
//importScript('Misplaced Pages:WikiProject User scripts/Scripts/Add LI menu');
//importStylesheet('Misplaced Pages:WikiProject User scripts/Scripts/Add LI menu/css');
importScript('User:AzaToth/twinklewarn.js');
importScript('User:AzaToth/twinklearv.js');
importScript('User:AzaToth/twinklespeedy.js');
importScript('User:AzaToth/twinklediff.js');
importScript('User:AzaToth/twinkleprotect.js');
importScript('User:AzaToth/twinkleprod.js');
importScript('User:AzaToth/twinklexfd.js');
importScript('User:AzaToth/salt.js');


function SoFixItLoad() // post-load
TwinkleConfig = {
{
revertMaxRevisions : 50,
UserMenu = new PortletMenu( 'p-personal' );
userTalkPageMode : 'window',
PageMenu = new PortletMenu( 'p-cactions' );
showSharedIPNotice : true,
NavMenu = new PortletMenu( 'p-navigation' );
openTalkPage : ,
//ToolMenu = new PortletMenu( 'p-tb' );
openTalkPageOnAutoRevert : false,
openAOLAnonTalkPage : false,
summaryAd : "",
deletionSummaryAd : "",
protectionSummaryAd : "",
watchSpeedyPages : ,
watchProdPages : false,
openUserTalkPageOnSpeedyDelete : ,
watchRevertedPages : ,
markRevertedPagesAsMinor : ,
deleteTalkPageOnDelete : true,
markWarningsAsMinor : true,
markAIVReportAsMinor : true,
markSpeedyPagesAsMinor : true,
markProdPagesAsMinor : true,
confirmUsernameToAIV : true,
toolboxButtons :
};


// This is inefficient and not particularly robust.
// {{commons ok}} tagger
// This comes first, I want this link to come up as
function commonsOK() {
// fast as possible.
document.editform.wpTextbox1.value += "\n{{commons ok}}";
//
document.editform.wpSummary.value = "{{]}}";
function GetByClass( sElem, sClass )
document.editform.submit();
{ var i, a2 = , a = document.getElementsByTagName( sElem );
for ( i = 0; i < a.length; i++ )
if ( a.className == sClass )
a2.push( a );
return a2;
}
var a, td = GetByClass( 'td', 'diff-otitle' );
if ( ( td = td ) && ( a = td.getElementsByTagName( 'a' ) ) )
a.href = a.href + '&action=edit'; // need to change text, later

var userName = UserMenu.getText( 'pt-userpage' );

// personal (top-most) menu
//
// Drini Háblame Prefs Watchlist Contribs Kate VAN ESP Log out <UTCdate>
//
UserMenu.setText( 'pt-mytalk' , 'Talk' );
UserMenu.setText( 'pt-preferences', 'Prefs' );
UserMenu.setText( 'pt-watchlist' , 'Watchlist' );
UserMenu.setText( 'pt-mycontris' , 'Contribs' );
UserMenu.setText( 'pt-logout' , 'Log out' );
//
UserMenu.setHref( 'pt-mycontris',
'http://en.wikipedia.org/search/?title=Special:Contributions&target=' +
userName + '&offset=0&limit=500' );
//
//
// it seems there is a stylesheet that makes them lowercase
//
// ok, the lowercased menu items are starting to really bug me:
//
document.getElementById( 'p-personal' ).getElementsByTagName( 'ul' ).style.textTransform = 'none';
UserMenu.insertBefore( 'pt-logout' , 'pt-logs', 'Logs','/search/?title=Special%3ALog&user=' + userName );
//
//UserMenu.insertBefore( 'pt-logout' , 'pt-irc' , 'ESP', 'irc://irc.freenode.net/wikipedia-esperanza' );
//UserMenu.insertBefore( 'pt-irc' , 'pt-vandal' , 'VAN', 'irc://irc.freenode.net/wikipedia-en-vandalism' );
UserMenu.insertBefore( 'pt-logs' , 'pt-kate', 'Kate',
'javascript:void InlineKate( "' + userName + '" )' );
if(document.getElementById('ca-edit'))
document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';

// so I always know what time it is in UTC land:
//
UserMenu.insertBefore( 'pt-kate' , 'pt-ipblocks', 'blocklist','/Special:Ipblocklist' );
UserMenu.insertBefore( 'pt-kate' , 'pt-blockage', 'block','/Special:Blockip');
UserMenu.append( 'pt-utc', UTCTime(), 'javascript:void UserMenu.setText("pt-utc",UTCTime())' );

// article-actions menu, (the "tabs")
//
if ( PageMenu ) // theory: if it has a history tab, then it's purgable
{
PageMenu.insertBefore( 'ca-history', 'ca-lastdiff', 'Last diff',
PageMenu.getHref( 'ca-history' ).replace( /action=history/, 'diff=0' ) );

PageMenu.append( 'ca-purge', 'Purge',
PageMenu.getHref( 'ca-history' ).replace( /action=history/, 'action=purge' ) );

PageMenu.setText( 'ca-edit' , 'Edit' );

PageMenu.setText( 'ca-history' , 'History' );

PageMenu.setText( 'ca-delete' , 'Delete' );
}

var x = 1;
NavMenu.append( 'n-' + x++, 'monobook.js', '/User:' + userName + '/monobook.js' );
NavMenu.append( 'n-' + x++, 'Vandalism Fighter', 'http://www.csclub.uwaterloo.ca/~dawill03/cdvf/vf.jar' );
NavMenu.append( 'n-' + x++, 'new users', 'http://en.wikipedia.org/Special:Log/newusers' );
NavMenu.append( 'n-' + x++, 'AfDs to be closed', 'http://en.wikipedia.org/Wikipedia:Articles_for_deletion/Old' );
}

function PortletMenu( id ) // constructor
{
this.menu = document.getElementById( id );
this.list = this.menu.getElementsByTagName( 'ul' ); // bypass "<h5>Views</h5>", etc.

// sigh...as far as I can figure, there is empty whitespace being treated
// as TextNodes....
//
var LIs = this.list.getElementsByTagName( 'li' );

for ( var i = 0; i < LIs.length; i++ )
{
this.id ] = LIs;
}

this.newItem = function( id, txt, url )
{ var li = document.createElement( 'li' ); li.id = id;
var a = document.createElement( 'a' ); a.href = url;

a.appendChild( document.createTextNode( txt ) );
li.appendChild( a );

this = li; // watch this!!!

return li;
}

this.append = function( id, txt, url )
{ this.list.appendChild( this.newItem( id, txt, url ) );
}
this.insertBefore = function( old, id, txt, url )
{ this.list.insertBefore( this.newItem( id, txt, url ), this );
}

// the ByTagName here is a bit annoying, but in Safari, I was picking
// up TextNodes by using this.firstChild.firstChild
//
this.getText = function( id ) { return this.getElementsByTagName( 'a' ).firstChild.data }
this.setText = function( id, txt ) { this.getElementsByTagName( 'a' ).firstChild.data = txt }

this.getHref = function( id ) { return this.getElementsByTagName( 'a' ).href }
this.setHref = function( id, url ) { this.getElementsByTagName( 'a' ).href = url }
// I add em as I need em....
}

function InlineKate( user )
{
var kate =
'http://kohl.wikimedia.org/~kate/cgi-bin/count_edits?dbname=enwiki&user=' + user;

var div = document.createElement( 'div' );
div.id = 'inlineKateDiv';
div.style.position = 'absolute';
div.style.zIndex = 1000;
div.style.left = '20px';
div.style.top = '20px';
div.style.backgroundColor = '#FFFFFF';
div.style.borderStyle = 'solid';
div.style.borderWidth = ' medium';
div.style.borderColor = '#000000';

var top = document.createElement( 'div' );
top.id = 'inlineKateTop';
top.style.textAlign = 'right';
top.style.margin = '8px';
top.style.backgroundColor = '#DDDDDD';

var a = document.createElement( 'a' );
a.appendChild( document.createTextNode( "Go to Kate's" ) );
a.href = kate;
a.target = '_parent';
a.style.margin = '8px';

top.appendChild( a );

a = document.createElement( 'a' );
a.appendChild( document.createTextNode( 'Close' ) );
a.href = "javascript:void RemoveNode('inlineKateDiv')";
a.style.margin = '8px';

top.appendChild( a );

div.appendChild( top );

var iframe = document.createElement( 'iframe' );
iframe.id = 'inlineKateBot';
iframe.style.width = '300px';
iframe.style.height = '400px';
iframe.style.margin = '8px';
iframe.style.borderStyle = 'solid';
iframe.style.borderWidth = 'thin';
iframe.style.borderColor = '#000000';
iframe.src = kate;

div.appendChild( iframe );

document.body.appendChild( div );
}

function RemoveNode( id )
{ var node = document.getElementById( id )
node.parentNode.removeChild( node );
}

function UTCTime()
{
// Get a date stamp for the time in UTC-land.
//
// for the future: a format arg
//
var s = '',
d = new Date(),
a = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
return d.getUTCDate() + ' ' +
a + ' ' +
d.getUTCFullYear() + ' ' +
( '0' + d.getUTCHours() ).substr( -2 ) + ':' +
( '0' + d.getUTCMinutes() ).substr( -2 ) + ' ' + 'UTC';
}

SoFixItInit();
window.addEventListener( 'load', SoFixItLoad, false );
} }

function addCommonsOK(){
function NUPatrol()
imgString = "Editing Image:";
{
if (document.getElementsByTagName('h1').firstChild.nodeValue.substring(0, imgString.length) == imgString) {
if ( ( window.location.href.indexOf( 'Special%3ALog&type=newusers' ) == -1 ) &&
addTab("javascript:commonsOK()", "{{commons ok}}", "");
( window.location.href.indexOf( 'Special:Log/newusers' ) == -1 ) )
akeytt();
return; // make more robust???
}

var items, item, i, links, user, name, talk, contribs, insertLoc, link;

items = document.getElementById( 'bodyContent' ).getElementsByTagName( 'ul' ).getElementsByTagName( 'li' );

function NewLink( txt, url, plainlinks, linkColor )
{ var a = document.createElement( 'a' );
a.appendChild( document.createTextNode( txt ) );
a.href = url;
if ( plainlinks ) a.className = 'plainlinks';
if ( linkColor )
{ if ( typeof linkColor == "string" )
a.style.color = linkColor;
else a.style.color = '#FF0000'; // old default behavior
}
return a;
}

for ( i = 0; i < items.length; i++ )
{
item = items;
links = item.getElementsByTagName( 'a' );

user = links; name = user.firstChild.nodeValue;
talk = links; talk.firstChild.nodeValue = 'talk'; // lowercase 'Talk' for consistency
contribs = links;

insertLoc = user.nextSibling; // ' newusers '

item.insertBefore( document.createTextNode( ' ( ' ), insertLoc );

item.insertBefore( talk, insertLoc );
item.insertBefore( document.createTextNode( ', ' ), insertLoc );

item.insertBefore( contribs, insertLoc );
item.insertBefore( document.createTextNode( ', ' ), insertLoc );

item.insertBefore( NewLink( 'actions', '/Special:Contributions/' + name, true, '#000088' ), insertLoc );
item.insertBefore( document.createTextNode( ', ' ), insertLoc );

item.insertBefore( NewLink( 'blocks', '/search/?title=Special%3ALog&type=block&page=User%3A' + name, true, '#008800' ), insertLoc );
item.insertBefore( document.createTextNode( ', ' ), insertLoc );

item.insertBefore( NewLink( 'is blocked?', '/Special:Ipblocklist?action=search&ip=' + name, true, '#888800' ), insertLoc );
item.insertBefore( document.createTextNode( ', ' ), insertLoc );
item.insertBefore( NewLink( 'do block!', '/Special:Blockip/' + name, true, '#880000' ), insertLoc );

item.insertBefore( document.createTextNode( ' )' ), insertLoc );

item.removeChild( insertLoc.nextSibling ); // should remove the span
item.removeChild( insertLoc ); // should remove ' newusers ' text
}
} }
if ( window.addEventListener ) window.addEventListener( 'load', NUPatrol, false );
addOnloadHook(addCommonsOK);
else if ( window.attachEvent ) window.attachEvent( 'onload', NUPatrol );

//---------------------------------------------------------------------------------
function removeAccessKeys(keylist) {
var t=document.getElementsByTagName('A'), u=document.getElementsByTagName('input');
for (var i=0; i<t.length+u.length; ++i) {
var s=((i<t.length) ? t : u);
for (var j=0; j<keylist.length; ++j) if (s.accessKey==keylist) s.accessKey='';
}
};

function removeDeleteKey() {removeAccessKeys();};

if (window.addEventListener) window.addEventListener("load",removeDeleteKey,false);
else if (window.attachEvent) window.attachEvent("onload",removeDeleteKey);

//</nowiki>

//Interiot's javascript edit counter
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
mw.loader.load('https://en.wikipedia.org/search/?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }

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

/* </nowiki> */

importScript("User:Ucucha/autofc.js"); // ]

importScript('User:Shubinator/DYKcheck.js'); //DYKcheck tool

Latest revision as of 20:32, 26 March 2022

/*** BEGIN WIKIBREAK ENFORCER ***/
$(document).ready(function() {
 
	/*** Start editing here ***/
 
	// When you want to end your break?
	// no leading zeroes. (example: 7 - correct, 07 - incorrect)
 
	var date = { year: 2017, month: 1, day: 1};
	var time = { hours: 00, minutes: 00, seconds: 01 };
 
	/*** Stop editing here ***/
 
	var currentDate = new Date();
	var enforcedBreakEnd = new Date(
		date.year,date.month-1,date.day,time.hours,time.minutes,time.seconds);
	if (currentDate <= enforcedBreakEnd) {
		alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString()
			+ "\n(now is "+currentDate.toLocaleString()+")\n\nBye!");
		location = "//"+location.host+"/search/?title="
			+ "Special:Userlogout&returnto=Main_Page";
	}
});
/*** END WIKIBREAK ENFORCER ***/

// Filter changes live
// ] - please include this line
mw.loader.load(
             'https://en.wikipedia.org/search/?title=User:Lupin/recent2.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');

// ] - please include this line 

mw.loader.load(
             'https://en.wikipedia.org/search/?title=User:Lupin/popups.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');
popupImages=false;
popupStructure='menus';
popupFixRedits = true;
popupFixDabs = true;
popupAdminLinks = true;
simplePopups = false;

//<nowiki>

//From somewhere
function hideafd(){
    var divs = document.getElementsByTagName("div");
    for(var x = 0; x < divs.length; ++x)
        if(divs.className.indexOf("afd") != -1)
            divs.style.display = "none";
    document.getElementById('footer').style.display = 'none';
}

function showafd(){
    var divs = document.getElementsByTagName("div");
    for(var x = 0; x < divs.length; ++x)
        if(divs.className.indexOf("afd") != -1)
            divs.style.display = "";
    document.getElementById('footer').style.display = '';
}

function addlilink(tabs, url, name){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.appendChild(na);
    tabs.appendChild(li);
    return li;
}


//Hybirdization of ABCD afd closer

function closeafd(bold, notbold){
    var form = document.editform;
    var txt = form.wpTextbox1;
    txt.value = "{{subst:at}} '''" + bold + "'''" + notbold + ". ~~~~\n" + txt.value + "\n{{subst:ab}}\n";
    form.wpSummary.value = "close discussion: " + bold + notbold;
    form.wpWatchthis.checked = false;
}

function afdresult(){
    var res = prompt("Result?");
    if(!res) return;
    var form = document.editform;
    form.wpSummary.value = 'AFD result';
    var txt = form.wpTextbox1;
    txt.value += '{{oldafdfull|date=] ]|result=' + res + '|votepage={{subst:PAGENAME}}}}';
    txt.focus();
}

function afddelete(){
    document.forms.deleteconfirm.wpReason.value = '+)&action=delete.*$/, '$1').replace(/_/g, ' ')).replace(/^(Talk|Misplaced Pages( talk)?):/, '') + ']]';
}

function replace(){
    var s = prompt("Search regexp?");
    if(s){
        var r = prompt("Replace regexp?");
        if(!r && r != '') return;
        var txt = document.editform.wpTextbox1;
        txt.value = txt.value.replace(new RegExp(s, "g"), r);
    }
}

function afdresult(){
    var res = prompt("Result?");
    if(!res) return;
    var form = document.editform;
    form.wpSummary.value = 'AFD result';
    var txt = form.wpTextbox1;
    txt.value += '{{oldafdfull|date=] ]|result=' + res + '|votepage={{subst:PAGENAME}}}}';
    txt.focus();
}

//////////////////////////////////////////
// Tabs by Korath
// returns <li><a href="url">name</a></li>
/////////////////////////////////////////
function addlilink(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;
}

// appends msg to the currently-editted page, sets the summary to summ,
// and marks or unmarks the Watch this page checkbox according to watch.
function edit_summary_watch(msg, summ, watch)
{
  var f = document.editform, t = f.wpTextbox1;
  if (t.value.length > 0)
    t.value += '\n';
  t.value += msg;
  f.wpSummary.value = summ;
}

function testn(number)
{
  var page = prompt("Vandalism to which article?")
  var f = document.editform, t = f.wpTextbox1;
  if (t.value.length > 0)
    t.value += '\n';
  t.value += "{{subst:" + "test" + number + "-n|" + page + "}} ~" + "~" + "~" + "~";
  if (t.value > 2)
    f.wpSummary.value = "Vandalism to ] - warning " + number;
  else   
    f.wpSummary.value = "Regarding ]";
}

function blankwarn(number)
{
  var page = prompt("Vandalism to which article?")
  var f = document.editform, t = f.wpTextbox1;
  if (t.value.length > 0)
    t.value += '\n';
  t.value += "{{subst:" + "test2a-n|" + page + "}} ~" + "~" + "~" + "~";
  f.wpSummary.value = "regarding ]";
}

function bvn(number)
{
  var page = prompt("Vandalism to which article?")
  var f = document.editform, t = f.wpTextbox1;
  if (t.value.length > 0)
    t.value += '\n';
  t.value += "{{subst:" + "bv-n|" + page + "}} ~" + "~" + "~" + "~";
  f.wpSummary.value = "comment on ]";
}

// adds various tabs to call the above
function add_tabs()
{
  var c1 = document.getElementById('column-one');
  var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul');

  // Only add for pages with "Editing User talk:" somewhere in the title
  if (document.title.indexOf("Editing User talk:") != -1)
    {
      tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:User:Shanel/welcome}} ~" + "~" + "~" + "~", "Welcome!", false, 0)',"Welcome!"));

tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test}} ~~" + "~~", "About your test...", true, 1)',"t1"));   
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test2}} ~~" + "~~", "About your edits...", true, 1)',"t2"));
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test2a}} ~~" + "~~", "About your content removal...", true, 1)',"t2a"));     
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test3}} ~~" + "~~", "Warning...", true, 1)',"t3"));   
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test4}} ~~" + "~~", "Last Warning...", true, 1)',"t4"));   
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:User:Shanel/block|~~"+"~~}}", "You have been blocked!", true, 1)',"t5"));
tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:User:Shanel/bv|~~"+"~~}}", "Please stop!", true, 1)',"bv"));
    }
 
  if (document.title.indexOf("Editing Misplaced Pages:Articles for deletion") != -1)
    {
        tabs.appendChild(addlilink('javascript:closeafd("keep", "")', 'Keep', ''));
        tabs.appendChild(addlilink('javascript:closeafd("delete", "")', 'Delete', ''));
        tabs.appendChild(addlilink('javascript:closeafd(prompt("Result?"), "")', 'Other', ''));
    }

  if(document.title.indexOf("Confirm delete") != -1)
    {
        tabs.appendChild(addlilink('javascript:afddelete()', 'AFD', ''));
    }

    if(document.title.indexOf("Editing ") != -1){
        tabs.appendChild(addlilink('javascript:replace()', 'Replace', ''));
    }

    if(document.title.indexOf("Editing Talk:") != -1){
        tabs.appendChild(addlilink('javascript:afdresult()', 'AFDr', ''));
    }


}

if (window.addEventListener)
  window.addEventListener("load", add_tabs, false);
else if (window.attachEvent)
  window.attachEvent("onload", add_tabs);

///////////////////////////////////////////////////////////////////
// AutoAFD by Korath
// This needs to change depending on skin used.
//////////////////////////////////////////////////////////////////
function add_link2(url, name)
{
  var na = document.createElement('a');
  na.setAttribute('href', url);
  na.appendChild(document.createTextNode(name));

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

  var tabs = document.getElementById('p-cactions').getElementsByTagName('ul');
  tabs.appendChild(li);
}

function strip_namespace(target)
{
  var colon = target.indexOf(':');
  if (colon != -1)
    {
      var spaces = new Array('User', 'Misplaced Pages', 'Image', 'MediaWiki', 'Template', 'Help', 'Category');
      var ns = target.substring(0, colon);
      if (ns == '' || ns == 'Talk')
        return target.substring(colon + 1);
      else
        for (var i = 0; i < spaces.length; ++i)
          {
            if (ns == spaces
                || ns == spaces + '_talk')
              return target.substring(colon + 1);
          }
    }

  return target;
}

function afd()
{
  document.editform.wpTextbox1.value = '{' + '{' + 'subst:afd}}\n' + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = 'afd';

  var target = document.editform.action;
  target = target.substring(target.indexOf('title=') + 6,
                            target.lastIndexOf('&action=submit'));

  var months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
  var date = new Date();
  date = date.getUTCFullYear() + '_' + months + '_' + date.getUTCDate();

  var pagename = strip_namespace(target);

  window.open('/search/?title=Misplaced Pages:Articles_for_deletion/' + pagename + '&action=edit&fakeaction=afdsub&faketarget=' + target,
              'Afd ' + unescape(target),
              'status,toolbar,location,menubar,directories,resizeable,scrollbars');
  window.open('/search/?title=Misplaced Pages:Articles_for_deletion/Log/' + date + '&action=edit&fakeaction=afdlist&faketarget=' + pagename,
              'AfdLog ' + unescape(target),
              'status,toolbar,location,menubar,directories,resizeable,scrollbars');
}

function autoafd()
{
  if (document.title.indexOf('Editing ') == 0)
    {
      var action = '';
      var target = '';
      if (location.search)
        {
          var l = location.search.substring(1).split('&');
          for (var i = 0; i < l.length; ++i)
            {
              var eq = l.indexOf('=');
              var name = l.substring(0, eq);
              if (name == 'fakeaction')
                action = l.substring(eq + 1);
              else if (name == 'faketarget')
                target = unescape(l.substring(eq + 1)).replace(/_/g, ' ');
            }
        }

      if (action == 'afdlist')
        {
          document.editform.wpTextbox1.value += '{{' + 'subst:afd3|pg=' + target + '}}\n';
          document.editform.wpSummary.value = ']';
        }
      else if (action == 'afdsub')
        {
          if (document.editform.wpTextbox1.value.length > 0)
            {
              target = document.editform.action;
              target = unescape(target.substring(target.indexOf('title=') + 6, target.lastIndexOf('&action=submit'))).replace(/_/g, ' ');
              window.alert("There's an old afd at the default location already.\n\n" +
                           'Please either move it out of the way (and update existing links to it), or file the Afd by hand in another location (such as ]).');
            }
          else
            document.editform.wpTextbox1.value += '{' + '{' + 'subst:afd2|pg=' + target + '|text=' + '}' + '}' +
  '-- ~' + '~' + '~' + '~\n' +
              '\n*\'\'\' \'\'\'\n*\'\'\' \'\'\'\n*\'\'\' \'\'\'\n';
        }
      else
        add_link2('javascript:afd()', 'Afd');
    }
}

if (window.addEventListener)
  window.addEventListener('load', autoafd, false);
else if (window.attachEvent)
  window.attachEvent('onload', autoafd);

// Returns <li><a href="url">name</a></li>
function addlilink(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;
}

// Adds a "blocklog" tab and fills in the username field on Special:Blockip, if a "&faketarget=username" is present.
function do_blockip_stuff()
{
  // focus on Reason field
  document.getElementsByName('wpBlockReason').focus();

  // Look for a &faketarget= for the username/ip
  var l = location.search.substring(1).split('&');
  var target = '';
  for (var i = 0; i < l.length; ++i)
    {
      var n = l.indexOf('=');
      if (l.substring(0, n) == 'faketarget')
 {
   target = l.substring(n + 1);
   break;
 }
    }

  if (target == '')
    return;

  // put account name in "IP Address/username" field
  var addr = document.getElementsByName('wpBlockAddress');
  addr.value = unescape(target);

  // add "blocklog" tab
  var c1 = document.getElementById('column-one');
  var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul');
  tabs.appendChild(addlilink('/search/?title=Special%3ALog&type=block&user=&page=User%3A' + target, 'blocklog'));
}

// Opens the block log in the current window, and Special:Blockip in a popup.
// Width, height, top, and left are chosen for a 1600x1200 display.
//function blockpage_and_log(target)
//{
//  window.open('Special_Blockip.html?foo=blarg&faketarget=' + target, 'Block', 'width=1600,height=600,top=600,left=0');
//  document.location.href = 'http://en.wikipedia.org/search/?title=Special%3ALog&type=block&user=&page=User%3A' + target;
//}

// Adds "block" and "blocklog" tabs to User: and User talk: pages.
function add_block_tab()
{
  var c1 = document.getElementById('column-one');
  var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul');

  // use the "edit this page" tab to get already-tidied url
  var editlk = document.getElementById('ca-edit').getElementsByTagName('a').href;
  // cut everything up to "title=" from the start and everything past "&action=edit" from the end
  editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit'));
  editlk = editlk.substring(editlk.indexOf(':') + 1);
  var slloc = editlk.indexOf('/');
  if (slloc > 0)
    editlk = editlk.substring(0, slloc);

  // add "block" tab
  tabs.appendChild(addlilink('/search/?title=Special%3ABlockip&faketarget=' + editlk, 'block'));

  // To open the block page and block log simultaneously, replace the above line with:
  // tabs.appendChild(addlilink('javascript:blockpage_and_log("' + editlk + '")', 'Block'));
  // and uncomment the blockpage_and_log() function above.

  // add "blocklog" tab
  tabs.appendChild(addlilink('/search/?title=Special%3ALog&type=block&user=&page=User%3A' + editlk, 'blocklog'));

}

function do_onload()
{
  if (document.title.indexOf('User:') == 0
      || document.title.indexOf('User talk:') == 0)
    add_block_tab();
  else if (document.title.indexOf('Block user') == 0) // could stand to be more robust
    do_blockip_stuff();
}

//From User:Func
if (window.addEventListener) 
  window.addEventListener("load", do_onload, false);
else if (window.attachEvent) 
  window.attachEvent("onload", do_onload);

if ( document.createElement && window.addEventListener )
{
 function SoFixItInit() // pre-load, (don't want to slow down loading of article's content, though)
 {

 }

 function SoFixItLoad() // post-load
 {
 UserMenu = new PortletMenu( 'p-personal'   );
 PageMenu = new PortletMenu( 'p-cactions'   );
  NavMenu = new PortletMenu( 'p-navigation' );
 //ToolMenu = new PortletMenu( 'p-tb'         );

 // This is inefficient and not particularly robust.
 // This comes first, I want this link to come up as
 // fast as possible.
 //
 function GetByClass( sElem, sClass )
 { var i, a2 = , a = document.getElementsByTagName( sElem );
 for ( i = 0; i < a.length; i++ )
 if ( a.className == sClass )
 a2.push( a );
 return a2;
 }
 var a, td = GetByClass( 'td', 'diff-otitle' );
 if ( ( td = td ) && ( a = td.getElementsByTagName( 'a' ) ) )
 a.href = a.href + '&action=edit'; // need to change text, later

 var userName = UserMenu.getText( 'pt-userpage' );

 // personal (top-most) menu
 //
 // Drini Háblame  Prefs  Watchlist  Contribs  Kate  VAN  ESP  Log out  <UTCdate>
 //
 UserMenu.setText( 'pt-mytalk'     , 'Talk'  );
 UserMenu.setText( 'pt-preferences', 'Prefs' );
 UserMenu.setText( 'pt-watchlist'  , 'Watchlist' );
 UserMenu.setText( 'pt-mycontris'  , 'Contribs' );
 UserMenu.setText( 'pt-logout'     , 'Log out'   );
 //
 UserMenu.setHref( 'pt-mycontris',
 'http://en.wikipedia.org/search/?title=Special:Contributions&target=' +
 userName + '&offset=0&limit=500' );
 //
 //
 // it seems there is a stylesheet that makes them lowercase
 //
 // ok, the lowercased menu items are starting to really bug me:
 //
 document.getElementById( 'p-personal' ).getElementsByTagName( 'ul' ).style.textTransform = 'none';
 UserMenu.insertBefore( 'pt-logout'   , 'pt-logs', 'Logs','/search/?title=Special%3ALog&user=' + userName );
 //
 //UserMenu.insertBefore( 'pt-logout'   , 'pt-irc' , 'ESP', 'irc://irc.freenode.net/wikipedia-esperanza' );
 //UserMenu.insertBefore( 'pt-irc'   , 'pt-vandal' , 'VAN', 'irc://irc.freenode.net/wikipedia-en-vandalism' );
 UserMenu.insertBefore( 'pt-logs'     , 'pt-kate', 'Kate',
 'javascript:void InlineKate( "' + userName + '" )' );
                if(document.getElementById('ca-edit'))
                       document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';

      // so I always know what time it is in UTC land:
 //
 UserMenu.insertBefore( 'pt-kate'   , 'pt-ipblocks', 'blocklist','/Special:Ipblocklist' );
 UserMenu.insertBefore( 'pt-kate'   , 'pt-blockage', 'block','/Special:Blockip');
 UserMenu.append( 'pt-utc', UTCTime(), 'javascript:void UserMenu.setText("pt-utc",UTCTime())' );

 // article-actions menu, (the "tabs")
 //
 if ( PageMenu ) // theory: if it has a history tab, then it's purgable
 {
 PageMenu.insertBefore( 'ca-history', 'ca-lastdiff', 'Last diff',
 PageMenu.getHref( 'ca-history' ).replace( /action=history/, 'diff=0' ) );

 PageMenu.append( 'ca-purge', 'Purge',
 PageMenu.getHref( 'ca-history' ).replace( /action=history/, 'action=purge' ) );

                        PageMenu.setText( 'ca-edit'     , 'Edit'   );

                        PageMenu.setText( 'ca-history'     , 'History'   );

                        PageMenu.setText( 'ca-delete'     , 'Delete'   );
 }

 var x = 1;
 NavMenu.append( 'n-' + x++, 'monobook.js', '/User:' + userName + '/monobook.js' );
        NavMenu.append( 'n-' + x++, 'Vandalism Fighter', 'http://www.csclub.uwaterloo.ca/~dawill03/cdvf/vf.jar' );
        NavMenu.append( 'n-' + x++, 'new users', 'http://en.wikipedia.org/Special:Log/newusers' );
        NavMenu.append( 'n-' + x++, 'AfDs to be closed', 'http://en.wikipedia.org/Wikipedia:Articles_for_deletion/Old' );
 }

 function PortletMenu( id ) // constructor
 {
 this.menu = document.getElementById( id );
 this.list = this.menu.getElementsByTagName( 'ul' ); // bypass "<h5>Views</h5>", etc.

 // sigh...as far as I can figure, there is empty whitespace being treated
 // as TextNodes....
 //
 var LIs = this.list.getElementsByTagName( 'li' );

 for ( var i = 0; i < LIs.length; i++ )
 {
 this.id ] = LIs;
 }

 this.newItem = function( id, txt, url )
 { var li = document.createElement( 'li' ); li.id   = id;
 var  a = document.createElement( 'a'  );  a.href = url;

  a.appendChild( document.createTextNode( txt ) );
 li.appendChild( a );

 this = li; // watch this!!!

 return li;
 }

 this.append = function( id, txt, url )
 { this.list.appendChild( this.newItem( id, txt, url ) );
 }
 
 this.insertBefore = function( old, id, txt, url )
 { this.list.insertBefore( this.newItem( id, txt, url ), this );
 }

 // the ByTagName here is a bit annoying, but in Safari, I was picking
 // up TextNodes by using this.firstChild.firstChild
 //
 this.getText = function( id      ) { return this.getElementsByTagName( 'a' ).firstChild.data }
 this.setText = function( id, txt ) {        this.getElementsByTagName( 'a' ).firstChild.data = txt }

 this.getHref = function( id      ) { return this.getElementsByTagName( 'a' ).href       }
 this.setHref = function( id, url ) {        this.getElementsByTagName( 'a' ).href = url }
 
 // I add em as I need em....
 }

 function InlineKate( user )
 {
 var kate =
 'http://kohl.wikimedia.org/~kate/cgi-bin/count_edits?dbname=enwiki&user=' + user;

 var div = document.createElement( 'div' );
 div.id = 'inlineKateDiv';
 div.style.position = 'absolute';
 div.style.zIndex   = 1000;
 div.style.left     =  '20px';
 div.style.top      =  '20px';
 div.style.backgroundColor = '#FFFFFF';
 div.style.borderStyle     = 'solid';
 div.style.borderWidth     = ' medium';
 div.style.borderColor     = '#000000';

 var top = document.createElement( 'div' );
 top.id = 'inlineKateTop';
 top.style.textAlign = 'right';
 top.style.margin = '8px';
 top.style.backgroundColor = '#DDDDDD';

 var a = document.createElement( 'a' );
 a.appendChild( document.createTextNode( "Go to Kate's" ) );
 a.href    = kate;
 a.target  = '_parent';
 a.style.margin = '8px';

 top.appendChild( a );

 a = document.createElement( 'a' );
 a.appendChild( document.createTextNode( 'Close' ) );
 a.href    = "javascript:void RemoveNode('inlineKateDiv')";
 a.style.margin = '8px';

 top.appendChild( a );

 div.appendChild( top );

 var iframe = document.createElement( 'iframe' );
 iframe.id   = 'inlineKateBot';
 iframe.style.width  = '300px';
 iframe.style.height = '400px';
 iframe.style.margin =   '8px';
 iframe.style.borderStyle = 'solid';
 iframe.style.borderWidth = 'thin';
 iframe.style.borderColor = '#000000';
 iframe.src = kate;

 div.appendChild( iframe );

 document.body.appendChild( div );
 }

 function RemoveNode( id )
 { var node = document.getElementById( id )
 node.parentNode.removeChild( node );
 }

 function UTCTime()
 {
 // Get a date stamp for the time in UTC-land.
 //
 // for the future: a format arg
 //
 var s = '',
 d = new Date(),
 a = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
 return d.getUTCDate() + ' ' +
 a + ' ' +
 d.getUTCFullYear() + ' ' +
 ( '0' + d.getUTCHours()   ).substr( -2 ) + ':' +
 ( '0' + d.getUTCMinutes() ).substr( -2 ) + ' ' + 'UTC';
 }

 SoFixItInit();
 window.addEventListener( 'load', SoFixItLoad, false );
}

function NUPatrol()
{
 if ( ( window.location.href.indexOf( 'Special%3ALog&type=newusers' ) == -1 ) &&
 ( window.location.href.indexOf( 'Special:Log/newusers'        ) == -1 )  )
 return; // make more robust???

 var items, item, i, links, user, name, talk, contribs, insertLoc, link;

 items = document.getElementById( 'bodyContent' ).getElementsByTagName( 'ul' ).getElementsByTagName( 'li' );

 function NewLink( txt, url, plainlinks, linkColor )
 { var a = document.createElement( 'a' );
 a.appendChild( document.createTextNode( txt ) );
 a.href = url;
 if ( plainlinks ) a.className = 'plainlinks';
 if ( linkColor )
 { if ( typeof linkColor == "string" )
 a.style.color = linkColor;
 else a.style.color = '#FF0000'; // old default behavior
 }
 return a;
 }

 for ( i = 0; i < items.length; i++ )
 {
 item = items;
 
 links = item.getElementsByTagName( 'a' );

 user = links; name = user.firstChild.nodeValue;
 talk = links; talk.firstChild.nodeValue = 'talk'; // lowercase 'Talk' for consistency
 contribs = links;

 insertLoc = user.nextSibling; // ' newusers '

 item.insertBefore( document.createTextNode( ' ( ' ), insertLoc );

 item.insertBefore( talk, insertLoc );
 item.insertBefore( document.createTextNode( ', ' ), insertLoc );

 item.insertBefore( contribs, insertLoc );
 item.insertBefore( document.createTextNode( ', ' ), insertLoc );

 item.insertBefore( NewLink( 'actions', '/Special:Contributions/' + name, true, '#000088' ), insertLoc );
 item.insertBefore( document.createTextNode( ', ' ), insertLoc );

 item.insertBefore( NewLink( 'blocks', '/search/?title=Special%3ALog&type=block&page=User%3A' + name, true, '#008800' ), insertLoc );
 item.insertBefore( document.createTextNode( ', ' ), insertLoc );

 item.insertBefore( NewLink( 'is blocked?', '/Special:Ipblocklist?action=search&ip=' + name, true, '#888800' ), insertLoc );
 item.insertBefore( document.createTextNode( ', ' ), insertLoc );
 
 item.insertBefore( NewLink( 'do block!', '/Special:Blockip/' + name, true, '#880000' ), insertLoc );

 item.insertBefore( document.createTextNode( ' )' ), insertLoc );

 item.removeChild( insertLoc.nextSibling ); // should remove the span
 item.removeChild( insertLoc ); // should remove ' newusers ' text
 }
}
if ( window.addEventListener ) window.addEventListener( 'load', NUPatrol, false );
else if ( window.attachEvent ) window.attachEvent( 'onload', NUPatrol );

//---------------------------------------------------------------------------------
function removeAccessKeys(keylist) {
  var t=document.getElementsByTagName('A'), u=document.getElementsByTagName('input');
  for (var i=0; i<t.length+u.length; ++i) {
    var s=((i<t.length) ? t : u);
    for (var j=0; j<keylist.length; ++j) if (s.accessKey==keylist) s.accessKey='';
  }
};

function removeDeleteKey() {removeAccessKeys();};

if (window.addEventListener) window.addEventListener("load",removeDeleteKey,false);
else if (window.attachEvent) window.attachEvent("onload",removeDeleteKey);

//</nowiki>

//Interiot's javascript edit counter
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
  mw.loader.load('https://en.wikipedia.org/search/?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }

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

/* </nowiki> */

importScript("User:Ucucha/autofc.js"); // ]

importScript('User:Shubinator/DYKcheck.js'); //DYKcheck tool