User:Lience/global.js

// Spoiler alerts // $(function{ localStorage.setItem("SiderailSpoilerWarningRead", "no"); });

// Something //

$(function {   // Wide-mode codeeditor    if($(".codeeditor").length > 0) var wideModeCodeeditor = setInterval(function {       if($(".codeeditor .editpage-widemode-trigger").length > 0) {           clearInterval(wideModeCodeeditor); $(".codeeditor .editpage-widemode-trigger").click; }   }, 100);    // Always view removed replies    $(".message-removed.hide").removeClass("hide");    // Empty delete reason    if(mw.config.get('wgAction') && mw.config.get('wgAction') === 'delete') $("#wpReason").val("");    /**     * Name:        Global navbar modifications     * Author:      KockaAdmiralac <1405223@gmail.com>     * Description: Modifies the global navbar to add useful buttons     */    var page = mw.config.get("wgPageName"),    globalLinks = {        "User": "Special:Mypage",        "Talk": "Special:Mytalk",        "Settings": "Special:Preferences",        "RC": "Special:RecentChanges",        "Log off": "Special:UserLogout?returnto=" + page,        "Contribs": "Special:Contributions/" + mw.config.get('wgUserName'),    }, linksContent = "";    if(mw.config.get("wgCityId") === "177")    {        globalLinks = $.extend(globalLinks, { "AL": "Special:AbuseLog", "NW": "Special:Newwikis", "Images": "Special:BlankPage/Images", "Global JS": "Special:Mypage/global.js", "Global CSS": "Special:Mypage/global.css" });   }    else if(mw.config.get("wgCityId") === "769303") globalLinks.AL = "Special:AbuseLog";    for(var prop in globalLinks) linksContent += "" + prop + "";    $(".global-navigation-container").append(linksContent);    /**     * Name:        Toggle side bar     * Author:      KockaAdmiralac <1405223@gmail.com>     * Des  cription: Adds a button for toggling the side bar     */    $("#WikiHeader .buttons").append('Toggle side bar ');	$("#ToggleSideBarButton").click(function {		if($("#WikiaRail").css("display") === "block") {			$("#WikiaMainContent").css({width: "100%"}); $("#WikiaRail").css({display: "none"}); }		else {			$("#WikiaMainContent").css({width: "calc(100% - 320px)"}); $("#WikiaRail").css({display: "block"}); }	}); });