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]]

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


popupFixDabs=true;
popupWatchDisambiggedPages=true;
popupOnlyArticleLinks=false;
popupOnEditSelection=false;
popupDragHandle='popupTopLinks';
popupRevertSummaryPrompt=true;
popupEditCounterTool='custom';
popupEditCounterUrl='http://tools.wikimedia.de/~interiot/cgi-bin/Tool1/wannabe_kate?username=$1&site=en.wikipedia.org';
popupAdminLinks=true;

// Script from [[User:Tra/sidebartranslate.js]]
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Tra/sidebartranslate.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></s'+'cript>');


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

addOnloadHook(function () {
    if(document.forms.editform) {
        uwaddToolboxLink('javascript:replace()', 'Replace', 'ca-replace');
    }
});


addOnloadHook(function () {
    if (unescape(window.location.href).indexOf("Special:Watchlist") < 0) return;

    // just one little ID attribute would be _so_ nice...
    var nsSelectForm = document.getElementById('namespace');
    while (nsSelectForm && !(nsSelectForm.tagName && nsSelectForm.tagName.toLowerCase() == 'form'))
         nsSelectForm = nsSelectForm.parentNode;
    if (!nsSelectForm) return;

    var link = document.createElement('a');
    link.id = 'listSince';
    link.href = '#listSince';  // must have a href to show as link!

    var then = +(new Date());
    var fixLinkHref = function () {
        var url = window.location.href.split('#')[0];
        var days = ( +(new Date()) - then )/(1000 * 3600 * 24);
        if (url.match(/[?&]days=/))
            this.href = url.replace(/([?&]days=)[^&]*/, '$1'+days);
        else
            this.href = url + (url.indexOf('?') < 0 ? '?':'&') + 'days=' + days;
        return true;
    };
    link.onclick = fixLinkHref;
    link.onmousedown = fixLinkHref;  // react to middle clicks too

    var frag = document.createDocumentFragment();
    frag.appendChild(document.createTextNode(' | '));
    frag.appendChild(link);
    link.appendChild(document.createTextNode('Changes'));
    frag.appendChild(document.createTextNode(' since last load.'));
    nsSelectForm.parentNode.insertBefore(frag, nsSelectForm);
});



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


 addOnloadHook(function () {
   mw.util.addPortletLink("p-personal", "/w/index.php?title=Special:Userlogin&wpName=Tra&wpRemember&returnto=" + wgPageName, "Log in (1)", "pt-login1", "Log in as Tra");
   mw.util.addPortletLink("p-personal", "/w/index.php?title=Special:Userlogin&wpName=Tra non-admin&wpRemember&returnto=" + wgPageName, "(2)", "pt-login2", "Log in as Tra non-admin");

   if(wgCanonicalSpecialPageName == false){addPortletLink("p-tb", "/wiki/Special:Prefixindex/" + wgPageName + "/", "Subpages", "t-subpages", "Show subpages of this page");
   }
 })

// addPurge
addOnloadHook(function () {

if(wgCanonicalNamespace == "Image"  ) {  

mw.util.addPortletLink('p-cactions', "/w/index.php?action=purge&title=" + wgPageName,
                   'Purge', 'ca-purge', 'Purge image', '0');

}

});