User:Meni Rosenfeld/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');

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

// 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 addOnloadHook(function { // if this is preview page or generated page, stop  if(document.getElementById("wikiPreview") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// if this is a revision history, stop if(document.getElementById("histlegend‎") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// if this is a diff page, stop if(document.getElementById("difference‎") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// if this is a watchlist, stop if(document.getElementById("watchdetails") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// if this is the main page, stop if(document.getElementById("mainpage") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// get the page title var pageTitle = document.title.split(" - ")[0].replace(" ", "_");

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

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

if(window.location.href.indexOf("&action=edit&section=0") != -1) document.getElementById("wpSummary").value = "/* Intro */ "; });

// Fix wikipedia's lowercase first letter problem // Fix the lowercase first letter problem by changing the page title to the correct one and hiding the template. // by pile0nades addOnloadHook(function {

try { var ch = get("//div[@id='bodyContent']/dl/dd/span[@class='plainlinks']/i[contains(.,'initial letter is capitalized')]/b").snapshotItem(0); var correction = ch.innerHTML; var articleTitle = get("//div[@id='content']/h1[@class='firstHeading']").snapshotItem(0); var template = ch.parentNode.parentNode.parentNode;

// check if the original and correct versions match // this avoids acting on non-"real" uses of the template if(articleTitle.innerHTML.toLowerCase == correction.toLowerCase) { // Correct the page title document.title = document.title.replace(articleTitle.innerHTML, correction); // Correct the article title articleTitle.innerHTML = correction; // Remove template template.style.display = "none"; } } catch(e){}

function get(query, context) { return document.evaluate(   query,    document,    null,    XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,    context  ); } });