Update Compass QoL Enhancer to 1.9.0

- Ctrl-clicking an activity in a user's learning tasks tab no longer collapses
everything else
This commit is contained in:
blankie 2023-08-11 14:57:24 +10:00
parent 86e3646fa2
commit 4f5bc106b7
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 14 additions and 1 deletions

View File

@ -2,7 +2,7 @@
// @name Compass QoL Enhancer // @name Compass QoL Enhancer
// @namespace blankie-scripts // @namespace blankie-scripts
// @match http*://*.compass.education/* // @match http*://*.compass.education/*
// @version 1.8.1 // @version 1.9.0
// @author blankie // @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 // @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 // @inject-into page
@ -150,6 +150,15 @@ function handlePanelItem(panel, panelItem, isDefault, tabToOpen) {
}); });
} }
function handleLearningTasksTable(element) {
// Make ctrl-clicking activities in a user's learning tasks tab no longer collapse everything else
for (let a of element.querySelectorAll(".x-grid-group-title a")) {
a.addEventListener("click", function(event) {
event.stopImmediatePropagation();
}, {passive: true});
}
}
function handleCKEditor(instance) { function handleCKEditor(instance) {
instance.on("contentDom", function() { instance.on("contentDom", function() {
let editable = instance.editable(); let editable = instance.editable();
@ -199,6 +208,8 @@ function handleNewNode(node, observer) {
for (let element of node.querySelectorAll("td, .x-tree-expander")) { for (let element of node.querySelectorAll("td, .x-tree-expander")) {
element.setAttribute("role", "button"); element.setAttribute("role", "button");
} }
} else if (node.localName === "table" && node.closest(".sel-learning-tasks-widget")) {
handleLearningTasksTable(node);
} else if (node.classList.contains("cke")) { } else if (node.classList.contains("cke")) {
let instance = unsafeWindow.CKEDITOR.instances[node.id.substring(4)]; let instance = unsafeWindow.CKEDITOR.instances[node.id.substring(4)];
handleCKEditor(instance); handleCKEditor(instance);

View File

@ -31,6 +31,8 @@ A userscript that adds small but useful features for Compass. Features include:
- File upload buttons now work with [Link Hints] - File upload buttons now work with [Link Hints]
- Links inside lesson plans now open in the parent tab by default instead of - Links inside lesson plans now open in the parent tab by default instead of
creating a new tab creating a new tab
- Ctrl-clicking an activity in a user's learning tasks tab no longer collapses
everything else
- The context menu that only says "Copy" is now suppressed - The context menu that only says "Copy" is now suppressed
- The option to remember logins is unchecked by default - The option to remember logins is unchecked by default