Color Code Individual Google Tasks

Looks for specific key words and changes the background of the cell of a google task to a predefined color

Stan na 01-09-2017. 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           Color Code Individual Google Tasks
// @namespace      Tevi
// @description	   Looks for specific key words and changes the background of the cell of a google task to a predefined color
// @include        https://www.google.com/calendar/*
// @include        https://calendar.google.com/*
// @version        1.1
// @grant          none
// ==/UserScript==
var keyWords = ["workout", "exam","research","homework"];
var backgroundColors = ['#D6BD2D','#9E0000','#D67B5C','#1E8096'];

document.addEventListener('DOMNodeInserted', function() { 
	var checkBox = document.querySelectorAll('span.tc-icon');
	for (var J = checkBox.length-1;  J >= 0;  --J){
		var str = checkBox[J].parentNode.textContent.toString();
		for (var I = keyWords.length - 1; I>= 0; --I)
			if(str.toLowerCase().indexOf(keyWords[I].toLowerCase()) >= 0)
            			checkBox[J].parentNode.parentNode.style.background = backgroundColors[I];
	}
}, false);