User:Ultimate Dark Carnage/wikia.js

(function(mw, $){  if (wgPageName === "Special:Chat"){    var size = $('.User').length;    if (isNAN(size) || size < 1){       return;       console.log('Code failed!');    }    else {       function action(action_type){          return 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.setAttribute('class', 'wikia-button');          button.setAttribute('id', button_id);          button.setAttribute('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');

function addTab(link, link_name, id){ var tab_links = { tablocation: link, title: link_name, dataid: id   }; $('.WikiaUserPagesHeader .tabs-container .tabs').append('' + tab_links.title + ''); }

function configure(value){ if (value === "true"){ addTab('/wiki/User:Ultimate Dark Carnage/Sandbox', 'Sandbox', 'sandbox'); addTab('/wiki/Special:Editcount/Ultimate Dark Carnage', 'Editcount', 'editcount'); } }

configure("true");