User:Ultimate Dark Carnage/wikia.js

(function(mw, $){  if (wgPageName === "Special:Chat"){    var size = $('.User').size;    if (isNAN(size) || size < 1){       return;       console.log('Code failed!');    }    else {       function action(action_type){          action_type.handler;       }       function clearChat{          $('.Chat li.message').remove;       }       function addButton(button_name, button_action, button_id){          button_action = action({ handler: button_action });         var button = document.createElement('a');          button.getAttribute('class', 'wikia-button');          button.getAttribute('id', button_id);          button.getAttribute('onclick', button_action);          button.innerHTML = button_name;          document.getElementsByClassName('Write')[0].appendChild(button);       }       addButton("Clear Chat", clearChat, "clear-chat");    }  } })(this.jQuery, this.mediawiki); function addNewLinks(link, link_title){ var l = '' + link_title + ''; $('.WikiaBarWrapper #my-tools-menu').append(l); }

function insertLinks{ addNewLinks('/wiki/Special:Chat', 'Chat'); addNewLinks('/wiki/Special:Forum', 'Forum'); addNewLinks('/wiki/Help:CSS', 'CSS'); addNewLinks('/wiki/Blog:Recent_posts', 'Recent Blogs'); addNewLinks('http://vstf.wikia.com/wiki/Report:Spam', 'Report Spam'); addNewLinks('http://vstf.wikia.com/wiki/Report:Vandalism', 'Report Vandalism'); }

addOnloadHook(insertLinks);

function addAccountNavigationLinks(link, link_title){ var l = '' + link_title + ''; $('#AccountNavigation .subnav').prepend(l); }

function insertAccountNavigationLinks{ addAccountNavigationLinks('/wiki/Special:MyPage/Sandbox', 'Sandbox'); addAccountNavigationLinks('/wiki/Special:Contributions', 'Contributions'); addAccountNavigationLinks('/wiki/Special:Editcount/Ultimate_Dark_Carnage', 'Editcount'); addAccountNavigationLinks('/wiki/Special:Following', 'Following'); }

addOnloadHook(insertAccountNavigationLinks);

function addButton(link, button_message){ var b = '' + button_message + ' '; $('#WikiaPageHeader .tally').before(b); }

function insertButtons(add){ if (add === "true"){ addButton('?useskin=monobook', 'Monobook'); addButton('?useskin=wikiamobile', 'Mobile'); }   else if (add === "false"){ } }

window.onload = insertButtons('true');