Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enable podio calendar past 6 months
// ==UserScript==
// @name Podio Re-enable calendar
// @namespace https://www.prestigegifting.co.uk
// @version 0.1
// @description Podio has limited the calendar to 6 months, this re-enables it.
// @author Benjamin Fortune <ben@prestigegifting.co.uk>
// @match https://podio.com/calendar
// @grant none
// ==/UserScript==
(function() {
'use strict';
const config = { attributes: true, childList: false, subtree: false };
const node = () => document.querySelector('#fullcalendar-header .prev');
const removeDisabled = (el) => {
if(el.classList.contains('disabled')) {
el.classList.remove('disabled');
}
};
const observer = new MutationObserver((mutations, observer) => {
for(const mutation of mutations) {
if(mutation.type === 'attributes' && mutation.attributeName === 'class') {
removeDisabled(mutation.target);
}
}
});
const id = setInterval(() => {
console.log('Looking for el');
if(node() !== null) {
removeDisabled(node());
observer.observe(node(), config);
clearInterval(id);
}
}, 100);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.