Showing/hiding sets of calendars
-
- Posts: 196
- Joined: September 23rd, 2018, 11:07 am
Showing/hiding sets of calendars
I have a significant number of calendars that I am accessing through Thunderbird. The problem is the following: with my current workflow sometimes I want a subset of calendars to be visible and some other times another set (e.g., "calendars to show while working", "calendars to see on vacation", etc.), and the rest of calendars hidden. Right now I need to go manually calendar by calendar and hide/show each one according to my preferences. Is there any way to facilitate this task? Any idea is welcome.
-
- Posts: 6403
- Joined: February 3rd, 2009, 6:29 pm
Re: Showing/hiding sets of calendars
You can simulate a click to a calendar checkbox to show/hide a calendar.
e.g.
<input type="checkbox" class="calendar-displayed" title="Show Home"/>
<input type="checkbox" class="calendar-displayed" title="Hide Holidays"/>
Or
Attribute selectors
http://developer.mozilla.org/docs/Web/C ... ors#Syntax
e.g.
<input type="checkbox" class="calendar-displayed" title="Show Home"/>
<input type="checkbox" class="calendar-displayed" title="Hide Holidays"/>
Code: Select all
(function () {
// show Home calendar
var input = document.querySelector('.calendar-displayed[title$="Home"]');
if (input.checked == false) input.click();
// hide Holidays calendar
var input = document.querySelector('.calendar-displayed[title$="Holidays"]');
if (input.checked == true) input.click();
})();
Code: Select all
(function () {
var inputs = [];
inputs.push(document.querySelector('.calendar-displayed[title$="Home"]'));
inputs.push(document.querySelector('.calendar-displayed[title$="Holidays"]'));
if (inputs[0].checked == false) {
// show Home calendar and hide Holidays calendar
if (inputs[0].checked == false) inputs[0].click();
if (inputs[1].checked == true) inputs[1].click();
} else {
// hide Home calendar and show Holidays calendar
if (inputs[0].checked == true) inputs[0].click();
if (inputs[1].checked == false) inputs[1].click();
}
})();
http://developer.mozilla.org/docs/Web/C ... ors#Syntax