From 13bffe0d7f134eda57a952e9d8604f0d4ed9d7da Mon Sep 17 00:00:00 2001 From: blankie Date: Wed, 6 Dec 2023 11:39:10 +1100 Subject: [PATCH] Update Compass QoL Enhancer to 1.24.4. - Fix showing finish time for calendar events with an ampersand --- Compass QoL Enhancer.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Compass QoL Enhancer.user.js b/Compass QoL Enhancer.user.js index 9003028..8b1e2ad 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.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}`; }