Skip to content

Commit

Permalink
Merge pull request #297 from aopell/develop
Browse files Browse the repository at this point in the history
Version 7.6
  • Loading branch information
aopell authored Dec 8, 2022
2 parents 6c9c42d + 946aeea commit 0e8dbe1
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 10 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- [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)
Expand Down Expand Up @@ -247,6 +248,13 @@ Schoology Plus is equipped with a fully-featured theme editor, allowing you to c
- 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)
Expand Down
15 changes: 15 additions & 0 deletions css/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -996,3 +1003,11 @@ 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;
cursor: pointer;
}
12 changes: 8 additions & 4 deletions js/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
])
}),
]),
Expand Down Expand Up @@ -779,9 +783,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];
Expand All @@ -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
]);
Expand Down Expand Up @@ -1310,4 +1314,4 @@ function indicateSubmittedAssignments() {
setTimeout(indicateSubmitted, 1000);
}

Logger.debug("Finished loading all.js");
Logger.debug("Finished loading all.js");
37 changes: 33 additions & 4 deletions js/api-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,44 @@
]),
]),
]),
createElement("div", ["splus-permissions-close"], {}, [
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";
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');
} } ),
]),
])
]));

let submitButton = document.getElementById("edit-reveal") || document.getElementById("edit-request");
submitButton.parentElement.classList.add("splus-allow-access");
submitButton.value = "Allow Access";
let submitButton = null; //document.getElementById("edit-reveal") || document.getElementById("edit-request");
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!" }),

createElement("div", ["splus-permissions-section"], {}, [
createElement("a", ["splus-permissions-link"], { href: "https://schoologypl.us/docs/faq/api", textContent: "Click Here to Read More" })
])
])
);
} 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", [], {
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");
Expand All @@ -91,4 +120,4 @@
}
}),
]));
})();
})();
2 changes: 1 addition & 1 deletion js/grades.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"update_url": "https://schoologypl.us/firefox_updates.json"
}
},
"version": "7.5",
"version": "7.6",
"icons": {
"128": "imgs/[email protected]",
"64": "imgs/[email protected]",
Expand Down

0 comments on commit 0e8dbe1

Please sign in to comment.