User:Gweit/monobook.js

/* */ function fixformat{ var replacements = [ [/<\/?(b|strong)>/gi, "'''"], [/<\/?(i|em|var)>/gi, "''"], [/\{\{([Ss]u[bp])\|([^}]+)\}\}/g, "$2"], [/\{\{([Aa]ctinium|[Aa]luminum|[Aa]mericium|[Aa]ntimony|[Aa]rgon|[Aa]rsenic|[Aa]statine|[Bb]arium|[Bb]erkelium|[Bb]eryllium|[Bb]ismuth|[Bb]ohrium|[Bb]oron|[Bb]romine|[Cc]admium|[Cc]alcium|[Cc]alifornium|[Cc]arbon|[Cc]erium|[Cc]aesium|[Cc]hlorine|[Cc]hromium|[Cc]obalt|[Cc]opper|[Cc]urium|[Dd]armstadtium|[Dd]ubnium|[Dd]ysprosium|[Ee]insteinium|[Ee]rbium|[Ee]uropium|[Ff]ermium|[Ff]luorine|[Ff]rancium|[Gg]adolinium|[Gg]allium|[Gg]ermanium|[Gg]old|[Hh]afnium|[Hh]assium|[Hh]elium|[Hh]olmium|[Hh]ydrogen|[Ii]ndium|[Ii]odine|[Ii]ridium|[Ii]ron|[Kk]rypton|[Ll]anthanum|[Ll]awrencium|[Ll]ead|[Ll]ithium|[Ll]utetium|[Mm]agnesium|[Mm]anganese|[Mm]eitnerium|[Mm]endelevium|[Mm]ercury|[Mm]olybdenum|[Nn]eodymium|[Nn]eon|[Nn]eptunium|[Nn]ickel|[Nn]iobium|[Nn]itrogen|[Nn]obelium|[Oo]smium|[Oo]xygen|[Pp]alladium|[Pp]hosphorus|[Pp]latinum|[Pp]lutonium|[Pp]olonium|[Pp]otassium|[Pp]raseodymium|[Pp]romethium|[Pp]rotactinium|[Rr]adium|[Rr]adon|[Rr]henium|[Rr]hodium|[Rr]oentgenium|[Rr]ubidium|[Rr]uthenium|[Rr]utherfordium|[Ss]amarium|[Ss]candium|[Ss]eaborgium|[Ss]elenium|[Ss]ilicon|[Ss]ilver|[Ss]odium|[Ss]trontium|[Ss]ulfur|[Tt]antalum|[Tt]echnetium|[Tt]ellurium|[Tt]erbium|[Tt]hallium|[Tt]horium|[Tt]hulium|[Tt]in|[Tt]itanium|[Tt]ungsten|[Uu]nun(?:bi|pent|quad|tr)ium|[Uu]ranium|[Vv]anadium|[Xx]enon|[Yy]tterbium|[Yy]ttrium|[Zz]inc|[Zz]irconium)\}\}/g, ""], [/<\/div +>/gi, " "], [/&iexcl;/g, "¡"], [/&cent;/g, "¢"], [/&pound;/g, "£"], [/&curren;/g, "¤"], [/&yen;/g, "¥"], [/&brvbar;/g, "¦"], [/&sect;/g, "§"], [/&uml;/g, "¨"], [/&copy;/g, "©"], [/&ordf;/g, "ª"], [/&laquo;/g, "«"], [/&not;/g, "¬"], [/&reg;/g, "®"], [/&macr;/g, "¯"], [/&deg;/g, "°"], [/&plusmn;/g, "±"], [/&sup2;/g, "²"], [/&sup3;/g, "³"], [/&acute;/g, "´"], [/&micro;/g, "µ"], [/&para;/g, "¶"], [/&middot;/g, "·"], [/&cedil;/g, "¸"], [/&sup1;/g, "¹"], [/&ordm;/g, "º"], [/&raquo;/g, "»"], [/&frac14;/g, "¼"], [/&frac12;/g, "½"], [/&frac34;/g, "¾"], [/&iquest;/g, "¿"], [/&Agrave;/g, "À"], [/&Aacute;/g, "Á"], [/&Acirc;/g, "Â"], [/&Atilde;/g, "Ã"], [/&Auml;/g, "Ä"], [/&Aring;/g, "Å"], [/&AElig;/g, "Æ"], [/&Ccedil;/g, "Ç"], [/&Egrave;/g, "È"], [/&Eacute;/g, "É"], [/&Ecirc;/g, "Ê"], [/&Euml;/g, "Ë"], [/&Igrave;/g, "Ì"], [/&Iacute;/g, "Í"], [/&Icirc;/g, "Î"], [/&Iuml;/g, "Ï"], [/&ETH;/g, "Ð"], [/&Ntilde;/g, "Ñ"], [/&Ograve;/g, "Ò"], [/&Oacute;/g, "Ó"], [/&Ocirc;/g, "Ô"], [/&Otilde;/g, "Õ"], [/&Ouml;/g, "Ö"], [/&times;/g, "×"], [/&Oslash;/g, "Ø"], [/&Ugrave;/g, "Ù"], [/&Uacute;/g, "Ú"], [/&Ucirc;/g, "Û"], [/&Uuml;/g, "Ü"], [/&Yacute;/g, "Ý"], [/&THORN;/g, "Þ"], [/&szlig;/g, "ß"], [/&agrave;/g, "à"], [/&aacute;/g, "á"], [/&acirc;/g, "â"], [/&atilde;/g, "ã"], [/&auml;/g, "ä"], [/&aring;/g, "å"], [/&aelig;/g, "æ"], [/&ccedil;/g, "ç"], [/&egrave;/g, "è"], [/&eacute;/g, "é"], [/&ecirc;/g, "ê"], [/&euml;/g, "ë"], [/&igrave;/g, "ì"], [/&iacute;/g, "í"], [/&icirc;/g, "î"], [/&iuml;/g, "ï"], [/&eth;/g, "ð"], [/&ntilde;/g, "ñ"], [/&ograve;/g, "ò"], [/&oacute;/g, "ó"], [/&ocirc;/g, "ô"], [/&otilde;/g, "õ"], [/&ouml;/g, "ö"], [/&divide;/g, "÷"], [/&oslash;/g, "ø"], [/&ugrave;/g, "ù"], [/&uacute;/g, "ú"], [/&ucirc;/g, "û"], [/&uuml;/g, "ü"], [/&yacute;/g, "ý"], [/&thorn;/g, "þ"], [/&yuml;/g, "ÿ"], [/&fnof;/g, "ƒ"], [/&Alpha;/g, "Α"], [/&Beta;/g, "Β"], [/&Gamma;/g, "Γ"], [/&Delta;/g, "Δ"], [/&Epsilon;/g, "Ε"], [/&Zeta;/g, "Ζ"], [/&Eta;/g, "Η"], [/&Theta;/g, "Θ"], [/&Iota;/g, "Ι"], [/&Kappa;/g, "Κ"], [/&Lambda;/g, "Λ"], [/&Mu;/g, "Μ"], [/&Nu;/g, "Ν"], [/&Xi;/g, "Ξ"], [/&Omicron;/g, "Ο"], [/&Pi;/g, "Π"], [/&Rho;/g, "Ρ"], [/&Sigma;/g, "Σ"], [/&Tau;/g, "Τ"], [/&Upsilon;/g, "Υ"], [/&Phi;/g, "Φ"], [/&Chi;/g, "Χ"], [/&Psi;/g, "Ψ"], [/&Omega;/g, "Ω"], [/&alpha;/g, "α"], [/&beta;/g, "β"], [/&gamma;/g, "γ"], [/&delta;/g, "δ"], [/&epsilon;/g, "ε"], [/&zeta;/g, "ζ"], [/&eta;/g, "η"], [/&theta;/g, "θ"], [/&iota;/g, "ι"], [/&kappa;/g, "κ"], [/&lambda;/g, "λ"], [/&mu;/g, "μ"], [/&nu;/g, "ν"], [/&xi;/g, "ξ"], [/&omicron;/g, "ο"], [/&pi;/g, "π"], [/&rho;/g, "ρ"], [/&sigmaf;/g, "ς"], [/&sigma;/g, "σ"], [/&tau;/g, "τ"], [/&upsilon;/g, "υ"], [/&phi;/g, "φ"], [/&chi;/g, "χ"], [/&psi;/g, "ψ"], [/&omega;/g, "ω"], [/&thetasym;/g, "ϑ"], [/&upsih;/g, "ϒ"], [/&piv;/g, "ϖ"], [/&bull;/g, "•"], [/&hellip;/g, "…"], [/&prime;/g, "′"], [/&Prime;/g, "″"], [/&oline;/g, "‾"], [/&frasl;/g, "⁄"], [/&weierp;/g, "℘"], [/&image;/g, "ℑ"], [/&real;/g, "ℜ"], [/&trade;/g, "™"], [/&alefsym;/g, "ℵ"], [/&larr;/g, "←"], [/&uarr;/g, "↑"], [/&rarr;/g, "→"], [/&darr;/g, "↓"], [/&harr;/g, "↔"], [/&crarr;/g, "↵"], [/&lArr;/g, "⇐"], [/&uArr;/g, "⇑"], [/&rArr;/g, "⇒"], [/&dArr;/g, "⇓"], [/&hArr;/g, "⇔"], [/&forall;/g, "∀"], [/&part;/g, "∂"], [/&exist;/g, "∃"], [/&empty;/g, "∅"], [/&nabla;/g, "∇"], [/&isin;/g, "∈"], [/&notin;/g, "∉"], [/&ni;/g, "∋"], [/&prod;/g, "∏"], [/&sum;/g, "∑"], [/&lowast;/g, "∗"], [/&radic;/g, "√"], [/&prop;/g, "∝"], [/&infin;/g, "∞"], [/&ang;/g, "∠"], [/&and;/g, "∧"], [/&or;/g, "∨"], [/&cap;/g, "∩"], [/&cup;/g, "∪"], [/&int;/g, "∫"], [/&there4;/g, "∴"], [/&sim;/g, "∼"], [/&cong;/g, "≅"], [/&asymp;/g, "≈"], [/&ne;/g, "≠"], [/&equiv;/g, "≡"], [/&le;/g, "≤"], [/&ge;/g, "≥"], [/&sub;/g, "⊂"], [/&sup;/g, "⊃"], [/&nsub;/g, "⊄"], [/&sube;/g, "⊆"], [/&supe;/g, "⊇"], [/&oplus;/g, "⊕"], [/&otimes;/g, "⊗"], [/&perp;/g, "⊥"], [/&sdot;/g, "⋅"], [/&lceil;/g, "⌈"], [/&rceil;/g, "⌉"], [/&lfloor;/g, "⌊"], [/&rfloor;/g, "⌋"], [/&lang;/g, "〈"], [/&rang;/g, "〉"], [/&loz;/g, "◊"], [/&spades;/g, "♠"], [/&clubs;/g, "♣"], [/&hearts;/g, "♥"], [/&diams;/g, "♦"], [/&OElig;/g, "Œ"], [/&oelig;/g, "œ"], [/&Scaron;/g, "Š"], [/&scaron;/g, "š"], [/&Yuml;/g, "Ÿ"], [/&circ;/g, "ˆ"], [/&tilde;/g, "˜"], [/&lsquo;/g, "‘"], [/&rsquo;/g, "’"], [/&sbquo;/g, "‚"], [/&ldquo;/g, "“"], [/&rdquo;/g, "”"], [/&bdquo;/g, "„"], [/&dagger;/g, "†"], [/&Dagger;/g, "‡"], [/&permil;/g, "‰"], [/&lsaquo;/g, "‹"], [/&rsaquo;/g, "›"], [/&euro;/g, "€"], [/\{\{SERVER\}\}\{\{localurl:/g, "{{fullurl:"], [/\{\{NAMESPACE\}\}:\{\{PAGENAME\}\}/g, "{{FULLPAGENAME}}"] ];   var form = document.editform; var txt = form.wpTextbox1; var val = txt.value; for(var i in replacements) val = val.replace(replacements[i][0], replacements[i][1]); txt.value = val; form.wpSummary.value += "formatting"; form.wpMinoredit.checked = true; }

function replace{ var s = prompt("Search regexp?"); if(s){ var r = prompt("Replace regexp?"); if(!r && r != '') return; var txt = document.editform.wpTextbox1; txt.value = txt.value.replace(new RegExp(s, "g"), r); } }

function addlilink(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); na.accesskey = key; var pref = 'alt-'; var clientPC = navigator.userAgent.toLowerCase; if(((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1)) || navigator.userAgent.toLowerCase.indexOf( 'mac' ) != -1 ) pref = 'control-'; if(clientPC.indexOf('opera')!=-1) pref = 'shift-esc-'; if(key && title) na.title = title + ' [' + pref + key + ']'; else if(title) na.title = title; else if(key) na.title = '[' + pref + key + ']'; var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); return li; }

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

function addPurge{ var x = document.getElementById('ca-history'); if(!x) return; if(x.children) x = x.children[0].href; else x = x.childNodes[0].href; addTab(x.replace(/=history/, "=purge"), 'purge', 'ca-purge', 'Purge the internal cache for this page', 'g'); }

function addEditSection0{ if(!document.getElementById) return; var x = document.getElementById('ca-edit'); if(!x) return; var y = document.createElement('LI'); y.id = 'ca-edit-0'; if(x.className == 'selected'){ if(/&action=edit&section=0$/.test(window.location.href)){ x.className = 'istalk'; y.className = 'selected'; } else { x.className = 'selected istalk'; }   } else if(x.className == 'selected istalk'){ if(/&action=edit&section=0$/.test(window.location.href)){ x.className = 'istalk'; y.className = 'selected istalk'; } else { y.className = 'istalk'; }   } else { y.className = x.className; x.className = 'istalk'; }   var z = document.createElement('A'); if(x.children){ z.href = x.children[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').children[1].insertBefore(y,x.nextSibling); }else{ z.href = x.childNodes[0].href + '&section=0'; z.appendChild(document.createTextNode('0')); y.appendChild(z); document.getElementById('p-cactions').childNodes[3].insertBefore(y,x.nextSibling); }   z.title = 'Edit the zeroth section of this page'; akeytt; }

function changeLinks{ if(!document.getElementById) return; document.getElementById('pt-mytalk').firstChild.innerHTML = 'Talk'; document.getElementById('pt-preferences').firstChild.innerHTML = 'Preferences'; document.getElementById('pt-watchlist').firstChild.innerHTML = 'Watchlist'; document.getElementById('pt-mycontris').firstChild.innerHTML = 'Contributions'; document.getElementById('pt-logout').firstChild.innerHTML = 'Log out'; if(document.getElementById('ca-talk')) document.getElementById('ca-talk').firstChild.innerHTML = 'Talk'; if(document.getElementById('ca-edit')) document.getElementById('ca-edit').firstChild.innerHTML = 'Edit'; if(document.getElementById('ca-nstab-wp')) document.getElementById('ca-nstab-wp').firstChild.innerHTML = 'About'; } function addForceSummary{ if(!/&action=edit/.test(window.location.href)) return; if(/&section=new/.test(window.location.href)) return; if(!document.forms.editform) return; document.forms.editform.wpSave.onclick = forceSummary; }

function forceSummary{ var form = document.forms.editform; if(!form.wpSummary.value.replace(/^(\/\*.*\*\/)? *(.*) *$/,'$2')){     var r = prompt('Are you sure you want to submit without adding a summary?\nTo add a summary, type it in the box below:',form.wpSummary.value); if(r == null) return false; form.wpSummary.value = r;   } return true; }

function morelinks{ if(document.title.indexOf("Editing ") == 0){ addTab('javascript:replace', 'Replace'); addTab('javascript:fixformat', 'Format'); } }

function addToolBoxLinks{ var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0]; addlilink(tb, '/wiki/Special:Newpages', 'New pages', 't-newpages'); addlilink(tb, '/wiki/Special:Shortpages', 'Short pages', 't-shortpages'); }

function myLoadFuncs{ addPurge; addEditSection0; changeLinks; addForceSummary; morelinks; addToolBoxLinks; } if (window.addEventListener) window.addEventListener("load",myLoadFuncs,false); else if (window.attachEvent) window.attachEvent("onload",myLoadFuncs);

// // User:Lupin/popups.js - please include this line

mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'             + '&action=raw&ctype=text/javascript&dontcountme=s');

popupActionsMenu=false; popupImages=false; popupPreviewRawTemplates=true; /* */