Skip to content

Commit

Permalink
Merge pull request #156 from aopell/develop
Browse files Browse the repository at this point in the history
Version 5.3.2
  • Loading branch information
aopell authored Apr 9, 2019
2 parents 15b39af + 7e09401 commit ae93aba
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 31 deletions.
6 changes: 6 additions & 0 deletions css/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ h1.setting-title {
margin-top: 10px !important;
}

.course-list-icon {
float: left;
padding: 7px 16px 7px 7px;
width: 64px;
}

/*
#139 fix
Make accept and cancel buttons similarly styled throughout the UI
Expand Down
2 changes: 1 addition & 1 deletion js/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ let modals = [
}
}
return retVal;
})(["DinosoftLabs", "Eucalyp", "Flat Icons", "Freepik", "Maxim Basinski", "Pixel Buddha", "Smashicons", "Twitter", "Vectors Market"])
})(["DinosoftLabs", "Eucalyp", "Flat Icons", "Freepik", "Maxim Basinski", "Pixel Buddha", "Smashicons", "Twitter", "Vectors Market", "srip", "surang", "Pixelmeetup"])
}),
createElement("span", [], { textContent: " from " }),
createElement("a", [], { href: "https://www.flaticon.com/", textContent: "flaticon.com" })
Expand Down
43 changes: 43 additions & 0 deletions js/courses.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
for (let course of document.querySelectorAll("li.course-item.list-item")) {
let parent = course.parentNode;
let wrapper = document.createElement("div");
parent.replaceChild(wrapper, course);
wrapper.appendChild(course);
course.prepend(createElement("img", ["course-list-icon"], { src: Theme.getIcon(course.querySelector(".course-title").textContent) }));
}

$.contextMenu({
selector: "li.course-item.list-item",
items: {
options: {
name: "Course Options",
callback: function (key, opt) {
openModal("course-settings-modal", {
courseId: this[0].querySelector(".section-item").id.match(/\d+/)[0],
courseName: `${this[0].querySelector(".course-title").textContent}: ${this[0].querySelector(".section-item").textContent}`
});
}
},
separator: "-----",
materials: {
name: "Materials",
callback: function (key, opt) { window.open(`https://lms.lausd.net/course/${this[0].querySelector(".section-item").id.match(/\d+/)[0]}/materials`, "_blank") }
},
updates: {
name: "Updates",
callback: function (key, opt) { window.open(`https://lms.lausd.net/course/${this[0].querySelector(".section-item").id.match(/\d+/)[0]}/updates`, "_blank") }
},
student_grades: {
name: "Grades",
callback: function (key, opt) { window.open(`https://lms.lausd.net/course/${this[0].querySelector(".section-item").id.match(/\d+/)[0]}/student_grades`, "_blank") }
},
mastery: {
name: "Mastery",
callback: function (key, opt) { window.open(`https://lms.lausd.net/course/${this[0].querySelector(".section-item").id.match(/\d+/)[0]}/mastery`, "_blank") }
},
members: {
name: "Members",
callback: function (key, opt) { window.open(`https://lms.lausd.net/course/${this[0].querySelector(".section-item").id.match(/\d+/)[0]}/members`, "_blank") }
}
}
});
8 changes: 5 additions & 3 deletions js/grades.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ var fetchQueue = [];
try {
await processAssignment(assignment);
} catch (err) {
addEditDisableReason(err);
addEditDisableReason(err.stack);
addEditDisableReason(`Course: ${course} Assignment: ${assignment}`)
if (!assignment.classList.contains("dropped") && assignment.querySelector(".missing")) {
// consequential failure: our denominator is invalid
invalidateCatTotal = true;
Expand Down Expand Up @@ -269,7 +270,7 @@ var fetchQueue = [];
}
}
} catch (err) {
addEditDisableReason("(category) " + (err || "General Error"));
addEditDisableReason("(category) " + (err.stack || "General Error"));
}
}

Expand Down Expand Up @@ -434,7 +435,8 @@ var fetchQueue = [];

// any state change when editing has been disabled
if (editDisableReason) {
alert("An error occurred loading assignments. Editing has been disabled.\nReason: " + JSON.stringify(editDisableReason));
Logger.error(JSON.stringify(editDisableReason));
alert("An error occurred loading assignments. Editing has been disabled. Please report this by pressing Ctrl+Shift+J (Cmd+Shift+J on Mac), taking a screenshot of the error messages, and sending it in the Schoology Plus Discord server.\nReason: " + JSON.stringify(editDisableReason));
document.getElementById("enable-modify").checked = false;
}
// enabling editing
Expand Down
115 changes: 89 additions & 26 deletions js/icons.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
var icons = [
//Physical education
//Source: https://www.flaticon.com/free-icon/speed_181017 by Eucalyp under Flaticon Basic License (CC BY 3.0)
{ regex: "( PE |Phys(ical)? Edu?(cation)?)", url: "https://image.flaticon.com/icons/svg/181/181017.svg" },
{ regex: "(\\bPE\\b|Phys(ical)? Edu?(cation)?|\\bSRLA\\b)", url: "https://image.flaticon.com/icons/svg/181/181017.svg" },
//World History
//Source: https://www.flaticon.com/free-icon/internet_174249 by Flat Icons under Flaticon Basic License (CC BY 3.0)
{ regex: "WO?R?LD HIST?(ORY)?", url: "https://image.flaticon.com/icons/svg/174/174249.svg" },
{ regex: "WO?R?LD HIST?(ORY)?|WHG", url: "https://image.flaticon.com/icons/svg/174/174249.svg" },
//Algebra 1/2
//Source: https://www.flaticon.com/free-icon/blackboard_167753 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "ALG(EB|EBRA)? ", url: "https://image.flaticon.com/icons/svg/167/167753.svg" },
{ regex: "ALG(EB|EBRA)?(\\d|\\b)", url: "https://image.flaticon.com/icons/svg/167/167753.svg" },
//Art History
//Source: https://www.flaticon.com/free-icon/paint-brush_214275 by Pixel Buddha under Flaticon Basic License (CC BY 3.0)
{ regex: "ART HIST", url: "https://image.flaticon.com/icons/svg/214/214275.svg" },
Expand All @@ -21,20 +21,20 @@ var icons = [
//Source: https://www.flaticon.com/free-icon/telescope_124553 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "ASTRONOMY", url: "https://image.flaticon.com/icons/svg/124/124553.svg" },
//Precalculus
//Source: https://www.flaticon.com/free-icon/axis_707967 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "PRE ?CALC", url: "https://image.flaticon.com/icons/svg/707/707967.svg" },
//Source: https://www.flaticon.com/free-icon/parabola_1074140 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "PRE ?CALC", url: "https://image.flaticon.com/icons/svg/1074/1074140.svg" },
//Calculus
//Source: https://www.flaticon.com/free-icon/calculating_265682 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: " CALC", url: "https://image.flaticon.com/icons/svg/265/265682.svg" },
//Source: https://www.flaticon.com/free-icon/line-graph_1572296 by Pixelmeetup under Flaticon Basic License (CC BY 3.0)
{ regex: "(^|\\b)CALC(ULUS)?\\b", url: "https://image.flaticon.com/icons/svg/1572/1572296.svg" },
//Chemistry
//Source: https://www.flaticon.com/free-icon/flask_123381 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "CHEM", url: "https://image.flaticon.com/icons/svg/123/123381.svg" },
//Computer Science and related courses
//Source: https://www.flaticon.com/free-icon/binary-code_626570 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "COMP SCI?|COMPUTER", url: "https://image.flaticon.com/icons/svg/626/626570.svg" },
//US History
//US History and other American studies
//Source: https://www.flaticon.com/free-icon/united-states-of-america_149513 by Smashicons under Flaticon Basic License (CC BY 3.0)
{ regex: "US HIST", url: "https://image.flaticon.com/icons/svg/149/149513.svg" },
{ regex: "US HIST|AMER(ICAN?)?", url: "https://image.flaticon.com/icons/svg/149/149513.svg" },
//Health
//Source: https://www.flaticon.com/free-icon/first-aid-kit_179555 by Pixel Buddha under Flaticon Basic License (CC BY 3.0)
{ regex: "HEALTH", url: "https://image.flaticon.com/icons/svg/179/179555.svg" },
Expand All @@ -55,7 +55,7 @@ var icons = [
{ regex: "PSYCH", url: "https://image.flaticon.com/icons/svg/552/552408.svg" },
//Writing Seminar/AP Seminar
//Source: https://www.flaticon.com/free-icon/writing_176690 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "SEM(INAR)? ", url: "https://image.flaticon.com/icons/svg/176/176690.svg" },
{ regex: "SEM(INAR)?\\b", url: "https://image.flaticon.com/icons/svg/176/176690.svg" },
//Discrete Math
//Source: https://www.flaticon.com/free-icon/calculating_251986 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "DISCR", url: "https://image.flaticon.com/icons/svg/251/251986.svg" },
Expand All @@ -65,51 +65,114 @@ var icons = [
//Band
//Source: https://www.flaticon.com/free-icon/drums_718543 by DinosoftLabs under Flaticon Basic License (CC BY 3.0)
{ regex: "BAND|MAR DYN", url: "https://image.flaticon.com/icons/svg/718/718543.svg" },
//Music (Generic)
//Music
//Source: https://www.flaticon.com/free-icon/treble-clef_579496 by Twitter under CC BY 3.0
{ regex: "MUSIC", url: "https://image.flaticon.com/icons/svg/579/579496.svg" },
{ regex: "MUSIC|JAZZ|CHOIR", url: "https://image.flaticon.com/icons/svg/579/579496.svg" },
//Biology
//Source: https://www.flaticon.com/free-icon/dna_620366 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "BIO(LOGY)? ", url: "https://image.flaticon.com/icons/svg/620/620366.svg" },
{ regex: "BIO(LOGY)?\\b", url: "https://image.flaticon.com/icons/svg/620/620366.svg" },
//Literature
//Source: https://www.flaticon.com/free-icon/open-book_167755 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: " LIT ", url: "https://image.flaticon.com/icons/svg/167/167755.svg" },
{ regex: "(^|\\b)LIT(ERATURE)?\\b", url: "https://image.flaticon.com/icons/svg/167/167755.svg" },
//Economics
//Source: https://www.flaticon.com/free-icon/profit_712743 by DinosoftLabs under Flaticon Basic License (CC BY 3.0)
{ regex: "ECON(O(MICS)?)?", url: "https://image.flaticon.com/icons/svg/712/712743.svg" },
//Statistics
//Source: https://www.flaticon.com/free-icon/graph_138349 by Smashicons under Flaticon Basic License (CC BY 3.0)
{ regex: "STAT(STICS|ISTCS)|STATS?|STATISTICS ", url: "https://image.flaticon.com/icons/svg/138/138349.svg" },
//Source: https://www.flaticon.com/free-icon/analysis_1006636 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "STAT(STICS|ISTCS)|STATS?|STATISTICS", url: "https://image.flaticon.com/icons/svg/1006/1006636.svg" },
//Film
//Source: https://www.flaticon.com/free-icon/video-camera_321799 by Vectors Market under Flaticon Basic License (CC BY 3.0)
{ regex: "FILM(MAKING)? ", url: "https://image.flaticon.com/icons/svg/321/321799.svg" },
{ regex: "FILM(MAKING)?\\b", url: "https://image.flaticon.com/icons/svg/321/321799.svg" },
//Geology
//Source: https://www.flaticon.com/free-icon/science_184647 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: " GEOLOGY ", url: "https://image.flaticon.com/icons/svg/184/184647.svg" },
{ regex: "GEOLOGY", url: "https://image.flaticon.com/icons/svg/184/184647.svg" },
//Government
//Source: https://www.flaticon.com/free-icon/university_167718 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: " GOVT ", url: "https://image.flaticon.com/icons/svg/167/167718.svg" },
//English (Generic)
{ regex: "\\bGOVT\\b", url: "https://image.flaticon.com/icons/svg/167/167718.svg" },
//Geometry
//Source: https://www.flaticon.com/free-icon/office-material_258316 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "GEOM", url: "https://image.flaticon.com/icons/svg/258/258316.svg" },
//Guitar
//Source: https://www.flaticon.com/free-icon/guitar_1586234 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "GUITAR", url: "https://image.flaticon.com/icons/svg/1586/1586234.svg" },
//English (Generic), Creative Writing, Composition
//Source: https://www.flaticon.com/free-icon/signing_254022 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "ENG(LISH)? ", url: "https://image.flaticon.com/icons/svg/254/254022.svg" },
{ regex: "ENG(LISH)?\\b|CREAT(IVE)? WRI?T(ING)?|\\bCOMP(OSITION)?\\b", url: "https://image.flaticon.com/icons/svg/254/254022.svg" },
//Spanish (Generic)
//Source: https://www.flaticon.com/free-icon/spain_206724 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "SPAN(ISH)? ", url: "https://image.flaticon.com/icons/svg/206/206724.svg" },
{ regex: "SPAN(ISH)?\\b", url: "https://image.flaticon.com/icons/svg/206/206724.svg" },
//French (Generic)
//Source: https://www.flaticon.com/free-icon/france_206657 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "FREN(CH)? ", url: "https://image.flaticon.com/icons/svg/206/206657.svg" },
{ regex: "FREN(CH)?\\b", url: "https://image.flaticon.com/icons/svg/206/206657.svg" },
//Environmental Science
//Source: https://www.flaticon.com/free-icon/recycle_291211 by Maxim Basinski under CC BY 3.0
{ regex: "ENV", url: "https://image.flaticon.com/icons/svg/291/291211.svg" },
//Robotics
//Source: https://www.flaticon.com/free-icon/robotic-arm_1546683 by Eucalyp under Flaticon Basic License (CC BY 3.0)
{ regex: "ROBOT", url: "https://image.flaticon.com/icons/svg/1546/1546683.svg" },
//Flight and Space
//Source: https://www.flaticon.com/free-icon/globe_744502 by Vectors Market under Flaticon Basic License (CC BY 3.0)
{ regex: "FLIGHT|SPACE", url: "https://image.flaticon.com/icons/svg/744/744502.svg" },
//Geography
//Source: https://www.flaticon.com/free-icon/globe_717982 by DinosoftLabs under Flaticon Basic License (CC BY 3.0)
{ regex: "GEOG", url: "https://image.flaticon.com/icons/svg/717/717982.svg" },
//Science (Generic)
//Source: https://image.flaticon.com/icons/svg/167/167733.svg by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "SCIENCE", url: "https://image.flaticon.com/icons/svg/167/167733.svg" },
//Art (Generic)
//Source: https://www.flaticon.com/free-icon/creativity_1497573 by Smashicons under Flaticon Basic License (CC BY 3.0)
{ regex: "(^|\\b)ART\\b", url: "https://image.flaticon.com/icons/svg/1497/1497573.svg" },
//Dance
//Source: https://www.flaticon.com/free-icon/dancing_493507 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "DANCE", url: "https://image.flaticon.com/icons/svg/493/493507.svg" },
//Museum Studies
//Source: https://www.flaticon.com/free-icon/banks_252032 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "MUSEUM", url: "https://image.flaticon.com/icons/svg/252/252032.svg" },
//Golf
//Source: https://www.flaticon.com/free-icon/golf_1584143 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "GOLF", url: "https://image.flaticon.com/icons/svg/1584/1584143.svg" },
//English Language Development
//Source: https://www.flaticon.com/free-icon/book_947478 by Eucalyp under Flaticon Basic License (CC BY 3.0)
{ regex: "(^|\\b)ELD\\b|(^|\\b)ELL\\b", url: "https://image.flaticon.com/icons/svg/947/947478.svg" },
//Theater/Drama
//Source: https://www.flaticon.com/free-icon/theater_214351 by Pixel Buddha under Flaticon Basic License (CC BY 3.0)
{ regex: "(^|\\b)THEA(TER)?\\b|DRAMA", url: "https://image.flaticon.com/icons/svg/214/214351.svg" },
//Leadership
//Source: https://www.flaticon.com/free-icon/government_1534091 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "LEADERSHIP", url: "https://image.flaticon.com/icons/svg/1534/1534091.svg" },
//TA, Peer Counseling
//Source: https://www.flaticon.com/free-icon/collaboration_1402119 by Eucalyp under Flaticon Basic License (CC BY 3.0)
{ regex: "SERVICE|PEER COUNSELING", url: "https://image.flaticon.com/icons/svg/1402/1402119.svg" },
// IB Middle Years Program Sci/Tech
//Source: https://www.flaticon.com/free-icon/idea_1460471 by Eucalyp under Flaticon Basic License (CC BY 3.0)
{ regex: "MYP ST TECH", url: "https://image.flaticon.com/icons/svg/1460/1460471.svg" },
//Latin
//Source: https://www.flaticon.com/free-icon/manuscript_1020074 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "LATIN", url: "https://image.flaticon.com/icons/svg/1020/1020074.svg" },
//Humanities
//Source: https://www.flaticon.com/free-icon/discussion_1205495 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "HUMANITI?E?S?", url: "https://image.flaticon.com/icons/svg/1205/1205495.svg" },
//Yearbook
//Source: https://www.flaticon.com/free-icon/memories_1006107 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "YEARBOOK", url: "https://image.flaticon.com/icons/svg/1006/1006107.svg" },
//Networking
//Source: https://www.flaticon.com/free-icon/network_1554377 by srip under Flaticon Basic License (CC BY 3.0)
{ regex: "NETWORKING", url: "https://image.flaticon.com/icons/svg/1554/1554377.svg" },
//Research
//Source: https://www.flaticon.com/free-icon/research_164996 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "RES(EA)?RCH", url: "https://image.flaticon.com/icons/svg/164/164996.svg" },
//No Period
//Source: https://www.flaticon.com/free-icon/house_149064 by Smashicons under Flaticon Basic License (CC BY 3.0)
{ regex: "HOME", url: "https://image.flaticon.com/icons/svg/149/149064.svg" },
//College Prep, etc.
//Source: https://www.flaticon.com/free-icon/mortarboard_167743 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "COL(LEGE)?\\b", url: "https://image.flaticon.com/icons/svg/167/167743.svg" },
//Career exploration
//Source: https://www.flaticon.com/free-icon/briefcase_149018 by Smashicons under Flaticon Basic License (CC BY 3.0)
{ regex: "CAREER|JOB", url: "https://image.flaticon.com/icons/svg/149/149018.svg" },
//Advisory, Homeroom, No Period
//Source: https://www.flaticon.com/free-icon/books_167756 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: "ADVIS|HOME|SOCIAL COM", url: "https://image.flaticon.com/icons/svg/167/167756.svg" },
//Math (Generic)
//Source: https://www.flaticon.com/free-icon/mathematics_1284095 by surang under Flaticon Basic License (CC BY 3.0)
{ regex: "(^|\\b)MATH", url: "https://image.flaticon.com/icons/svg/1284/1284095.svg" },
//All classes without an image
//Source: https://www.flaticon.com/free-icon/bookshelf_164949 by Freepik under Flaticon Basic License (CC BY 3.0)
{ regex: ".", url: "https://image.flaticon.com/icons/svg/164/164949.svg" }
Expand Down
13 changes: 12 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"update_url": "https://aopell.me/SchoologyPlus/update.json"
}
},
"version": "5.3.1",
"version": "5.3.2",
"icons": {
"128": "imgs/[email protected]",
"64": "imgs/[email protected]",
Expand Down Expand Up @@ -169,6 +169,17 @@
],
"run_at": "document_end"
},
{
"matches": [
"https://lms.lausd.net/courses",
"https://lms.lausd.net/courses/*"
],
"js": [
"js/course.js",
"js/courses.js"
],
"run_at": "document_end"
},
{
"matches": [
"https://lms.lausd.net/*"
Expand Down

0 comments on commit ae93aba

Please sign in to comment.