v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:Emi/monobook.js

From Dwarf Fortress Wiki
< User:Emi
Revision as of 04:30, 25 April 2010 by Emi (talk | contribs)
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files
importScript('User:Emi/clock.js');
importScript('User:Emi/newpages.js');
importScript('User:Emi/colorcontrib.js');
importScript('User:Briess/hideAnnouncements.js');


addOnloadHook(function() {

var something = document.getElementById('disclaimer');


    if (wgNamespaceNumber != 2 && wgNamespaceNumber != 3)  // User or User talk
        return;
    var user = wgTitle.split("/")[0];
    var url = wgScript + "?title=Special:Contributions&user=" + encodeURIComponent(user);
    addPortletLink("p-tb", url, "User rights", "t-userrights", "List of user groups for "+user);

var newLI = document.createElement('li');
newLI.innerHTML = "<a href='" + url + "'>user contributions</a>";

insertAfter( something, newLI );

var newLI = document.createElement('li');
newLI.innerHTML = "<a href='http://df.magmawiki.com/index.php/special:recent changes'>recent changes</a>";

insertAfter( something, newLI );

var newLI = document.createElement('li');
newLI.innerHTML = "<a href='http://df.magmawiki.com/index.php/main_page'>main page</a>";

insertAfter( something, newLI );

});

function insertAfter( referenceNode, newNode )
{
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}