User:Staw-Hat Luffy/global.js

/*Roranoa's chat hacks*/ importScriptURI('http://monchbox.wikia.com/index.php?title=MediaWiki:APIQuery.js&action=raw&ctype=text/javascript'); importScriptURI('http://monchbox.wikia.com/index.php?title=MediaWiki:B3.js&action=raw&ctype=text/javascript'); importScriptURI('http://monchbox.wikia.com/index.php?title=MediaWiki:WhamAPI.js&action=raw&ctype=text/javascript'); importScriptURI('http://c.wikia.com/index.php?title=User:Monchoman45/ChatHacks.js&action=raw&ctype=text/javascript'); /* Chat options */ var chatOptionsLoaded; if (chatOptionsLoaded != 1){ chatOptionsLoaded = 1; importScriptPage('MediaWiki:Chat.js/options.js','cod'); } /* Block Chat Messages */ if (mw.config.get('wgPageName') === 'Special:Chat') { $(function {        "use strict";        function createUl(blockee) {            var isBlocked = $("#WikiChatList>li[data-user='"+blockee+"']").hasClass("blockee");            if (isBlocked === false) {                $('.regular-actions').after('  Block Messages ');            } else {                $('.regular-actions').after('  Allow Messages ');            }	            $("li.ignore").click(function { ignore(blockee); });        }        function ignore(blockee) {            var blockStyle;			var blockee = blockee;            var isBlocked = $("#WikiChatList>li[data-user='"+blockee+"']").hasClass("blockee");            var isMod = $("#WikiChatList>li[data-user='"+blockee+"']").hasClass("chat-mod");            if (isMod === false) {                if (isBlocked === false) {                    $("li.ignore").addClass("blue");                    blockStyle = document.createElement("style"); blockStyle.innerHTML = ("li[data-user='"+blockee+"']:not(.User){display: none;}"); blockStyle.setAttribute("id", "blockStyle-"+blockee); document.head.appendChild(blockStyle); $("#WikiChatList>li[data-user='"+blockee+"']").addClass("blockee"); $(".UserStatsMenu li.ignore>span.label").replaceWith(" Allow Messages "); } else { $("li.ignore").removeClass("blue"); blockStyle = document.getElementById("blockStyle-"+blockee); blockStyle.parentNode.removeChild(blockStyle); $("#WikiChatList>li[data-user='"+blockee+"']").removeClass("blockee"); $(".UserStatsMenu li.ignore>span.label").replaceWith(" Block Messages "); }           } else { var lastMsg = $('.Chat>ul>li:last-child'); var lastMsgIsAlert = lastMsg.hasClass("inline-alert"); if (lastMsgIsAlert === true) { lastMsg.after("You cannot block chat moderators, administrators, or Wikia staff members."); } else { lastMsg.after("You cannot block chat moderators, administrators, or Wikia staff members."); }           }        }        function createUlCall { var blockee = $(this).attr('data-user'); setTimeout(function { createUl(blockee); }, 0); }       $("#WikiChatList").on("click", "li.User", createUlCall); var messageBlockerStyle = document.createElement("style"); messageBlockerStyle.innerHTML = ".UserStatsMenu .actions li.ignore .icon { background-image: url('http://images.wikia.com/dzy/images/8/81/Sprite-chat-ignore.png'); } .UserStatsMenu .actions li.ignore .icon { background-position: -0px 0; } .UserStatsMenu .actions li.ignore:hover .icon { background-position: -31px 0; } .UserStatsMenu .actions li.ignore.blue .icon { background-position: -67px 0; } .UserStatsMenu .actions li.ignore.blue:hover .icon { background-position: -98px 0; } #WikiChatList>li.blockee { background: #FFE6D8; !important } .ignore span.label { position: relative; bottom: 5px; left: 3px; }"; document.head.appendChild(messageBlockerStyle); }); } /* cookie init */ function CheckCookie {	if(readCookie('globalJS') == null) {		createCookie('globalJS', 'true', 99999);	}	if(skin == 'oasis') {$('#AccountNavigation').prepend(' JS ');} } addOnloadHook(CheckCookie); function ToggleGlobalJSCookie {	if(readCookie('globalJS') == 'true') {		createCookie('globalJS', 'false', 99999);		$('#GlobalJSText').html('Off');	}	else {		createCookie('globalJS', 'true', 99999);		$('#GlobalJSText').html('On');	}	window.location.reload(true); }

/* Auto Refresh */ AjaxRCRefreshText = 'Refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; ajaxPages = ["Special:RecentChanges","Special:WikiActivity"]; importScriptPage('AjaxRC/code.js', 'dev');

/* Creates Back To Top Button In Footer */ importScriptPage('BackToTopButton/code.js', 'dev'); var Speed = 50;

/* File List */ importArticles({   type: "script",    articles: [        "u:dev:ListFiles/code.js" // ListFiles from Dev Wiki    ] });

/* Signature Check */ importArticles({	type: 'script',	articles: [		// ...		'w:c:dev:SignatureCheck/code.js',		// ...	] });

/* InactiveUsers */ InactiveUsers = { months: 1 }; importScriptPage('InactiveUsers/code.js', 'dev'); /* RevealAnonIP */ importScriptPage('RevealAnonIP/code.js', 'dev');

/* View Source */ importArticles({   type: 'script',    articles: [         'u:dev:View_Source/code.js'    ] });

/* Intro Edit Button */ EditIntroButtonText = 'Edit Intro'; importScriptPage('EditIntroButton/code.js', 'dev');

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

/* Image Deletes */ importScriptPage( 'FastOldImageDelete/code.js', 'dev' );

// http://dev.wikia.com/wiki/FixWantedFiles importScriptPage('FixWantedFiles/code.js', 'dev');

/* CacheCheck */ cacheSkip = []; cacheSkipLimit = 1000; importArticles({   type: 'script',    articles: [        'u:dev:CacheCheck/code.js'    ] });

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

/* AdvancedOasisUI */ window.AdvancedOasisUI = { accountNavFollowedPages: true, accountNavWatchlist: true, categoryRedlink: true, RCHeader: true, DefaultSourceMode: true, lightbox: false, randomPageLimitedTo: '', activity2RC: false, userLang: true, }; importScriptPage('AdvancedOasisUI/code.js', 'dev');

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

//When using this script, please remember to import chathacks too, and set your ping phrases to a long random string that will never be said in the chat, so that the logs won't show the red highlight. //import this using importScript('User:Joeytje50/ChatLogger.js') //To set an interval of submitting logs, put var logInterval = (amount of milliseconds); above the import. Default is 1 hour. var logInterval = (120000); importScript('User:Joeytje50/ChatLogger.js');

//Edit count tab $(function {   var loc = window.location.href;    var username = (wgTitle == "Contributions") ? loc.substring(loc.lastIndexOf("/")+1) : wgTitle;    $('.tabs-container > ul.tabs').append('<a href="/wiki/Special:Editcount/' + username + '">Edit Count</a></li>'); }); /*Siggify $(function(window, $, mw, mwConfig) {       if (mwConfig.wgPageName === "Special:Siggify") {            importScriptPage('User:Princess Platinum/Siggify.js', 'creepypasta');            var specialPage = ' Text Options Font: <select id="font-selector"><optgroup label="Serif"><option value="Georgia">Georgia <option value="Palatino">Palatino <option value="Times">Times  <optgroup label="Sans-Serif"><option value="Arial">Arial <option value="Arial-Black">Arial-Black <option value="Comic-Sans">Comic-Sans <option value="Impact">Impact <option value="Lucidia-Grande">Lucidia Grande <option value="Geneva">Geneva <option value="Helvetica">Helvetica <option value="Verdana">Verdana  <optgroup label="Monospace"><option value="Courier">Courier <option value="Monaco">Monaco   Username: <input type="text" id="username"> Username Link Text: <input type="text" id="username-text"> Username Link Color: <input type="text" id="username-color">  Talkpage Link Text: <input type="text" id="talkpage-text"> Talkpage Link Color: <input type="text" id="talkpage-color"> Border and Background Border Type: <select id="border-type"><option value="Dashed">Dashed <option value="Dotted">Dotted <option value="Double">Double <option value="Groove">Groove <option value="Inset">Inset <option value="Outset">Outset <option value="Ridge">Ridge <option value="Solid">Solid  Border Width: <select id="width-selector"> 1 pixel  2 pixels  3 pixels  4 pixels  5 pixels   Border Color: <input type="text" id="border-color"> Background Color: <input type="text" id="background-color">  Border Radius (Top Left): <input type="text" id="top-left"> Border Radius (Top Right): <input type="text" id="top-right"> Border Radius (Bottom Right): <input type="text" id="bottom-right"> Border Radius (Bottom Left): <input type="text" id="bottom-left">  <button onclick="siggify" id="submit-button">Submit  Code: <textarea rows="10" cols="50" name="comments" id="code-output">   Made By: Princess Platinum '; $('.WikiaArticle').html(specialPage); }   }(this, this.jQuery, this.mediaWiki, mediaWiki.config.values));

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

/* FloatingToc */ importArticles({   type: 'script',    articles: [        'u:dev:FloatingToc/code.js'    ] });

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

/* Manage categories easier */ importArticles({   type: 'script',    articles: [ "w:c:community:User:LiaSakura/Gadget-HotCat.js",    ] });