Last active
December 17, 2017 15:38
-
-
Save G33kDude/4ef48d78fde6cb07490a1c1de3ba79d0 to your computer and use it in GitHub Desktop.
Userscript to add a "Dismiss All" button to the Blackboard Learn updates page
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 Blackboard Dismiss All Updates | |
// @namespace https://github.com/G33kDude | |
// @version 0.1 | |
// @description Adds a "Dismiss All" button to the Blackboard Learn updates page | |
// @author GeekDude | |
// @match *://*.blackboard.com/webapps/streamViewer/streamViewer* | |
// @grant none | |
// @update https://gist.github.com/G33kDude/4ef48d78fde6cb07490a1c1de3ba79d0/raw/BlackboardDismissAll.user.js | |
// ==/UserScript== | |
var dismiss = document.createElement("a"); | |
dismiss.href = "#"; | |
dismiss.innerText = "Dismiss All"; | |
dismiss.style.marginLeft = "1em"; | |
dismiss.style.position = "absolute"; | |
dismiss.style.top = "23px"; | |
dismiss.style.right = "60px"; | |
dismiss.style.zIndex = 13; | |
dismiss.onclick = function(e){ | |
e.preventDefault(); | |
if (!confirm("Are you sure you want to dismiss all notifications?")) | |
return; | |
var dis = document.querySelectorAll("a.browse[title=Dismiss]"); | |
for (var i = 0; i < dis.length; i++) { | |
dis[i].click(); | |
} | |
}; | |
var settings = document.getElementById("openSettings_alerts"); | |
settings.parentNode.insertBefore(dismiss, settings); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment