Last active
December 21, 2018 19:25
-
-
Save lefte/978f3be2dc0297f34153fa9cca685876 to your computer and use it in GitHub Desktop.
BlueJeans Future Meeting Canceler
This file contains 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 BlueJeans Future Meeting Canceler | |
// @author Erik Hanson (erik.hanson@gmail.com) | |
// @version 1.0 | |
// @namespace https://gists.github.com/lefte/978f3be2dc0297f34153fa9cca685876 | |
// @grant none | |
// @run-at document-idle | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js | |
// @description Adds a "cancel meeting" link to every meeting, otherwise BlueJeans only allows you to cancel today's meetings, so you can't cancel future events | |
// @match https://*.bluejeans.com/scheduling/* | |
// ==/UserScript== | |
// What we want on every card | |
//<ul class="cancel-options-list"> | |
//<li class="cancel-option cancel-meeting-option urlSmall">Cancel Meeting</li> | |
//<li class="cancel-option cancel-series-option urlSmall">Cancel Series</li> | |
//</ul> | |
// What BlueJeans shows on all future days beyond today | |
//<ul class="cancel-options-list"> | |
//<li class="cancel-option cancel-series-option urlSmall">Cancel Series</li> | |
//</ul> | |
$(function() { | |
// Page checker, since GM loads before the page does | |
function isPageReady() { | |
if ($("#schedule-meeting:visible").length > 0) { | |
console.log("dom ready"); | |
console.log("cards: %o", $(".item-card-container")); | |
$(".item-card-container").click(function() { | |
console.log("card clicked"); | |
checkCards(); | |
}); | |
} else { | |
console.log("dom isn't really ready yet"); | |
setTimeout(isPageReady, 500); | |
} | |
} | |
// Re-check the cards, since the meeting links are only created after the card is clicked | |
function checkCards() { | |
$(".cancel-options-list").not(":has('.cancel-meeting-option')").prepend("<li class=\"cancel-option cancel-meeting-option urlSmall\">Cancel Meeting</li>"); | |
} | |
// Initialize | |
isPageReady(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment