User:Phroziac/monobook.js

From Wiktionary, the free dictionary
Jump to navigation Jump to search

Note: You may have to bypass your browser’s cache to see the changes. In addition, after saving a sitewide CSS file such as MediaWiki:Common.css, it will take 5-10 minutes before the changes take effect, even if you clear your cache.

  • Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
  • Konqueror and Chrome: click Reload or press F5;
  • Opera: clear the cache in Tools → Preferences;
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

This JavaScript is executed for Phroziac on every page load, when User:Phroziac is using the Monobook skin.


// add "favourites" to navigation box
function addToNav() {
  var lastnav = document.getElementById('n-sitesupport');
  var newnav;
  var newa;

  newnav = document.createElement('li');
  newa = document.createElement('a');
  newa.href='/wiki/Wiktionary:Requested_articles';
  newa.appendChild(document.createTextNode('Requests'));
  newnav.appendChild(newa);

  newnav.appendChild(document.createTextNode(' '));

  newa = document.createElement('a');
  newa.href='/wiki/Category:Requested_articles';
  newa.appendChild(document.createTextNode('(cat)'));
  newnav.appendChild(newa);

  lastnav.parentNode.appendChild(newnav);
}

function reformatMyPage() {
  addToNav();
}
var hack = 'failed';
var hack_articletitle ='';
if (window.addEventListener) window.addEventListener("load",reformatMyPage,false);
else if (window.attachEvent) window.attachEvent("onload",reformatMyPage);


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

// delay in seconds before popup appears
popupDelay=0.4;
// move default titles into popups so they don't interfere
removeTitles=true;