User:EdwardoehtwJohns/monobook.js

Source: 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.
// [[User:Lupin/popups.js]]

mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');


function winc(s) {
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=' + s
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}

// Helper tools
mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Addtabs/monobook.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');
//

// Admin rollback tools
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Specialadmin/monobook.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//

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

winc('User:Cyde/monobook.js/close_afd.js');

//You may need up to all of these for the dates and units things to work.
winc('User:Cyde/monobook.js/dates.js');
winc('User:Cyde/monobook.js/anwar.js');
winc('User:Cyde/monobook.js/unitformatter.js');
winc('User:Omegatron/monobook.js/addlink.js'); 
winc('User:Omegatron/monobook.js/fixdiffwidth.js');
winc('User:Omegatron/monobook.js/edittop.js'); 
winc('User:Quarl/unwatch.js&oldid=35457582');
//End section listing.

popupFixRedirs=true;
popupFixDabs=true;
popupMaxPreviewSentences=12;
popupMaxPreviewCharacters=2400;
popupRedirAutoClick='wpSave';
popupStructure='menus'

/* <pre><nowiki> */

/**
 * Here be all good stuff
 * Original location: [[User:Alphax/monobook.js]]
 * Forked from [[User:ABCD/monobook.js]] around April 2005
 * Dual licensed under the GFDL and GPL
 * See also: [[User:JesseW/monobook.js]]
 * And best of all: [[WP:US]]
 */

/**** Add Godmode-lite ****/

// this one breaks popups
// document.write('<SCRIPT SRC="http://sam.zoy.org/wikipedia/godmode-light.js"><\/SCRIPT>');

/**** Live RC filter ****/

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

document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js&action=raw&ctype=text/javascript&dontcountme=s"><\/script>');

/**** afd helper ****/

// From [[User:Jnothman/afd_helper/script.js]]

document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Cyde/afd_helper/script.js&action=raw&ctype=text/javascript&dontcountme=s"><\/script>');

/**** Initialise on window load ****/

if (window.addEventListener) window.addEventListener("load",myLoadFuncs,false);
else if (window.attachEvent) window.attachEvent("onload",myLoadFuncs);
else
{
    window.previousLoadFunction = window.onload;
    window.onload = function()
    {
        window.previousLoadFunction();
        myLoadFuncs();
    }
}

/**** Load custom functions ****/

function myLoadFuncs()
{
    // &action=purge
    //addPurge();
    
    // &section=0
    addEditSection0();
    
    // cause the personal menu looks bad
    //changeLinks();
    
    // now add a million extra tabs
    morelinks();
    
    // and some stuff for the sidebar
    addToolBoxLinks();
    
    // make red talk page links start new sections
    talkpageplus();
    
    // for admins only...
    // if(document.title.indexOf("Confirm delete - Delete") == 0) addVfdLink();
    
    // change the title of the edit link
    ta['ca-edit'] = ['e', 'Edit page'];
    
    // remove the logout access key
    //ta['pt-logout'] = new Array(null, null);
    
    // re-render the title and accesskeys for stuff
    akeytt();
    
    // add history link to new messages box
    newmessagehistory();
}

/**** Edit section 0 ****/

function addEditSection0()
{
    ta['ca-edit-0'] = ['', 'Edit the zeroth section of this page'];
    if(!document.getElementById) return;
    var x = document.getElementById('ca-edit');
    if(!x) return;
    var y = document.createElement('LI');
    y.id = 'ca-edit-0';
    if(x.className == 'selected'){
      if(/&action=edit&section=0$/.test(window.location.href)){
        x.className = 'istalk';
        y.className = 'selected';
      } else {
        x.className = 'selected istalk';
      }
    } else if(x.className == 'selected istalk'){
      if(/&action=edit&section=0$/.test(window.location.href)){
        x.className = 'istalk';
        y.className = 'selected istalk';
      } else {
        y.className = 'istalk';
      }
    } else {
      y.className = x.className;
      x.className = 'istalk';
    }
    var z = document.createElement('A');
    if(x.children){
        z.href = x.children[0].href + '&section=0';
        z.appendChild(document.createTextNode('0'));
        y.appendChild(z);
        document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling);
    }else{
        z.href = x.childNodes[0].href + '&section=0';
        z.appendChild(document.createTextNode('0'));
        y.appendChild(z);
        document.getElementById('p-cactions').childNodes[3].insertBefore(y,x.nextSibling);
    }
}

/**** Add generic tab ****/

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

/**** Add tab as menu ****/

function addlimenu(tabs, name, id)
{
    var na = document.createElement('a');
    na.href = '#';
    var mn = document.createElement('ul');
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.id = id;
    li.className = 'tabmenu';
    li.appendChild(na);
    li.appendChild(mn);
    tabs.appendChild(li);
    return li;
}

/**** Add purge tab ****/

function addPurge()
{
    ta['ca-purge'] = ['g', 'Purge the internal cache for this page'];
    if(!document.getElementById) return;
    var x = document.getElementById('ca-history');
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    if(!x) return;
    if(x.children) x = x.children[0];
    else x = x.childNodes[0];
    
    var pf = document.createElement('form');
    pf.action = '?action=purge';
    pf.method = 'POST';
    pf.id = 'pf';
    x.appendChild(pf);
    
    addlilink(tabs, 'javascript:document.getElementById("pf").submit();', 'purge', 'ca-purge');
}

/**** Add afd header, footer and comment ****/

function closeafd(bold, notbold)
{
    var txt = document.editform.wpTextbox1;
    txt.value = "<div class="boilerplate metadata vfd" style="background-color: #F3F9FF; margin: 2em 0 0 0; padding: 0 10px 0 10px; border: 1px solid #AAAAAA;">
:''The following discussion is an archived debate of the proposed deletion of the article below. <span style="color:red">'''Please do not modify it.'''</span>  Subsequent comments should be made on the appropriate discussion page (such as the article's talk page or in a [[Wikipedia:Deletion review|deletion review]]).  No further edits should be made to this page.  ''
<!--Template:Afd top

Note:  If you are seeing this page as a result of an attempt to re-nominate an article for deletion, you must manually edit the AfD nomination links in order to create a new discussion page using the name format of [[Wikipedia:Articles for deletion/PAGENAME (2nd nomination)]].  When you create the new discussion page, please provide a link to this old discussion in your nomination. -->

The result was '''" + bold + "'''" + notbold + ". &ndash; ~~~~\n" + txt.value
    + "\n
:''The above discussion is preserved as an archive of the debate.  <span style="color:red">'''Please do not modify it.'''</span> Subsequent comments should be made on the appropriate discussion page (such as the article's talk page or in a [[Wikipedia:Deletion review|deletion review]]). No further edits should be made to this page. <!--Template:Afd bottom--></div>

\n";
    txt = document.editform.wpSummary;
    txt.value = "close discussion: " + bold + notbold;
    
    // I don't mind still watching them
    // document.editform.wpWatchthis.checked = false;
}

/**** Generic custom talk message ****/

function autoMessage(msgtext, summary, saveopt)
{
    var txt = document.editform.wpTextbox1;
    document.editform.wpSummary.value = summary;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += msgtext;
    if(saveopt == 'save')
    {
        document.editform.submit();
    }
    else if(saveopt == 'preview')
    {
        document.editform.wpPreview.click();
    }
    else if(saveopt == 'diff')
    {
        document.editform.wpDiff.click();
    }
}

/**** Get the pagename for a specified thread ****/

function startThread()
{
    var which = prompt("Thread number?");
    var now = new Date();
    if(which < 10) which = '0' + which;
    var timestamp = now.getUTCFullYear() + '';
    now.getUTCMonth() < 9 ? timestamp += '0' + (now.getUTCMonth() + 1) : timestamp += (now.getUTCMonth() + 1);
    now.getUTCDate() < 10 ? timestamp += '0' + now.getUTCDate() : timestamp += now.getUTCDate();
    return '{{User talk:Alphax/' + timestamp + '-' + which + '}}';
}

/**** Get the text for a specified test number ****/

function test(x)
{
    var s = (x == '1' ? '' : x);
    return ['{{subst:test' + s + '}} &ndash; ~~~~', '{{test' + s + '}}'];
}

/**** String replacement popup ****/

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

/**** Talk page AFD result ****/

function afdresult()
{
    var res = prompt("Result?");
    if(!res) return;
    var afddate = prompt("Nomination date?");
    document.editform.wpSummary.value = 'AFD result - ' + res.replace(/'/g, '');
    var txt = document.editform.wpTextbox1;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += '{{oldafdfull|date=[[' + afddate + ']] [[2006]]|result=' + res + '|votepage=EdwardoehtwJohns/monobook.js}}';
    txt.focus();
}

/**** Make old AfD's appear or disappear ****/

function hideafd()
{
    var divs = document.getElementsByTagName("div");
    for(var x = 0; x < divs.length; ++x)
        if(divs[x].className.indexOf("vfd") != -1)
            divs[x].style.display = "none";
    // needed to shrink the page - rendering bug
    document.getElementById('footer').style.display = 'none';
}

function showafd()
{
    var divs = document.getElementsByTagName("div");
    for(var x = 0; x < divs.length; ++x)
        if(divs[x].className.indexOf("vfd") != -1)
            divs[x].style.display = "";
    // might as well put it back...
    document.getElementById('footer').style.display = '';
}

/**** Make the top links look better ****/

function changeLinks()
{
    if(!document.getElementById) return;
    // remove the "my" bits
    document.getElementById('pt-mytalk').firstChild.innerHTML = 'talk';
    document.getElementById('pt-watchlist').firstChild.innerHTML = 'watchlist';
    document.getElementById('pt-mycontris').firstChild.innerHTML = 'contributions';
    // add a clock
    var toplinks = document.getElementById('p-personal').getElementsByTagName('ul')[0];
    addlilink(toplinks, '#', '', 'utcdate');
    showtime();
}

/**** Not sure how this works ****/

function afddelete(){
    var form = document.forms.deleteconfirm;
    form.wpReason.value = '[[Wikipedia:Articles for deletion/' + unescape(window.location.href.replace(/^.*\?title=([^&]+)&action=delete.*$/, '$1').replace(/_/g, ' ')) + ']]';
    form.wpConfirm.checked = true;
}

/**** Mega Tab Adding ****
 *
 * I'm making this comment block REALLY REALLY BIG so I can find it
 *
 * Possibly the most useful bit of this entire file, it adds various tabs depending on
 * what page we are on
 *
 */

function morelinks()
{
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    if(document.title.indexOf("Editing Wikipedia:Articles for deletion") == 0)
    {
        /**** I'm insane! ****/
        
        addlimenu(tabs, 'afd actions', 'afda');
        var afda = document.getElementById('afda').getElementsByTagName('ul')[0];
        addlilink(afda, 'javascript:closeafd("keep", "")', 'keep', '');
        addlilink(afda, 'javascript:closeafd("merge and redirect", " to [[" + prompt("Merge and redirect to?") + "]]")', 'merge', '');
        addlilink(afda, 'javascript:closeafd("redirect", " to [[" + prompt("Redirect to?") + "]]")', 'redir', '');
        addlilink(afda, 'javascript:closeafd("transwiki", " to " + prompt("Transwiki to?"))', 'trans', '');
        addlilink(afda, 'javascript:closeafd("transwiki", " to Wiktionary")', 'wikt', '');
        addlilink(afda, 'javascript:closeafd("speedy delete", "")', 'speedy', '');
        addlilink(afda, 'javascript:closeafd("delete", "")', 'del', '');
        addlilink(afda, 'javascript:closeafd(prompt("Result?"), "")', 'other', '');
        addlilink(tabs, 'javascript:replace()', 'replace', '');
        
        /**** Finish insanity ****/
        
        /**** The "Make it Awesome!" button ****
        
        document.editform.wpSummary.value = 'This vote brought to you by the "Make it Awesome!" button';
        var txt = document.editform.wpTextbox1;
        if(txt.value.length > 0) txt.value += '\n';
        txt.value += "*'''Make it awesome!''' ~~~~";
        document.editform.submit();
        
        **** Finish making it awesome ****/
    }
    else if(document.title.indexOf("Confirm delete - Delete") == 0)
    {
        addlilink(tabs, 'javascript:afddelete()', 'afd', '');
    }
    else if(document.title.indexOf("Editing User talk:") == 0)
    {
        addlilink(tabs, 'javascript:replace()', 'replace', '');
        addlimenu(tabs, 'talk messages', 'talkm');
        var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0];
        addlilink(talkm, 'javascript:autoMessage("== Welcome to Wikipedia! ==

Hello {{PAGENAME}}, and '''[[Wikipedia:Welcome, newcomers|welcome]]''' to Wikipedia! Thanks for your contributions. I hope that you like the place and decide to stay.

If you haven't already read the [[Wikipedia:policies and guidelines|policies and guidelines]] page, some of the key points are:
* The [[Wikipedia:Five pillars|Five pillars]] of Wikipedia:
*# [[Wikipedia:What Wikipedia is not|Wikipedia is an encyclopedia]]
*# Articles must conform to a [[Wikipedia:neutral point of view|neutral point of view]]
*# Wikipedia is [[free content]], and submissions must not violate the [[Wikipedia:copyright policy|copyright policy]]
*# Observe [[Wikipedia:Etiquette|Wikiquette]] and the other [[Wikipedia:Writers' rules of engagement|rules of engagement]]
*# [[Wikipedia:Ignore all rules|Wikipedia doesn't have firm rules]]
* The [[Wikipedia:Simplified Ruleset|Simplified Ruleset]] adds:
** [[Wikipedia:Be bold|Be bold]] in making changes
** Information should be [[Wikipedia:Verifiability|verifiable]]
** Provide an [[Wikipedia:Edit summary|Edit summary]]
** [[Wikipedia:Sign your posts on talk pages|Sign your posts on talk pages]] using four tildes (&#126;&#126;&#126;&#126;).
** Use the [[Wikipedia:Show preview|Show preview]] button
** There are five [[m:Foundation issues|official rules]] which must be followed

Some other useful pages are:
* [[Wikipedia:How to edit a page|How to edit a page]]
* The [[Wikipedia:Introduction]] to Wikipedia
* The [[Wikipedia:Tutorial|Tutorial]]
* The [[Wikipedia:Manual of Style|Manual of Style]]
* What to do if you see [[Wikipedia:vandalism|vandalism]]
* How to [[Wikipedia:Merging and moving pages|move and merge]] pages
* The [[Wikipedia:Village pump|Village pump]] and [[Wikipedia:Help desk|Help desk]], for questions about Wikipedia
* The [[Wikipedia:reference desk|reference desk]], for questions which are ''not'' about Wikipedia
* [[Wikipedia:How to write a great article|How to write a great article]]

If you feel a change is needed, feel free to make it yourself!  Wikipedia is a [[wiki]], so anyone (yourself included) can edit any article by following the '''{{MediaWiki:edit}}''' link. Wikipedia convention is to [[Wikipedia:be bold|be bold]] and not be afraid of making mistakes.  If you're not sure how editing works, have a look at [[Wikipedia:how to edit a page|''How to edit a page'']], or try out the [[Wikipedia:Sandbox|Sandbox]] to test your editing skills.

If, for some reason, you are unable to [[Wikipedia:How_to_edit_a_page | fix a problem yourself]], feel free to ask someone else to do it. Wikipedia has a vibrant [[Wikipedia:Community_Portal | community of contributors]] who have a wide range of skills and specialties, and many of them would be glad to help. As well as the wiki community pages there are [[meta:IRC Channels | IRC Channels]], where you are more than welcome to ask for assistance.

If you have any questions, feel free to '''ask me''' on [[User talk:Alphax|my talk page]] or [[Special:Emailuser/Alphax|via email]]. Thanks and happy editing, ~~~~", "Welcome to Wikipedia!", "save")', 'welcome', '');
        addlilink(talkm, 'javascript:autoMessage("==Welcome!==
[[Wikipedia:Introduction|Welcome to Wikipedia]], the free encyclopedia! You don't have to [[Special:Userlogin|log in]] to read or edit articles on Wikipedia, but you may wish to create a account. Doing so is free, requires no personal information, and provides several [[Wikipedia:Why create an account?|benefits]], including:
*The use of a [[Wikipedia:Username|username]] of your choice, provided that it is [[Wikipedia:Username#Inappropriate_usernames|appropriate]].
*The use of your own [[Wikipedia:Watchlist|watchlist]], which shows when articles you are interested in have changed.
*The ability to [[Help:Starting a new page|create new pages]].
*The ability to [[Wikipedia:How to rename a page|rename pages]].
*The ability to edit [[Wikipedia:Semi-protection policy|semi-protected pages]].
*The ability to [[Special:Upload|upload images]].
*The ability to customize the appearance and behavior of the website.
*Your [[IP address]] will no longer be visible to other users.

We hope that you choose to become a Wikipedian and '''[[Special:Userlogin|create an account]]'''. Feel free to ask me any questions you may have on my talk page. By the way, make sure to [[Wikipedia:Sign your posts on talk pages|sign and date]] your comments with four tildes ('''&#126;&#126;&#126;&#126;'''). Thanks, ~~~~", "Create an account!", "save")', 'anon', '');
        addlilink(talkm, 'javascript:autoMessage(startThread(), "new thread", "save")', 'thread', '');
        addlilink(talkm, 'javascript:autoMessage("<div style="background-color:#F9F9F9; border:1px solid #AAA; padding:5px;"> [[Image:Information_icon.svg|20px|left]] Hello. Please don't forget to provide an [[Help:Edit summary|edit summary]]. Thanks, and happy editing. <!-- Template:Editsummary --></div>  ~~~~", "Edit summary", "save")', 'summary', '');
        addlilink(talkm, 'javascript:autoMessage("'''Welcome!'''

Hello, and [[Wikipedia:Welcome, newcomers|welcome]] to Wikipedia. Someone must have been lazy, as you have not been welcomed yet. Thank you for your contributions. Since you have been here for a while, we can pretty much assume you are not a troll, vandal, or clueless newbie. I hope you continue to like the place and don't get all grumpy and leave over nothing. Here are a few good links for newcomers, even though you aren't one:

*[[Wikipedia:How to edit a page|How to edit a page]]
*[[Wikipedia:Tutorial|Editing, policy, conduct, and structure tutorial]]
*[[Wikipedia:Picture tutorial|Picture tutorial]]
*[[Wikipedia:How to write a great article|How to write a great article]]
*[[Wikipedia:Five pillars|The Five Pillars of Wikipedia]]
*[[Wikipedia:Naming conventions|Naming conventions]]
*[[Wikipedia:Manual of Style|Manual of Style]]
*[[Wikipedia:Merge|Merging, redirecting, and renaming pages]]
*If you're ready for the complete list of Wikipedia documentation, there's also [[Wikipedia:Topical index]].

I hope you still  enjoy editing here and being a [[Wikipedia:Wikipedians|Wikipedian]], and won't get mad over something stupid and leave! By the way, please be sure to continue to [[Wikipedia:Sign your posts on talk pages|sign your name on Talk]] and vote pages using four tildes (&#126;&#126;&#126;&#126;) to produce your name and the current date, or three tildes (&#126;&#126;&#126;) for just your name. If you have any questions, see the [[Wikipedia:Help|help pages]], add a question to the [[Wikipedia:village pump|village pump]] or ask me on my Talk page. Again, welcome, and sorry for your not being welcomed in the past! ~~~~", "Welcome to Wikipedia!", "save")', 'oldwelcome', '');
        addlilink(talkm, 'javascript:autoMessage("Please do not replace Wikipedia pages with blank content. Blank pages are harmful to Wikipedia because they have a tendency to confuse readers. If it is a duplicate article, please [[Wikipedia:Redirect|redirect]] it to an appropriate existing page. If the page has been [[Wikipedia:How to spot vandalism|vandalised]], please [[Wikipedia:How to revert a page to an earlier version|revert]] it to the last legitimate version. If you feel that the content of a page is inappropriate, please [[Wikipedia:How to edit a page|edit]] the page and replace it with appropriate content. If you believe there is no hope for the page, please see the [[Wikipedia:Deletion policy|deletion policy]] for how to proceed. Thanks for contributing to Wikipedia!<!-- Template:Blank -->  ~~~~", "{{blanking}}", "save")', 'blanking', '');
        addlilink(talkm, 'javascript:autoMessage("[[Image:Stop hand.svg|left|30px]] Welcome to Wikipedia. We invite everyone to contribute constructively to our encyclopedia. Take a look at the [[Wikipedia:Welcome, newcomers|welcome page]] if you would like to learn more about contributing. However, unconstructive edits{{#if:{{{1|}}}|, such as those you made to [[:{{{1}}}]],}} are considered [[Wikipedia:Vandalism|vandalism]]. If you continue in this manner you may be '''[[Wikipedia:blocking policy|blocked]] from editing without further warning'''. Please stop, and consider improving rather than damaging the work of others. Thank you. <!-- Template:Blatantvandal (serious warning) -->  ~~~~", "{{bv}}", "save")', 'bv', '');
        addlilink(talkm, 'javascript:autoMessage(test(1)[0], test(1)[1], "save")', 'test', '');
        addlilink(talkm, 'javascript:autoMessage(test(2)[0], test(2)[1], "save")', 'test2', '');
        addlilink(talkm, 'javascript:autoMessage(test("2a")[0], test("2a")[1], "save")', 'test2a', '');
        addlilink(talkm, 'javascript:autoMessage(test(3)[0], test(3)[1], "save")', 'test3', '');
        addlilink(talkm, 'javascript:autoMessage(test(4)[0], test(4)[1], "save")', 'test4', '');
        addlilink(talkm, 'javascript:autoMessage(test(5)[0], test(5)[1], "save")', 'test5', '');
        addlilink(talkm, 'javascript:autoMessage("[[Wikipedia:Welcome, newcomers|Welcome]], and thank you for experimenting with Wikipedia! Your test worked, and thank you for reverting or removing it yourself. The best way to do tests in the future would be to use the [[Wikipedia:Sandbox|sandbox]]. You can look at these pages as well: [[Wikipedia:How to edit a page|how to edit a page]], [[Wikipedia:Tutorial|the tutorial]], and [[Wikipedia:How to write a great article|how to write a great article]]. All of these pages are good places to start. Again, welcome, and I hope that you will like [[Wikipedia]]. <!-- Template:Test-self (mild first level warning) -->  ~~~~", "{{selftest}}", "save")', 'selftest', '');
    }
    else if(document.title.indexOf("Editing ") == 0)
    {
        addlilink(tabs, 'javascript:replace()', 'replace', '');
        addlilink(tabs, 'javascript:afdresult()', 'afd result', '');
    }
    else if(document.title.indexOf("Wikipedia:Articles for deletion") == 0)
    {
        addlilink(tabs, 'javascript:hideafd()', 'hide closed', 'ca-hide');
        ta['ca-hide'] = ['', 'Hide closed AFDs'];
        addlilink(tabs, 'javascript:showafd()', 'show closed', 'ca-show');
        ta['ca-show'] = ['', 'Show closed AFDs'];
    }
}

/**** Add links to the toolbox ****/

function addToolBoxLinks()
{
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
    
    var afdtime = new Date();
    var months = ['January', 'February', 'March', 'April', 'May', 'June',
        'July', 'August', 'September', 'October', 'November', 'December'];
    afdtime.setUTCDate(afdtime.getUTCDate() - 7);
    
    addlilink(tb, '/wiki/Special:Newpages', 'New pages', '');
    addlilink(tb, '/wiki/Special:Shortpages', 'Short pages', '');
    addlilink(tb, '/wiki/Special:Log', 'Logs', '');
    addlilink(tb, '/wiki/Template:Deletiontools', 'Deletion tools', '');
    addlilink(tb, '/wiki/Wikipedia:Articles_for_deletion/Log/' + afdtime.getUTCFullYear()
        + '_' + months[afdtime.getUTCMonth()] + '_' + afdtime.getUTCDate(), 'Week old AfD', '');
    addlilink(tb, '/wiki/Wikipedia:Disambiguation_pages_with_links', 'Dab list', '');
    addlilink(tb, '/wiki/Wikipedia:Template_messages/User_talk_namespace', 'Talk messages', '');
    addlilink(tb, '/wiki/User:Cyde/monobook.js', 'Monobook.js', '');
    addlilink(tb, '/wiki/User:Cyde/monobook.css', 'Monobook.css', '');
    addlilink(tb, '/wiki/Wikipedia:Sandbox', 'Sandbox', '');
    addlilink(tb, '/wiki/WP:ICT', 'Image Copyright tags', '');
}

/**** Get a clock that autoupdates! ****/

function showtime()
{
    var timerID;
    var now = new Date();
    var timeValue = now.toUTCString().replace(/GMT/, "UTC");
    document.getElementById('utcdate').firstChild.innerHTML = timeValue;
    timerID = setTimeout('showtime()', 100);
}

/**** Auto start new topics when hitting empty talk pages from the content page ****/

function talkpageplus()
{
    var talkpagelink = document.getElementById('ca-talk');
    if (talkpagelink.className == 'new')
    {
        talkpagelink.firstChild.href += '&section=new';
    }
}

/**** Add history link to the "You have new messages" box ****/

function newmessagehistory()
{
    var divs = document.getElementsByTagName('div');
    var talkmessagebox;
    
    for(var x = 0; x < divs.length; ++x)
    {
        if(divs[x].className.indexOf('usermessage') != -1)
        {
            talkmessagebox = divs[x];
            x = divs.length; // force break
        }
    }
    
    divs = ''; // release divs?
    if(!talkmessagebox) return false;
    
    var newmessagelink = talkmessagebox.getElementsByTagName('a')[0];
    
    var historylink = document.createElement('a');
    historylink.href = newmessagelink.href.replace(/\/wiki\//, '/w/index.php?title=') + '&action=history';
    historylink.className = 'extiw';
    historylink.appendChild(document.createTextNode('changes'));
    
    var talkmessagetext = 'You have ';
    talkmessagebox.innerHTML = talkmessagetext;
    
    talkmessagebox.appendChild(newmessagelink);
    talkmessagebox.appendChild(document.createTextNode(' ('));
    talkmessagebox.appendChild(historylink);
    talkmessagebox.appendChild(document.createTextNode(')'));
}

/* </nowiki></pre> */

//
$(Dfn_js_con)
function Dfn_js_con()
{
//moves
Mvaluejs_class = 'yes';
//edits
Rvaluejs_class = 'yes';
//uploads
Uvaluejs_class = 'yes';
}
//