User:Marsian~commonswiki/monobook.js

Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// popups by [[w:en:User:Lupin/popups.js]]

document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
             + '&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"></script>');

popupWatchRedirredPages=false;
popupWatchDisambiggedPages=false;
popupPreviewFirstParOnly=false;
popupOnlyArticleLinks=false;
popupThumbAction="sizetoggle";

// add new link by [[w:ja:user:cpro]]
// slightly modified by me ("avsnitt 0" instead of japanska)
function createLink(href, text) {
  var newLink = document.createElement('a');
  newLink.href = href;
  newLink.appendChild(document.createTextNode(text));
  return newLink;
}

// add a tab so as to edit the very top section (section=0)
function addTopSectionEditTab() {
  var editTab = document.getElementById('ca-edit');
  if(!editTab) return;

  var newTab = document.createElement('li');
  newTab.id = 'ca-secedit';
  newTab.appendChild(createLink(editTab.childNodes[0].href + '&section=0', 'avsnitt 0'));
  editTab.parentNode.insertBefore(newTab, editTab.nextSibling);
}
$(addTopSectionEditTab);