User:Lil' Miss Rarity/sidebar.js

var sidebar = {};

sidebar.config = { background: $("#WikiaPageBackground").css("background-color"), noLoad: ["Special:Chat"], sbUrl: "http://community.wikia.com/api.php?action=parse&format=json&text=%7B%7BUser:" + mw.config.get("wgUserName") + "/sidebar%7D%7D" };

sidebar.htmlContent = "My Tools   ";

sidebar.funct = {};

sidebar.funct.init = function { if (!mw.config.get("skin") === ("oasis"||"wikia") &&        sidebar.config.noLoad.indexOf(mw.config.get("wgPageName")) > -1) { return; }   mw.util.addCSS("#sidebarWrapper{-moz-box-shadow:3px 3px 3px 0 rgba(50,50,50,.75);-webkit-box-shadow:3px 3px 3px 0 rgba(50,50,50,.75);box-shadow:3px 3px 3px 0 rgba(50,50,50,.75);height:89.1%;left:-12%;overflow:auto;position:fixed;padding:6px;top:5.5%;transition:left .5s;width:11%;z-index:999999999}#sidebarWrapper>div{font-size:150%;text-align:left}#sidebarWrapper>ul{list-type:none}#sidebarWrapper>ul>li{font-size:120%;paddin:0;margin:0}#sidebarTrigger:hover>#sidebarWrapper{left:0}#sidebarTrigger{background-color:transparent;height:91%;left:0;position:fixed;top:5.5%;width:12%;z-index:999888888}#sidebarList{list-style:none}#WikiaHeader{position:fixed;width:100%}#WikiaPage{margin-top:3%}"); $("body").append(sidebar.htmlContent); $("#sidebarWrapper").css("background-color", sidebar.config.background); sidebar.funct.loadSidebar; };

sidebar.funct.loadSidebar = function { $.ajax({       crossDomain: true,        url: sidebar.config.sbUrl,        type: "POST",	    dataType: "jsonp",        success: function(data) {            data = $(data["parse"]["text"]["*"]);            $("#sidebarList").html(data);        },	    error: function {            $("#sidebarList").html(" Can't Connect to Community Central ");        }    }); };

sidebar.funct.init;