Created
March 6, 2017 08:32
-
-
Save kitze/6e71a4b86b88a6078592ab013e616c86 to your computer and use it in GitHub Desktop.
cleanup squads projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Clean up squads projects | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description keep only the projects you need | |
// @author Kitze | |
// @match https://squads.com/my-deliveries | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
console.log('cleaning up squads projects...'); | |
setTimeout(() => { | |
var projectsToKeep = ['swipeguide', 'ordina', 'circulator', 'boiler']; | |
var allProjects = document.querySelectorAll(".my-deliveries_i"); | |
var allProjectsArray = []; | |
[].forEach.call(allProjects, project => allProjectsArray.push(project)); | |
var projectsToRemove = allProjectsArray.filter(project => !projectsToKeep.some(validProject => project.innerText.toLowerCase().indexOf(validProject) !== -1)); | |
projectsToRemove.forEach(project => project.style.display = 'none'); | |
}, 5000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment