ftv

try to take over the world!

اعتبارا من 19-10-2017. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         ftv
// @version      5.0.4
// @namespace    http://tampermonkey.net/
// @description  try to take over the world!
// @author       You
// @match https://www.youtube.com/live_chat?continuation=0ofMyAMmGiBDZzhLRFFvTFdIaEtTMjVFVEZsYWVqUWdBUSUzRCUzRDABaAE%253D
// @require http://code.jquery.com/jquery-2.1.4.min.js
// @require https://code.jquery.com/ui/1.12.1/jquery-ui.js
// @grant        none
// ==/UserScript==
$(document).ready(function(){
    var my= $("yt-img-shadow#avatar").find("img").attr("src").substr(22,6);
    add();
    $("#title").append("<img id='listbtn' style='cursor:pointer;width:24px;height:24px;' src='https://gaming.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f60e.svg' alt='過濾名單' >");
    $("body").append("<div id='list' style='border:1px #426487 solid;font-size:small;display:none;position:absolute;right:0px;z-index:999;background:#fff;'></div>");
    $("#listbtn").click(function(){$("#list").toggle(200);});
    $("#listbtn").mouseleave(function(){ $(this).attr("src","https://gaming.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f60e.svg");});
    $("#listbtn").mouseover(function(){ $(this).attr("src","https://gaming.youtube.com/s/gaming/emoji/72836fb0/emoji_u1f633.svg");});
    $("div#items").on("DOMNodeInserted",function(e){
        if(e.target.tagName == "SPAN" ){
            var a = e.target.parentNode.parentNode.firstChild.childNodes[0].src.substr(22,6);
            $("yt-live-chat-text-message-renderer").last().hide();
            var m = $("yt-live-chat-text-message-renderer").last().find("img#img");
            setTimeout(function(){
if($("[id='"+a+"']").html() === undefined){$(this).remove();}
                m.attr("it",a).attr("new","o").attr("ix",m.parents("yt-live-chat-text-message-renderer").attr("id").substr(30,10)).css({"cursor":"pointer"});
                var mp = $('.mp').map(function() {
                    return this.id;
                }).get().join('');
                if(mp.match(m.attr("it")) != m.attr("it") || m.attr("it") == my){
                    $("div#items").css("transform","translatey(-2px)");
                    $("div#items").css("transform","translatey(-2px)");
                    $("[it='"+a+"']").parents("yt-live-chat-text-message-renderer").slideDown(200);
                }else{
                    $("[id='"+a+"']").animate({opacity:'0'}).animate({opacity:'1'});
                    console.log($("[id='"+a+"']").html()+":"+m.parents("yt-live-chat-text-message-renderer").find("span#message").text());
                }
                m.last().one("click",function(){
                    // $("#list").append(m.attr("it")+"【");
                    $("#list").append("<div style='background:#666666;color:#fff;margin:1px;padding:1px;cursor:pointer;' class='mp' id='"+m.attr("it")+"'>"+m.parents("yt-live-chat-text-message-renderer").find("#author-name").html().substr(0,10)+"</div>");
                    $("[it='"+m.attr("it")+"']").parents("yt-live-chat-text-message-renderer").hide();
                    $(".mp").click(function(){$(this).remove();});
                });
            },600);
        }
    });
    function add(){
        $("yt-live-chat-text-message-renderer").find("img#img").each(function(){
            if(!$(this).attr("new")){
                $(this).css("cursor","pointer").attr("new","o").attr("it",$(this).attr("src").substr(22,6));
                $(this).on("click",function(){
                    $("#list").append("<div style='background:#666666;color:#fff;margin:1px;padding:1px;cursor:pointer;' class='mp' id='"+$(this).attr("it")+"'>"+$(this).parents("yt-live-chat-text-message-renderer").find("#author-name").html().substr(0,10)+"</div>");
                    $("[it='"+$(this).attr("it")+"']").parents("yt-live-chat-text-message-renderer").hide();
                    $(".mp").click(function(){$(this).remove();});
});
            }
            if($("#list").text().match(String($(this).attr("it")))){
                $(this).parents("yt-live-chat-text-message-renderer").hide();
            }
        });
    }
});