User:Wayne Miller/monobook.js

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

popupDelay=4; simplePopups=true; popupFixDabs=true; popupFixDabsSummary="Disambiguation link repair (%s) - You can help!";

// GERBRANT.EDIT.TOP // From User:Gerbrant/edit/top.js // This will add an [edit] link at the top of all pages except preview pages and the main page // Originally by User:Pile0nades, modified by User:Gerbrant.

// Add an [edit] link to pages hookEvent("load", function {	if(window.location.href.indexOf("/wiki/Special:") != -1) return;	if(document.getElementById("wikiPreview")) return;	if(document.getElementById("histlegend‎")) return;	if(document.getElementById("difference‎")) return;	if(document.getElementById("watchdetails")) return;	if(document.getElementById("mainpage")) return;

if(window.location.href.indexOf("&action=edit") == -1) {		var pageTitle = document.title.split(" - ")[0].replace(" ", "_"); var divContainer = document.createElement("div"); divContainer.innerHTML = ' \ [edit] '; var coos = document.getElementById("coordinates"); if(coos) coos.style.right = "4.5em"; document.getElementById("content").insertBefore(			divContainer, document.getElementsByTagName("h1")[0]); }	else if(window.location.href.indexOf("&action=edit&section=0") != -1) {		e = document.getElementById("wpSummary"); if(e) e.value = "/* Intro */ "; } });

// VIEW SOURCE // From User:Misza13/Scripts/View source addOnloadHook(function {  if (location.href.indexOf('viewsource=1') != -1) {    sl = document.getElementById('wpSummaryLabel'); sl.parentNode.removeChild(sl);    ed = document.getElementById('wpSummary').parentNode; ed.parentNode.removeChild(ed);    return;  }  editbutton = document.getElementById('ca-edit');  if (editbutton && location.href.indexOf('action=edit')==-1) {    editlink = editbutton.getElementsByTagName('a')[0].href + '&viewsource=1';    tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];    na = document.createElement('a');    na.href = editlink; na.appendChild(document.createTextNode('view source'));    li = document.createElement('li'); li.id = 'ca-viewsource'; li.appendChild(na);    tabs.insertBefore(li,editbutton);  } });