User:Nizu/monobook.js

From Guild Wars Wiki
Jump to navigationJump 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.
 // GuildWatch - by [[User:Ale_jrb]]

function importScript(page, lang) {
     var url = wgScriptPath + '/index.php?title='
                            + encodeURIComponent(page.replace(' ','_'))
                            + '&action=raw&ctype=text/javascript&dontcountme=s';
     if (lang) url = 'http://' + lang + '.wikipedia.org' + url;
     var s = document.createElement('script');
     s.src = url;
     s.type='text/javascript';
     document.getElementsByTagName('head')[0].appendChild(s);
 }

// Need the addPortlet function...
 importScript('User:Ale_jrb/portlet.js');

// Get the Guild Watch function...
 importScript('User:Ale_jrb/guildwatch.js');

// Get the editing functions...
 importScript('User:Ale_jrb/guildwatchfuncs.js');

//own sig
if (location.href.indexOf("&action=edit") > -1) {
addButton('/skins/common/images/button_hr.png','absatz','<\/br>','','');
}
function inputlink() {
if (location.href.indexOf("&action=edit") > -1) {
  var newA = document.createElement("a");
  var newAText = document.createTextNode("TCT Category");
  newA.appendChild(newAText);
  newA.setAttribute("href", "http://wiki.guildwars.com/wiki/Category:Guild_The_Chaos_Theorie_Category");
  document.getElementById("toolbar").appendChild(newA);
  }
}
inputlink();


function wiki_addSomthing(tagnameinput, tagnameinputnumber, createElementName, setAttributeName, setAttributeValue, dataValue) {
    
  var tag = document.getElementsByTagName(tagnameinput)[tagnameinputnumber];    

  var obj = document.createElement(createElementName);
  obj.setAttribute(setAttributeName, setAttributeValue);
  obj.data = dataValue;
  tag.appendChild(obj);
  return obj;
    
}
wiki_addSomthing('body', '0', 'a', 'href', 'http://wiki.guildwars.com/wiki/Guild:The_Chaos_Theorie', 'My Guild');