User:Sopoforic/monobook.js

/*#### This area contains scripts only for Firefox ####*/ var detect = navigator.userAgent.toLowerCase; var IE; var place = detect.indexOf('msie') + 1; if (place) IE=true; if (!IE) {

/* Put all scripts you want disabled only in Internet Explorer in this area. */

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

//START edit top // This will add an [edit] link at the top of all pages except preview pages and the main page // by User:Pile0nades

// Add an [edit] link to pages $(function {  // if this is preview page or generated page, stop  if( document.getElementById("wikiPreview") || document.getElementById("histlegend‎") || document.getElementById("difference‎") || document.getElementById("watchdetails") || document.getElementById("ca-viewsource") || window.location.href.indexOf("/wiki/Special:") != -1 ) {   if(window.location.href.indexOf("&action=edit&section=0") != -1) {      document.getElementById("wpSummary").value = "/* Intro */ ";    }    return;  };

// get the page title var pageTitle = wgPageName;

// create div and set innerHTML to link var divContainer = document.createElement("div"); divContainer.innerHTML = ' [edit intro] ';

// insert divContainer into the DOM below the h1 if(window.location.href.indexOf("&action=edit") == -1) { document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]); }

}); //END edit top

//START lupin's anti-vandal thingy // Script from User:Lupin/recent2.js mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js'             + '&action=raw&ctype=text/javascript&dontcountme=s'); //END lupin's anti-vandal thingy

//START popups // 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'); popupFixDabs=true; popupFixDabsSummary="Disambiguation link repair - You can help!"; //END popups

//START 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'); } //END Interiot's javascript edit counter

//START ADDLILINK

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; } //END ADDLILINK

//START ADDTAB

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

//START USERTAB //Please leave the following line //user:Where/usertabs addOnloadHook(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://en.wikipedia.org/w/index.php?title=Special%3ALog&type=move&user=" + username, "page moves", "ca-pagemoves", "page moves", "");      addTab("http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=" + username, "block log", "ca-blog", "blog", "");      addTab("http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user=" + username, "edit count", "ca-kate", "kate", "");   } }); //END USERTAB

//START Changes since I last edited //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);

//get page name

/*Returns the name of the page. For example, if you were browsing the "foo" WP page, getPname would return "foo".*/ function getPname { return wgPageName.replace(/_/g, ' '); } //END Changes since I last edited

//what links here watchlist

// Script from User:Tra/whatlinksherewatchlist.js mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Tra/whatlinksherewatchlist.js'             + '&action=raw&ctype=text/javascript');

// Script from User:Gimmetrow/fixRefs.js mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Gimmetrow/fixRefs.js'             + '&action=raw&ctype=text/javascript');

// Script from User:AndyZ/peerreviewer.js importScript('User:AndyZ/peerreviewer.js'); //User:AndyZ/peerreviewer.js

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

TwinkleConfig = { userTalkPageMode :      'tab', };

// Script from User:Dr pda/persondata.js importScript('User:Dr pda/persondata.js'); //User:Dr pda/persondata.js

// User:Krimpet/CH2.js importScript('User:Krimpet/CH2.js');

// tagger function commonsOK { document.editform.wpTextbox1.value += "\n"; document.editform.wpSummary.value = ""; document.editform.submit; } function addCommonsOK{ if (document.editform && wgCanonicalNamespace == "Image") { mw.util.addPortletLink("p-cactions", "javascript:commonsOK", "", ""); } } $(addCommonsOK);

}