From c7f1cc010119f20cc016c7aad6abfe80f4a8d190 Mon Sep 17 00:00:00 2001 From: jetline0 Date: Fri, 15 Apr 2022 00:04:20 -0400 Subject: [PATCH 1/7] Fix course catalog nicknames issue --- js/all.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/all.js b/js/all.js index 81f8c37..0c724af 100644 --- a/js/all.js +++ b/js/all.js @@ -778,9 +778,9 @@ let siteNavigationTileHelpers = { let courseAlias; if (cardData.parentElement.href) { - let courseLinkMatch = cardData.parentElement.href.match(/\/course\/(\d+)\/?$/); + let courseLinkMatch = cardData.parentElement.href.split("/"); if (courseLinkMatch) { - courseLinkMatch = courseLinkMatch[1]; + courseLinkMatch = courseLinkMatch.at(-2); } if (courseLinkMatch && Setting.getValue("courseAliases")) { courseAlias = Setting.getValue("courseAliases")[courseLinkMatch]; @@ -1309,4 +1309,4 @@ function indicateSubmittedAssignments() { setTimeout(indicateSubmitted, 1000); } -Logger.debug("Finished loading all.js"); \ No newline at end of file +Logger.debug("Finished loading all.js"); From edb1e9765059886f339f8546b5c4056bbd8b309e Mon Sep 17 00:00:00 2001 From: rhinolary <39052241+Roguim@users.noreply.github.com> Date: Thu, 3 Nov 2022 17:42:02 +1100 Subject: [PATCH 2/7] Added an API blocked message This will come up when the API is disabled by the user's school --- js/api-key.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/js/api-key.js b/js/api-key.js index 58517fd..298425c 100644 --- a/js/api-key.js +++ b/js/api-key.js @@ -75,8 +75,19 @@ ])); let submitButton = document.getElementById("edit-reveal") || document.getElementById("edit-request"); - submitButton.parentElement.classList.add("splus-allow-access"); - submitButton.value = "Allow Access"; + if(submitButton === null) { + let permElement = document.getElementsByClassName('splus-permissions-description')[0]; + permElement.append(createElement("br", [], {})); + permElement.append(createElement("br", [], {})); + permElement.append( + createElement("div", ["splus-permissions-section"], { style: "background-color: var(--error, #F44336); color: var(--contrast-text, white); padding: var(--padding, 5px); border-radius: var(--border-radius, 0px);" }, [ + createElement("span", [], { textContent: "It looks like your school or district has disabled API Key generation. Unfortunately, this means the above features will not work. The rest of Schoology Plus' features will still work, though!" }) + ]) + ); + } else { + submitButton.parentElement.classList.add("splus-allow-access"); + submitButton.value = "Allow Access"; + } submitButton.parentElement.insertAdjacentElement("afterend", createElement("div", ["splus-api-key-footer"], { style: { textAlign: "center" } }, [ createElement("a", [], { @@ -91,4 +102,4 @@ } }), ])); -})(); \ No newline at end of file +})(); From 175f9f754b02da7ae8e982ac53b94b0bb4267bd3 Mon Sep 17 00:00:00 2001 From: rhinolary <39052241+Roguim@users.noreply.github.com> Date: Thu, 3 Nov 2022 17:55:54 +1100 Subject: [PATCH 3/7] Added a button to close the API page This will let users use their API key --- css/all.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/css/all.css b/css/all.css index bade8dc..a6c1ae8 100644 --- a/css/all.css +++ b/css/all.css @@ -996,3 +996,10 @@ a._3_bfp { list-style: disc !important; list-style-position: inside !important; } + +.splus-permissions-close { + position: absolute; + left: 69%; + top: 5%; + font-size: xx-large; +} From fd8fa9602d6f1c79b68d9b47cc8612b2fcb01fb5 Mon Sep 17 00:00:00 2001 From: rhinolary <39052241+Roguim@users.noreply.github.com> Date: Thu, 3 Nov 2022 18:13:27 +1100 Subject: [PATCH 4/7] Added a button to close the API key page This can be used for students and staff to access their own API keys instead of it being blocked behind Schoology Plus. --- js/api-key.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/js/api-key.js b/js/api-key.js index 298425c..7194fbe 100644 --- a/js/api-key.js +++ b/js/api-key.js @@ -71,6 +71,19 @@ ]), ]), ]), + createElement("div", ["splus-permissions-close"], {}, [ + createElement("span", [], { textContent: "×", onclick: function() { + document.getElementsByClassName('splus-permissions-wrapper')[0].style.display = "none"; + currentKey.parentElement.style.display = "block"; + currentSecret.parentElement.style.display = "block"; + document.getElementsByClassName('splus-api-key-page')[0].classList.remove('splus-api-key-page'); + document.getElementsByClassName('splus-api-key-page')[0].classList.remove('splus-api-key-page'); + document.getElementsByClassName('splus-api-key-footer')[0].style.display = "none"; + let submitButton = document.getElementById("edit-reveal") || document.getElementById("edit-request"); + submitButton.value = "Reveal Existing Secret"; + submitButton.parentElement.classList.remove('splus-allow-access'); + } } ), + ]), ]) ])); From 30b5bbc6d8b6f032d3d127789f75d305b732fcda Mon Sep 17 00:00:00 2001 From: dsnsgithub <48170013+dsnsgithub@users.noreply.github.com> Date: Thu, 3 Nov 2022 18:57:54 -0700 Subject: [PATCH 5/7] fix minimum grade calculation --- js/grades.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/grades.js b/js/grades.js index f2154b7..cd395dc 100644 --- a/js/grades.js +++ b/js/grades.js @@ -690,7 +690,7 @@ var fetchQueue = []; let total = 0; let totalPercentWeight = 0; let catWeight = 0; // 0 to 1 - for (let category of perRow.parentElement.querySelectorAll(`.category-row[data-parent-id="${perRow.dataset.id}]"`)) { + for (let category of perRow.parentElement.querySelectorAll(`.category-row[data-parent-id="${perRow.dataset.id}"]`)) { let weightPercentElement = category.getElementsByClassName("percentage-contrib")[0]; if (!weightPercentElement) { continue; From 286d85ea01755fa7bc42c2423d335005efbf2dfb Mon Sep 17 00:00:00 2001 From: 9s2j6 <20372625+9s2j6@users.noreply.github.com> Date: Sat, 19 Nov 2022 14:05:40 -0700 Subject: [PATCH 6/7] Add custom domain instructions to README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 91cb6cd..07e2e8e 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ - [Schoology Plus Announcements](#schoology-plus-announcements) - [Schoology Plus Settings](#schoology-plus-settings) - [Theme Editor](#theme-editor) + - [Custom Domain Support](#custom-domain-support) - [Course Options](#course-options) - [Course Nicknames](#course-nicknames) - [Custom Grading Scales](#custom-grading-scales) @@ -232,6 +233,13 @@ Schoology Plus has customizable settings, including but not limited to: Schoology Plus is equipped with a fully-featured theme editor, allowing you to create your own custom theme. The theme editor allows you to preview your changes to the interface, including colors, logos, cursors, and custom icons. To learn more about the theme editor, see the [Theme Editor help page](/docs/themes). +### Custom Domain Support +Schoology Plus can be configured to work with your school's custom Schoology instance. Simply navigate to the homepage of your school's Schoology implementation, then right click the extension and select "Enable Schoolgy Plus on this domain" + +![Custom Domains](https://i.imgur.com/WYgCVES.png) + +*Image: The option to enable Schoology Plus for your school's domain can be found by right-clicking the extension.* + ## Course Options ![Course Options](https://i.imgur.com/NGqCxVc.png) From 946aeea076214682010ab06a3cc9b58e3662db12 Mon Sep 17 00:00:00 2001 From: Aaron Opell Date: Sun, 4 Dec 2022 12:12:03 -0800 Subject: [PATCH 7/7] Cleanup and bump version --- README.md | 16 ++++++++-------- css/all.css | 8 ++++++++ js/all.js | 6 +++++- js/api-key.js | 13 +++++++++---- manifest.json | 2 +- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 07e2e8e..7fa50ec 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,10 @@ - [Schoology Plus Announcements](#schoology-plus-announcements) - [Schoology Plus Settings](#schoology-plus-settings) - [Theme Editor](#theme-editor) - - [Custom Domain Support](#custom-domain-support) - [Course Options](#course-options) - [Course Nicknames](#course-nicknames) - [Custom Grading Scales](#custom-grading-scales) +- [Custom Domain Support](#custom-domain-support) - [Feedback and Support Discord](#feedback-and-support-discord) - [Contributing](#contributing) - [Contributors](#contributors) @@ -233,13 +233,6 @@ Schoology Plus has customizable settings, including but not limited to: Schoology Plus is equipped with a fully-featured theme editor, allowing you to create your own custom theme. The theme editor allows you to preview your changes to the interface, including colors, logos, cursors, and custom icons. To learn more about the theme editor, see the [Theme Editor help page](/docs/themes). -### Custom Domain Support -Schoology Plus can be configured to work with your school's custom Schoology instance. Simply navigate to the homepage of your school's Schoology implementation, then right click the extension and select "Enable Schoolgy Plus on this domain" - -![Custom Domains](https://i.imgur.com/WYgCVES.png) - -*Image: The option to enable Schoology Plus for your school's domain can be found by right-clicking the extension.* - ## Course Options ![Course Options](https://i.imgur.com/NGqCxVc.png) @@ -255,6 +248,13 @@ Schoology Plus can be configured to work with your school's custom Schoology ins - You can create custom grading scales for courses where the teacher does not have a grading scale set for the class. - This will be used to calculate letter grades for assignment categories and courses on the grades page +# Custom Domain Support +Schoology Plus can be configured to work with your school's custom Schoology instance. Simply navigate to the homepage of your school's Schoology implementation, then right click the extension and select "Enable Schoolgy Plus on this domain". This is necessary only if your school's Schoology site is running on a domain that does not end in `schoology.com`. See [this page](https://schoologypl.us/docs/faq/domain) for more information. + +![Custom Domains](https://i.imgur.com/WYgCVES.png) + +*Image: The option to enable Schoology Plus for your school's domain can be found by right-clicking the extension.* + # Feedback and Support Discord Schoology Plus has a Discord server where you can offer feature suggestions, report bugs, get support, or just talk with other Schoology Plus users. [Click here to join!](https://discord.schoologypl.us) diff --git a/css/all.css b/css/all.css index a6c1ae8..622852b 100644 --- a/css/all.css +++ b/css/all.css @@ -972,6 +972,13 @@ a._3_bfp { width: 400px; } +.splus-permissions-link { + text-align: center; + font-size: 14px; + color: white !important; + text-decoration: underline; +} + .splus-permissions-description strong { font-size: 16px; text-decoration: underline; @@ -1002,4 +1009,5 @@ a._3_bfp { left: 69%; top: 5%; font-size: xx-large; + cursor: pointer; } diff --git a/js/all.js b/js/all.js index 6e9b15a..f6b4bc7 100644 --- a/js/all.js +++ b/js/all.js @@ -272,6 +272,10 @@ let modals = [ { 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" }, + { name: "@FenyLabs", url: "https://github.com/FenyLabs" }, + { name: "@jetline0", url: "https://github.com/jetline0" }, + { name: "@dsnsgithub", url: "https://github.com/dsnsgithub" }, + { name: "@senoj26", url: "https://github.com/senoj26" }, ]) }), ]), @@ -808,7 +812,7 @@ let siteNavigationTileHelpers = { // stylistically equivalent to the other card data, in terms of our class list for the container element // FIXME: there's a stylistic incongruity between a nicknamed course in the dropdown and a non-nicknamed one let newCardDataChild = createElement("div", ["_36sHx", "_3M0N7", "fjQuT", "_1EyV_", "splus-coursesdropdown-nicknamed-dataset", "splus-addedtodynamicdropdown"], {}, [ - createElement("div", ["_1wP6w", "_23_WZ", "_2qcpH", "_3ghFm", "_17Z60", "_1Aph-", "gs0RB"], { textContent: courseAlias }), // stylized like section title + createElement("div", ["_3U8Br", "_1wP6w", "_23_WZ", "_2qcpH", "_3ghFm", "_17Z60", "_1Aph-", "gs0RB"], { textContent: courseAlias }), // stylized like section title createElement("div", ["_2wOCj", "xjR5v", "_2qcpH", "_17Z60", "_1Aph-", "gs0RB", "splus-coursealiasing-exempt"], { textContent: origCourseTitle.textContent + ": " + origSectionTitle.textContent }), // original full title, stylized like school name createElement("div", ["_2wOCj", "xjR5v", "_2qcpH", "_17Z60", "_1Aph-", "gs0RB"], { textContent: origSchoolTitle.textContent }) // school title, original styling and text ]); diff --git a/js/api-key.js b/js/api-key.js index 7194fbe..7295c0a 100644 --- a/js/api-key.js +++ b/js/api-key.js @@ -72,7 +72,7 @@ ]), ]), createElement("div", ["splus-permissions-close"], {}, [ - createElement("span", [], { textContent: "×", onclick: function() { + createElement("span", [], { textContent: "×", title: "Hide this message and show the original API key page (for developers)", onclick: function() { document.getElementsByClassName('splus-permissions-wrapper')[0].style.display = "none"; currentKey.parentElement.style.display = "block"; currentSecret.parentElement.style.display = "block"; @@ -87,14 +87,18 @@ ]) ])); - let submitButton = document.getElementById("edit-reveal") || document.getElementById("edit-request"); + let submitButton = null; //document.getElementById("edit-reveal") || document.getElementById("edit-request"); if(submitButton === null) { - let permElement = document.getElementsByClassName('splus-permissions-description')[0]; + let permElement = document.getElementsByClassName("splus-permissions-description")[0]; permElement.append(createElement("br", [], {})); permElement.append(createElement("br", [], {})); permElement.append( createElement("div", ["splus-permissions-section"], { style: "background-color: var(--error, #F44336); color: var(--contrast-text, white); padding: var(--padding, 5px); border-radius: var(--border-radius, 0px);" }, [ - createElement("span", [], { textContent: "It looks like your school or district has disabled API Key generation. Unfortunately, this means the above features will not work. The rest of Schoology Plus' features will still work, though!" }) + createElement("span", [], { textContent: "It looks like your school or district has disabled API Key generation. Unfortunately, this means the above features will not work. The rest of Schoology Plus' features will still work, though!" }), + + createElement("div", ["splus-permissions-section"], {}, [ + createElement("a", ["splus-permissions-link"], { href: "https://schoologypl.us/docs/faq/api", textContent: "Click Here to Read More" }) + ]) ]) ); } else { @@ -104,6 +108,7 @@ submitButton.parentElement.insertAdjacentElement("afterend", createElement("div", ["splus-api-key-footer"], { style: { textAlign: "center" } }, [ createElement("a", [], { + href: "#", textContent: "Deny Access", onclick: () => { alert("API key access was denied. Please keep in mind many Schoology Plus features will not work correctly with this disabled. You can change this at any time from the Schoology Plus settings menu."); trackEvent("Change Access", "denied", "API Key"); diff --git a/manifest.json b/manifest.json index 4d8dae7..97042ba 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,7 @@ "update_url": "https://schoologypl.us/firefox_updates.json" } }, - "version": "7.5", + "version": "7.6", "icons": { "128": "imgs/icon@128.png", "64": "imgs/icon@64.png",