From 6eafd7e5e8c390a79d8ebdcd1d648cb5c80b21b5 Mon Sep 17 00:00:00 2001 From: Saagar Jha Date: Sun, 28 Nov 2021 22:01:50 -0800 Subject: [PATCH 1/4] Add loader.js to the list of background scripts loader.js appears to be required by analytics.js. If loader.js doesn't exist the extension sits around firing a timer every ten milliseconds waiting for window.splusLoaded, which is highly inefficient and keeps the Chrome Renderer process using CPU in the background. --- manifest.json | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.json b/manifest.json index e130ab8..e48192c 100644 --- a/manifest.json +++ b/manifest.json @@ -49,6 +49,7 @@ "content_security_policy": "script-src 'self'; object-src 'self'", "background": { "scripts": [ + "js/loader.js", "js/analytics.js", "lib/js/analytics.js", "lib/js/purify.min.js", From 7b3dd64371e168f1564097bde360ca4c430e0d4d Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 16 Apr 2023 15:46:01 -0700 Subject: [PATCH 2/4] Some style updates --- css/all.css | 4 ++-- js/course.js | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/css/all.css b/css/all.css index 05cfd3c..32c37a0 100644 --- a/css/all.css +++ b/css/all.css @@ -452,7 +452,7 @@ section.sgy-card .sgy-card-lens img.injected-course-icon { *:not(.submit-span-wrapper)>input[type=button], *:not(.submit-span-wrapper)>input[type=submit] { - height: 29px !important; + height: 32px !important; vertical-align: middle !important; border: 2px solid var(--border-color) !important; background-color: var(--primary-color) !important; @@ -463,12 +463,12 @@ section.sgy-card .sgy-card-lens img.injected-course-icon { background-color: var(--hover-color) !important; } -.submit-span-wrapper, .submit-span-wrapper input[type=button], .submit-span-wrapper input[type=submit] { height: 25px !important; vertical-align: middle !important; color: var(--contrast-text-color) !important; + padding: 4px 8px !important; } .submit-span-wrapper, .submit-span-wrapper[style] { diff --git a/js/course.js b/js/course.js index 7586cc2..5b2f2f5 100644 --- a/js/course.js +++ b/js/course.js @@ -15,7 +15,10 @@ let courseSettingsCourseName; let img = createSvgLogo(); Object.assign(img.style, { verticalAlign: "middle", paddingLeft: "4px", width: "18px" }); button.prepend(img); - button.querySelector("input").style.paddingLeft = "4px"; + button.style.setProperty("height", "36px", "important"); + let buttonInput = button.querySelector("input"); + buttonInput.style.paddingLeft = "4px"; + buttonInput.style.setProperty("height", "36px", "important"); button.style.cursor = "pointer"; button.addEventListener("click", () => openModal("course-settings-modal", { courseId: document.location.href.match(/\/(\d+)\//)[1], courseName: document.querySelector(".page-title").textContent })); From 773ca97c455b1a8f3a8a74e9123c6b1c90853ee2 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 20 Aug 2023 11:05:55 -0700 Subject: [PATCH 3/4] fix issue importing settings --- js/preload.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/js/preload.js b/js/preload.js index 09c2f2d..c98b6cd 100644 --- a/js/preload.js +++ b/js/preload.js @@ -1152,22 +1152,22 @@ Setting.import = function () { try { let importedSettingsObj = JSON.parse(importedSettings); + + Setting.setValues(importedSettingsObj, () => { + trackEvent("button_click", { + id: "import-settings-success", + context: "Settings", + legacyTarget: "import-settings", + legacyAction: "successfully imported settings", + legacyLabel: "Setting" + }); + alert("Successfully imported settings. If Schoology Plus breaks, please restore defaults or reinstall. Reloading page.") + location.reload(); + }); } catch (err) { alert("Failed to import settings! They were probably malformed. Make sure the settings are valid JSON."); return; } - - Setting.setValues(importedSettingsObj, () => { - trackEvent("button_click", { - id: "import-settings-success", - context: "Settings", - legacyTarget: "import-settings", - legacyAction: "successfully imported settings", - legacyLabel: "Setting" - }); - alert("Successfully imported settings. If Schoology Plus breaks, please restore defaults or reinstall. Reloading page.") - location.reload(); - }); } } From 769eb44af9712b98727d6e77f1cca490ddc05f30 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 20 Aug 2023 18:07:10 -0700 Subject: [PATCH 4/4] fix styling issues for new interface; bump version --- css/all.css | 37 +++++++++++++++++++++++++++++++++++-- css/modern/all.css | 8 +++++--- manifest.json | 2 +- scss/modern/all.scss | 8 +++++--- 4 files changed, 46 insertions(+), 9 deletions(-) diff --git a/css/all.css b/css/all.css index 32c37a0..b3c51df 100644 --- a/css/all.css +++ b/css/all.css @@ -18,10 +18,28 @@ background-color: var(--primary-color) !important; } +nav li button._1Z0RM, +nav li a._1Z0RM { + background-color: var(--primary-color) !important; +} + +nav button._1wP6w, +nav a._1Z0RM { + color: var(--contrast-text-color) !important; +} + +nav button svg.KebabIcon-kebab-icon-2-N7X { + filter: Invert(1) !important; +} + ._2kpZl:focus:not(:active), ._2T2dA, ._2W23R:active, -._3OAXJ:hover:not(:active) { +._3OAXJ:hover:not(:active), +nav li button._1Z0RM:hover:not(:active), +nav li button._1Z0RM:focus:not(:active), +nav li a._1Z0RM:hover:not(:active), +nav li a._1Z0RM:focus:not(:active) { background-color: var(--hover-color) !important; } @@ -64,6 +82,7 @@ footer button { background-color: transparent !important; } +#site-navigation-footer > div._3W1Kw, footer._2T2dA { background-color: var(--primary-color) !important; } @@ -74,7 +93,18 @@ footer._2T2dA { background-color: var(--primary-color) !important; } -.use-custom-url #header>header nav>ul>li>a._2JX1Q { +/* This version is used for the old header style (pre 23/24 school year) */ +.use-custom-url #header>header nav>ul>li>a._2JX1Q:not(:has(> div._3UYz2)) { + background: var(--background-url) no-repeat !important; + background-image: var(--background-url) !important; + background-size: 160px !important; + background-position: center center !important; + height: 60px !important; + margin-top: 0 !important; +} + +/* This version is used for the new header style (23/24 school year) */ +.use-custom-url #header>header nav>ul>li>a._2JX1Q div._3UYz2 { background: var(--background-url) no-repeat !important; background-image: var(--background-url) !important; background-size: 160px !important; @@ -750,6 +780,9 @@ ul.tabs li a { } footer li a, +footer div button, +#copyright, +footer li.Footer-vertical-divider-3-9qQ::after, header li a, .splus-modal-footer-text a, body a.link-btn.active, diff --git a/css/modern/all.css b/css/modern/all.css index d53847d..812e8c1 100644 --- a/css/modern/all.css +++ b/css/modern/all.css @@ -274,7 +274,9 @@ variable-intellisense { [modern=true]:root body a.link-btn.active, [modern=true]:root div.courses-left-menu, [modern=true]:root .portfolio-list a.btn, -[modern=true]:root a._3_bfp { +[modern=true]:root a._3_bfp, +[modern=true]:root nav li a._1Z0RM, +[modern=true]:root nav li button._1Z0RM { color: var(--contrast-text) !important; } @@ -2325,7 +2327,7 @@ variable-intellisense { [modern=true]:root ._1IGEH:focus:not(:active), [modern=true]:root ._1oxpz:hover:not(:active), -[modern=true]:root ._1Z0RM, +[modern=true]:root #wrapper ._1Z0RM, [modern=true]:root .Dkh_K:active { background-color: var(--accent); color: var(--text); @@ -2357,7 +2359,7 @@ variable-intellisense { [modern=true]:root ._1IGEH:focus:not(:active), [modern=true]:root ._1oxpz:hover:not(:active), -[modern=true]:root ._1Z0RM, +[modern=true]:root #wrapper ._1Z0RM, [modern=true]:root .Dkh_K:active { background-color: var(--accent) !important; } diff --git a/manifest.json b/manifest.json index 913cfac..5c81211 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,7 @@ "update_url": "https://schoologypl.us/firefox_updates.json" } }, - "version": "7.8.1", + "version": "7.8.2", "icons": { "128": "imgs/icon@128.png", "64": "imgs/icon@64.png", diff --git a/scss/modern/all.scss b/scss/modern/all.scss index d7e2abd..6d89d40 100644 --- a/scss/modern/all.scss +++ b/scss/modern/all.scss @@ -305,7 +305,9 @@ variable-intellisense { body a.link-btn.active, div.courses-left-menu, .portfolio-list a.btn, - a._3_bfp { + a._3_bfp, + nav li a._1Z0RM, + nav li button._1Z0RM { color: var(--contrast-text) !important; } @@ -2558,7 +2560,7 @@ variable-intellisense { ._1IGEH:focus:not(:active), ._1oxpz:hover:not(:active), - ._1Z0RM, + #wrapper ._1Z0RM, .Dkh_K:active { background-color: var(--accent); color: var(--text); @@ -2596,7 +2598,7 @@ variable-intellisense { ._1IGEH:focus:not(:active), ._1oxpz:hover:not(:active), - ._1Z0RM, + #wrapper ._1Z0RM, .Dkh_K:active { background-color: var(--accent) !important; }