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.
/* <pre><nowiki> */

// Speedy deletion tags //
importScript('User:AzaToth/morebits.js');
importScript('User:AzaToth/twinklespeedy.js');
importScript('User:AzaToth/twinklexfd.js');
TwinkleConfig = {
        markSpeedyPagesAsMinor          :       false,
        openUserTalkPageOnSpeedyDelete  :       [ ],
        watchSpeedyPages                :       [ 'g1', 'g2', 'g3', 'g4', 'g5', 'g7', 'g10', 'g11', 'g12', 'a1', 
'a3', 'a7', 'r1', 'r2', 'u1', 'u3', 't1' ], 
};

// External link behaviour //
addOnloadHook(function() {
    var alinks = document.getElementsByTagName("a");
    var tablink;
    for (var i = 0, leng = alinks.length; i < leng; i++) {
        tablink = alinks[i];
        if (/\bexternal\b/.test(tablink.className) && tablink.href.indexOf("http://en.wikipedia.org") != 0)
            tablink.target = "_tab";
    }
});

// Interwiki link behaviour //
addOnloadHook(function() {
    var alinks = document.getElementsByTagName("a");
    var tablink;
    for (var i = 0, leng = alinks.length; i < leng; i++) {
        tablink = alinks[i];
        if (/\bextiw\b/.test(tablink.className) && tablink.href.indexOf("http://en.wikipedia.org") != 0)
            tablink.target = "_tab";
    }
});

// Default limitation of "What Links Here" to mainspace only //
addOnloadHook(function(){
 var ln = document.getElementById('t-whatlinkshere');
 if (!ln) return;
 ln.firstChild.href = ln.firstChild.getAttribute('href', 2) + '?namespace=0';
});

// User:Anomie/fix-tab-text.js //
addOnloadHook(function(){
    var fix=function(id, text){
        var el=document.getElementById(id);
        if(!el) return;
        for(el=el.firstChild; el && el.nodeName!='A'; el=el.nextSibling);
        if(!el) return;
        while(el.firstChild) el.removeChild(el.firstChild);
        el.appendChild(document.createTextNode(text));
    }
    fix('ca-edit', 'edit');
    fix('ca-addsection', '+');
    fix('pt-userpage', 'home');
    fix('pt-watchlist', 'watchlist');
    fix('pt-mycontris', 'contributions');
    fix('pt-preferences', 'preferences');
});

// Navigation links //
addOnloadHook(function() {
mw.util.addPortletLink('p-navigation','/wiki/Category:Categories','Categories','t-categories','Category:Categories');
});

// Interaction links //
addOnloadHook(function() {
mw.util.addPortletLink('p-interaction','/wiki/Wikipedia:Signpost','Signpost','t-signpost','Wikipedia:Signpost');
});

// Toolbox links //
addOnloadHook(function() {
mw.util.addPortletLink('p-tb','/wiki/Special:Logs','Other logs','t-logs','Special:Logs');
});

// Page-specific log link //
if (wgNamespaceNumber >= 0)
addOnloadHook(function(){
 mw.util.addPortletLink('p-tb', mw.config.get('wgServer')+mw.config.get('wgScript')+'?title=Special:Log&page='+wgPageName,
 'Page logs', 't-pagelog', 'Logs for this page', '', document.getElementById('t-upload'))
})

// Personal links //
addOnloadHook(function() {
mw.util.addPortletLink('p-personal','/wiki/User:Adrian M. H./Directory','Links','pt-links','Link directory','l',
document.getElementById('pt-preferences'));
});
addOnloadHook(function() {
mw.util.addPortletLink('p-personal','/wiki/Special:Log?user=Adrian M. H.','log','pt-log','Log of my actions','',document.getElementById('pt-logout'));
});

// Purge tab //
addOnloadHook(function () {
    var hist; var url;
    if (!(hist = document.getElementById('ca-history') )) return;
    if (!(url = hist.getElementsByTagName('a')[0] )) return;
    if (!(url = url.href )) return;
    mw.util.addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),
                   'purge', 'ca-purge', 'Purge server cache for this page', '0');
});

// Customised version of toolbar clock //
function liveClock()
{
 
	liveClock.node = mw.util.addPortletLink( 'p-personal', mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=' + wgPageName + '&action=purge', '', 'utcdate' );
 
	showTime();
}
addOnloadHook(liveClock)
 
function showTime()
{
 
	var dateNode = liveClock.node;
	if( !dateNode ) {
		return;
	}
    var now = new Date();
	var hh = now.getUTCHours();
	var mm = now.getUTCMinutes();
	var ss = now.getUTCSeconds();
	var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
	dateNode.firstChild.replaceChild( document.createTextNode( time ), dateNode.firstChild.firstChild );
 
    window.setTimeout(showTime, 1000);
}

// Ref buttons in edit toolbar //
importScript('User:Mr.Z-man/refToolbar.js');

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