From 4f5bc106b7e3e5ce904bf0fea3f65074faa4739c Mon Sep 17 00:00:00 2001 From: blankie Date: Fri, 11 Aug 2023 14:57:24 +1000 Subject: [PATCH] Update Compass QoL Enhancer to 1.9.0 - Ctrl-clicking an activity in a user's learning tasks tab no longer collapses everything else --- Compass QoL Enhancer.user.js | 13 ++++++++++++- README.md | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Compass QoL Enhancer.user.js b/Compass QoL Enhancer.user.js index 0f8806e..0e2d750 100644 --- a/Compass QoL Enhancer.user.js +++ b/Compass QoL Enhancer.user.js @@ -2,7 +2,7 @@ // @name Compass QoL Enhancer // @namespace blankie-scripts // @match http*://*.compass.education/* -// @version 1.8.1 +// @version 1.9.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 @@ -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) { instance.on("contentDom", function() { let editable = instance.editable(); @@ -199,6 +208,8 @@ function handleNewNode(node, observer) { for (let element of node.querySelectorAll("td, .x-tree-expander")) { element.setAttribute("role", "button"); } + } else if (node.localName === "table" && node.closest(".sel-learning-tasks-widget")) { + handleLearningTasksTable(node); } else if (node.classList.contains("cke")) { let instance = unsafeWindow.CKEDITOR.instances[node.id.substring(4)]; handleCKEditor(instance); diff --git a/README.md b/README.md index 46bcbe6..325cb67 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ A userscript that adds small but useful features for Compass. Features include: - File upload buttons now work with [Link Hints] - Links inside lesson plans now open in the parent tab by default instead of 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 option to remember logins is unchecked by default