User:Chieftainalex/ATools.js

/* */ /* From https://wiki.guildwars2.com/wiki/User:Chieftain_Alex/ATools.js */ (function ATools (document) {

/* Fetch mw variables */ var conf = mw.config.get([     'wgServer',      'wgPageName',      'wgRelevantPageName',      'wgTitle',      'wgNamespaceNumber',      'wgCurRevisionId'   ]);

/* Provide the pretty buttons to start the legwork! */  /** Last diff **/ var caHistory = document.getElementById('ca-history'); if (caHistory != undefined) { lastdiff = document.createElement('li'); lastdiff.id = 'special-diff'; lastdiff.innerHTML = ' diff last ' document.getElementById('ca-history').parentNode.insertBefore(lastdiff, document.getElementById('ca-history').nextSibling) }

/** Link to users' pages/images **/ if (conf.wgNamespaceNumber == 2 || conf.wgNamespaceNumber == 3) { // namespace: User, User talk var pageRootName = conf.wgTitle.substring(0, ((conf.wgTitle.indexOf('/') > 0) ? conf.wgTitle.indexOf('/') : conf.wgTitle.length));

var usertoolbox = document.createElement('div'); usertoolbox.id = 'userlinks'; usertoolbox.className = 'portal'; document.getElementById('mw-panel').appendChild(usertoolbox);

var usertoolboxheading = document.createElement('h3'); usertoolboxheading.id = 'userlinks-heading'; usertoolboxheading.innerHTML = 'Pages and files'; document.getElementById('userlinks').appendChild(usertoolboxheading);

var usertools = document.createElement('div'); usertools.id = 'link-list-box'; usertools.className = 'body'; usertools.innerHTML = '' + 'User\'s pages' + 'User\'s images' + '' document.getElementById('userlinks').appendChild(usertools); } })(document); /* */