User:Ultimate Dark Carnage/wikia.js

/*function configureEl(el, class_name, attribute, attr_val, refElem){ var elem = document.createElement(el); elem.setAttribute('class', class_name); elem.setAttribute(attribute, attr_val); refElem.append(elem); }

var element = {}; element.elname = 'a'; element.classname = 'wikia-button'; element.attrib = 'href'; element.attribval = 'javascript:openTestWindow;'; element.refElem = $('.WikiaHeader .tally');

configureEl(element.elname, element.classname, element.attrib, element.attribval, element.refElem);

function openTestWindow{ $.showCustomModal('Test Form',         '' +              ' ' +                  '' +                      ' ' +                          '' +                              '' +                          '' +                          '' +                              '' +                                  '' +                              '' +                              '' +                                  '' +                                      'Test' + '' + '' + 'Hello World</a>' + '</li>' + '</ul>' + '</li>' + '</ul>' + ' ' +                 ' ' +              ' ' +          ' '); }*/

/*$(document).ready(function{   var sidebarHTML =         '<aside class="CustomSidebar" id="CustomSidebar">' +            ' Sidebar ' +            '<ul class="CustomSidebarNavigation" id="CustomSidebarNavigation">' +                '' +                    '<a href="/wiki/Special:Block" title="Block">Block</a>' +                '</li>' +            '</ul>' +        ' ';    var sidebarStyle =         '<style type="text/css" media="all" id="CustomSidebarStyle" class="CustomSidebarCSS">' +            '.CustomSidebar {' +                'position: fixed;' +                'left: 0;' +                'top: 0;' +                'width: 125px;' +                'height: 100%;' +                'background: black;' +                'background: -moz-linear-gradient(top, black 0%, #232323 100%);' +                'background: -webkit-gradient(linear, 50% 0, 50% 100%, from(black), to(#232323));' + 'background: -webkit-linear-gradient(top, black 0%, #232323 100%);' + 'background: -ms-linear-gradient(top, black 0%, #232323 100%);' + 'background: -o-linear-gradient(top, black 0%, #232323 100%);' + 'background: linear-gradient(top, black 0%, #232323 100%);' + 'filter: progid:DXImageTransform.Microsoft.Gradient( GradientType=1, startColorStr="#000000", endColorStr="#232323");' + '}' +           '.CustomSidebar h2 {' + 'text-align: center;' + 'border-bottom: none !important;' + 'color: white !important;' + 'margin: 0 !important;' + 'background: silver;' + 'padding: 2px;' + 'font-variant: small-caps;' + 'font-family: "Segoe UI", Arial, sans-serif;' + 'font-size: 10pt;' + '}' +           '.CustomSidebar .CustomSidebarNavigation {' + 'margin: 0 !important;' + 'padding: 0 !important;' + 'list-style: none inside !important;' + 'width: 100%;' + '}' +           '.CustomSidebar .CustomSidebarNavigation li a {' + 'padding: 2px !important;' + 'font-variant: small-caps;' + 'font-family: "Segoe UI", Arial, sans-serif;' + 'font-size: 10pt;' + 'color: white !important;' + '}' +           '.CustomSidebar .CustomSidebarNavigation li:hover {' + 'background: navy !important;' + '}' +       ' ';    $('body.mediawiki').append(sidebarHTML); $('head').append(sidebarStyle); });*/

if (typeof wgUserName != 'undefined'){ var onTheWikiNav = '' + '<a href="http://vstf.wikia.com" title="VSTF Wiki" class="subnav-2a">VSTF<img class="chevron" src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D"/></a>' + '<ul class="subnav-3 subnav">' + '' + '<a href="http://vstf.wikia.com/Report:Wiki">Report Wiki</a>' + '</li>' + '</ul>' + '</li>' + '' + '<a href="/wiki/Special:Contact" title="Contact Staff" class="subnav-2a">Contact<img class="chevron" src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D"/></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");

/*function addSideMenu{ var user_split = wgUserName.split(' ').join('_'); var menuHTML = '<aside class="side-menu" id="side-menu">' + '<section class="side-menu-navigation" id="side-menu-navigation">' + '<nav class="side-menu-top-buttons" id="side-menu-top-buttons">' + '<button class="close wikia-chiclet-button">' + ' ' +                   '<button class="maximize wikia-chiclet-button">' + ' ' +               ' ' +                '<header class="side-menu-header" id="side-menu-header">' + ' Side Menu ' + ' ' +               '<ul class="side-menu-nav-items">' + '' + '<a href="?action=edit">Edit</a>' + '</li>' + '' + '<a href="?action=purge">Purge</a>' + '</li>' + '' + '<a href="?action=history">History</a>' + '</li>' + '' + '<a href="/wiki/User:' + user_split + '">Profile</a>' + '</li>' + '</ul>' + ' ' +       ' '; }*/