-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontent.js
More file actions
99 lines (82 loc) · 4.53 KB
/
content.js
File metadata and controls
99 lines (82 loc) · 4.53 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
(function() {
'use strict';
const tooltip = document.createElement('div');
tooltip.style.cssText = 'position: absolute; background-color: rgba(0, 0, 0, 0.69); color: white; padding: 5px; border-radius: 4px; display: none; z-index: 1000;';
document.body.appendChild(tooltip);
function showTooltip(text, x, y) {
tooltip.innerHTML = text;
tooltip.style.left = (x + 10) + 'px';
tooltip.style.top = (y + 10) + 'px';
tooltip.style.display = 'block';
}
function hideTooltip() {
tooltip.style.display = 'none';
}
function checkAndColorTiles() {
const jobTiles = document.querySelectorAll('div[data-test="job-tile-list"] section');
jobTiles.forEach(tile => {
var text = "";
const paymentStatus = tile.querySelector('small[data-test="payment-verification-status"]');
if (paymentStatus && paymentStatus.textContent.includes("Payment verified")) {
tile.style.backgroundColor = 'rgba(144, 238, 144, 0.3)';
}else{
text=text+"-Client payment method not verified<br>";
}
const proposals = tile.querySelector('strong[data-test="proposals"]');
if (proposals && proposals.textContent.includes("50+")) {
proposals.style.setProperty('color', 'rgba(230, 16, 16, 1)', 'important');
text=text+'-Too many aplicants <br>'
}
if (proposals && proposals.textContent.includes("20 to 50")) {
proposals.style.setProperty('color', 'rgba(230, 102, 16, 1)', 'important');
text=text+'-Too many aplicants <br>'
}
if (proposals && proposals.textContent.includes("15 to 20")) {
proposals.style.setProperty('color', 'rgba(230, 123, 16, 1)', 'important');
text=text+'-Too many aplicants <br>'
}
if (proposals && proposals.textContent.includes("10 to 15")) {
proposals.style.setProperty('color', 'rgba(230, 173, 16, 1)', 'important');
}
if (proposals && proposals.textContent.includes("10 to 15")) {
proposals.style.setProperty('color', 'rgba(230, 209, 16, 1)', 'important');
}
if (proposals && proposals.textContent.includes("5 to 10")) {
proposals.style.setProperty('color', 'rgba(109, 230, 16, 1)', 'important');
}
if (proposals && proposals.textContent.includes("than 5")) {
proposals.style.setProperty('color', 'rgba(16, 230, 23, 1)', 'important');
}
const spent = tile.querySelector('span[data-test="formatted-amount"]');
if (spent && spent.textContent.trim() === "$0") {
spent.style.setProperty('color', 'rgba(230, 16, 16, 1)', 'important');
text=text+'-Client has $0 spent <br>'
}
else if (spent && spent.textContent.includes('+')) {
spent.style.setProperty('color', 'rgba(109, 230, 16, 1)', 'important');
}else{
spent.style.setProperty('color', 'rgba(230, 173, 16, 1)', 'important');
}
const connects = tile.querySelector('strong[data-test="connect-price"]');
if (connects && connects.textContent.startsWith('16')) {
connects.style.setProperty('color', 'rgba(230, 16, 16, 1)', 'important');
}
const posted = tile.querySelector('span[data-test="posted-on"]');
if (posted && posted.textContent.includes('hours')&&posted.textContent.trim().split(" ")[0]>1) {
posted.style.setProperty('color', 'rgba(230, 209, 16, 1)', 'important');
}
else if (posted && ((posted.textContent.includes('hours')&&posted.textContent.trim().split(" ")[0]>3)||!posted.textContent.includes('minutes') ) ) {
posted.style.setProperty('color', 'rgba(230, 102, 16, 1)', 'important');
text=text+'-Too old <br>';
}else{
posted.style.setProperty('color', 'rgba(16, 230, 23, 1)', 'important');
}
tile.addEventListener('mouseover', (event) => {
const tooltipText = text;
showTooltip(tooltipText, event.pageX, event.pageY);
});
tile.addEventListener('mouseout', hideTooltip);
});
}
setInterval(checkAndColorTiles, 1000);
})();