Update Compass QoL Enhancer to 1.18.0

- Make links in Looking Ahead actual links
This commit is contained in:
blankie 2023-10-09 14:28:23 +11:00
parent 077ee05b00
commit 35268b251f
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,7 @@
// @name Compass QoL Enhancer
// @namespace blankie-scripts
// @match http*://*.compass.education/*
// @version 1.17.2
// @version 1.18.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
@ -91,6 +91,19 @@ if (NewsfeedItemWidget) {
}
}
// Make links in Looking Ahead actual links
let NewsfeedAlertItemWidget = getExtClass("Compass.widgets.NewsfeedAlertItemWidget");
if (NewsfeedAlertItemWidget) {
let original = NewsfeedAlertItemWidget.prototype.initComponent;
NewsfeedAlertItemWidget.prototype.initComponent = function() {
this.alertItem.Content = this.alertItem.Content.replaceAll(
/<a onclick="Compass\.postForm\('\/ActionCentre\/', { eventId:(\d+), attendeeId:(\d+)}\)"/gi,
"<a href=\"/Organise/Activities/Events/Event.aspx?eventId=$1&userId=$2\"",
);
original.apply(this, arguments);
};
}
// Automatically open learning tasks specified in the URL
let LearningTasksDetailsWidgetNew = getExtClass("Compass.widgets.LearningTasksDetailsWidgetNew");
if (LearningTasksDetailsWidgetNew) {

View File

@ -50,6 +50,8 @@ A userscript that adds small but useful features for Compass. Features are:
use [Link Hints] and ctrl-click to open them)
- Class and news feed items can now be opened by simply clicking on their
background
- Make links in Looking Ahead actual links (you can ctrl-click them and they
now work with [Link Hints])
- 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