User:Ultimate Dark Carnage/wikia.js

$(function{   navigator.info = (function{ var N = navigator.appName, ua = navigator.userAgent, tem, M = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); if (M && (tem = ua.match(/version\/([\.\d]+)/i))!== null) M[2] = tem[1]; M = M? [M[1], M[2]] : [N, navigator.appVersion, '-?']; return M;   });

function getBrowserName(name){ var browserName; if (name){ switch (name){ case 'MSIE': browserName = 'Internet Explorer'; break; case 'Firefox': browserName = 'Mozilla Firefox'; break; case 'Chrome': browserName = 'Google Chrome'; break; default: browserName = name; }           return browserName; }   }

function getBrowserVersion(value){ if (value > -1){ value = parseInt(value); return value; }   }

var browser = getBrowserName(navigator.info[0]), version = getBrowserVersion(navigator.info[1]);

$('.global-navigation .page-width').append(' ' + browser + ' ' + version + ' '; }); function changeGlobalNav{ var globalNav = $('.global-navigation'), startAWikiButton = globalNav.find('.start-wikia'); startAWikiButton.text('Start a wiki'); startAWikiButton.attr('title', 'Start a wiki'); }

window.onload = changeGlobalNav;

if (typeof wgUserName != 'undefined'){ var onTheWikiNav = '' + 'VSTF' + '' + '' + 'Report Wiki' + '' + '' + '' + '' + 'Contact</a>' + '<ul class="subnav-3 subnav">' + '' + '<a href="/wiki/Special:Contact/bug">Bug</a>' + '</li>' + '</ul>' + '</li>'; $('.WikiHeader > nav.WikiNav .marked').children('.firstChild').append(onTheWikiNav); }

function addNewLinks(link, link_title){ var l = '<a href="' + link + '">' + link_title + '</a></li>'; $('.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'); addNewLinks('javascript:test;', 'Test'); }

addOnloadHook(insertLinks);

function test{ if (wgCanonicalSpecialPageName != WikiActivity){ window.location.href+="?action=edit"; } }

function addAccountNavigationLinks(link, link_title){ var l = '<a href="' + link + '">' + link_title + '</a></li>'; $('#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 = '<a href="' + link + '" class="wikia-button wikia-single-button">' + button_message + '</a> '; $('#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('<a href="' + tab_links.tablocation + '">' + tab_links.title + '</a></li>'); }

function configure(value){ if (value === "true"){ addTab('/wiki/User:' + encodeURI($('#UserProfileMasthead hgroup').children('h1').text) + '/Sandbox', 'Sandbox', 'sandbox'); addTab('/wiki/Special:Editcount/' + encodeURI($('#UserProfileMasthead hgroup').children('h1').text), 'Editcount', 'editcount'); } }

configure("true");