User:Merovingian/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 addOnloadHook(func) { if (window.addEventListener) window.addEventListener("load", func, false); else if (window.attachEvent) window.attachEvent("onload", func); }

/* add menu for selecting subsets of secial characters */ /***** must match MediaWiki:Edittools *****/ function addCharSubsetMenu { var specialchars = document.getElementById('specialchars');

if (specialchars) { var menu = ""; menu += " Wiki "; menu += " Latin/Roman "; menu += " Greek "; menu += " Cyrillic "; menu += " Arabic "; menu += " Catalan "; menu += " Croatian "; menu += " Czech & Slovak "; menu += " Dutch/Frisian "; menu += " Esperanto "; menu += " Estonian "; menu += " French "; menu += " German "; menu += " Hawaiian "; menu += " Hebrew "; menu += " Hieroglyph "; menu += " Hungarian "; menu += " Icelandic "; menu += " Indo-European "; menu += " Irish "; menu += " Italian "; menu += " Korean "; menu += " Latvian "; menu += " Lithuanian "; menu += " Maltese "; menu += " Navajo & Apache "; menu += " Old English "; menu += " Pinyin "; menu += " Polish "; menu += " Portuguese "; menu += " Rōmaji "; menu += " Romanian "; menu += " Scandinavian "; menu += " Sorbian "; menu += " Spanish "; menu += " Thai "; menu += " Turkic "; menu += " Vietnamese "; menu += " Welsh "; menu += " Yiddish "; menu += " IPA "; menu += " Math/TeX "; menu += " "; specialchars.innerHTML = menu + specialchars.innerHTML;

/* default subset - try to use a cookie some day */ chooseCharSubset(0); } }

/* select subsection of special characters */ function chooseCharSubset(s) { var l = document.getElementById('specialchars').getElementsByTagName('p'); for (var i = 0; i < l.length ; i++) { l[i].style.display = i == s ? 'inline' : 'none'; l[i].style.visibility = i == s ? 'visible' : 'hidden'; } }

addOnloadHook(addCharSubsetMenu);

//

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

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

/* */

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

/* */

addOnloadHook( function {     addTab("javascript:doQwikify", "wikify", "ca-wikify", "Mark for wikification", "");  } );

function doQwikify {

document.editform.wpTextbox1.value = "{"+"{wikify}}\n\n" + document.editform.wpTextbox1.value; document.editform.submit;

}

if (window.addEventListener) window.addEventListener("load", addQwikify, false); else if (window.attachEvent) window.attachEvent("onload", addQwikify);

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

//