Update Compass QoL Enhancer to 1.19.0

- Fix submitting links by pressing Enter
This commit is contained in:
blankie 2023-10-11 11:05:34 +11:00
parent 470e175c0d
commit 6fefb06b1f
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 17 additions and 2 deletions

View File

@ -2,7 +2,7 @@
// @name Compass QoL Enhancer
// @namespace blankie-scripts
// @match http*://*.compass.education/*
// @version 1.18.1
// @version 1.19.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
@ -503,6 +503,20 @@ document.body.addEventListener("click", function(event) {
}
}, {passive: true});
// Allow submitting links by pressing Enter instead of clicking the button
document.body.addEventListener("keydown", function(event) {
if (event.key !== "Enter" || event.target.localName !== "input" || event.target.type !== "text") {
return;
}
let window = unsafeWindow.Ext.getCmp(event.target.closest(".x-window").id);
if (!window || window.itemId !== "urlSelectionModal") {
return;
}
window.down("#saveButton").handler();
}, {passive: true});
// Stop the calendar and email buttons from opening in a new tab
for (let element of document.querySelectorAll("#productNavBar a[target='_blank']")) {
element.removeAttribute("target");

View File

@ -38,6 +38,7 @@ A userscript that adds small but useful features for Compass. Features are:
- Files and folders in Resources are now marked clickable ([Link Hints] can now
open them!)
- File upload buttons now work with [Link Hints]
- Fix submitting links by simply pressing Enter
- Links inside lesson plans now open in the parent tab by default instead of
creating a new tab
- Links submitted to learning tasks are now actual links (they now work with
@ -55,7 +56,7 @@ A userscript that adds small but useful features for Compass. Features are:
- The context menu that only says "Copy" is now suppressed
- Workaround a [Link Hints bug](https://github.com/lydell/LinkHints/issues/86)
that prevents it from seeing links inside lesson plans and such
- FIles and folders in Resources are now sorted alphabetically
- Files and folders in Resources are now sorted alphabetically
- The option to remember logins is unchecked by default
- The dashboard tab in a user's profile no longer points you to #dsh