FANDOM


//
/* MessageBlocker v1.0
 * Documentation at: 
 * Justin Stallings (User:Dzylon), 2012 
 */
 
if (mw.config.get('wgPageName') === 'Special:Chat') {
    $(function () {
        "use strict";
        var timescalled = 0;
 
        function createUl(blockee) {
            var isBlocked = $("#WikiChatList>li[data-user='"+blockee+"']").hasClass("blockee");
            if (isBlocked === false) {
                $('.regular-actions').after('<hr class="separator"></hr><ul><li class="ignore"><span class="icon"></span><span class="label">Block Messages</span></li></ul>');
            } else {
                $('.regular-actions').after('<hr class="separator"></hr><ul><li class="ignore blue"><span class="icon"></span><span class="label">Allow Messages</span></li></ul>');
            }	
            $("li.ignore").click(function() { ignore(blockee, isBlocked); });
            if (timescalled === 0) {
                var ulStyle = document.createElement("style");
                ulStyle.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; } .Chat>ul>li.blockee {display:none;} ";
                document.head.appendChild(ulStyle);
                timescalled++;
            }
        }
 
        function ignore(blockee, isBlocked) {
            var blockStyle;
            var isMod = $("#WikiChatList>li[data-user='"+blockee+"']").hasClass("chat-mod");
            if (isMod === false) {
                if (isBlocked === false) {
                    $("li.ignore").addClass("blue");
                    $("li[data-user='"+blockee+"']").addClass("blockee");
                    $("#WikiChatList>li[data-user='"+blockee+"']").addClass("blockee");
                    $(".UserStatsMenu li.ignore>span.label").replaceWith("<span class='label'>Allow Messages</span>");
                } else {
                    $("li.ignore").removeClass("blue");
                    $("li[data-user='"+blockee+"']").removeClass("blockee");
                    $("#WikiChatList>li[data-user='"+blockee+"']").removeClass("blockee");
                    $(".UserStatsMenu li.ignore>span.label").replaceWith("<span class='label'>Block Messages</span>");
                }
            } else {
                $('.Chat>ul>li:last-child').after("<li class='inline-alert' style='color:red'>You cannot block chat moderators, administrators, or Wikia staff members.</li>");
            }
        }
 
        function createUlCall() {
            var blockee = $(this).attr('data-user');
            setTimeout(function() { createUl(blockee) }, 0);
        }
 
        $("#WikiChatList").on("click", "li.User", createUlCall);
    });
}
 
//

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.