Created
September 22, 2021 23:52
-
-
Save roeyfuchs/89126119030212f9151a91d4932f5ec3 to your computer and use it in GitHub Desktop.
Open all unread messages button for OpenU messages system
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 Open all unread messages button for OpenU messages system | |
// @version 0.1 | |
// @description adding "Mark all as read" button in the messages system | |
// @author Roey | |
// @match https://sheilta.apps.openu.ac.il/Main/Messages/* | |
// @license MIT | |
// ==/UserScript== | |
(function() { | |
let place = document.querySelectorAll(".search-summary")[0] | |
let button = document.createElement('button') | |
button.innerHTML = "Open all unread messages" | |
button.onclick = OpenAll | |
place.appendChild(button) | |
function OpenAll(zEvent){ | |
let x = document.getElementsByClassName("panel-heading unread-message"); | |
let i; | |
for (i=0; i<x.length;i++){ | |
let j = x[i].getElementsByClassName("collapsed")[0]; | |
j.click() | |
} | |
} | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment