Update Compass QoL Enhancer to 1.24.4.

- Fix showing finish time for calendar events with an ampersand
This commit is contained in:
blankie 2023-12-06 11:39:10 +11:00
parent 50db62f7f5
commit 13bffe0d7f
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
// @name Compass QoL Enhancer
// @namespace blankie-scripts
// @match http*://*.compass.education/*
// @version 1.24.3
// @version 1.24.4
// @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
@ -415,7 +415,7 @@ function handleNewCalendarEvent(element, calendar) {
let finishString = unsafeWindow.Ext.util.Format.date(calendarData.finish, unsafeWindow.Compass.TIME_NO_PERIOD_FORMAT);
let textElement = a.querySelector(".ext-evt-bd") || a;
// yes, innerHTML. longTitleWithoutTime can apparently contain HTML. lets hope that startString and finishString don't
if (textElement.innerHTML === `${startString}: ${calendarData.longTitleWithoutTime}`) {
if (textElement.innerHTML.startsWith(`${startString}: `)) {
textElement.innerHTML = `${startString} - ${finishString}: ${calendarData.longTitleWithoutTime}`;
}