User:Sky2042/darkvector.js

From Warcraft Wiki
Jump to navigation Jump to search

Note: After publishing, 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 / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// changes the personal links (at the top) to include direct links to
// the customized CSS and JS pages, shortens the other links

function changePersonal() {
var divs = document.getElementsByTagName('div');
document.getElementById('p-personal').innerHTML = "<h5>Personal tools</h5><div class='pBody'><ul><li id='pt-userpage'><a href='/User:Sky2042'>Sky2042</a></li><li id='pt-mytalk'><a href='/User_talk:Sky2042'>talk</a></li><li id='pt-mycss'><a href='/User:Sky2042/darkvector.css'>css</a></li><li id='pt-myjs'><a href='/User:Sky2042/darkvector.js'>js</a></li><li id='pt-xfd'><a href='/Category:Articles_for_speedy_deletion'>xfd</a></li><li id='pt-preferences'><a href='/Special:Preferences'>prefs</a></li><li id='pt-watchlist'><a href='/Special:Watchlist'>watch</a></li><li id='pt-contributions'><a href='/Special:Contributions/Sky2042'>con</a></li><li id='pt-logout'><a href='/Special:Userlogout'>log</a></li></ul></div>";
}

addOnloadHook(changePersonal);


document.write('<script src="http://www.wowhead.com/widgets/power.js"></scr' + 'ipt>');


// adds delete? links to category namespace
if(wgNamespaceNumber == 14) addOnloadHook(categoryEditLinks)
function categoryEditLinks() {
  var pagediv = document.getElementById('mw-pages');
  if(!pagediv) return
  var pages = pagediv.getElementsByTagName('a');
  if(pages.length == 0) return
  for(var i=pages.length-1;i>0;i--) {
    if(!pages[i].href) continue;
    var li = pages[i].parentNode;
    li.appendChild(document.createTextNode(' ['));
    var ea = document.createElement('a');
    ea.appendChild(document.createTextNode('del'));
    var url = (pages[i].href.indexOf('?') != -1) ? '&' : '?'
    url = pages[i].href + url + 'action=delete';
    ea.setAttribute('href',url);
    li.appendChild(ea);
    li.appendChild(document.createTextNode(']'));
  }
}



// </pre>[[Category:User JS|Sky2042]]