Skip to content

Commit

Permalink
Merge pull request #249 from aopell/develop
Browse files Browse the repository at this point in the history
Numerous dark theme/checkmark fixes; temporary performance fix
  • Loading branch information
aopell authored Jan 17, 2021
2 parents 5358ae9 + b860463 commit 6656ca5
Show file tree
Hide file tree
Showing 13 changed files with 168 additions and 23 deletions.
10 changes: 8 additions & 2 deletions css/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,12 @@ a._3_bfp {
cursor: pointer;
}

.splus-mark-completed-check .upcoming-subevents-block .splus-completed-check-indicator {
position: absolute;
right: 16px;
top: 0;
}

.splus-mark-completed-check .splus-assignment-notcomplete .splus-completed-check-indicator::after {
color: var(--muted-text) !important;
content: "▢";
Expand All @@ -773,11 +779,11 @@ a._3_bfp {

/* "loading" state to avoid vertical scrolling when transitioning from 'forced completed' to 'query state' */
/* animated spin. default center,center rotate origin appears to be slightly off, but not likely to be noticeable for <1s load times. */
.splus-mark-completed-check .course-event:not(.splus-assignment-complete):not(.splus-assignment-notcomplete) .splus-completed-check-indicator {
.splus-mark-completed-check .upcoming-event:not(.upcoming-subevents-block):not(.splus-assignment-complete):not(.splus-assignment-notcomplete) .splus-completed-check-indicator {
animation: rotation 0.8s infinite linear;
}

.splus-mark-completed-check .course-event:not(.splus-assignment-complete):not(.splus-assignment-notcomplete) .splus-completed-check-indicator::after {
.splus-mark-completed-check .upcoming-event:not(.upcoming-subevents-block):not(.splus-assignment-complete):not(.splus-assignment-notcomplete) .splus-completed-check-indicator::after {
color: var(--muted-text) !important;
content: "⚆";
}
Expand Down
64 changes: 61 additions & 3 deletions css/modern/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ variable-intellisense {
color: var(--text);
}

[modern=true]:root body {
background: var(--primary) !important;
background-color: var(--primary) !important;
}

[modern=true]:root #youtube-disclaimer {
display: inline-block !important;
color: var(--text) !important;
Expand Down Expand Up @@ -145,7 +150,7 @@ variable-intellisense {
background-color: var(--primary) !important;
}

[modern=true]:root iframe {
[modern=true]:root iframe:not([id^=firefox-screenshots-]) {
background-color: white !important;
}

Expand Down Expand Up @@ -744,6 +749,12 @@ variable-intellisense {
color: var(--text) !important;
}

[modern=true]:root #basic-user-warning {
background-color: var(--highlight) !important;
border: none !important;
border-radius: var(--border-radius) !important;
}

[modern=true]:root .date-header h4 span,
[modern=true]:root .s-poll-option-title,
[modern=true]:root .s-like-sentence {
Expand Down Expand Up @@ -828,6 +839,16 @@ variable-intellisense {
color: var(--text) !important;
}

[modern=true]:root .selected-realm .name-wrapper {
background: var(--secondary) !important;
border-radius: var(--border-radius) !important;
}

[modern=true]:root .userlist_input input, [modern=true]:root .userlist_input_shadow, [modern=true]:root .userlist_input input[type=text] {
background-color: var(--input) !important;
border-radius: var(--border-radius) !important;
}

[modern=true]:root #edge-filters-btn {
background-color: var(--text) !important;
color: var(--secondary) !important;
Expand Down Expand Up @@ -1357,6 +1378,10 @@ variable-intellisense {
color: var(--muted-text) !important;
}

[modern=true]:root .subevent-count {
background-color: var(--secondary) !important;
}

[modern=true]:root #edit-course-switcher-select-nid-menu {
border: var(--modern-border) !important;
background-color: var(--secondary);
Expand Down Expand Up @@ -1399,6 +1424,27 @@ variable-intellisense {
color: var(--text);
}

[modern=true]:root .shuffleParent div.sshuffleContainer, [modern=true]:root .shuffleParent .mediaThumbContainer {
background: var(--secondary) !important;
border: var(--modern-border) !important;
border-radius: var(--border-radius) !important;
}

[modern=true]:root .s-media-album-content-container {
background-color: var(--secondary) !important;
border-radius: var(--border-radius) !important;
padding: var(--padding) !important;
}

[modern=true]:root .created {
color: var(--muted-text) !important;
}

[modern=true]:root .album-comments {
background: var(--accent) !important;
border: none !important;
}

[modern=true]:root .privatemsg-list td {
background-color: var(--accent) !important;
}
Expand Down Expand Up @@ -1481,6 +1527,12 @@ variable-intellisense {
border-bottom: var(--modern-border) !important;
}

[modern=true]:root .discussion-require-post-notice .warning {
background: var(--highlight) !important;
border: none !important;
border-radius: var(--border-radius) !important;
}

[modern=true]:root .discussion-view .sticky-wrapper h2.page-title {
background: var(--primary) !important;
}
Expand Down Expand Up @@ -1901,12 +1953,18 @@ variable-intellisense {
border-bottom: var(--border-size) solid var(--input) !important;
}

[modern=true]:root .dropbox-viewer-submission-activity,
[modern=true]:root .dropbox-viewer-submission-activity-inner {
[modern=true]:root #dropbox-viewer-wrapper .dropbox-viewer-submission-activity,
[modern=true]:root #dropbox-viewer-wrapper .dropbox-viewer-submission-activity-inner {
background-color: var(--primary) !important;
color: var(--text) !important;
}

[modern=true]:root .popups-dropbox-viewer .popups-close a {
background-color: var(--secondary) !important;
border: var(--modern-border) !important;
height: 16px !important;
}

[modern=true]:root ul#attachment-selector li:hover > a {
background-color: var(--accent);
}
Expand Down
Binary file added imgs/checkmarks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/quick-access.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/theme-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/themes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/what-if-grades.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions js/all-idle.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,10 @@
});

// this delegate has the conditional within it
if (applyCourseAliases) {
applyCourseAliases(filteredList);
}
// TEMPORARY CHANGE: Disable searching for nicknames on DOM updates
// if (applyCourseAliases) {
// applyCourseAliases(filteredList);
// }

if (applyThemeIcons && filteredList.length > 0) {
applyThemeIcons();
Expand Down
24 changes: 15 additions & 9 deletions js/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,12 @@ document.querySelector("#header > header > nav > ul:nth-child(2)").prepend(creat
title: "Toggle Theme\n\nUse this button to temporarily disable your Schoology Plus theme if something isn't displaying correctly.",
onclick: e => {
let newVal = document.documentElement.getAttribute("modern") == "false" ? "true" : "false";
if(newVal == "false") {
tempTheme = "Schoology Plus";
} else {
tempTheme = undefined;
}
Theme.apply(Theme.active);
document.documentElement.setAttribute("modern", newVal);
trackEvent("modern-theme-toggle", newVal, "Navbar Button");
},
Expand Down Expand Up @@ -1095,6 +1101,9 @@ function indicateSubmittedAssignments() {
// checks on the backend if an assignment is complete (submitted)
// does not check user overrides
async function isAssignmentCompleteAsync(assignmentId) {
if (assignmentId == null) {
return false;
}
try {
let revisionData = await fetchApiJson(`dropbox/${assignmentId}/${getUserId()}`);
let revisions = revisionData.revision;
Expand All @@ -1108,8 +1117,7 @@ function indicateSubmittedAssignments() {

// checks user override for assignment completion
function isAssignmentMarkedComplete(assignmentId) {
let overrides = Setting.getValue(completionOverridesSetting);
return !!(overrides && overrides[assignmentId]);
return !!Setting.getNestedValue(completionOverridesSetting, assignmentId);
}

function setAssignmentCompleteOverride(assignmentId, isComplete) {
Expand Down Expand Up @@ -1154,11 +1162,11 @@ function indicateSubmittedAssignments() {

// returns assignment ID for convenience
async function processAssignmentUpcomingAsync(eventElement) {
let infotipElement = eventElement.querySelector(".infotip");
let infotipElement = eventElement.querySelector(".infotip, .singleday");
let assignmentElement = infotipElement.querySelector("a[href]");

// TODO errorcheck the assignmentId match
let assignmentId;
let assignmentId = null;
if (assignmentElement.href.includes("/assignment/")) {
assignmentId = assignmentElement.href.match(/assignment\/(\d+)/)[1];
} else if (assignmentElement.href.includes("/course/")) {
Expand All @@ -1177,7 +1185,7 @@ function indicateSubmittedAssignments() {
}

if (!eventElement.querySelector(".splus-completed-check-indicator")) {
infotipElement.insertAdjacentElement("afterend", createAssignmentSubmittedCheckmarkIndicator(eventElement, assignmentId));
infotipElement.insertAdjacentElement(infotipElement.classList.contains("singleday") ? "afterbegin" : "afterend", createAssignmentSubmittedCheckmarkIndicator(eventElement, assignmentId));
}

return assignmentId;
Expand All @@ -1203,16 +1211,14 @@ function indicateSubmittedAssignments() {
break;
}

// filter to course-event to avoid generic calendar events
let upcomingEventElements = upcomingList.querySelectorAll(".upcoming-event.course-event");
let upcomingEventElements = upcomingList.querySelectorAll(".upcoming-event:not(.upcoming-subevents-block)");

for (let eventElement of upcomingEventElements) {
try {
// TODO only process if it's an assignment, not (e.g.) a calendar event
idSet.add(await processAssignmentUpcomingAsync(eventElement));
}
catch (err) {
Logger.error(`Failed checking assignment '${eventElement.querySelector(".infotip a[href]").href}' : `, err);
Logger.error(`Failed checking assignment '${eventElement.querySelector(".infotip a[href]")?.href}' : `, err);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions js/grades.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
while (!window.splusPreload) { }

const timeout = ms => new Promise(res => setTimeout(res, ms));
const BUG_REPORT_FORM_LINK = "https://docs.google.com/forms/d/e/1FAIpQLScF1_MZofOWT9pkWp3EfKSvzCPpyevYtqbAucp1K5WKGlckiA/viewform?entry.118199430=";
const SINGLE_COURSE = window.location.href.includes("/course/");
Expand Down
10 changes: 10 additions & 0 deletions js/version-specific.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,16 @@ let migrationsTo = {
openModal("choose-theme-modal");
}
}, 50);
},
"7.1": function (currentVersion, previousVersion) {
saveBroadcasts([
createBroadcast(
710,
"Course Nicknames Under Maintenance",
"Due to performance concerns, course nicknames may not show up in every place you're used to seeing them. We're working on a fix so hopefully this can be resolved as soon as possible. Thanks for your patience.",
new Date(2021, 0 /* January */, 16)
)
]);
}
};

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"id": "[email protected]"
}
},
"version": "7.0",
"version": "7.1",
"icons": {
"128": "imgs/[email protected]",
"64": "imgs/[email protected]",
Expand Down
72 changes: 67 additions & 5 deletions scss/modern/all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ variable-intellisense {
color: var(--text);
}

body {
background: var(--primary) !important;
background-color: var(--primary) !important;
}

#youtube-disclaimer {
display: inline-block !important;
color: var(--text) !important;
Expand Down Expand Up @@ -153,7 +158,7 @@ variable-intellisense {
background-color: var(--primary) !important;
}

iframe {
iframe:not([id^=firefox-screenshots-]) {
// iframe must be white, because we can't change styles within it
background-color: white !important;
}
Expand Down Expand Up @@ -798,6 +803,12 @@ variable-intellisense {
}
}

#basic-user-warning {
background-color: var(--highlight) !important;
border: none !important;
border-radius: var(--border-radius) !important;
}

.date-header h4 span,
.s-poll-option-title,
.s-like-sentence {
Expand Down Expand Up @@ -883,6 +894,16 @@ variable-intellisense {
color: var(--text) !important;
}

.selected-realm .name-wrapper {
background: var(--secondary) !important;
border-radius: var(--border-radius) !important;
}

.userlist_input input, .userlist_input_shadow, .userlist_input input[type=text] {
background-color: var(--input) !important;
border-radius: var(--border-radius) !important;
}

#edge-filters-btn {
background-color: var(--text) !important;
color: var(--secondary) !important;
Expand Down Expand Up @@ -1467,6 +1488,10 @@ variable-intellisense {
color: var(--muted-text) !important;
}

.subevent-count {
background-color: var(--secondary) !important;
}

#edit-course-switcher-select-nid-menu {
border: var(--modern-border) !important;
background-color: var(--secondary);
Expand Down Expand Up @@ -1509,6 +1534,29 @@ variable-intellisense {
color: var(--text);
}

// Photo Albums

.shuffleParent div.sshuffleContainer, .shuffleParent .mediaThumbContainer {
background: var(--secondary) !important;
border: var(--modern-border) !important;
border-radius: var(--border-radius) !important;
}

.s-media-album-content-container {
background-color: var(--secondary) !important;
border-radius: var(--border-radius) !important;
padding: var(--padding) !important;
}

.created {
color: var(--muted-text) !important;
}

.album-comments {
background: var(--accent) !important;
border: none !important;
}

// Messages

.privatemsg-list {
Expand Down Expand Up @@ -1600,6 +1648,12 @@ variable-intellisense {

// Discussion Board

.discussion-require-post-notice .warning {
background: var(--highlight) !important;
border: none !important;
border-radius: var(--border-radius) !important;
}

.discussion-view {
.sticky-wrapper h2.page-title {
background: var(--primary) !important;
Expand Down Expand Up @@ -2086,10 +2140,18 @@ variable-intellisense {
border-bottom: var(--border-size) solid var(--input) !important;
}

.dropbox-viewer-submission-activity,
.dropbox-viewer-submission-activity-inner {
background-color: var(--primary) !important;
color: var(--text) !important;
#dropbox-viewer-wrapper {
.dropbox-viewer-submission-activity,
.dropbox-viewer-submission-activity-inner {
background-color: var(--primary) !important;
color: var(--text) !important;
}
}

.popups-dropbox-viewer .popups-close a {
background-color: var(--secondary) !important;
border: var(--modern-border) !important;
height: 16px !important;
}

ul#attachment-selector li:hover>a {
Expand Down

0 comments on commit 6656ca5

Please sign in to comment.