MediaWiki:Common.js

The UESPWiki – Your source for The Elder Scrolls since 1995

 
Jump to: navigation, search

Note - After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh); Konqueror: click Reload or press F5; Opera: clear the cache in Tools → Preferences; Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

/* <pre><nowiki> */

/*
addsectionbottom
  Add a new section link to the bottom of discussion pages
  Copied from http://rationalwiki.com/
*/
 
function addsectionbottom() {
  var caplus;
  if (!(caplus = document.getElementById("ca-addsection"))) return;
  var content;
  if (!(content = document.getElementById("bodyContent"))) return;
  if (document.URL.indexOf('?')>=0) return;
  var addsection = document.createElement("div");
  addsection.innerHTML = "<h3><span class=\"editsection\">[<a " + "href=\"" + caplus.childNodes[0].getAttribute("href") + 
                         "\" title=\"" + caplus.childNodes[0].getAttribute("title") +
                         "\" accesskey=\"" + caplus.childNodes[0].getAttribute("accesskey") + 
                         "\" ><span> Add new section</span> </a>]</span></h3>"
  addsection.id = "addsectionbottom";
  var catlinks = document.getElementById("catlinks");
  if (catlinks == null)
  {
    content.appendChild(addsection);
  } else {
    content.insertBefore(addsection, catlinks);
  }
}
 
addOnloadHook(addsectionbottom);

/* </nowiki></pre> */
Sponsored Links
Personal tools