diff --git a/Compass QoL Enhancer.user.js b/Compass QoL Enhancer.user.js index b2b297c..866502f 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.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 diff --git a/README.md b/README.md index 9caee0c..f05f5aa 100644 --- a/README.md +++ b/README.md @@ -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