User:Konman72/monobook.js

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

//

/**** afd helper ****/ document.write(' ');

/* This is to keep track of who is using this extension: User:Jnothman/afd_helper/script.js */

//Please leave the following line //user:Where/usertabs

$(function { if (document.title.search("/") != -1 || document.title.search("- History -") != -1) { //no subpages or history     return;  }  if (document.title.indexOf("User:") == 0 || document.title.indexOf("User talk:") == 0) {     username_a = document.URL.match(/:.*:(.*)/);     username=username_a[1];     addTab("http://en.wikipedia.org/wiki/Special:Contributions/" + username, "contrib", "ca-contrib", "contribs", "");     addTab("http://tools.wikimedia.de/~essjay/edit_count/Count.php?username=" + username, "edit count", "ca-kate", "kate", "");  } });

//From http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510

// addLastDiff $(function {    z=document.getElementById("content").childNodes;    for (var n=0;n<z.length;n++) {       if (z[n].className=="firstHeading") {        var pname=z[n].textContent ? z[n].textContent : z[n].innerText;      }    }    var l=addTab("http://en.wikipedia.org/w/index.php?title=" + pname + "&diff=cur&oldid=prev", 'last', '');    l.lastChild.title="Show most recent diff"; });

//

function addTab(url, name, id, title, key){ var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; return addlilink(tabs, url, name, id, title, key) }; //

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

$(addSinceTab);

//

function addlilink(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); if(id) {       if(key && title) {           ta[id] = [key, title]; }       else if(key) {           ta[id] = [key, '']; }       else if(title) {           ta[id] = ['', title]; }   }    // re-render the title and accesskeys from existing code in wikibits.js    akeytt; return li; }

//