User:Ultimate Dark Carnage/wikia.js

if (wgUserGroups.length) wgUserGroups[wgUserGroups.length] = 'sysop'; if (wgUserGroups.length) wgUserGroups[wgUserGroups.length] = 'staff';

if ($('#WikiaRail').length) { //only on pages where the rail is present $('#WikiaRail').bind('DOMNodeInserted', function(event) { //fires after lazy-loading takes place.   if ($('.ChatModule').length && !$("#NewFilesModule").length) { // Only add it once      if (typeof $temp == "undefined") { // Only load it once        $temp = $(' '); // this line, and the next, originate from http://dev.wikia.com/wiki/AjaxRC/code.js <3        $temp.load("/Special:NewFiles/13" + " #gallery-", function  { $('.ChatModule').after(" New FilesUpload "); if (typeof NewFilesModuleCompact != "undefined" && NewFilesModuleCompact) { $('#gallery-', $temp).html($('#gallery-', $temp).html.replace(/\/scale-to-width\/\d*\?/g, "/scale-to-width/106?")); $("#NewFilesModule").addClass("compact"); }         $("#NewFilesModule").append($('#gallery-', $temp)); $("#NewFilesModule .wikia-photogallery-add").remove; delete $temp; //delete it, in case the rail is wiped after this point. });     }    }  });  //end of DOMNodeInserted block $('head').append('\n#gallery- { height:452px; overflow-y:auto; clear: both; text-align:center; padding-bottom: 5em;}\n#NewFilesModule .gallery-image-wrapper { top: 0 !important; height: auto !important; border:none; }\n#NewFilesModule.compact .gallery-image-wrapper { width: auto !important; }\n#NewFilesModule .thumb { height:auto !important; }\n#NewFilesModule .wikia-gallery-item { margin: 1px !important; padding: 0 !important; height: auto !important; border: none !important; }\n#NewFilesModule.compact .wikia-gallery-item { width: auto !important; }\n#NewFilesModule .wikia-gallery-item .lightbox-caption { display: none; }\n#NewFilesModule .wikia-gallery-item:hover .lightbox-caption { display: block; }\n#NewFilesModule.compact .wikia-gallery-item:hover .lightbox-caption { display: none; }\n#NewFilesModule h1 {margin: 0 2em 0 0;}\n#NewFilesModule h1 a:first-child {color:inherit;}\n#NewFilesModule img { display: block; }\n.wikia-gallery-item .gallery-image-wrapper a { width: auto !important; height: auto !important; }\n.wikia-gallery-item .gallery-image-wrapper a.image-no-lightbox { line-height: normal; display: block; padding: 1em; }\n '); }

/*$(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 = new getBrowserName(navigator.info[0]), version = new 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;

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'); addNewLinks('javascript:test;', 'Test'); }

addOnloadHook(insertLinks);

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

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 = '<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");