Update Compass QoL Enhancer to 1.26.0

- Add refresh button to learning tasks
This commit is contained in:
blankie 2024-02-07 14:20:12 +11:00
parent 4aec87e0eb
commit 25e4f6e593
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 17 additions and 1 deletions

View File

@ -2,7 +2,7 @@
// @name Compass QoL Enhancer
// @namespace blankie-scripts
// @match http*://*.compass.education/*
// @version 1.25.0
// @version 1.26.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
@ -203,6 +203,21 @@ if (LearningTasksDetailsWidgetNew) {
return taskGrid;
}
// Add refresh button to learning tasks
let originalInitTBar = LearningTasksDetailsWidgetNew.prototype.initTBar;
LearningTasksDetailsWidgetNew.prototype.initTBar = function() {
originalInitTBar.apply(this, arguments);
let widget = this;
let refreshButton = {
itemId: "refreshButton",
text: "Refresh",
handler: function() {
widget.taskStore.load();
}
};
this.tbar.splice(this.tbar.indexOf("->") + 1, 0, refreshButton);
};
}
// Automatically add (and remove) the currently open learning task to the URL

View File

@ -50,6 +50,7 @@ A userscript that adds small but useful features for Compass. Features are:
- Learning tasks now being links (you can ctrl-click them)
- Opening a learning task will automatically add its ID to the URL
- Learning tasks' grades and general visibility are now shown
- Add refresh button to learning tasks view
- The previous/next buttons and sessions dropdown are now links (you can now
use [Link Hints] and ctrl-click to open them)
- Class and news feed items can now be opened by simply clicking on their