User:ShermanTheMythran/wikia.js

/*! * jQuery Cookie Plugin v1.3 * https://github.com/carhartl/jquery-cookie * * Copyright 2011, Klaus Hartl * Dual licensed under the MIT or GPL Version 2 licenses. * http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/GPL-2.0 */ (function ($, document, undefined) {	var pluses = /\+/g;	function raw(s) {		return s;	}	function decoded(s) {		return decodeURIComponent(s.replace(pluses, ' '));	}	var config = $.cookie = function (key, value, options) {		// write		if (value !== undefined) {			options = $.extend({}, config.defaults, options);			if (value === null) {				options.expires = -1;			}			if (typeof options.expires === 'number') {				var days = options.expires, t = options.expires = new Date;				t.setDate(t.getDate + days);			}			value = config.json ? JSON.stringify(value) : String(value);			return (document.cookie = [ encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), options.expires ? '; expires=' + options.expires.toUTCString : '', // use expires attribute, max-age is not supported by IE options.path   ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join(''));		}		// read		var decode = config.raw ? raw : decoded;		var cookies = document.cookie.split('; ');		for (var i = 0, l = cookies.length; i < l; i++) {			var parts = cookies[i].split('=');			if (decode(parts.shift) === key) {				var cookie = decode(parts.join('='));				return config.json ? JSON.parse(cookie) : cookie;			}		}		return null;	};	config.defaults = {};	$.removeCookie = function (key, options) {		if ($.cookie(key) !== null) {			$.cookie(key, null, options);			return true;		}		return false;	}; })(jQuery, document);

/*Fixed Collapsible Header Toolbar - by ShermanTheMythran*/ //Code relies on jQuery Cookie Plugin $('.wikia-header-mask').before(' ▲ #HeaderCollapse{position:fixed;z-index:-1;right:10px;width:30px;margin:34px 0 0;background:white;color:black;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:black}.WikiaHeader{width:100% !important;position:fixed;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;transition:top .5s;-moz-transition:top .5s;-webkit-transition:top .5s;-o-transition:top .5s}.WikiaPage{top:10px;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('marginTop','-=37px'); $.cookie('headerCollapse','collapsed',{expires: 365}); }; var expandHeader = function { $('#HeaderCollapse').removeClass('collapsed').addClass('expanded').unbind.bind('click',collapseHeader); $('.WikiaHeader').css('marginTop','+=37px'); $.removeCookie('headerCollapse'); }; $('#HeaderCollapse').click(collapseHeader); var hcCookie = $.cookie('headerCollapse'); if(hcCookie == "collapsed") { $(collapseHeader); }

/*Fixed Collapsible Footer Toolbar - by ShermanTheMythran*/ //Code relies on jQuery Cookie Plugin $('.wikia-bar').before(' ▼ #FooterCollapse{position:absolute;z-index:-1;right:10px;width:30px;bottom:25px;background:white;color:black;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:black;}#FooterCollapse span{display:block;transition:transform .5s;-moz-transition:-moz-transform .5s;-webkit-transition:-webkit-transform .5s;-o-transition:-o-transform .5s}#WikiaPage{margin-bottom:25px}.WikiaBarWrapper{transition:bottom .5s;-moz-transition:bottom .5s;-webkit-transition:bottom .5s;-o-transition:bottom .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)}.WikiaBarCollapseWrapper,.WikiaBarWrapper .arrow{display:none} '); var collapseFooter = function { $('#FooterCollapse').removeClass('expanded').addClass('collapsed').unbind.bind('click',expandFooter); $('.WikiaBarWrapper').css('bottom','-25px'); $.cookie('footerCollapse','collapsed',{expires: 365}); }; var expandFooter = function { $('#FooterCollapse').removeClass('collapsed').addClass('expanded').unbind.bind('click',collapseFooter); $('.WikiaBarWrapper').css('bottom','0px'); $.removeCookie('footerCollapse'); }; $('#FooterCollapse').click(collapseFooter); $('.WikiaBarWrapper').css('bottom','0px'); var fcCookie = $.cookie('footerCollapse'); if(fcCookie == "collapsed") { $(collapseFooter); }

/*Header Toolbar TOC - by ShermanTheMythran*/ if (document.getElementById("toc") == null) { } else { $('.GlobalNavigation').append('Jump to... #toctitle{display:none}.tocnumber::before{content:"#"}.tocnumber::after{content:":"}.toc li{width:100% !important}'); $('.topNav.TOC .subnav').append( $('.toc') ); $('.toc ul').addClass('catnav').css('margin','0'); }