Todoist enhancer

Todoist.com differnt enhancements

As of 2015-05-21. See the latest version.

// ==UserScript==
// @name         Todoist enhancer
// @namespace    https://todoist.com/app
// @version      0.2
// @description  Todoist.com differnt enhancements
// @copyright    plesk, 2015
// @match        https://todoist.com/app*
// ==/UserScript==

//TODO Font size according task priority

//Array with labels parameters
var label_style = new Array(); 
// 0 - Label name
// 1 - Text color
// 2 - Background color

j = label_style.length;
label_style[j] = new Array();
label_style[j][0] = "letter";                           
label_style[j][1] = "white";        
label_style[j][2] = "orangered"; 

j = label_style.length;
label_style[j] = new Array();
label_style[j][0] = "call";                           
label_style[j][1] = "white";        
label_style[j][2] = "red"; 

j = label_style.length;
label_style[j] = new Array();
label_style[j][0] = "control";                           
label_style[j][1] = "blue";        
label_style[j][2] = "lightgreen"; 


// Changing labels colour
function colour_labels(){ 
    var labels = document.getElementsByClassName("label");
    var i;
    for (i = 0; i < labels.length; i++){
        if (labels[i].className == "label"){
            label_style.forEach(function(ls){
                if(labels[i].innerText == ls[0]){
                    labels[i].innerText = labels[i].innerText.toUpperCase();
                    labels[i].style.color = ls[1];
                    labels[i].style.backgroundColor = ls[2];
                } 
            })
        }
    }
}

setInterval(colour_labels, 1000);
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

一年攒够 12 元

云驰互联

云驰互联