lingyaobr / Cores customizaveis no novo chat UOL

// ==UserScript==
// @name         Cores customizaveis no novo chat UOL
// @namespace    http://www.yao-chat.ml
// @version      1.1
// @description  Adiciona uma seleção de cores customizaveis no novo chat da UOL
// @author       Ling Yao
// @match        http://batepapo.uol.com.br/beta/*
// @grant        none
// ==/UserScript==

var createCustomColor = function(){
    var customColor = $('<input type="color" id="color" ng-model="turing.color" ng-disabled="formSubmitted" class="ng-pristine ng-valid">');
    customColor.change(function(){
        var scope = angular.element(document.querySelector('form[name="roomLogin"]')).scope();
        var value = this.value;
        scope.$apply(function(){
            scope.turing.color = value;
        });
    });
    var listCustomColor = $('<li class="nickCustomColor" style="width: 160px"></li>');
    listCustomColor.append("Outra cor: ");
    listCustomColor.append(customColor);
    $('#nickColorList').append(listCustomColor);
}

var customColorInterval = setInterval(function(){
    if(window.hasOwnProperty('$') && document.querySelector('#nickColorList')){
       createCustomColor();
       clearInterval(customColorInterval);
    }
}, 100);