Twitch Chroma Chat

Chroma Key Style Background for Twitch Chat

Stan na 01-04-2014. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

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

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name       Twitch Chroma Chat
// @author	   TraCeRMan
// @version    0.1
// @description  Chroma Key Style Background for Twitch Chat
// @include        http://*.twitch.tv/*
// @include        http://twitch.tv/*
// @exclude        http://www.twitch.tv/*/dashboard
// @exclude        http://www.twitch.tv/inbox*
// @exclude        http://www.twitch.tv/subscriptions*
// @exclude        http://store.twitch.tv
// @exclude        http://api.twitch.tv/*
// @exclude        https://api.twitch.tv/*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js
// @grant       GM_addStyle
// @copyright  2013+, tracerman
// @namespace https://greasyfork.org/users/59
// ==/UserScript==

var showCheck72 = 0;
var zNode14       = document.createElement ('div');

zNode14.innerHTML = '<button id="myButton14" type="button">'
                + 'C</button>';

zNode14.setAttribute ('id', 'myContainer14');
document.body.appendChild (zNode14);


    
//--- Activate the newly added button.
document.getElementById ("myButton14").addEventListener (
    "click", ButtonClickAction, false
);

function ButtonClickAction (zEvent) {
    
   /* $('.ember-chat').css("background", "#00ff00"); */
    
    if(showCheck72 == 1) {
    $('.ember-chat').css("background", "");
    $(".chat-messages").each(function () {
      this.style.setProperty("background", "00000", "important");
});
$("#myButton14").fadeTo("fast", 1).delay(200).css({"color":"green"});
    showCheck72 = 0;
}
else if(showCheck72 == 0) {
    $('.ember-chat').css("background", "#00ff00");
    $(".chat-messages").each(function () {
      this.style.setProperty("background", "#00ff00", "important");
});
$("#myButton14").fadeTo("fast", 0.5).delay(200).css({"color":"red"});
        showCheck72 = 1;
}
else {
    
}
    
}

//--- Style our newly added elements using CSS.
GM_addStyle ( multilineStr ( function () {/*!
    #myContainer14 {
        position:               absolute;
        bottom:                    0;
        right:					0;
        font-size:              10px;
        border:                 0px outset black;
        margin:                 0px;
        opacity:                10.0;
        z-index:                255;
        padding:                0px 1px;
    }

    #myButton14 {
        cursor:                 pointer;
       	background: 			transparent;
    	border: 				none !important;
        color:					green;
        font-weight:			bold;
    }

    
*/} ) );

function multilineStr (dummyFunc) {
    var str = dummyFunc.toString ();
    str     = str.replace (/^[^\/]+\/\*!?/, '') // Strip function () { /*!
            .replace (/\s*\*\/\s*\}\s*$/, '')   // Strip */ }
            .replace (/\/\/.+$/gm, '') // Double-slash comments wreck CSS. Strip them.
            ;
    return str;
}