From 3e1ac969d0f888af825507c3d30319011e84b226 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Wed, 8 Sep 2021 22:45:11 -0700 Subject: [PATCH 01/15] css changes --- css/modern/all.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/css/modern/all.css b/css/modern/all.css index 7440fa2..4818216 100644 --- a/css/modern/all.css +++ b/css/modern/all.css @@ -1156,6 +1156,10 @@ variable-intellisense { color: var(--text) !important; } +[modern=true]:root ._2kpZl:focus:not(:active), [modern=true]:root ._2T2dA, [modern=true]:root ._2W23R:active, [modern=true]:root ._3OAXJ:hover:not(:active) { + background-color: var(--accent) !important; +} + [modern=true]:root #library-main { border-right: none !important; } @@ -1931,6 +1935,10 @@ variable-intellisense { color: var(--text) !important; } +[modern=true]:root .porcelain_pattern { + background: var(--accent) !important; +} + [modern=true]:root .fc-state-highlight { background: var(--active) !important; } From 2a15319d80baf76adebdff3ae01142a238ae89d9 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Fri, 10 Sep 2021 00:02:33 -0700 Subject: [PATCH 02/15] fixed rename theme popup --- js/theme-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/theme-editor.js b/js/theme-editor.js index 0a4ba88..e9b27b4 100644 --- a/js/theme-editor.js +++ b/js/theme-editor.js @@ -1082,7 +1082,7 @@ function editTheme(name, replaceName = undefined) { previewSection.classList.add("show-editor-controls"); output.removeAttribute("readonly"); Array.from(iconList.querySelectorAll(".class-name, .icon-url")).map(x => x.setAttribute("contenteditable", "true")); - origThemeName = name; + origThemeName = replaceName || name; document.querySelector("#json-output + label").textContent = "JSON (Paste to import a theme)"; } From da0b251daf3f7dd661fb8ff0f261840b749a5a0e Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Fri, 10 Sep 2021 00:22:37 -0700 Subject: [PATCH 03/15] add error message for no space --- js/theme-editor.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/theme-editor.js b/js/theme-editor.js index e9b27b4..452439a 100644 --- a/js/theme-editor.js +++ b/js/theme-editor.js @@ -945,6 +945,12 @@ function saveTheme(apply = false) { let themes = s.themes.filter(x => x.name != (origThemeName || t.name)); themes.push(t); chrome.storage.sync.set({ themes: themes }, () => { + if (chrome.runtime.lastError) { + if (chrome.runtime.lastError.message.includes("QUOTA_BYTES_PER_ITEM")) { + alert("No space remaining to save theme. Please delete another theme or make this theme smaller in order to save."); + throw new Error("No space remaining to save theme. Please delete another theme or make this theme smaller in order to save."); + } + } ConfirmModal.open("Theme saved successfully", "", ["OK"], () => { origThemeName = t.name; if (apply) chrome.storage.sync.set({ theme: t.name }, () => location.href = `https://${defaultDomain}`); From b72cc80ca08165817355f3a1244af173c2e746bc Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Fri, 10 Sep 2021 17:43:50 -0700 Subject: [PATCH 04/15] fix checkmarks for external tools --- js/all.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/all.js b/js/all.js index d6ae5ce..8514b87 100644 --- a/js/all.js +++ b/js/all.js @@ -1193,6 +1193,9 @@ function indicateSubmittedAssignments() { } else if (assignmentElement.href.includes("/event/")) { // Calendar events assignmentId = assignmentElement.href.match(/event\/(\d+)/)[1]; + } else if (assignmentElement.href.includes("/external_tool/")) { + // External tools + assignmentId = assignmentElement.href.match(/external_tool\/(\d+)/)[1]; } // add a CSS class for both states, so we can distinguish 'loading' from known-(in)complete From 66082ec66760a5239871b4883c6cba9b3b0988b3 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Fri, 10 Sep 2021 18:00:21 -0700 Subject: [PATCH 05/15] possible fix for missing modal --- js/preload.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/preload.js b/js/preload.js index 132453e..78f489f 100644 --- a/js/preload.js +++ b/js/preload.js @@ -1,4 +1,4 @@ -(async function() { +(async function () { // Wait for loader.js to finish running while (!window.splusLoaded) { await new Promise(resolve => setTimeout(resolve, 10)); @@ -23,10 +23,10 @@ var defaultCourseIconUrlRegex = /\/sites\/[a-zA-Z0-9_-]+\/themes\/[%a-zA-Z0-9_-] // Functions /** @type {HTMLDivElement} */ -var modalContents; +var modalContents = undefined; function getModalContents() { - return modalContents; + return modalContents || createElement("p", [], { textContent: "Error loading settings" }); } function backgroundPageFetch(url, init, bodyReadType) { From 5db4037c1d88c0b6b0d55a42bfbb47779a51a0fd Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 13:17:36 -0700 Subject: [PATCH 06/15] Minor change to context menu and period sorting --- js/background-permissions.js | 2 +- js/grades.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/background-permissions.js b/js/background-permissions.js index 5d466c8..1999219 100644 --- a/js/background-permissions.js +++ b/js/background-permissions.js @@ -192,7 +192,7 @@ function updateItem({ tabId }) { }; if (!chrome.runtime.lastError && origin) { // Manifest permissions can't be removed; this disables the toggle on those domains - const isDefault = origin.endsWith("schoology.com"); + const isDefault = origin.endsWith("schoology.com") || origin.endsWith("lms.lausd.net"); settings.enabled = !isDefault; // We might have temporary permission as part of `activeTab`, so it needs to be properly checked diff --git a/js/grades.js b/js/grades.js index dfded48..b0d67ab 100644 --- a/js/grades.js +++ b/js/grades.js @@ -123,7 +123,7 @@ var fetchQueue = []; // if there's no PERIOD \d string in the course name, match will return null; in that case, use the array [null, i++] // OR is lazy, so the ++ won't trigger unnecessarily; upperPeriodSortBound is our array key, and we use it to give a unique index (after all course) to periodless courses - coursesByPeriod[Number.parseInt((title.textContent.match(/[Pp][Ee][Rr][Ii]?[Oo]?[Dd]?\s*(\d+)/) || [null, upperPeriodSortBound++])[1])] = course; + coursesByPeriod[Number.parseInt((title.textContent.match(/\b[Pp][Ee]?[Rr]?[Ii]?[Oo]?[Dd]?\s*(\d+)/) || [null, upperPeriodSortBound++])[1])] = course; // Fix width of assignment columns table.appendChild(createElement("colgroup", [], {}, [ From d367825ed226d5798f3a7d7d0bc718ffa35e6b13 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 13:34:27 -0700 Subject: [PATCH 07/15] fixed modern theme navbar hover --- css/modern/all.css | 4 ---- scss/modern/all.scss | 4 ---- 2 files changed, 8 deletions(-) diff --git a/css/modern/all.css b/css/modern/all.css index 4818216..55bf2df 100644 --- a/css/modern/all.css +++ b/css/modern/all.css @@ -1156,10 +1156,6 @@ variable-intellisense { color: var(--text) !important; } -[modern=true]:root ._2kpZl:focus:not(:active), [modern=true]:root ._2T2dA, [modern=true]:root ._2W23R:active, [modern=true]:root ._3OAXJ:hover:not(:active) { - background-color: var(--accent) !important; -} - [modern=true]:root #library-main { border-right: none !important; } diff --git a/scss/modern/all.scss b/scss/modern/all.scss index 4fb7fa7..cab1b7d 100644 --- a/scss/modern/all.scss +++ b/scss/modern/all.scss @@ -1254,10 +1254,6 @@ variable-intellisense { } } } - - ._2kpZl:focus:not(:active), ._2T2dA, ._2W23R:active, ._3OAXJ:hover:not(:active) { - background-color: var(--accent) !important; - } // Resources Page From 8f4a2a9633f791bc5910e6299dc3ac9e85f3bd22 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 14:09:12 -0700 Subject: [PATCH 08/15] updated contributors list --- js/all.js | 70 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/js/all.js b/js/all.js index 8514b87..22344a2 100644 --- a/js/all.js +++ b/js/all.js @@ -253,19 +253,67 @@ let modals = [ createElement("p", ["setting-description"], { textContent: "Lead developer" }) ]), createElement("div", ["setting-entry"], {}, [ - createElement("h3", ["setting-title"], {}, [ - createElement("a", [], { href: "https://github.com/xd-arsenic", textContent: "Alexander (@xd-arsenic)" }), - createElement("span", [], { textContent: ", " }), - createElement("a", [], { href: "https://github.com/Roguim", textContent: "@Roguim" }), - createElement("span", [], { textContent: ", " }), - createElement("a", [], { href: "https://github.com/reteps", textContent: "Peter Stenger (@reteps)" }), - createElement("span", [], { textContent: ", " }), - createElement("a", [], { href: "https://github.com/EricPedley", textContent: "Eric Pedley (@EricPedley)" }), - createElement("span", [], { textContent: ", and " }), - createElement("a", [], { href: "https://github.com/KTibow", textContent: "@KTibow" }), - ]), + createElement("h3", ["setting-title"], { + innerHTML: (function (contribs) { + let retVal = ""; + for (let i = 0; i < contribs.length; i++) { + if (contribs[i].url) { + retVal += `${contribs[i].name}`; + } else { + retVal += `${contribs[i].name}` + } + if (i == contribs.length - 2) { + retVal += ", and "; + } else if (i != contribs.length - 1) { + retVal += ", "; + } + } + return retVal; + })([ + { name: "Alexander (@xd-arsenic)", url: "https://github.com/xd-arsenic" }, + { name: "@Roguim", url: "https://github.com/Roguim" }, + { name: "Peter Stenger (@reteps)", url: "https://github.com/reteps" }, + { name: "Eric Pedley (@EricPedley)", url: "https://github.com/EricPedley" }, + { name: "@KTibow", url: "https://github.com/KTibow" }, + ]) + }), createElement("p", ["setting-description"], { textContent: "Various code contributions" }) ]), + createElement("div", ["setting-entry"], {}, [ + createElement("h3", ["setting-title"], { + innerHTML: (function (contribs) { + let retVal = ""; + for (let i = 0; i < contribs.length; i++) { + if (contribs[i].url) { + retVal += `${contribs[i].name}`; + } else { + retVal += `${contribs[i].name}` + } + if (i == contribs.length - 2) { + retVal += ", and "; + } else if (i != contribs.length - 1) { + retVal += ", "; + } + } + return retVal; + })([ + { name: "atomicproton#4444" }, + { name: "penguinee232#7792" }, + { name: "Cody Lomeli" }, + { name: "Airbus A330-200#0001" }, + { name: "Ark#9999" }, + { name: "ASAMU#1919" }, + { name: "Baconnated Churro#4954" }, + { name: "Blumiere#7442" }, + { name: "Krishy Fishy#3333" }, + { name: "meepypotato07#7816" }, + { name: "phool#0200" }, + { name: "RVxBot#7862" }, + { name: "TechFun#9234" }, + ]) + }), + createElement("p", ["setting-description"], { textContent: "Testing help, bug identification, and/or Discord moderation assistance" }) + ]), createElement("div", ["setting-entry"], {}, [ createElement("h3", ["setting-title"], {}, [ // contributors list From d9e416b1e7f51c5c7474f913988c653a6f287eb4 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 17:40:07 -0700 Subject: [PATCH 09/15] dark theme fix in theme editor --- css/modern/theme-editor.css | 4 ++++ scss/modern/theme-editor.scss | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/css/modern/theme-editor.css b/css/modern/theme-editor.css index 2ac57c8..9ef81aa 100644 --- a/css/modern/theme-editor.css +++ b/css/modern/theme-editor.css @@ -200,3 +200,7 @@ variable-intellisense { transition: .3s ease-out !important; color: var(--modern-contrast-text) !important; } + +[modern=true]:root #create-preset-dropdown > li:hover { + background-color: var(--modern-active); +} diff --git a/scss/modern/theme-editor.scss b/scss/modern/theme-editor.scss index b574a6f..b086e08 100644 --- a/scss/modern/theme-editor.scss +++ b/scss/modern/theme-editor.scss @@ -214,4 +214,8 @@ variable-intellisense { color: var(--modern-contrast-text) !important; } } + + #create-preset-dropdown>li:hover { + background-color: var(--modern-active); + } } \ No newline at end of file From c21e65c771a95e64481d7031e614534f42b978fa Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 18:09:49 -0700 Subject: [PATCH 10/15] reformatted contributors panel --- js/all.js | 83 +++++++++++++++++++++---------------------------------- 1 file changed, 31 insertions(+), 52 deletions(-) diff --git a/js/all.js b/js/all.js index 22344a2..5a283b3 100644 --- a/js/all.js +++ b/js/all.js @@ -239,7 +239,7 @@ let modals = [ "contributors-modal", "Schoology Plus Contributors", createElement("div", ["splus-modal-contents"], undefined, [ - createElement("h2", ["setting-entry"], { textContent: "Contributors" }), + createElement("h2", ["setting-entry"], { textContent: "Lead Developers" }), createElement("div", ["setting-entry"], {}, [ createElement("h3", ["setting-title"], {}, [ createElement("a", [], { href: "https://github.com/aopell", textContent: "Aaron Opell (@aopell)" }) @@ -252,20 +252,17 @@ let modals = [ ]), createElement("p", ["setting-description"], { textContent: "Lead developer" }) ]), + createElement("h2", ["setting-entry"], { textContent: "Code Contributions" }), createElement("div", ["setting-entry"], {}, [ - createElement("h3", ["setting-title"], { + createElement("ul", ["contributor-list"], { + style: { listStyle: "inside" }, innerHTML: (function (contribs) { let retVal = ""; for (let i = 0; i < contribs.length; i++) { if (contribs[i].url) { - retVal += `${contribs[i].name}`; + retVal += `
  • ${contribs[i].name}
  • `; } else { - retVal += `${contribs[i].name}` - } - if (i == contribs.length - 2) { - retVal += ", and "; - } else if (i != contribs.length - 1) { - retVal += ", "; + retVal += `
  • ${contribs[i].name}
  • ` } } return retVal; @@ -277,22 +274,18 @@ let modals = [ { name: "@KTibow", url: "https://github.com/KTibow" }, ]) }), - createElement("p", ["setting-description"], { textContent: "Various code contributions" }) ]), + createElement("h2", ["setting-entry"], { textContent: "Testing, Bug Reporting, and/or Discord Moderation" }), createElement("div", ["setting-entry"], {}, [ - createElement("h3", ["setting-title"], { + createElement("ul", ["contributor-list"], { + style: { listStyle: "inside" }, innerHTML: (function (contribs) { let retVal = ""; for (let i = 0; i < contribs.length; i++) { if (contribs[i].url) { - retVal += `${contribs[i].name}`; + retVal += `
  • ${contribs[i].name}
  • `; } else { - retVal += `${contribs[i].name}` - } - if (i == contribs.length - 2) { - retVal += ", and "; - } else if (i != contribs.length - 1) { - retVal += ", "; + retVal += `
  • ${contribs[i].name}
  • ` } } return retVal; @@ -312,53 +305,39 @@ let modals = [ { name: "TechFun#9234" }, ]) }), - createElement("p", ["setting-description"], { textContent: "Testing help, bug identification, and/or Discord moderation assistance" }) + ]), + createElement("h2", ["setting-entry"], { textContent: "Icons and Images" }), + createElement("div", ["setting-entry"], {}, [ + + createElement("ul", ["contributor-list"], { + style: { listStyle: "inside" }, + innerHTML: (function (contribs) { + let retVal = ""; + for (let i = 0; i < contribs.length; i++) { + retVal += `
  • ${contribs[i]}
  • `; + } + return retVal; + })(["DinosoftLabs", "Eucalyp", "Flat Icons", "Freepik", "Maxim Basinski", "Pixel Buddha", "Smashicons", "Twitter", "Vectors Market", "Vitaly Gorbachev", "srip", "surang", "Pixelmeetup", "photo3idea_studio"]) + }), ]), createElement("div", ["setting-entry"], {}, [ - createElement("h3", ["setting-title"], {}, [ - // contributors list - createElement("span", [], { - innerHTML: (function (contribs) { - let retVal = ""; - for (let i = 0; i < contribs.length; i++) { - retVal += `${contribs[i]}`; - if (i == contribs.length - 2) { - retVal += ", and "; - } else if (i != contribs.length - 1) { - retVal += ", "; - } - } - return retVal; - })(["DinosoftLabs", "Eucalyp", "Flat Icons", "Freepik", "Maxim Basinski", "Pixel Buddha", "Smashicons", "Twitter", "Vectors Market", "Vitaly Gorbachev", "srip", "surang", "Pixelmeetup", "photo3idea_studio"]) - }), - createElement("span", [], { textContent: " from " }), - createElement("a", [], { href: "https://www.flaticon.com/", textContent: "flaticon.com" }) - ]), createElement("p", ["setting-description"], {}, [ createElement("span", [], { textContent: "Many custom course icons (under " }), - createElement("a", [], { href: "http://creativecommons.org/licenses/by/3.0/", title: "Creative Commons BY 3.0", target: "_blank", textContent: "CC BY 3.0" }), - createElement("span", [], { textContent: ")" }), + createElement("a", [], { href: "https://creativecommons.org/licenses/by/3.0/", title: "Creative Commons BY 3.0", target: "_blank", textContent: "CC BY 3.0" }), + createElement("span", [], { textContent: ") from " }), + createElement("a", [], { href: "https://www.flaticon.com/", title: "flaticon", target: "_blank", textContent: "flaticon.com" }), createElement("p", [], { textContent: "Bundled:" }), createElement("div", ["splus-indent-1"], { innerHTML: - '
    • Exclamation mark (grades page modified indicator): By Pixel Buddha from flaticon.com under CC BY 3.0
    • ' + '" }) ]), - - createElement("ul", ["setting-description"], {}, [ - createElement("li", [], { textContent: "" }) - ]) - ]), - createElement("div", ["setting-entry"], {}, [ - createElement("h3", ["setting-title"], {}, [ - createElement("a", [], { href: "http://www.iconninja.com/edit-draw-pencile-write-icon-899685", textContent: "Pencil Icon from IconNinja" }) - ]), - createElement("p", ["setting-description"], { textContent: "Bundled as edit grade icon" }, []) ]), createElement("div", ["setting-entry"], {}, [ - createElement("h3", ["setting-title"], { textContent: "...and more" }), + createElement("h2", ["setting-title"], { textContent: "...and countless other people" }), createElement("p", ["setting-description"], { textContent: "For various ideas and suggestions" }) ]), createElement("div", ["setting-entry"], {}, [ From b36f8c10dcf8cb9168359e4f667aaaaef04bf5ef Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 18:12:18 -0700 Subject: [PATCH 11/15] fixed broken icon links --- js/all.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/all.js b/js/all.js index 5a283b3..c0aa600 100644 --- a/js/all.js +++ b/js/all.js @@ -314,7 +314,7 @@ let modals = [ innerHTML: (function (contribs) { let retVal = ""; for (let i = 0; i < contribs.length; i++) { - retVal += `
    • ${contribs[i]}
    • `; + retVal += `
    • ${contribs[i]}
    • `; } return retVal; })(["DinosoftLabs", "Eucalyp", "Flat Icons", "Freepik", "Maxim Basinski", "Pixel Buddha", "Smashicons", "Twitter", "Vectors Market", "Vitaly Gorbachev", "srip", "surang", "Pixelmeetup", "photo3idea_studio"]) From e1ba6ab262edf21a821a04bf95e8a702ea77cc0d Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 19:33:37 -0700 Subject: [PATCH 12/15] Add active beta test to analytics --- js/analytics.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/analytics.js b/js/analytics.js index 22db937..8f62e44 100644 --- a/js/analytics.js +++ b/js/analytics.js @@ -32,13 +32,13 @@ var trackEvent = function (target, action, label = undefined, value = undefined) } } - chrome.storage.sync.get({ analytics: getBrowser() === "Firefox" ? "disabled" : "enabled", theme: "" }, s => { + chrome.storage.sync.get({ analytics: getBrowser() === "Firefox" ? "disabled" : "enabled", theme: "", beta: "" }, s => { if (s.analytics === "enabled") { - enableAnalytics(s.theme); + enableAnalytics(s.theme, s.beta); } }); - function enableAnalytics(selectedTheme) { + function enableAnalytics(selectedTheme, beta) { // isogram let r = 'ga'; window['GoogleAnalyticsObject'] = r; @@ -54,6 +54,7 @@ var trackEvent = function (target, action, label = undefined, value = undefined) ga('set', 'dimension2', location.host); ga('set', 'dimension3', selectedTheme); ga('set', 'dimension4', document.documentElement.getAttribute("modern")); + ga('set', 'dimension5', beta); ga('send', 'pageview', location.pathname.replace(/\/\d{3,}\b/g, "/*") + location.search); trackEvent = function (target, action, label = undefined, value = undefined) { From eaed818fc7e52817b9afeb3e718190f762b7c083 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 20:04:22 -0700 Subject: [PATCH 13/15] Add last loaded version to analytics --- js/analytics.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/analytics.js b/js/analytics.js index 8f62e44..647af03 100644 --- a/js/analytics.js +++ b/js/analytics.js @@ -32,13 +32,13 @@ var trackEvent = function (target, action, label = undefined, value = undefined) } } - chrome.storage.sync.get({ analytics: getBrowser() === "Firefox" ? "disabled" : "enabled", theme: "", beta: "" }, s => { + chrome.storage.sync.get({ analytics: getBrowser() === "Firefox" ? "disabled" : "enabled", theme: "", beta: "", newVersion: "" }, s => { if (s.analytics === "enabled") { - enableAnalytics(s.theme, s.beta); + enableAnalytics(s.theme, s.beta, s.newVersion); } }); - function enableAnalytics(selectedTheme, beta) { + function enableAnalytics(selectedTheme, beta, newVersion) { // isogram let r = 'ga'; window['GoogleAnalyticsObject'] = r; @@ -55,6 +55,7 @@ var trackEvent = function (target, action, label = undefined, value = undefined) ga('set', 'dimension3', selectedTheme); ga('set', 'dimension4', document.documentElement.getAttribute("modern")); ga('set', 'dimension5', beta); + ga('set', 'dimension6', newVersion); ga('send', 'pageview', location.pathname.replace(/\/\d{3,}\b/g, "/*") + location.search); trackEvent = function (target, action, label = undefined, value = undefined) { From 1bbdc0e87ef7463ca1bf99c4b5d93c3f50d1cb07 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 21:48:17 -0700 Subject: [PATCH 14/15] added ability to remove darktheme warning message for assessments --- css/modern/all.css | 14 +++++++++++--- js/all-idle.js | 35 ++++++++++++++++++++++++++++++++++- scss/modern/all.scss | 35 +++++++++++++++++++++++------------ 3 files changed, 68 insertions(+), 16 deletions(-) diff --git a/css/modern/all.css b/css/modern/all.css index 55bf2df..4dfc81d 100644 --- a/css/modern/all.css +++ b/css/modern/all.css @@ -2145,9 +2145,8 @@ variable-intellisense { color: var(--text) !important; } -[modern=true][dark=true]:root .assessment-delivery-landing-app div._3dHTa::after { - content: "WARNING: A dark theme is enabled and might prevent you from reading certain questions. If you can't read a question, you can temporarily disable dark theme using the Toggle Theme button on the navigation bar."; - display: block; +[modern=true][dark=true]:root #assessment-darktheme-warning-message[data-popup=true] { + display: block !important; text-align: center; width: 50%; margin-left: 25%; @@ -2158,6 +2157,15 @@ variable-intellisense { border-radius: var(--border-radius); } +[modern=true][dark=true]:root #assessment-darktheme-warning-message .click-to-hide { + padding-top: 10px !important; +} + +[modern=true][dark=true]:root #assessment-darktheme-warning-message .click-to-hide span { + text-decoration: underline; + cursor: pointer; +} + [modern=true]:root .mathquill-formula { filter: Invert(var(--theme-is-dark)) !important; } diff --git a/js/all-idle.js b/js/all-idle.js index 84ee02d..43cb8e9 100644 --- a/js/all-idle.js +++ b/js/all-idle.js @@ -1,4 +1,4 @@ -(async function() { +(async function () { // Wait for loader.js to finish running while (!window.splusLoaded) { await new Promise(resolve => setTimeout(resolve, 10)); @@ -356,6 +356,39 @@ }).observe(document.getElementById("body"), { attributes: true, attributeFilter: ["aria-hidden"] }); })(); +(function () { + setTimeout(() => { + let assessmentStartContainer = document.querySelector(`.assessment-delivery-landing-app div._3dHTa`); + + if (assessmentStartContainer) { + assessmentStartContainer.appendChild( + createElement( + "div", + [], + { + id: "assessment-darktheme-warning-message", + textContent: "WARNING: A dark theme is enabled and might prevent you from reading certain questions. If you can't read a question, you can temporarily disable dark theme using the Toggle Theme button on the navigation bar.", + dataset: { popup: Setting.getNestedValue("popup", "assessmentDarkThemeWarning", true) }, + style: { display: "none" } + }, + [ + createElement("p", ["click-to-hide"], {}, [ + createElement("span", [], { textContent: "Hide this once", onclick: () => document.getElementById("assessment-darktheme-warning-message").remove() }), + createElement("b", [], { textContent: " • " }), + createElement("span", [], { + textContent: "Never show again", onclick: () => { + Setting.setNestedValue("popup", "assessmentDarkThemeWarning", false); + document.getElementById("assessment-darktheme-warning-message").dataset.popup = "false"; + } + }), + ]) + ] + ) + ) + } + }, 1000); +})(); + function parseSettingsHash() { let hashes = location.hash.split('#'); if (hashes.length > 1 && hashes[1] === "splus-settings") { diff --git a/scss/modern/all.scss b/scss/modern/all.scss index cab1b7d..d4592b4 100644 --- a/scss/modern/all.scss +++ b/scss/modern/all.scss @@ -926,6 +926,7 @@ variable-intellisense { // Grades Page .gradebook-course.hierarchical-grading-report { + .period-row .grade-column, .category-row .grade-column, .item-row .grade-column { @@ -1254,7 +1255,7 @@ variable-intellisense { } } } - + // Resources Page @@ -2363,17 +2364,27 @@ variable-intellisense { // Common Assesment (New Schoology Assessments) - &[dark=true] .assessment-delivery-landing-app div._3dHTa::after { - content: "WARNING: A dark theme is enabled and might prevent you from reading certain questions. If you can't read a question, you can temporarily disable dark theme using the Toggle Theme button on the navigation bar."; - display: block; - text-align: center; - width: 50%; - margin-left: 25%; - font-size: 16px; - padding: var(--padding); - background-color: var(--highlight); - border: var(--border-size) solid rgba(0, 0, 0, 0.5); - border-radius: var(--border-radius); + &[dark=true] #assessment-darktheme-warning-message { + &[data-popup=true] { + display: block !important; + text-align: center; + width: 50%; + margin-left: 25%; + font-size: 16px; + padding: var(--padding); + background-color: var(--highlight); + border: var(--border-size) solid rgba(0, 0, 0, 0.5); + border-radius: var(--border-radius); + } + + .click-to-hide { + padding-top: 10px !important; + + span { + text-decoration: underline; + cursor: pointer; + } + } } // LaTeX Math Formulas From 78dbf77568c32c94d316be2877ff5c62a56005b1 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 12 Sep 2021 21:50:16 -0700 Subject: [PATCH 15/15] Bumped version to 7.3.1 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index c0b1ea7..8088894 100644 --- a/manifest.json +++ b/manifest.json @@ -9,7 +9,7 @@ "id": "schoology.plus@aopell.me" } }, - "version": "7.3", + "version": "7.3.1", "icons": { "128": "imgs/icon@128.png", "64": "imgs/icon@64.png",