diff --git a/js/all-idle.js b/js/all-idle.js index 36e3594..cb3d4cd 100644 --- a/js/all-idle.js +++ b/js/all-idle.js @@ -1,3 +1,6 @@ +while (!window.splusLoaded || !window.splusLoaded.has("all")) { } +Logger.debug("Started loading all-idle.js"); + // hack for course aliases (async function () { let applyCourseAliases = null; @@ -368,4 +371,6 @@ parseSettingsHash(); // Handle opening Schoology Plus Settings window.addEventListener("hashchange", event => { parseSettingsHash(); -}); \ No newline at end of file +}); + +Logger.debug("Finished loading all-idle.js"); \ No newline at end of file diff --git a/js/all.js b/js/all.js index d87df2c..e7d23a1 100644 --- a/js/all.js +++ b/js/all.js @@ -1,4 +1,5 @@ -while (!window.splusLoaded && !window.splusLoaded.has("preload")) { } +while (!window.splusLoaded || !window.splusLoaded.has("preload")) { } +Logger.debug("Started loading all.js"); // Inform user about theme { diff --git a/js/assessment.js b/js/assessment.js index 8a25ee6..4a6ea57 100644 --- a/js/assessment.js +++ b/js/assessment.js @@ -1,3 +1,6 @@ +while (!window.splusLoaded || !window.splusLoaded.has("all")) { } +Logger.debug("Started loading assessment.js"); + // modifications to Confirm Submission assessment popup (function () { /** @@ -78,4 +81,6 @@ childList: true, subtree: false }); -})(); \ No newline at end of file +})(); + +Logger.debug("Finished loading assessment.js"); \ No newline at end of file diff --git a/js/course.js b/js/course.js index 4184b1b..8711991 100644 --- a/js/course.js +++ b/js/course.js @@ -1,4 +1,5 @@ -while (!window.splusLoaded && !window.splusLoaded.has("all")) { } +while (!window.splusLoaded || !window.splusLoaded.has("all")) { } +Logger.debug("Started loading course.js"); let courseIdNumber; let courseSettingsCourseName; @@ -203,4 +204,6 @@ function restoreCourseDefaults() { location.reload(); }); } -} \ No newline at end of file +} + +Logger.debug("Finished loading course.js"); \ No newline at end of file diff --git a/js/courses.js b/js/courses.js index 8ce620a..66e825c 100644 --- a/js/courses.js +++ b/js/courses.js @@ -1,4 +1,5 @@ -while (!window.splusLoaded && !window.splusLoaded.has("all")) { } +while (!window.splusLoaded || !window.splusLoaded.has("all")) { } +Logger.debug("Started loading courses.js"); for (let course of document.querySelectorAll("li.course-item.list-item")) { let parent = course.parentNode; @@ -70,4 +71,6 @@ $.contextMenu({ if (location.search.includes("reorder")) { document.querySelector("#reorder-ui .link-btn").click(); -} \ No newline at end of file +} + +Logger.debug("Finished loading courses.js"); \ No newline at end of file diff --git a/js/grades.js b/js/grades.js index 5c59f2b..5a6c36b 100644 --- a/js/grades.js +++ b/js/grades.js @@ -1,4 +1,5 @@ -while (!window.splusLoaded && !window.splusLoaded.has("preload")) { } +while (!window.splusLoaded || !window.splusLoaded.has("all")) { } +Logger.debug("Started loading grades.js"); const timeout = ms => new Promise(res => setTimeout(res, ms)); const BUG_REPORT_FORM_LINK = "https://docs.google.com/forms/d/e/1FAIpQLScF1_MZofOWT9pkWp3EfKSvzCPpyevYtqbAucp1K5WKGlckiA/viewform?entry.118199430="; @@ -1583,3 +1584,5 @@ function processNonenteredAssignments() { }, sleep ? 3000 : 0); } } + +Logger.debug("Finished loading grades.js"); \ No newline at end of file diff --git a/js/home.js b/js/home.js index 239a497..5d30f50 100644 --- a/js/home.js +++ b/js/home.js @@ -1,4 +1,5 @@ -while (!window.splusLoaded && !window.splusLoaded.has("all")) { } +while (!window.splusLoaded || !window.splusLoaded.has("all")) { } +Logger.debug("Started loading home.js"); /** @typedef {{id:number,title:string,message:string,timestamp?:Date,icon?:string}} Broadcast */ @@ -104,4 +105,5 @@ if (homeFeedContainer && Setting.getValue("broadcasts") !== "disabled") { } indicateSubmittedAssignments(); -createQuickAccess(); \ No newline at end of file +createQuickAccess(); +Logger.debug("Finished loading home.js"); \ No newline at end of file diff --git a/js/mastery.js b/js/mastery.js deleted file mode 100644 index 39dfb61..0000000 --- a/js/mastery.js +++ /dev/null @@ -1,14 +0,0 @@ -let courses = document.getElementsByClassName("gradebook-course-title"); -let coursesByPeriod = []; - -for (let course of courses) { - coursesByPeriod[Number.parseInt(course.textContent.match(/PERIOD (\d)/)[1])] = course; -} - -if (Setting.getValue("orderClasses") == "period") { - for (let course of coursesByPeriod) { - if (course) { - course.parentElement.appendChild(course); - } - } -} \ No newline at end of file diff --git a/js/materials.js b/js/materials.js index 1b665e1..75d5766 100644 --- a/js/materials.js +++ b/js/materials.js @@ -5,6 +5,9 @@ "use strict"; +while (!window.splusLoaded || !window.splusLoaded.has("all")) { } +Logger.debug("Started loading materials.js"); + (async function () { let classId = window.location.pathname.match(/\/course\/(\d+)\/materials/)[1]; // ID of current course ("section"), as a string @@ -383,3 +386,5 @@ })().catch(reason => { Logger.error("Error running materials page modification script: ", reason); }); + +Logger.debug("Finished loading materials.js"); \ No newline at end of file diff --git a/js/page.js b/js/page.js index 0c2037f..c9ab685 100644 --- a/js/page.js +++ b/js/page.js @@ -1,3 +1,6 @@ +while (!window.splusLoaded || !window.splusLoaded.has("all")) { } +Logger.debug("Started loading page.js"); + // Adds an "Open in New Tab" link to /page pages which simply embed something. (function () { const iframe = document.querySelector('.s-page-summary iframe'); @@ -30,4 +33,4 @@ function processIframeSrc(rawLink) { return link.href; } -Logger.log("Loaded page script"); \ No newline at end of file +Logger.debug("Finished loading page.js"); \ No newline at end of file diff --git a/manifest.json b/manifest.json index 1430cf4..df86060 100644 --- a/manifest.json +++ b/manifest.json @@ -9,7 +9,7 @@ "id": "schoology.plus@aopell.me" } }, - "version": "7.2.1", + "version": "7.2.2", "icons": { "128": "imgs/icon@128.png", "64": "imgs/icon@64.png", @@ -193,16 +193,6 @@ ], "run_at": "document_end" }, - { - "matches": [ - "https://lms.lausd.net/mastery*", - "https://*.schoology.com/mastery*" - ], - "js": [ - "js/mastery.js" - ], - "run_at": "document_end" - }, { "matches": [ "https://lms.lausd.net/",