NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Trakt.tv Advanced Filtering
// @namespace openuserjs.org/users/Light
// @version 0.1
// @description Enables advanced filtering in Trakt.tv for free users
// @author Light
// @require https://code.jquery.com/jquery-3.2.1.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @match *://trakt.tv/*
// ==/UserScript==
var isFilterPanelOpen = false;
waitForKeyElements(
'.alert-vip-required',
removeVipAlert
);
function removeVipAlert(jNode) {
jNode.remove();
}
waitForKeyElements(
'a[href$="/vip/filtering"]',
activateOnClick
);
function activateOnClick(jNode) {
jNode.attr('href', '');
jNode.click(function () {
toggleFilterPanel();
return false;
});
}
function toggleFilterPanel() {
var frame = $('.frame').eq(0);
var filterPanel = $('.advanced-filters').eq(0);
if (!isFilterPanelOpen) {
frame.css('margin-left', '600px');
setTimeout(function() {
filterPanel.css('opacity', '1');
filterPanel.css('width', 'auto');
filterPanel.css('overflow', 'visible');
}, 500);
} else {
filterPanel.css('width', '0px');
filterPanel.css('opacity', '0');
frame.css('margin-left', '300px');
}
isFilterPanelOpen = !isFilterPanelOpen;
}