Greasy Fork is available in English.

Google Calendar Web Material

Google Calendar Web Material event flairs

19.04.2016 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

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

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

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

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @author        Balázs Orbán ([email protected])
// @name          Google Calendar Web Material
// @description   Google Calendar Web Material event flairs
// @match         https://calendar.google.com/*
// @version       1.0
// @namespace https://greasyfork.org/users/39251
// ==/UserScript==

var event_flair = [
  ["Work out", "Work", "url(https://goo.gl/6uktJo)"],
  ["Matematikk", "Fysikk", "url(https://goo.gl/PW8YmH)"],
  ["code", "programming", "url(https://goo.gl/uIiBCo)"],
  ["Run", "jog", "url(https://goo.gl/H7KTYU)"],
  ["Clean", "wash", "url(https://goo.gl/2A76Xn)"],
  ["Spanish", "German", "url(https://goo.gl/z1fy1s)"],
  ["Photography", "photo", "url(https://goo.gl/7LjvkO)"]
];

var target = document.querySelector('#gridcontainer');
var observer = new MutationObserver(function(mutations) {
  mutations.forEach(function(mutation) {
      console.log("changed");
      var select = document.querySelectorAll('.chip dd, .cbrdcc');
      for (i = 0; i < select.length; i++) {
          compareFunction = function(e) {
              return select[i].innerText.indexOf(e) !== -1;
          };
          for (j = 0; j < event_flair.length; j++) {
              if (event_flair[j].filter(compareFunction).length) {
                  select[i].style.backgroundImage = event_flair[j][event_flair[j].length - 1];
                  //TESTING//console.log(event_flair[j][0] + " " + event_flair[j][event_flair[j].length-1]);
              }
          }
      }
  });
});
var config = {
  attributes: true,
  childList: true,
  characterData: true
};
observer.observe(target, config);