Skip to content

Instantly share code, notes, and snippets.

@xbenjii
Created October 19, 2018 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xbenjii/01470d9457c1bc92ea4e8e0d08e87641 to your computer and use it in GitHub Desktop.
Save xbenjii/01470d9457c1bc92ea4e8e0d08e87641 to your computer and use it in GitHub Desktop.
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