Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
doprz committed Mar 6, 2023
2 parents cbb9649 + 356f1ac commit c4cebcc
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 28 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Course registration doesn't have to feel like shopping for Black Friday anymore.

UT Registration Planner features automatic course conflict highlighting and a modern UI for a fast and intuitive experience registering for courses while featuring a full light or dark mode theme based on your system preference.

[Note]: Please be mindful of other extensions that modify the course registration page as it may cause undesired behavior.

Clicking the `UTRP` button will open a modal that shows course information such as:
- Instructors
- Times
Expand Down
5 changes: 4 additions & 1 deletion content-scripts/components/CSUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ const CSUI = () => {
setCourse(course)
// console.log(course)
const courseUID = course.uid
const url = `https://utdirect.utexas.edu/apps/registrar/course_schedule/20232/${courseUID}/`

const semesterCodeURL = window.location.href
const semesterCode = semesterCodeURL.match(/.*utdirect.utexas.edu\/apps\/registrar\/course_schedule\/(\d+).*/)[1]
const url = `https://utdirect.utexas.edu/apps/registrar/course_schedule/${semesterCode}/${courseUID}/`

axios.get(url).then(({ data }) => {
const $ = cheerio.load(data)
Expand Down
2 changes: 1 addition & 1 deletion content-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "content-scripts",
"version": "1.2.0",
"version": "1.2.1",
"scripts": {
"dev": "plasmo dev",
"build": "plasmo build",
Expand Down
21 changes: 21 additions & 0 deletions extension/content/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,25 @@ chrome.runtime.onConnect.addListener(function (port) {
})
}
})
})

const getUserCourseList = async () => {
try {
return userCourseList = await getStorage("userCourseList")
} catch (error) {
console.error(error)
}
}

chrome.storage.onChanged.addListener(async (changes) => {
// console.log(changes)
userCourseList = await getUserCourseList()
courses = userCourseList.length ? `${userCourseList.length}` : undefined

if (userCourseList && courses) {
chrome.action.setBadgeBackgroundColor({ color: "#bf5700" })
chrome.action.setBadgeText({ text: courses })
} else {
chrome.action.setBadgeText({ text: "" })
}
})
46 changes: 23 additions & 23 deletions extension/content/csui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "UT Registration Planner",
"description": "Improves the course registration process at the University of Texas at Austin.",
"version": "1.2.0",
"version": "1.2.1",
"manifest_version": 3,
"icons": {
"16": "icons/UT-Registration-Planner-Icon16.png",
Expand Down
2 changes: 1 addition & 1 deletion ut-registration-planner/components/QuickActionsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const QuickActionsBar = (props: Props) => {
tooltip="Search"
onClick={() =>
openNewTab(
"https://utdirect.utexas.edu/apps/registrar/course_schedule/20232"
"https://utdirect.utexas.edu/apps/registrar/course_schedule/20239"
)
}
>
Expand Down
2 changes: 1 addition & 1 deletion ut-registration-planner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ut-registration-planner",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down

0 comments on commit c4cebcc

Please sign in to comment.