forked from fewle/Ticketeer-Integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTicketeer.timer.user.js
43 lines (33 loc) · 964 Bytes
/
Ticketeer.timer.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// ==UserScript==
// @name Ticketeer timer
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author You
// @match https://www.ticketeer.se/*
// @grant none
// ==/UserScript==
$('body').append('<style>.activeTimer{background-image:linear-gradient(#2E3229,#92b06a);}')
checkDOMChange();
function checkDOMChange()
{
hasTimmers();
myTimeout = setTimeout(function(){ checkDOMChange(); }, 500);
}
var timeoutFader;
function hasTimmers()
{
if ($('.timer-active').length > 0)
{
var currentText = $("#TimerWatch h3").text();
var activeTimer = $('.timer-active').parents('li').find('.task-title').text();
if (currentText != activeTimer)
{
$('.timer-active').parents('li').addClass("activeTimer");
}
}
else
{
$('.task').removeClass("activeTimer");
}
}