-
Notifications
You must be signed in to change notification settings - Fork 0
/
drei_calendar.js
46 lines (38 loc) · 1.31 KB
/
drei_calendar.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
43
44
45
46
function run()
{
run_count++;
var is_loading = document.querySelector(".fc-view-container span.loader");
if (run_count < 20 && is_loading) {
console.log('run: Calendar still loading')
window.setTimeout(run, config_timeout);
return;
}
var checkedOptions = ["A912", "RiskBusters", "Holidays SK", "Holidays AT"];
//var uncheckedOptions = ["Wholesale", "Billing", "Integration", "Testenvironment Calender"];
// Uncheck all options first
var elementsToDisable = document.querySelectorAll('.slicer .slItem input[type=checkbox]');
elementsToDisable.forEach(function(element) {
if (element && element.checked) {
element.click();
}
});
// Check options that we want checked
checkedOptions.forEach(function(str) {
element = document.querySelector('input[value="'+str+'"]');
if (element && !element.checked) {
element.click();
}
});
// Apply selected options
applyButton = document.querySelector('div.slApply a.applyLink')
if (applyButton) {
//Replace the inline javascript:void() with more reasonable string
applyButton.href = '#';
applyButton.click();
}
}
if (typeof config_timeout == 'undefined') {
var config_timeout = 1000;
}
var run_count=0;
run();