MediaWiki:Wikia.js

/* Userpage Tags */ importScript('MediaWiki:Wikia.js/UserRightsIcons.js');

/* Refresh Activity */ importScript('MediaWiki:AjaxRC.js');

/* Countdown */ importScriptPage('Countdown/code.js', 'dev');

/* List of Duplicate Images */ importScriptPage('DupImageList/code.js', 'dev');

/* Inactive Userpage Tags */ importScriptPage('InactiveUsers/code.js', 'dev');

/* Easier Patrolling */ importScriptPage('AjaxPatrol/code.js', 'dev' );

/* Automatic Drop Downs */ importScriptPage('AutoEditDropdown/code.js', 'dev');

/* Disable Commenting on Old Blogs*/ window.LockOldBlogs = { expiryDays: 10, expiryMessage: "This blog has been archived, please don\'t comment." }; importScriptPage('LockOldBlogs/code.js','dev' );

/* Search Enhancements */ $('.Search .WikiaSearch input[name="search"]').attr('placeholder','Search this wiki'); /* Fix Project Namespace Titles */ $('.ns-4 .WikiaPageHeader > h1').html(wgTitle); $('.ns-4 .WikiaPageHeader > .tally').after(' ' + wgSiteName + ' page '); /* A Few Fixes */ $('#my-tools-menu').addClass('WikiaMenuElement'); $('.mediawiki').addClass(wgUserName);

/* Display Clock */ var refreshDate; function addDate { var UTCDate = ((new Date).toUTCString).replace("GMT", "(UTC)"); $('#showdate').empty.attr('title','Purge the server cache and update the contents of this page.').attr('style','text-decoration:none !important;').attr('href',window.location.href + '?action=purge').html(UTCDate.substring(5)); window.clearTimeout(refreshDate); refreshDate = window.setTimeout(addDate, 1000); } $(document).ready(function {  $(' ').appendTo('.WikiaBarWrapper .toolbar .tools');   addDate; }); /* Jammers */ $(document).ready(function {	var wgUserNamee = wgUserName.split(' ').join('_');	var $jammers = $('.jammers.' + wgUserNamee);	var $jammersX = $('.jammers:not(.' + wgUserNamee + ')');	$($jammers).show;	$($jammersX).remove; });

/* Open External Links in New Tabs */ $('.links a, .wikis a, a.external, .WikiNav > ul > li:last-child > .subnav-2 > li:first-child > .subnav-2a, .WikiNav > ul > li:last-child > .subnav-2 > li > .subnav-3 > li > .subnav-3a').attr('target', '_blank');

/* Fix for AdBlock users */ if($('#WikiaTopAds').css('display') != "block" && $('body').hasClass('wikinav2') ) { $('#WikiaHeader').after(' '); }

/*-Full Lia.js-*/

/*Search Enhancements - by ShermanTheMythran (special thanks to Lunarity)*/ mediaWiki.loader.load('jquery.ui.core', null, true); mediaWiki.loader.using('jquery.ui.core', function { "use strict"; $('body').on('keypress.WikiaSearchHack', function(ev) { if (ev.ctrlKey || ev.altKey || ev.metaKey || !ev.which || $(ev.target).is(':focusable')) { return; } ev.preventDefault; var $box = $('#WikiaSearch > input[type="text"]').focus; $box.val($box.val + (ev.key || String.fromCharCode(ev.charCode))); }); }); /*Hide Header Toolbar - by ShermanTheMythran*/ $('.wikia-header-mask').before(' ▲ #HeaderCollapse{position:absolute;z-index:-1;right:10px;width:30px;margin:34px 0 0;background:#CFD2DA;color:#305599;text-align:center;border-radius:0 0 5px 5px;-webkit-border-radius:0 0 5px 5px;cursor:pointer;border-width:0 2px 2px;border-style:solid;border-color:#91aacf;transition:margin .5s;-moz-transition:margin .5s;-webkit-transition:margin .5s;-o-transition:margin .5s}#HeaderCollapse span{display:block;transition:transform .5s;-moz-transition:-moz-transform .5s;-webkit-transition:-webkit-transform .5s;-o-transition:-o-transform .5s}.WikiaTopAds{top:34px;padding:20px 0 !important;z-index:-1;transition:top .5s;-moz-transition:top .5s;-webkit-transition:top .5s;-o-transition:top .5s}.WikiaPage{transition:top .5s;-moz-transition:top .5s;-webkit-transition:top .5s;-o-transition:top .5s}#HeaderCollapse.expanded span{transform:rotateY(0deg);-moz-transform:rotateY(0deg);-webkit-transform:rotateY(0deg);-ms-transform:scaleX(1);-o-transform:scaleX(1)}#HeaderCollapse.collapsed span{transform:rotateX(180deg);-moz-transform:rotateX(180deg);-webkit-transform:rotateX(180deg);-ms-transform:scaleY(-1);-o-transform:scaleY(-1)} '); var collapseHeader = function { $('#HeaderCollapse').removeClass('expanded').addClass('collapsed').unbind.bind('click',expandHeader); $('.WikiaHeader').css('position','absolute'); $.cookie('headerCollapse','collapsed',{expires: 365}); }; var expandHeader = function { $('#HeaderCollapse').removeClass('collapsed').addClass('expanded').unbind.bind('click',collapseHeader); $('.WikiaHeader').css('position','fixed'); $.cookie('headerCollapse',null); }; $('#HeaderCollapse').click(collapseHeader); var hcCookie = $.cookie('headerCollapse'); if(hcCookie == "collapsed") { $(collapseHeader); }

/*Hide Footer Toolbar - by ShermanTheMythran*/ $('.wikia-bar').before(' ▼ #FooterCollapse{position:absolute;z-index:-1;right:10px;width:30px;bottom:25px;background:#FDFDFD;color:#305599;text-align:center;border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0;cursor:pointer;border-width:2px 2px 0;border-style:solid;border-color:#91aacf;transition:bottom .5s;-moz-transition:bottom .5s;-webkit-transition:bottom .5s;-o-transition:bottom .5s}#FooterCollapse span{display:block;transition:transform .5s;-moz-transition:-moz-transform .5s;-webkit-transition:-webkit-transform .5s;-o-transition:-o-transform .5s}#FooterCollapse.expanded span{transform:rotateY(0deg);-moz-transform:rotateY(0deg);-webkit-transform:rotateY(0deg);-ms-transform:scaleX(1);-o-transform:scaleX(1)}#FooterCollapse.collapsed span{transform:rotateX(180deg);-moz-transform:rotateX(180deg);-webkit-transform:rotateX(180deg);-ms-transform:scaleY(-1);-o-transform:scaleY(-1)} '); var collapseFooter = function { $('#FooterCollapse').removeClass('expanded').addClass('collapsed').unbind.bind('click',expandFooter); $('.WikiaBarWrapper').css('position','absolute'); $.cookie('footerCollapse','collapsed',{expires: 365}); }; var expandFooter = function { $('#FooterCollapse').removeClass('collapsed').addClass('expanded').unbind.bind('click',collapseFooter); $('.WikiaBarWrapper').css('position','fixed'); $.cookie('footerCollapse',null); }; $('#FooterCollapse').click(collapseFooter); var fcCookie = $.cookie('footerCollapse'); if(fcCookie == "collapsed") { $(collapseFooter); } /*Magic Spells - by ShermanTheMythran*/ $(document).ready(function {       $('.WikiaBarWrapper .tools').append(' ▲ ▼ #MagicSpells{font-family:Helvetica;padding:2px 5px !important}.spell{display:inline-block;color:#305599 !important;margin:0 3px;vertical-align:top;cursor:pointer;transition:transform .5s,text-shadow .5s;-moz-transition:-moz-transform .5s,text-shadow .5s;-webkit-transition:-webkit-transform .5s,text-shadow .5s;-o-transition:-o-transform .5s,text-shadow .5s}.spell:hover{text-shadow:0 0 4px #305599} '); }); $('.scroll-top').click(function {	$('html, body').animate({scrollTop:0}, 'slow'); } ); $('.scroll-bottom').click(function {	$('html, body').animate({scrollTop: $(document).height}, 'slow'); } );

/*Various Fixes - by ShermanTheMythran*/ $('.WikiNav > ul > li:first-child').addClass('liActive'); $('.WikiNav > ul > li').mouseenter(function {	$('.WikiNav > ul > li').removeClass('liActive');	$(this).addClass('liActive'); } ); $('.WikiNav .subnav-3').parent.mouseenter(function {	$(this).addClass('liActive-2'); } ); $('.WikiNav .subnav-2 > li').mouseleave(function {	$('.WikiNav .subnav-2 > li').removeClass('liActive-2'); } );

/* Add a blog under Contribute (By Codyn320) - jQuery */ $(document).ready(function { $('.WikiHeader .buttons .contribute ul li').first.after('Add a Blog</li'); });