Skip to content

Commit

Permalink
Merge pull request #281 from aopell/develop
Browse files Browse the repository at this point in the history
Version 7.4.1
  • Loading branch information
aopell authored Mar 6, 2022
2 parents dda7fc2 + b057bbc commit d191bdc
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 20 deletions.
13 changes: 8 additions & 5 deletions css/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@

/* Drop down menus (grades, applications, and user menu) */

/* Kept old classes to remain compatible with older versions of Schoology */
.StandardHeader-header-drop-menu-YShpU,
.StandardHeader-header-drop-menu-YShpU {
.Header-header-drop-menu-3SaYV {
background-color: var(--hover-color) !important;
}

a.StandardHeader-header-drop-menu-YShpU:hover,
.StandardHeader-header-drop-menu-YShpU li a:hover {
.StandardHeader-header-drop-menu-YShpU li a:hover,
a.Header-header-drop-menu-3SaYV:hover,
.Header-header-drop-menu-3SaYV li a:hover {
background-color: var(--background-color) !important;
}

Expand Down Expand Up @@ -910,7 +913,7 @@ a._3_bfp {
}

#center-inner.splus-api-key-page #center-top .page-title,
#center-inner.splus-api-key-page #content-wrapper form p.description.warning,
#center-inner.splus-api-key-page #content-wrapper form p.description,
#center-inner.splus-api-key-page .submit-span-wrapper {
display: none;
}
Expand All @@ -920,7 +923,7 @@ a._3_bfp {
margin: 10px 0 !important;
}

#edit-reveal {
.splus-allow-access input {
width: 100%;
}

Expand Down Expand Up @@ -992,4 +995,4 @@ a._3_bfp {
padding: 0 10%;
list-style: disc !important;
list-style-position: inside !important;
}
}
2 changes: 2 additions & 0 deletions css/modern/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ variable-intellisense {
color: var(--contrast-text) !important;
}

[modern=true]:root .Header-header-button-1EE8Y,
[modern=true]:root .Header-header-button-active-GnvKh,
[modern=true]:root .StandardHeader-header-button-1562K,
[modern=true]:root [class*="StandardHeader-header-drop-menu-item-"],
[modern=true]:root [class*="StandardHeader-header-drop-menu-"] li a *,
Expand Down
32 changes: 18 additions & 14 deletions js/api-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,28 @@
(function () {
let currentKey = document.getElementById("edit-current-key");
let currentSecret = document.getElementById("edit-current-secret");
currentKey.parentElement.style.display = "none";
currentSecret.parentElement.style.display = "none";

if (currentSecret.value.indexOf("*") === -1) {
let key = currentKey.value;
let secret = currentSecret.value;
if (currentKey && currentSecret) {
// If API key has already been generated
currentKey.parentElement.style.display = "none";
currentSecret.parentElement.style.display = "none";

trackEvent("Change Access", "allowed", "API Key");
if (currentSecret.value.indexOf("*") === -1) {
let key = currentKey.value;
let secret = currentSecret.value;

Setting.setValue("apikey", key, () => {
Setting.setValue("apisecret", secret, () => {
Setting.setValue("apiuser", getUserId(), () => {
Setting.setValue("apistatus", "allowed", () => {
location.pathname = "/";
trackEvent("Change Access", "allowed", "API Key");

Setting.setValue("apikey", key, () => {
Setting.setValue("apisecret", secret, () => {
Setting.setValue("apiuser", getUserId(), () => {
Setting.setValue("apistatus", "allowed", () => {
location.pathname = "/";
});
});
});
});
});
}
}

let centerInner = document.getElementById("center-inner");
Expand Down Expand Up @@ -70,11 +74,11 @@
])
]));

let submitButton = document.getElementById("edit-reveal");
let submitButton = document.getElementById("edit-reveal") || document.getElementById("edit-request");
submitButton.parentElement.classList.add("splus-allow-access");
submitButton.value = "Allow Access";

submitButton.parentElement.insertAdjacentElement("afterend", createElement("div", ["splus-api-key-footer"], {style: {textAlign: "center"}}, [
submitButton.parentElement.insertAdjacentElement("afterend", createElement("div", ["splus-api-key-footer"], { style: { textAlign: "center" } }, [
createElement("a", [], {
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.");
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.4",
"version": "7.4.1",
"icons": {
"128": "imgs/[email protected]",
"64": "imgs/[email protected]",
Expand Down
2 changes: 2 additions & 0 deletions scss/modern/all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ variable-intellisense {
}
}

.Header-header-button-1EE8Y,
.Header-header-button-active-GnvKh,
.StandardHeader-header-button-1562K,
[class*="StandardHeader-header-drop-menu-item-"],
[class*="StandardHeader-header-drop-menu-"] li a *,
Expand Down

1 comment on commit d191bdc

@senoe
Copy link

@senoe senoe commented on d191bdc Mar 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.