diff --git a/css/all.css b/css/all.css index 622852be..803cbda7 100644 --- a/css/all.css +++ b/css/all.css @@ -278,12 +278,21 @@ video.easter-egg { justify-content: space-between; } -.restore-defaults { - color: red !important; +.settings-actions-wrapper { margin-top: 10px; font-weight: normal; } +.settings-actions-wrapper > a, +.settings-actions-wrapper > span { + margin-left: 10px; + margin-right: 10px; +} + +.restore-defaults { + color: red !important; +} + .margin-under { margin-bottom: 10px !important; } @@ -411,6 +420,12 @@ h1.setting-title { display: inline; } +#popups-overlay, +.active-loader .loading-overlay { + /* Modern-Compatible, however will default back to normal if Modern is not enabled.*/ + background-color: var(--primary, var(--primary-color)); +} + .popups-body .no-answer-provided { background: url('https://app.schoology.com/sites/all/themes/schoology_theme/images/error_404.png') no-repeat 0 0; padding: 0 0 0 25px; diff --git a/css/modern/all.css b/css/modern/all.css index 09b55654..4ed6ac80 100644 --- a/css/modern/all.css +++ b/css/modern/all.css @@ -81,6 +81,7 @@ variable-intellisense { [modern=true]:root textarea, [modern=true]:root select, +[modern=true]:root optgroup, [modern=true]:root input[type=text] { background-color: var(--input) !important; color: var(--text) !important; @@ -224,6 +225,10 @@ variable-intellisense { color: var(--text); } +[modern=true]:root .drGks a:hover, [modern=true]:root .drGks a:focus { + background-color: var(--highlight); +} + [modern=true]:root .grade-data { color: var(--grades) !important; } @@ -255,7 +260,7 @@ variable-intellisense { [modern=true]:root footer li a, [modern=true]:root header li a { - color: var(--contrast-text) !important; + color: var(--link-color) !important; } [modern=true]:root .splus-modal-footer-text { @@ -412,6 +417,7 @@ variable-intellisense { [modern=true]:root tr.error { background-color: var(--error) !important; border-color: var(--error) !important; + color: var(--text); } [modern=true]:root .splus-courses-navbar-button div[role=menu], @@ -832,6 +838,10 @@ variable-intellisense { color: var(--text) !important; } +[modern=true]:root .comment-body-wrapper { + color: var(--text) !important; +} + [modern=true]:root .s-polls-poll-option, [modern=true]:root #edge-filters-menu { background: none !important; @@ -920,6 +930,7 @@ variable-intellisense { [modern=true]:root .userlist_input input[type=text] { background-color: var(--input) !important; border-radius: var(--border-radius) !important; + color: white; } [modern=true]:root #edge-filters-btn { @@ -1386,15 +1397,47 @@ variable-intellisense { } [modern=true]:root .tab-nav:hover { - background-color: var(--active); + background-color: var(--hover-color); } -[modern=true]:root .tab-nav .active { +[modern=true]:root .tab-nav.active { background-color: var(--input); } -[modern=true]:root .tab-nav .active:hover { +[modern=true]:root .tab-nav.active:hover { + background-color: var(--input); +} + +[modern=true]:root #ui-datepicker-div { + background-color: var(--input) !important; +} + +[modern=true]:root .ui-datepicker-days-cell a { + background-color: var(--primary) !important; + border-color: var(--border-color) !important; +} + +[modern=true]:root .ui-datepicker-unselectable { + background-color: var(--accent) !important; +} + +[modern=true]:root .ui-datepicker-days-cell.ui-datepicker-current-day a { + background-color: var(--active) !important; +} + +[modern=true]:root .ui-datepicker-days-cell-over a { + background-color: var(--hover-color) !important; +} + +[modern=true]:root .ui-datepicker-links > div > a { background-color: var(--input); + background-blend-mode: screen; + border: var(--modern-border); + border-radius: var(--border-radius); +} + +[modern=true]:root .ui-datepicker-links > div:hover > a { + background-color: var(--hover-color); } [modern=true]:root .action-links, @@ -1831,6 +1874,14 @@ variable-intellisense { border-bottom: var(--modern-border) !important; } +[modern=true]:root .tw-bs .btn:hover { + background-color: var(--hover-color) !important; +} + +[modern=true]:root .tw-bs .dropdown-menu { + background-color: var(--primary) !important; +} + [modern=true]:root .portfolio-route-content { border: var(--modern-border) !important; border-radius: var(--border-radius) !important; @@ -1845,7 +1896,8 @@ variable-intellisense { background: var(--accent) !important; } -[modern=true]:root .portfolio-card, [modern=true]:root .item-card { +[modern=true]:root .portfolio-card, +[modern=true]:root .item-card { background: var(--primary) !important; } @@ -1870,16 +1922,43 @@ variable-intellisense { border-radius: var(--border-radius) !important; } +[modern=true]:root .tw-bs .portfolio-card__item-count-num { + color: var(--contrast-text) !important; +} + +[modern=true]:root .tw-bs .btn { + background-color: var(--primary) !important; + border: var(--modern-border) !important; + border-radius: var(--border-radius) !important; + color: var(--contrast-text) !important; +} + +[modern=true]:root .tw-bs .btn:hover { + background-color: var(--hover-color) !important; +} + +[modern=true]:root .tw-bs .dropdown-menu { + background-color: var(--primary) !important; +} + +[modern=true]:root .tw-bs .item-form__title-inline .sgy-autosave-input .form-group:hover label, +[modern=true]:root .tw-bs .item-form__title-inline .sgy-autosave-input .form-group:hover label span { + color: var(--muted-text) !important; +} + [modern=true]:root .tw-bs .remaining-char-len { color: var(--text) !important; } -[modern=true]:root .tw-bs .add-item-dropdown__add-new-icon::before, [modern=true]:root .tw-bs .portfolio-list__add-new-icon::before { +[modern=true]:root .tw-bs .add-item-dropdown__add-new-icon::before, +[modern=true]:root .tw-bs .portfolio-list__add-new-icon::before { background-color: var(--primary) !important; - border-color: var(--modern-border) !important; + border-color: var(--border-color) !important; } -[modern=true]:root .tw-bs .item-view-container, [modern=true]:root .tw-bs .item-form__title-bar, [modern=true]:root .tw-bs .item-page { +[modern=true]:root .tw-bs .item-view-container, +[modern=true]:root .tw-bs .item-form__title-bar, +[modern=true]:root .tw-bs .item-page { background-color: var(--background-color) !important; border-color: var(--border-color) !important; outline-color: var(--border-color) !important; @@ -1889,7 +1968,8 @@ variable-intellisense { color: var(--link-color) !important; } -[modern=true]:root .sgy-autosave-input.sgy-autosave-input--editing label span, [modern=true]:root .sgy-autosave-input.sgy-autosave-input--editing .form-group:hover label span { +[modern=true]:root .sgy-autosave-input.sgy-autosave-input--editing label span, +[modern=true]:root .sgy-autosave-input.sgy-autosave-input--editing .form-group:hover label span { color: var(--text) !important; } @@ -2191,6 +2271,14 @@ variable-intellisense { border-color: var(--contrast-border) !important; } +[modern=true]:root .update-comments-pagenation { + background-color: var(--accent); +} + +[modern=true]:root .feed-comments-viewall-container { + color: var(--link-color); +} + [modern=true]:root .dropbox-viewer-item-wrapper { background-color: var(--primary); } @@ -2923,3 +3011,378 @@ variable-intellisense { [modern=true]:root .splus-button-tile.active { background-color: var(--active) !important; } + +[modern=true]:root .settings-label { + color: var(--text); +} + +[modern=true]:root .s-grade-item-assignment-submission-app { + background-color: var(--primary); + color: var(--text); +} + +[modern=true]:root ._2mytC:hover a, +[modern=true]:root ._2mytC:focus a, +[modern=true]:root .Oq4U1:hover:not(:active), +[modern=true]:root .Oq4U1:focus, +[modern=true]:root .s-grade-item-assignment-submission-app:hover, +[modern=true]:root .s-grade-item-assignment-submission-app:focus, +[modern=true]:root span[role="button"]:hover, +[modern=true]:root span[role="button"]:focus, +[modern=true]:root #grading-rubric-edit-slider .large-submit-buttons button.btn.submit.ng-binding:hover, +[modern=true]:root #grading-rubric-edit-slider .large-submit-buttons button.btn.submit.ng-binding:focus, +[modern=true]:root .sort-handle:hover, +[modern=true]:root .sort-handle:focus { + background-color: var(--hover-color); +} + +[modern=true]:root .Oq4U1:active { + background-color: var(--active); +} + +[modern=true]:root .s-share-checkbox-form-wrapper .checkboxes-wrapper { + background-color: var(--primary); +} + +[modern=true]:root #attachment-selector #toggle-copy:hover { + background-color: var(--hover-color); +} + +[modern=true]:root .comments-list .comment { + background: var(--primary); + border: var(--modern-border); + border-color: var(--border-color); + color: var(--text); +} + +[modern=true]:root .comment-date { + color: var(--muted-text); +} + +[modern=true]:root .unpublished, +[modern=true]:root #folder-contents-table .unpublished .folder-contents-cell { + background-color: var(--primary); +} + +[modern=true]:root .masquerade-box { + background-color: var(--secondary); + border: var(--modern-border); +} + +[modern=true]:root div.grade-assignment-popup .description, [modern=true]:root #sEditGradeTable tr th { + color: var(--text); + background-color: var(--primary); +} + +[modern=true]:root #badges-fullscreen-btn { + background-color: var(--primary); + border: var(--modern-border); + border-radius: var(--border-radius); +} + +[modern=true]:root .even .badge-course-table-cell, +[modern=true]:root #s-attendance-edit-form tbody td, +[modern=true]:root #s-attendance-edit-form tbody td div, +[modern=true]:root #s-attendance-edit-form tbody th { + background-color: var(--primary); +} + +[modern=true]:root th.badge-course-table-cell, +[modern=true]:root #s-badge-table-main .sticky-header th, +[modern=true]:root #s-attendance-edit-form thead th { + background: var(--secondary); +} + +[modern=true]:root th.badge-course-table-cell .action-links-unfold { + background-color: var(--input) !important; +} + +[modern=true]:root th.badge-course-table-cell .action-links-unfold span, +[modern=true]:root .date-chooser a.prev span, +[modern=true]:root .date-chooser a.next span { + filter: contrast(5%); +} + +[modern=true]:root #s-attendance-taken-row .attendance-taken-label { + color: var(--text); +} + +[modern=true]:root #s-attendance-taken-row.odd td, +[modern=true]:root #s-attendance-taken-row.even td { + background-color: var(--accent); +} + +[modern=true]:root #s-attendance-edit-form tbody tr:hover th, +[modern=true]:root #s-attendance-edit-form #s-attendance-taken-row .attendance-taken-status:hover, +[modern=true]:root #s-attendance-edit-form #s-attendance-taken-row .attendance-taken-status:focus { + background-color: var(--hover-color); +} + +[modern=true]:root #s-attendance-edit-form #s-attendance-taken-row .edited { + background-color: var(--highlight); +} + +[modern=true]:root #attendance-comment-field { + background-color: var(--accent); + border: var(--modern-border); +} + +[modern=true]:root .comment-status-label { + color: var(--text); +} + +[modern=true]:root #s-attendance-edit-form #s-attendance-taken-row .attendance-taken-status--start { + background-color: var(--active); + border-color: var(--contrast-border); +} + +[modern=true]:root .footer-buttons .date-chooser-calendar, +[modern=true]:root .header-buttons .date-chooser-calendar, +[modern=true]:root .footer-buttons .infotip, +[modern=true]:root .header-buttons .infotip { + background: var(--primary); + border: var(--modern-border); + border-radius: var(--border-radius); +} + +[modern=true]:root a.prev:hover, +[modern=true]:root a.prev:focus, +[modern=true]:root a.next:hover, +[modern=true]:root a.next:focus { + background: var(--hover-color); +} + +[modern=true]:root a.prev, +[modern=true]:root a.next { + background: var(--primary); +} + +[modern=true]:root a.prev { + border-radius: var(--border-radius) 0 0 var(--border-radius); +} + +[modern=true]:root a.next { + border-radius: 0 var(--border-radius) var(--border-radius) 0; +} + +[modern=true]:root .scale-level-scale { + background-color: var(--highlight); + border: var(--modern-border); +} + +[modern=true]:root #s-grading-category-add-form .form-item, +[modern=true]:root #s-grading-category-add-form fieldset { + background-color: var(--primary); +} + +[modern=true]:root #grading-rubric-edit-slider .right-column { + border-color: var(--border-color); +} + +[modern=true]:root #grading-rubric-edit-slider .large-submit-buttons { + background-color: var(--secondary); + border-color: var(--border-color); +} + +[modern=true]:root #grading-rubric-edit-slider .large-submit-buttons button.btn.submit.ng-binding { + background-color: var(--primary); + box-shadow: 0px 2px 0px var(--highlight); +} + +[modern=true]:root .sort-handle { + background-color: var(--accent); +} + +[modern=true]:root #grading-rubric-edit-slider .ui-sortable-helper, +[modern=true]:root #district-mastery-grading-rubric-edit-slider .ui-sortable-helper, +[modern=true]:root #grading-rubric-edit-slider .ui-sortable-helper td, +[modern=true]:root #district-mastery-grading-rubric-edit-slider .ui-sortable-helper td { + background-color: var(--active) !important; +} + +[modern=true]:root .rubric-editor-add-criteria, +[modern=true]:root .rubric-editor-add-objectives { + color: text; +} + +[modern=true]:root #grading-rubric-edit-slider .large-submit-buttons .btn.cancel.ng-scope { + color: var(--muted-text); +} + +[modern=true]:root #grading-rubric-edit-slider .large-submit-buttons .btn.cancel.ng-scope:hover, +[modern=true]:root #grading-rubric-edit-slider .large-submit-buttons .btn.cancel.ng-scope:focus { + color: var(--text); +} + +[modern=true]:root .alignment-form-container .header { + background-color: var(--secondary); +} + +[modern=true]:root .guid-item:active, +[modern=true]:root .alignment-form-container .header .search-tab.active, +[modern=true]:root .alignment-form-container li.active, +[modern=true]:root .alignment-form-container div.active { + background-color: var(--active); +} + +[modern=true]:root .alignment-breadcrumbs .breadcrumb-item:first-child, +[modern=true]:root .alignment-breadcrumbs .breadcrumb-item, +[modern=true]:root .alignment-form-container li, +[modern=true]:root .selected-container .selected-item { + color: var(--link-color); + border-color: var(--contrast-border); +} + +[modern=true]:root .alignment-form-container li .gray, +[modern=true]:root .alignment-form-container div .gray { + color: var(--text) !important; +} + +[modern=true]:root .empty { + color: var(--muted-text); +} + +[modern=true]:root .add-criteria-text { + color: var(--text); +} + +[modern=true]:root .parent-names-list.description { + color: var(--muted-text); +} + +[modern=true]:root .s-enrollment-invite-form .metadata-wrapper, +[modern=true]:root #grading-group-create { + color: var(--text); +} + +[modern=true]:root .s-enrollment-invite-form .user-invite-wrapper { + background-color: var(--accent); + color: var(--text); +} + +[modern=true]:root .s-enrollment-invite-form .user-name-wrapper, +[modern=true]:root .people-filters .selected-users, +[modern=true]:root .people-filters .show-all-users { + color: var(--link-color); +} + +[modern=true]:root .people-filters .selected-users.active, +[modern=true]:root .people-filters .show-all-users.active { + color: var(--contrast-text); + background-color: var(--active); +} + +[modern=true]:root .term-item-tag, +[modern=true]:root .locked-question .tag-item { + color: var(--text); + background-color: var(--secondary); + border-color: var(--border-color); +} + +[modern=true]:root .link-btn { + background: var(--secondary); + color: var(--text); + border: var(--modern-border); + border-radius: var(--border-radius); + border-color: var(--border-color); +} + +[modern=true]:root .s-enrollment-invite-form .s-enrollment-invite-list-wrapper, +[modern=true]:root .s-enrollment-invite-form #network-selected { + background-color: var(--primary); + border-color: var(--border-color); +} + +[modern=true]:root .submit-btn { + background: var(--primary); + color: var(--contrast-text); + border-radius: var(--border-radius); +} + +[modern=true]:root .cancel-btn { + background: var(--accent) !important; + color: var(--muted-text) !important; + border-radius: var(--border-radius); +} + +[modern=true]:root .submit-btn:hover, +[modern=true]:root .submit-btn:focus, +[modern=true]:root .cancel-btn:hover, +[modern=true]:root .cancel-btn:focus { + background: var(--hover-color) !important; + color: var(--text) !important; +} + +[modern=true]:root .s-js-grid-loading-cover { + background-color: var(--primary); +} + +[modern=true]:root .grader-grid-table-header-wrapper .grader-grid-header-cell, +[modern=true]:root .grader-grid-table-header-wrapper .grader-grid-header-cell.hidden-grade .gradebook__major-period-title, +[modern=true]:root .grader-grid-table-header-wrapper .grader-grid-header-cell.showing-unpublished .gradebook__major-period-title { + background-color: var(--secondary); + color: var(--text); +} + +[modern=true]:root .enhanced-gb-body .grid-table-col-header-static-content .select2-container:not(.select2-dropdown-open) .select2-choice > .select2-chosen, +[modern=true]:root .enhanced-gb-body .s-js-grades-gradebook-options-bar .select2-container:not(.select2-dropdown-open) .select2-choice > .select2-chosen { + color: var(--text) !important; +} + +[modern=true]:root .grader-grid--crosshair-line-column, +[modern=true]:root .grader-grid--crosshair-line-row, +[modern=true]:root .grader-grid--crosshair-center { + background-color: var(--hover-color) !important; +} + +[modern=true]:root .gradebook__grade-custom-override + .grader-grid-col-header-gp, +[modern=true]:root .gradebook__grade-custom-override + .grader-grid-col-header-overall { + background-color: var(--primary); +} + +[modern=true]:root .grader-grid-cell:not(.gradebook__grade-custom-override) .grader-grid-cell-block:not(.updated) .grade-value, +[modern=true]:root .grader-grid-cell:not(.gradebook__grade-custom-override) .grader-grid-cell-block:not(.updated) .s-js-grader-grid-cell-display, +[modern=true]:root .grader-grid-table-header-wrapper .gradebook__major-grade-period-header .gradebook__subperiod-element-calculated, +[modern=true]:root .grader-grid-table-header-wrapper .gradebook__major-grade-period-header .grading-period-override-column { + color: var(--text); +} + +[modern=true]:root .gradebook__subperiod-element-calculated.has-override-column, +[modern=true]:root .grading-period-override-column { + background-color: var(--accent); +} + +[modern=true]:root .enhanced-gb-body .s-js-grades-gradebook-options-bar .select2-container.select2-dropdown-open.select2-container-active span { + color: var(--link-color); +} + +[modern=true]:root .enhanced-gb-body .s-js-grades-gradebook-options-bar .select2-container.select2-dropdown-open.select2-container-active { + background-color: var(--primary); + border-radius: var(--border-radius); +} + +[modern=true]:root #autocomplete.grading-scale-ac-popup ul li, +[modern=true]:root .enhanced-gb-body #main-content-wrapper .action-links a, +[modern=true]:root .enhanced-gb-body #main-content-wrapper .action-links button, +[modern=true]:root .enhanced-gb-body .s-course-csm-toggler.select2-toggle.select2-drop .select2-result-label, +[modern=true]:root .enhanced-gb-body .s-grades-grader-filters-dropdown.select2-toggle.select2-drop .select2-result-label { + background-color: var(--secondary); + color: var(--text); +} + +[modern=true]:root #autocomplete.grading-scale-ac-popup ul li:hover, +[modern=true]:root .enhanced-gb-body #main-content-wrapper .action-links a:hover, +[modern=true]:root .enhanced-gb-body #main-content-wrapper .action-links button:hover, +[modern=true]:root .enhanced-gb-body .s-course-csm-toggler.select2-toggle.select2-drop .select2-result-label:hover, +[modern=true]:root .enhanced-gb-body .s-grades-grader-filters-dropdown.select2-toggle.select2-drop .select2-result-label:hover, +[modern=true]:root #autocomplete.grading-scale-ac-popup ul li:focus, +[modern=true]:root .enhanced-gb-body #main-content-wrapper .action-links a:focus, +[modern=true]:root .enhanced-gb-body #main-content-wrapper .action-links button:focus, +[modern=true]:root .enhanced-gb-body .s-course-csm-toggler.select2-toggle.select2-drop .select2-result-label:focus, +[modern=true]:root .enhanced-gb-body .s-grades-grader-filters-dropdown.select2-toggle.select2-drop .select2-result-label:focus { + background-color: var(--hover-color); +} + +[modern=true]:root #grade-comment-field { + background-color: var(--primary); +} diff --git a/imgs/lausd-2022.png b/imgs/lausd-2022.png new file mode 100644 index 00000000..7ab7e5fd Binary files /dev/null and b/imgs/lausd-2022.png differ diff --git a/js/all-idle.js b/js/all-idle.js index 43cb8e99..5412e449 100644 --- a/js/all-idle.js +++ b/js/all-idle.js @@ -356,6 +356,12 @@ }).observe(document.getElementById("body"), { attributes: true, attributeFilter: ["aria-hidden"] }); })(); +(function () { + if (location.pathname.startsWith("/link") && Setting.getValue("autoBypassLinkRedirects") === "enabled") { + document.querySelector("a.s-extlink-direct[href]").click(); + } +})(); + (function () { setTimeout(() => { let assessmentStartContainer = document.querySelector(`.assessment-delivery-landing-app div._3dHTa`); diff --git a/js/all.js b/js/all.js index f6b4bc73..7159364c 100644 --- a/js/all.js +++ b/js/all.js @@ -112,6 +112,16 @@ let modalFooterText = "Schoology Plus © Aaron Opell, Glen Husman 2017-2021" let frame = document.createElement("iframe"); frame.src = `https://schoologypl.us/changelog?version=${chrome.runtime.getManifest().version}`; +function generateDebugInfo() { + return JSON.stringify({ + version: chrome.runtime.getManifest().version, + getBrowser: getBrowser(), + url: location.href, + storageContents: __storage, + userAgent: navigator.userAgent + }, null, 2); +} + let modals = [ new Modal( "settings-modal", @@ -312,7 +322,7 @@ let modals = [ ]), createElement("h2", ["setting-entry"], { textContent: "Icons and Images" }), createElement("div", ["setting-entry"], {}, [ - + createElement("ul", ["contributor-list"], { style: { listStyle: "inside" }, innerHTML: (function (contribs) { @@ -410,10 +420,25 @@ let modals = [ })() ]), modalFooterText + ), + new Modal( + "debug-modal", + "Debug Info", + createElement("div", ["splus-modal-contents"], {}, [ + createElement("div", ["setting-entry"], {}, [ + createButton("debug-modal-clipboard-copy", "Copy to Clipboard", event => navigator.clipboard.writeText(generateDebugInfo())), + ]), + createElement("pre", [], { + id: "debug-modal-content", + textContent: "Loading..." + }), + ]), + modalFooterText, + (modal, x) => document.getElementById("debug-modal-content").textContent = generateDebugInfo() ) ]; -(() => { +(async () => { // Run when new version installed let newVersion = Setting.getValue("newVersion"); if (!newVersion || newVersion != chrome.runtime.getManifest().version) { @@ -444,7 +469,7 @@ let modals = [ ] }); - versionSpecificFirstLaunch(currentVersion, newVersion); + await versionSpecificFirstLaunch(currentVersion, newVersion); Setting.setValue("newVersion", chrome.runtime.getManifest().version); } })(); @@ -1131,9 +1156,9 @@ async function createQuickAccess() { } } catch (err) { if (err === "noapikey") { - wrapper.appendChild(createElement("div", ["quick-access-no-api"], { }, [ + wrapper.appendChild(createElement("div", ["quick-access-no-api"], {}, [ createElement("p", [], { textContent: "Please grant access to your enrolled courses in order to use this feature." }), - createButton("quick-access-grant-access", "Grant Access", () => {location.pathname = "/api"; }), + createButton("quick-access-grant-access", "Grant Access", () => { location.pathname = "/api"; }), ])); } else { throw err; diff --git a/js/api-key.js b/js/api-key.js index 7295c0a9..7e494cf8 100644 --- a/js/api-key.js +++ b/js/api-key.js @@ -87,7 +87,7 @@ ]) ])); - let submitButton = null; //document.getElementById("edit-reveal") || document.getElementById("edit-request"); + let submitButton = document.getElementById("edit-reveal") || document.getElementById("edit-request"); if(submitButton === null) { let permElement = document.getElementsByClassName("splus-permissions-description")[0]; permElement.append(createElement("br", [], {})); diff --git a/js/background.js b/js/background.js index 3362ab62..691e979f 100644 --- a/js/background.js +++ b/js/background.js @@ -47,6 +47,24 @@ chrome.runtime.onInstalled.addListener(function (details) { // TODO: Open window here to ask new users to select their domain // chrome.tabs.create({ url: "https://schoologypl.us" }) trackEvent("Runtime onInstalled", details.reason, "Versions"); + + chrome.contextMenus.create({ + "title": "Theme Editor", + "contexts": ["browser_action"], + "onclick": () => window.open(chrome.runtime.getURL("/theme-editor.html"), "_blank") + }); + + chrome.contextMenus.create({ + "title": "Discord Support Server", + "contexts": ["browser_action"], + "onclick": () => window.open("https://discord.schoologypl.us", "_blank") + }); + + chrome.contextMenus.create({ + "title": "Schoology Plus Website", + "contexts": ["browser_action"], + "onclick": () => window.open("https://schoologypl.us?utm_source=ext-context-menu", "_blank") + }); }); Logger.log("Loaded event page"); diff --git a/js/course.js b/js/course.js index 7a49f7f6..965acaad 100644 --- a/js/course.js +++ b/js/course.js @@ -53,7 +53,10 @@ let courseSettingsCourseName; ]) ]), createElement("p", ["add-grade-symbol"], {}, [ - createElement("a", [], { textContent: "Add Grading Symbol", href: "#", onclick: (event) => createRow() }) + createElement("a", [], { textContent: "+ Add Grading Symbol", href: "#", onclick: (event) => createRow() }) + ]), + createElement("p", ["add-grade-symbol"], {}, [ + createElement("a", [], { textContent: "> Set as default grading scale for all courses", href: "#", onclick: setDefaultScale }) ]) ]), createElement("div", ["setting-entry"], {}, [ @@ -68,14 +71,16 @@ let courseSettingsCourseName; ]), createElement("div", ["settings-buttons-wrapper"], undefined, [ createButton("save-course-settings", "Save Settings", saveCourseSettings), - createElement("a", ["restore-defaults"], { textContent: "Restore Defaults", onclick: restoreCourseDefaults, href: "#" }) + createElement("div", ["settings-actions-wrapper"], {}, [ + createElement("a", ["restore-defaults"], { textContent: "Restore Defaults", onclick: restoreCourseDefaults, href: "#" }) + ]), ]) ]), modalFooterText, setCourseOptionsContent)); })(); document.querySelector("#course-settings-modal .close").onclick = modalClose; -const defaultGradingScale = { "90": "A", "80": "B", "70": "C", "60": "D", "0": "F" }; +const defaultGradingScale = Setting.getValue("getGradingScale")(null); let gradingScale = defaultGradingScale; function setCourseOptionsContent(modal, options) { @@ -146,8 +151,7 @@ function createRow(percentage, symbol) { gradingScaleWrapper.appendChild(row); } -function saveCourseSettings() { - let currentValue = Setting.getValue("gradingScales", {}); +function getCreatedGradingScale() { let scale = {}; for (let r of document.querySelectorAll(".grade-symbol-row")) { let inputBoxes = r.querySelectorAll("input"); @@ -155,13 +159,30 @@ function saveCourseSettings() { scale[inputBoxes[0].value] = inputBoxes[1].value; } else { alert("Values cannot be empty!"); - return; + return null; } } - if (scale != currentValue[courseIdNumber]) { - trackEvent("gradingScales", "set value", "Course Settings"); + + return scale; +} + +function saveCourseSettings(skipSavingGradingScale = false) { + let currentValue = Setting.getValue("gradingScales", {}); + + if (skipSavingGradingScale) { + let scale = getCreatedGradingScale(); + + if (scale === null) { + alert("Values cannot be empty!"); + return; + } + + if (scale != currentValue[courseIdNumber]) { + trackEvent("gradingScales", "set value", "Course Settings"); + } + + currentValue[courseIdNumber] = scale; } - currentValue[courseIdNumber] = scale; let currentAliasesValue = Setting.getValue("courseAliases", {}); let newAliasValue = document.getElementById("setting-input-course-alias").value; @@ -194,19 +215,35 @@ function saveCourseSettings() { }); } +function setDefaultScale() { + let scale = getCreatedGradingScale(); + + if (scale === null) { + alert("Values cannot be empty!"); + return; + } + + if (confirm("Are you sure you want to set this as your default grading scale?\n\nThis will replace the grading scale for all courses except for those where you have already defined custom grading scales.\n\nThis will also save your course settings and reload the page.")) { + Setting.setValue("defaultGradingScale", scale, () => saveCourseSettings(true)); + } +} + function restoreCourseDefaults() { trackEvent("restore-course-defaults", "restore default values", "Course Settings"); let currentValue = Setting.getValue("gradingScales", {}); - currentValue[courseIdNumber] = defaultGradingScale; + delete currentValue[courseIdNumber]; let currentAliasesValue = Setting.getValue("courseAliases", {}); - currentAliasesValue[courseIdNumber] = null; + delete currentAliasesValue[courseIdNumber]; let courseIconOverride = Setting.getValue("forceDefaultCourseIcons", {}); - courseIconOverride[courseIdNumber] = null; + delete courseIconOverride[courseIdNumber]; + + let courseQuickLinks = Setting.getValue("courseQuickLinks", {}); + delete courseQuickLinks[courseIdNumber]; if (confirm(`Are you sure you want to reset all options for the course "${courseSettingsCourseName}" to their default values? This action is irreversible.`)) { - Setting.setValues({ gradingScales: currentValue, courseAliases: currentAliasesValue, forceDefaultCourseIcons: courseIconOverride }, () => { + Setting.setValues({ gradingScales: currentValue, courseAliases: currentAliasesValue, forceDefaultCourseIcons: courseIconOverride, courseQuickLinks: courseQuickLinks }, () => { alert("Settings restored. Reloading."); location.reload(); }); diff --git a/js/courses.js b/js/courses.js index 73253749..21e53e89 100644 --- a/js/courses.js +++ b/js/courses.js @@ -75,7 +75,9 @@ $.contextMenu({ }); if (location.search.includes("reorder")) { - document.querySelector("#reorder-ui .link-btn").click(); + setTimeout(() => { + document.querySelector("#reorder-ui .link-btn").click(); + }, 750); } Logger.debug("Finished loading courses.js"); \ No newline at end of file diff --git a/js/default-themes.js b/js/default-themes.js index 33d1d6c8..c35c64bc 100644 --- a/js/default-themes.js +++ b/js/default-themes.js @@ -287,6 +287,21 @@ let __defaultThemes = [ "border": "#024f7d" } }, + "logo": { + "preset": "lausd_2022" + } + }, + { + "name": "LAUSD 2019", + "version": 2, + "color": { + "custom": { + "primary": "#143f69", + "hover": "#345f89", + "background": "#345f89", + "border": "#024f7d" + } + }, "logo": { "preset": "lausd_2019" } diff --git a/js/grades.js b/js/grades.js index cd395dc1..0a6400fc 100644 --- a/js/grades.js +++ b/js/grades.js @@ -703,7 +703,7 @@ var fetchQueue = []; if (colMatch) { let scorePercent = Number.parseFloat(colMatch[1]); - if (scorePercent && !Number.isNaN(scorePercent)) { + if ((scorePercent || scorePercent === 0) && !Number.isNaN(scorePercent)) { total += (weightPercent.slice(1, -2) / 100) * scorePercent; let weight = Number.parseFloat(weightPercent.slice(1, -2)); totalPercentWeight += weight; @@ -743,20 +743,17 @@ var fetchQueue = []; deltaScore = -scoreVal; } - deltaScore = Math.round(deltaScore * 100) / 100; + // ?: Using Math.ceil ensures finalGrade >= desiredGrade when possible + deltaScore = Math.ceil(deltaScore * 100) / 100; - if (deltaScore < -scoreVal) { - // probably 1 under due to rounding - deltaScore++; - } - - // TODO refactor: we already have our DOM elements + const finalGrade = Math.round((scoreVal + deltaScore) * 100) / 100; if (score) { - score.title = scoreVal + deltaScore; - score.textContent = scoreVal + deltaScore; + // TODO refactor: we already have our DOM elements + score.title = finalGrade; + score.textContent = finalGrade; } - prepareScoredAssignmentGrade(element.querySelector(".injected-assignment-percent"), scoreVal + deltaScore, maxVal); + prepareScoredAssignmentGrade(element.querySelector(".injected-assignment-percent"), finalGrade, maxVal); recalculateCategoryScore(catRow, deltaScore, noGrade ? maxVal : 0); recalculatePeriodScore(perRow, deltaScore, noGrade ? maxVal : 0); }; @@ -889,7 +886,25 @@ var fetchQueue = []; }; } - calcMinFor.separator = "-----"; + calcMinFor.separator1 = "-----"; + + calcMinFor.calculateMinGradeForCustom = { + name: "For Custom Value", + callback: function (key, opt) { + trackEvent("assignment", `calc-min-for-custom`, "What-If Grades"); + + let value = prompt("Please enter a grade to calculate for (a number on the scale of 0 to 100)"); + + if (!Number.isNaN(value) && !Number.isNaN(Number.parseFloat(value))) { + // if a number, calculate + calculateMinimumGrade(this[0], Number.parseFloat(value) / 100); + } else { + alert("Invalid number") + } + } + }; + + calcMinFor.separator2 = "-----"; calcMinFor.courseOptions = { name: "Change Grade Boundaries", callback: function () { diff --git a/js/home.js b/js/home.js index c28a88bd..333b2526 100644 --- a/js/home.js +++ b/js/home.js @@ -73,9 +73,16 @@ function postFromBroadcast(broadcast) { function dismissNotification(event) { let id = event.target.dataset.broadcastId; + let unreadBroadcasts = Setting.getValue("unreadBroadcasts"); unreadBroadcasts.splice(unreadBroadcasts.findIndex(x => x.id == id), 1); Setting.setValue("unreadBroadcasts", unreadBroadcasts); + + let readBroadcasts = localStorage.getItem("splus-readBroadcasts"); + readBroadcasts = readBroadcasts === null ? [] : JSON.parse(readBroadcasts); + readBroadcasts.push(id); + localStorage.setItem("splus-readBroadcasts", JSON.stringify(readBroadcasts)); + document.getElementById(`broadcast${id}`).outerHTML = ""; } @@ -84,7 +91,18 @@ function formatDateAsString(date) { } if (homeFeedContainer && Setting.getValue("broadcasts") !== "disabled") { - (function () { + (async function () { + try { + let onlineBroadcasts = await (await fetch("https://schoologypl.us/alert.json")).json(); + + let readBroadcasts = localStorage.getItem("splus-readBroadcasts"); + readBroadcasts = readBroadcasts === null ? [] : JSON.parse(readBroadcasts); + + saveBroadcasts(onlineBroadcasts.filter(b => !readBroadcasts.includes(b.id))); + } catch (err) { + // Ignore + } + let observer = new MutationObserver(function (mutations) { if (mutations.length == 0) { return; @@ -94,8 +112,14 @@ if (homeFeedContainer && Setting.getValue("broadcasts") !== "disabled") { // style is set on homeFeedContainer whenever Schoology decides to unhide it (static CSS sets display: none), i.e. when it's finished loading // once this happens, we can do our thing - for (let broadcast of Setting.getValue("unreadBroadcasts") || []) { - feed.insertAdjacentElement("afterbegin", postFromBroadcast(broadcast)); + let unreadBroadcasts = Setting.getValue("unreadBroadcasts"); + for (let broadcast of unreadBroadcasts || []) { + if (!broadcast.expires || broadcast.expires > Date.now()) { + feed.insertAdjacentElement("afterbegin", postFromBroadcast(broadcast)); + } else { + unreadBroadcasts.splice(unreadBroadcasts.findIndex(x => x.id == broadcast.id), 1); + Setting.setValue("unreadBroadcasts", unreadBroadcasts); + } } // then disconnect diff --git a/js/preload.js b/js/preload.js index 866d447d..4e9da86b 100644 --- a/js/preload.js +++ b/js/preload.js @@ -405,7 +405,12 @@ function updateSettings(callback) { // wrapper functions for e.g. defaults __storage.getGradingScale = function (courseId) { let defaultGradingScale = { "90": "A", "80": "B", "70": "C", "60": "D", "0": "F" }; - if (__storage.gradingScales && __storage.gradingScales[courseId]) { + + if (__storage.defaultGradingScale) { + defaultGradingScale = __storage.defaultGradingScale; + } + + if (courseId !== null && __storage.gradingScales && __storage.gradingScales[courseId]) { return __storage.gradingScales[courseId]; } @@ -763,6 +768,28 @@ function updateSettings(callback) { undefined, element => element.value ).control, + new Setting( + "autoBypassLinkRedirects", + "Automatically Bypass Link Redirects", + "Automatically skip the external link redirection page, clicking 'Continue' by default", + "enabled", + "select", + { + options: [ + { + text: "Enabled", + value: "enabled" + }, + { + text: "Disabled", + value: "disabled" + } + ] + }, + value => value, + undefined, + element => element.value + ).control, new Setting( "helpCenterFAB", "Schoology Help Button", @@ -826,7 +853,12 @@ function updateSettings(callback) { ]), createElement("div", ["settings-buttons-wrapper"], undefined, [ createButton("save-settings", "Save Settings", () => Setting.saveModified()), - createElement("a", ["restore-defaults"], { textContent: "Restore Defaults", onclick: Setting.restoreDefaults, href: "#" }) + createElement("div", ["settings-actions-wrapper"], {}, [ + createElement("a", [], { textContent: "View Debug Info", onclick: () => openModal("debug-modal"), href: "#" }), + createElement("a", [], { textContent: "Export Settings", onclick: Setting.export, href: "#" }), + createElement("a", [], { textContent: "Import Settings", onclick: Setting.import, href: "#" }), + createElement("a", ["restore-defaults"], { textContent: "Restore Defaults", onclick: Setting.restoreDefaults, href: "#" }) + ]), ]) ]); @@ -984,6 +1016,39 @@ Setting.restoreDefaults = function () { } } +/** + * Exports settings to the clipboard in JSON format + */ +Setting.export = function () { + trackEvent("export-settings", "export settings", "Setting"); + navigator.clipboard.writeText(JSON.stringify(__storage, null, 2)) + .then(() => alert("Copied settings to clipboard!")) + .catch(err => alert("Exporting settings failed!")); +} + +/** + * Import settings from clipboard in JSON format + */ +Setting.import = function () { + trackEvent("import-settings", "attempt import settings", "Setting"); + if (confirm("Are you sure you want to import settings? Importing invalid or malformed settings will most likely break Schoology Plus.")) { + let importedSettings = prompt("Please paste settings to import below:"); + + try { + let importedSettingsObj = JSON.parse(importedSettings); + } catch (err) { + alert("Failed to import settings! They were probably malformed. Make sure the settings are valid JSON."); + return; + } + + Setting.setValues(importedSettingsObj, () => { + trackEvent("import-settings", "successfully imported settings", "Setting"); + alert("Successfully imported settings. If Schoology Plus breaks, please restore defaults or reinstall. Reloading page.") + location.reload(); + }); + } +} + /** * Callback function called when any setting is changed in the settings menu * @param {Event} event Contains a `target` setting element diff --git a/js/theme-editor.js b/js/theme-editor.js index c9da837f..ddb8a40f 100644 --- a/js/theme-editor.js +++ b/js/theme-editor.js @@ -1,10 +1,11 @@ const schoologyPlusLogoImageUrl = chrome.runtime.getURL("/imgs/schoology-plus-wide.svg"); const schoologyLogoImageUrl = "https://ui.schoology.com/design-system/assets/schoology-logo-horizontal-white.884fbe559c66e06d28c5cfcbd4044f0e.svg"; const lausdLegacyImageUrl = chrome.runtime.getURL("/imgs/lausd-legacy.png"); -const lausdNewImageUrl = chrome.runtime.getURL("/imgs/lausd-2019.png"); +const lausd2019ImageUrl = chrome.runtime.getURL("/imgs/lausd-2019.png"); +const lausd2022ImageUrl = chrome.runtime.getURL("/imgs/lausd-2022.png"); const CURRENT_VERSION = SchoologyTheme.CURRENT_VERSION; const placeholderUrl = "https://via.placeholder.com/200x50?text=School+Logo"; -const LAUSD_THEMES = ["LAUSD Orange", "LAUSD Dark Blue"]; +const LAUSD_THEMES = ["LAUSD Orange", "LAUSD Dark Blue", "LAUSD 2019"]; const CLASSIC_THEMES = ["Schoology Plus", "Rainbow"] var defaultDomain = "app.schoology.com"; @@ -46,6 +47,7 @@ var themeBorderColor = document.getElementById("theme-border-color"); var themeLinkColor = document.getElementById("theme-link-color"); var themeSchoologyPlusLogo = document.getElementById("theme-schoology-plus-logo"); var themeSchoologyLogo = document.getElementById("theme-schoology-logo"); +var themeLAUSDLogo2022 = document.getElementById("theme-lausd-logo-2022"); var themeNewLAUSDLogo = document.getElementById("theme-new-lausd-logo"); var themeLAUSDLogo = document.getElementById("theme-lausd-logo"); var themeDefaultLogo = document.getElementById("theme-default-logo"); @@ -423,6 +425,9 @@ function renderTheme(t) { case "lausd_2019": themeNewLAUSDLogo.click(); break; + case "lausd_2022": + themeLAUSDLogo2022.click(); + break; case "default": themeDefaultLogo.click(); break; @@ -874,9 +879,12 @@ function updateOutput() { } else if (themeSchoologyLogo.checked) { theme.logo = new ThemeLogo(undefined, "schoology_logo"); setCSSVariable("background-url", `url(${schoologyLogoImageUrl})`); + } else if (themeLAUSDLogo2022.checked) { + theme.logo = new ThemeLogo(undefined, "lausd_2022"); + setCSSVariable("background-url", `url(${lausd2022ImageUrl})`); } else if (themeNewLAUSDLogo.checked) { theme.logo = new ThemeLogo(undefined, "lausd_2019"); - setCSSVariable("background-url", `url(${lausdNewImageUrl})`); + setCSSVariable("background-url", `url(${lausd2019ImageUrl})`); } else if (themeLAUSDLogo.checked) { theme.logo = new ThemeLogo(undefined, "lausd_legacy"); setCSSVariable("background-url", `url(${lausdLegacyImageUrl})`); diff --git a/js/theme-model.js b/js/theme-model.js index c0fa4f22..b92df5bb 100644 --- a/js/theme-model.js +++ b/js/theme-model.js @@ -279,7 +279,7 @@ class ThemeLogo { /** * Defines a logo image * @param {string} url Link to an image - * @param {"schoology_plus"|"schoology_logo"|"lausd_legacy"|"lausd_2019"|"default"} preset Built-in image + * @param {"schoology_plus"|"schoology_logo"|"lausd_legacy"|"lausd_2019"|"lausd_2022"|"default"} preset Built-in image */ constructor(url, preset) { this.url = url; diff --git a/js/theme.js b/js/theme.js index 9ae80d11..3a0e29f9 100644 --- a/js/theme.js +++ b/js/theme.js @@ -107,6 +107,9 @@ class Theme { case "lausd_legacy": Theme.setLogoUrl(chrome.runtime.getURL("/imgs/lausd-legacy.png")); break; + case "lausd_2022": + Theme.setLogoUrl(chrome.runtime.getURL("/imgs/lausd-2022.png")); + break; case "lausd_2019": Theme.setLogoUrl(chrome.runtime.getURL("/imgs/lausd-2019.png")); break; diff --git a/js/version-specific.js b/js/version-specific.js index fc4f0ab3..43c0139f 100644 --- a/js/version-specific.js +++ b/js/version-specific.js @@ -92,7 +92,7 @@ function createToastButton(text, id, onClick, transition = "fadeOutRight") { } /** - * @typedef {{id:number,title:string,message:string,timestamp?:Date,icon?:string}} Broadcast + * @typedef {{id:number,title:string,message:string,timestamp?:Date,expires?:timestamp}} Broadcast * @param {Broadcast[]} broadcasts Broadcasts to save * @param {()=>void} callback Function called after broadcasts are saved */ @@ -118,7 +118,7 @@ function saveBroadcasts(broadcasts, callback = undefined) { * @returns {Broadcast} */ function createBroadcast(id, title, message, timestamp = Date.now()) { - return { id, title, message, timestamp: +timestamp }; + return { id: String(id), title, message, timestamp: +timestamp }; } /** @@ -249,16 +249,6 @@ let migrationsTo = { } }, 50); }, - "7.4": function (currentVersion, previousVersion) { - var accessToAccountInterval = setInterval(function () { - if (document.readyState === "complete" && openModal && !document.querySelector(".splus-modal-open")) { - clearInterval(accessToAccountInterval); - if (!Setting.getValue("apistatus")) { - location.pathname = "/api"; - } - } - }, 50); - }, "7.5": function (currentVersion, previousVersion) { chrome.storage.sync.get(["themes"], values => { if (values.themes) { @@ -291,10 +281,20 @@ let migrationsTo = { Logger.log(`No themes to migrate`); } }); - } + }, + "7.7": function (currentVersion, previousVersion) { + var accessToAccountInterval = setInterval(function () { + if (document.readyState === "complete" && openModal && !document.querySelector(".splus-modal-open")) { + clearInterval(accessToAccountInterval); + if (!Setting.getValue("apistatus")) { + location.pathname = "/api"; + } + } + }, 50); + }, }; -function versionSpecificFirstLaunch(currentVersion, previousVersion) { +async function versionSpecificFirstLaunch(currentVersion, previousVersion) { Logger.log("[Updater] First launch after update, updating to ", currentVersion, " from ", previousVersion); if (!previousVersion) { @@ -310,5 +310,5 @@ function versionSpecificFirstLaunch(currentVersion, previousVersion) { } else if (compareVersions(migrateTo, currentVersion) <= 0 && compareVersions(migrateTo, previousVersion) > 0) { migrationsTo[migrateTo](currentVersion, previousVersion); } - } + } } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 97042bab..efb0caff 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,7 @@ "update_url": "https://schoologypl.us/firefox_updates.json" } }, - "version": "7.6", + "version": "7.7", "icons": { "128": "imgs/icon@128.png", "64": "imgs/icon@64.png", diff --git a/scss/modern/all.scss b/scss/modern/all.scss index d4144630..9e65c9ef 100644 --- a/scss/modern/all.scss +++ b/scss/modern/all.scss @@ -82,6 +82,7 @@ variable-intellisense { textarea, select, + optgroup, input[type=text] { background-color: var(--input) !important; color: var(--text) !important; @@ -238,6 +239,13 @@ variable-intellisense { color: var(--text); } + .drGks a { + &:hover, + &:focus { + background-color: var(--highlight); + } + } + .grade-data { color: var(--grades) !important; } @@ -283,7 +291,7 @@ variable-intellisense { footer li a, header li a { - color: var(--contrast-text) !important; + color: var(--link-color) !important; } .splus-modal-footer-text { @@ -452,6 +460,7 @@ variable-intellisense { tr.error { background-color: var(--error) !important; border-color: var(--error) !important; + color: var(--text); } // Courses and Groups Dropdown @@ -620,7 +629,7 @@ variable-intellisense { .color-dark-7, .color-dark-8, .color-dark-9, - .color-dark-10, { + .color-dark-10 { border-color: rgba(0, 0, 0, 0.4) !important; } @@ -889,6 +898,10 @@ variable-intellisense { color: var(--text) !important; } + .comment-body-wrapper { + color: var(--text) !important; + } + .s-polls-poll-option, #edge-filters-menu { background: none !important; @@ -978,6 +991,7 @@ variable-intellisense { .userlist_input input[type=text] { background-color: var(--input) !important; border-radius: var(--border-radius) !important; + color: white; } #edge-filters-btn { @@ -1500,10 +1514,10 @@ variable-intellisense { .tab-nav { &:hover { - background-color: var(--active); + background-color: var(--hover-color); } - .active { + &.active { background-color: var(--input); &:hover { @@ -1512,6 +1526,43 @@ variable-intellisense { } } + #ui-datepicker-div { + background-color: var(--input) !important; + } + + .ui-datepicker-days-cell a { + background-color: var(--primary) !important; + border-color: var(--border-color) !important; + } + + .ui-datepicker-unselectable { + background-color: var(--accent) !important; + } + + .ui-datepicker-days-cell.ui-datepicker-current-day a { + background-color: var(--active) !important; + } + + .ui-datepicker-days-cell-over a { + background-color: var(--hover-color) !important; + } + + .ui-datepicker-links { + > div { + > a { + background-color: var(--input); + background-blend-mode: screen; + border: var(--modern-border); + border-radius: var(--border-radius); + } + &:hover { + > a { + background-color: var(--hover-color); + } + } + } + } + // Course Page .action-links, @@ -1992,6 +2043,14 @@ variable-intellisense { .portfolio-view__add-new-bg { border-bottom: var(--modern-border) !important; } + + .btn:hover { + background-color: var(--hover-color) !important; + } + + .dropdown-menu { + background-color: var(--primary) !important; + } } .portfolio-route-content { @@ -2008,7 +2067,8 @@ variable-intellisense { background: var(--accent) !important; } - .portfolio-card, .item-card { + .portfolio-card, + .item-card { background: var(--primary) !important; } @@ -2039,16 +2099,45 @@ variable-intellisense { border-radius: var(--border-radius) !important; } + .portfolio-card__item-count-num { + color: var(--contrast-text) !important; + } + + .btn { + background-color: var(--primary) !important; + border: var(--modern-border) !important; + border-radius: var(--border-radius) !important; + color: var(--contrast-text) !important; + + &:hover { + background-color: var(--hover-color) !important; + } + } + + .dropdown-menu { + background-color: var(--primary) !important; + } + + .item-form__title-inline .sgy-autosave-input .form-group:hover { + label, + label span { + color: var(--muted-text) !important; + } + } + .remaining-char-len { color: var(--text) !important; } - .add-item-dropdown__add-new-icon::before, .portfolio-list__add-new-icon::before { + .add-item-dropdown__add-new-icon::before, + .portfolio-list__add-new-icon::before { background-color: var(--primary) !important; - border-color: var(--modern-border) !important; + border-color: var(--border-color) !important; } - .item-view-container, .item-form__title-bar, .item-page { + .item-view-container, + .item-form__title-bar, + .item-page { background-color: var(--background-color) !important; border-color: var(--border-color) !important; outline-color: var(--border-color) !important; @@ -2060,7 +2149,8 @@ variable-intellisense { } .sgy-autosave-input.sgy-autosave-input--editing { - & label span, & .form-group:hover label span { + label span, + .form-group:hover label span { color: var(--text) !important; } } @@ -2409,6 +2499,14 @@ variable-intellisense { border-color: var(--contrast-border) !important; } + .update-comments-pagenation { + background-color: var(--accent); + } + + .feed-comments-viewall-container { + color: var(--link-color); + } + .dropbox-viewer-item-wrapper { background-color: var(--primary); } @@ -3295,4 +3393,410 @@ variable-intellisense { .splus-button-tile.active { background-color: var(--active) !important; } -} \ No newline at end of file + + // + // Teacher Areas + // + // Test Setup + .settings-label { + color: var(--text); + } + + // Buttons + .s-grade-item-assignment-submission-app { + background-color: var(--primary); + color: var(--text); + } + + // Button Hover + ._2mytC:hover a, + ._2mytC:focus a, + .Oq4U1:hover:not(:active), + .Oq4U1:focus, + .s-grade-item-assignment-submission-app:hover, + .s-grade-item-assignment-submission-app:focus, + span[role="button"]:hover, + span[role="button"]:focus, + #grading-rubric-edit-slider .large-submit-buttons button.btn.submit.ng-binding:hover, + #grading-rubric-edit-slider .large-submit-buttons button.btn.submit.ng-binding:focus, + .sort-handle:hover, + .sort-handle:focus { + background-color: var(--hover-color); + } + + // Active Buttons + .Oq4U1:active { + background-color: var(--active); + } + + .s-share-checkbox-form-wrapper .checkboxes-wrapper { + background-color: var(--primary); + } + + #attachment-selector #toggle-copy:hover { + background-color: var(--hover-color); + } + + + .comments-list .comment { + background: var(--primary); + border: var(--modern-border); + border-color: var(--border-color); + color: var(--text); + } + + .comment-date { + color: var(--muted-text); + } + + + + // // + // Course Materials Page // + // // + .unpublished, + #folder-contents-table .unpublished .folder-contents-cell { + background-color: var(--primary); + } + + .masquerade-box { + background-color: var(--secondary); + border: var(--modern-border); + } + + div.grade-assignment-popup .description, #sEditGradeTable tr th { + color: var(--text); + background-color: var(--primary); + } + + // // + // Badges & Attendance Pages // + // // + #badges-fullscreen-btn { + background-color: var(--primary); + border: var(--modern-border); + border-radius: var(--border-radius); + } + + .even .badge-course-table-cell, + #s-attendance-edit-form tbody td, + #s-attendance-edit-form tbody td div, + #s-attendance-edit-form tbody th { + background-color: var(--primary); + } + + th.badge-course-table-cell, + #s-badge-table-main .sticky-header th, + #s-attendance-edit-form thead th { + background: var(--secondary); + } + + th.badge-course-table-cell .action-links-unfold { + background-color: var(--input) !important; + } + + th.badge-course-table-cell .action-links-unfold span, + .date-chooser a.prev span, + .date-chooser a.next span { + filter: contrast(5%); + } + + #s-attendance-taken-row .attendance-taken-label { + color: var(--text); + } + + #s-attendance-taken-row.odd td, + #s-attendance-taken-row.even td { + background-color: var(--accent); + } + + #s-attendance-edit-form tbody tr:hover th, + #s-attendance-edit-form #s-attendance-taken-row .attendance-taken-status:hover, + #s-attendance-edit-form #s-attendance-taken-row .attendance-taken-status:focus { + background-color: var(--hover-color); + } + + #s-attendance-edit-form #s-attendance-taken-row .edited { + background-color: var(--highlight); + } + + #attendance-comment-field { + background-color: var(--accent); + border: var(--modern-border); + } + + .comment-status-label { + color: var(--text); + } + + #s-attendance-edit-form #s-attendance-taken-row .attendance-taken-status--start { + background-color: var(--active); + border-color: var(--contrast-border); + } + + .footer-buttons .date-chooser-calendar, + .header-buttons .date-chooser-calendar, + .footer-buttons .infotip, + .header-buttons .infotip { + background: var(--primary); + border: var(--modern-border); + border-radius: var(--border-radius); + } + + a.prev:hover, + a.prev:focus, + a.next:hover, + a.next:focus { + background: var(--hover-color); + } + + a.prev, + a.next { + background: var(--primary); + } + + a.prev { + border-radius: var(--border-radius) 0 0 var(--border-radius); + } + + a.next { + border-radius: 0 var(--border-radius) var(--border-radius) 0; + } + + + // // + // Grade Setup Page // + // // + .scale-level-scale { + background-color: var(--highlight); + border: var(--modern-border); + } + + #s-grading-category-add-form .form-item, + #s-grading-category-add-form fieldset { + background-color: var(--primary); + } + + #grading-rubric-edit-slider .right-column { + border-color: var(--border-color); + } + + #grading-rubric-edit-slider .large-submit-buttons { + background-color: var(--secondary); + border-color: var(--border-color); + } + + #grading-rubric-edit-slider .large-submit-buttons button.btn.submit.ng-binding { + background-color: var(--primary); + box-shadow: 0px 2px 0px var(--highlight); + } + + .sort-handle { + background-color: var(--accent); + } + + #grading-rubric-edit-slider .ui-sortable-helper, + #district-mastery-grading-rubric-edit-slider .ui-sortable-helper, + #grading-rubric-edit-slider .ui-sortable-helper td, + #district-mastery-grading-rubric-edit-slider .ui-sortable-helper td { + background-color: var(--active) !important; + } + + .rubric-editor-add-criteria, + .rubric-editor-add-objectives { + color: text; + } + + #grading-rubric-edit-slider .large-submit-buttons .btn.cancel.ng-scope { + color: var(--muted-text); + } + + #grading-rubric-edit-slider .large-submit-buttons .btn.cancel.ng-scope:hover, + #grading-rubric-edit-slider .large-submit-buttons .btn.cancel.ng-scope:focus { + color: var(--text); + } + + .alignment-form-container .header { + background-color: var(--secondary); + } + + .guid-item:active, + .alignment-form-container .header .search-tab.active, + .alignment-form-container li.active, + .alignment-form-container div.active { + background-color: var(--active); + } + + .alignment-breadcrumbs .breadcrumb-item:first-child, + .alignment-breadcrumbs .breadcrumb-item, + .alignment-form-container li, + .selected-container .selected-item { + color: var(--link-color); + border-color: var(--contrast-border); + } + + .alignment-form-container li .gray, + .alignment-form-container div .gray { + color: var(--text) !important; + } + + .empty { + color: var(--muted-text); + } + + .add-criteria-text { + color: var(--text); + } + + + + // // + // MEMBERS PAGE // + // // + .parent-names-list.description { + color: var(--muted-text); + } + + .s-enrollment-invite-form .metadata-wrapper, + #grading-group-create { + color: var(--text); + } + + .s-enrollment-invite-form .user-invite-wrapper { + background-color: var(--accent); + color: var(--text); + } + + .s-enrollment-invite-form .user-name-wrapper, + .people-filters .selected-users, + .people-filters .show-all-users { + color: var(--link-color); + } + + .people-filters .selected-users.active, + .people-filters .show-all-users.active { + color: var(--contrast-text); + background-color: var(--active); + } + + .term-item-tag, + .locked-question .tag-item { + color: var(--text); + background-color: var(--secondary); + border-color: var(--border-color); + } + + .link-btn { + background: var(--secondary); + color: var(--text); + border: var(--modern-border); + border-radius: var(--border-radius); + border-color: var(--border-color); + } + + .s-enrollment-invite-form .s-enrollment-invite-list-wrapper, + .s-enrollment-invite-form #network-selected { + background-color: var(--primary); + border-color: var(--border-color); + } + + .submit-btn { + background: var(--primary); + color: var(--contrast-text); + border-radius: var(--border-radius); + } + + .cancel-btn { + background: var(--accent) !important; + color: var(--muted-text) !important; + border-radius: var(--border-radius); + } + + .submit-btn:hover, + .submit-btn:focus, + .cancel-btn:hover, + .cancel-btn:focus { + background: var(--hover-color) !important; + color: var(--text) !important; + } + + + + + // // + // Gradebook Page // + // // + .s-js-grid-loading-cover { + background-color: var(--primary); + } + + .grader-grid-table-header-wrapper .grader-grid-header-cell, + .grader-grid-table-header-wrapper .grader-grid-header-cell.hidden-grade .gradebook__major-period-title, + .grader-grid-table-header-wrapper .grader-grid-header-cell.showing-unpublished .gradebook__major-period-title { + background-color: var(--secondary); + color: var(--text); + } + + .enhanced-gb-body .grid-table-col-header-static-content .select2-container:not(.select2-dropdown-open) .select2-choice > .select2-chosen, + .enhanced-gb-body .s-js-grades-gradebook-options-bar .select2-container:not(.select2-dropdown-open) .select2-choice > .select2-chosen { + color: var(--text) !important; + } + + .grader-grid--crosshair-line-column, + .grader-grid--crosshair-line-row, + .grader-grid--crosshair-center { + background-color: var(--hover-color) !important; + } + + .gradebook__grade-custom-override + .grader-grid-col-header-gp, + .gradebook__grade-custom-override + .grader-grid-col-header-overall { + background-color: var(--primary); + } + + .grader-grid-cell:not(.gradebook__grade-custom-override) .grader-grid-cell-block:not(.updated) .grade-value, + .grader-grid-cell:not(.gradebook__grade-custom-override) .grader-grid-cell-block:not(.updated) .s-js-grader-grid-cell-display, + .grader-grid-table-header-wrapper .gradebook__major-grade-period-header .gradebook__subperiod-element-calculated, + .grader-grid-table-header-wrapper .gradebook__major-grade-period-header .grading-period-override-column { + color: var(--text); + } + + .gradebook__subperiod-element-calculated.has-override-column, + .grading-period-override-column { + background-color: var(--accent); + } + + .enhanced-gb-body .s-js-grades-gradebook-options-bar .select2-container.select2-dropdown-open.select2-container-active span { + color: var(--link-color); + } + + .enhanced-gb-body .s-js-grades-gradebook-options-bar .select2-container.select2-dropdown-open.select2-container-active { + background-color: var(--primary); + border-radius: var(--border-radius); + } + + #autocomplete.grading-scale-ac-popup ul li, + .enhanced-gb-body #main-content-wrapper .action-links a, + .enhanced-gb-body #main-content-wrapper .action-links button, + .enhanced-gb-body .s-course-csm-toggler.select2-toggle.select2-drop .select2-result-label, + .enhanced-gb-body .s-grades-grader-filters-dropdown.select2-toggle.select2-drop .select2-result-label { + background-color: var(--secondary); + color: var(--text); + } + + #autocomplete.grading-scale-ac-popup ul li:hover, + .enhanced-gb-body #main-content-wrapper .action-links a:hover, + .enhanced-gb-body #main-content-wrapper .action-links button:hover, + .enhanced-gb-body .s-course-csm-toggler.select2-toggle.select2-drop .select2-result-label:hover, + .enhanced-gb-body .s-grades-grader-filters-dropdown.select2-toggle.select2-drop .select2-result-label:hover, + #autocomplete.grading-scale-ac-popup ul li:focus, + .enhanced-gb-body #main-content-wrapper .action-links a:focus, + .enhanced-gb-body #main-content-wrapper .action-links button:focus, + .enhanced-gb-body .s-course-csm-toggler.select2-toggle.select2-drop .select2-result-label:focus, + .enhanced-gb-body .s-grades-grader-filters-dropdown.select2-toggle.select2-drop .select2-result-label:focus { + background-color: var(--hover-color); + } + + #grade-comment-field { + background-color: var(--primary); + } +} diff --git a/theme-editor.html b/theme-editor.html index edf1b729..60067bdb 100644 --- a/theme-editor.html +++ b/theme-editor.html @@ -311,18 +311,25 @@
Logo
Schoology Logo

+

+ +

diff --git a/themes/README.md b/themes/README.md index cc3d9c79..cccc8cf5 100644 --- a/themes/README.md +++ b/themes/README.md @@ -96,7 +96,8 @@ A Schoology Plus theme has the following format and components (each component w "preset": "schoology_plus", "preset": "schoology_logo", "preset": "lausd_legacy", - "preset": "lausd_2019" + "preset": "lausd_2019", + "preset": "lausd_2022" }, "cursor": { "primary": "https://example.com/my-cursor-image.png" @@ -332,7 +333,7 @@ A Schoology Plus theme has the following format and components (each component w |Default Value|![Schoology Plus](https://imgur.com/znq2Mc1.png) |Description|Describes the logo to be displayed on the left side of the navbar. |Subkey Options (Must contain ***exactly one*** of these subkeys)|
KeyDescription
`url`A direct link to an image to be used as the logo. Should be **160x50** or smaller for best results.
`preset`One of the values described below that results in a preset image being used as the logo.
-|`preset` Values|
ValuePreview
`"schoology_plus"`![Schoology Plus](https://imgur.com/znq2Mc1.png)
`"schoology_logo"`![Schoology logo](https://i.imgur.com/y64kiCY.png)
`"lausd_legacy"`![LAUSD legacy](https://imgur.com/Mm7FXhD.png)
`"lausd_2019"`![LAUSD 2019](https://imgur.com/NOuGRyZ.png)
`"default"`Don't override the logo whatsoever
**NOTE**: The Schoology and Schoology Plus logos have a transparent background, however the LAUSD logo backgrounds are orange or dark blue as shown. +|`preset` Values|
ValuePreview
`"schoology_plus"`![Schoology Plus](https://imgur.com/znq2Mc1.png)
`"schoology_logo"`![Schoology logo](https://i.imgur.com/y64kiCY.png)
`"lausd_legacy"`![LAUSD legacy](https://imgur.com/Mm7FXhD.png)
`"lausd_2019"`![LAUSD 2019](https://imgur.com/NOuGRyZ.png)
`"lausd_2022"`![LAUSD 2022](https://i.imgur.com/QFbx7wL.png)
`"default"`Don't override the logo whatsoever
**NOTE**: The Schoology and Schoology Plus logos have a transparent background, however the LAUSD logo backgrounds are orange or dark blue as shown. **Examples** ```js // Example using "url"