Update Compass QoL Enhancer to 1.12.0

- News feed items can now be opened by simply clicking on their background
This commit is contained in:
blankie 2023-08-25 21:59:29 +10:00
parent c0854ffcb7
commit ea7dcfd7dc
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 9 additions and 1 deletions

View File

@ -2,7 +2,7 @@
// @name Compass QoL Enhancer
// @namespace blankie-scripts
// @match http*://*.compass.education/*
// @version 1.11.0
// @version 1.12.0
// @author blankie
// @description A userscript that adds small but useful features for Compass, such as the ability to close windows by clicking on the background
// @inject-into page
@ -325,6 +325,13 @@ document.body.addEventListener("click", function(event) {
} else if (event.target.classList.contains("x-form-file-btn")) {
// Make Link Hints work with uploading files
event.target.querySelector("input[type=file]").click();
} else if (event.target.closest(".newsfeed-newsItem") && !event.target.closest("a")) {
// Expand news feed items by clicking on them
// the <a> check is to prevent expending by clicking on a link (say, to a file)
let seeMore = event.target.closest(".newsfeed-newsItem").querySelector(".newsfeed-newsItem-seeMoreCTA a");
if (seeMore) {
seeMore.click();
}
}
}, {passive: true});

View File

@ -39,6 +39,7 @@ A userscript that adds small but useful features for Compass. Features include:
everything else
- The previous/next buttons and sessions dropdown are now links (you can now
use [Link Hints] and ctrl-click to open them)
- News feed items can now be opened by simply clicking on their background
- The context menu that only says "Copy" is now suppressed
- The option to remember logins is unchecked by default