Wikipedia:WikiProject User scripts/Scripts/Changes since I last edited

From Wikipedia, the free encyclopedia

//


//From http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510
function addSinceTab() {
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    if (window.location.href.indexOf("&action=history&gotosince=true")!=-1) {
       do_since_I_last_edited()
    }
    else if (!/wiki\/Special:|w\/index.php?title=Special:/.test(window.location.href)) {
       var thetitle=document.title.slice(0, String(document.title).indexOf(" - "));
       var l=addlilink(tabs, "/w/index.php?title="+thetitle+"&action=history&gotosince=true", 'Changes since I last edited', '');
       l.lastChild.title="Changes since I last edited";
    }
}
function do_since_I_last_edited() {
        var csub=document.getElementById("contentSub");
        var msg=document.createElement("p");
        msg.appendChild(document.createTextNode
                        ("Parsing history... please wait..."));
        msg.className="error";
        csub.insertBefore(msg, csub.firstChild)

        var username=document.getElementById("pt-userpage").textContent;
        var hists=document.getElementById("pagehistory").getElementsByTagName('li');
        for (n=0;n<hists.length;n++) {
            if (hists[n].getElementsByTagName("span")[0].getElementsByTagName('a')[0].textContent==username) {
                document.location=hists[n].childNodes[1].href; 
                return;
            }
        }

        msg.replaceChild(document.createTextNode
                         ("You have not edited this page! (recently)"),
                         msg.firstChild);
}

addOnloadHook(addSinceTab);

// 

//