Skip to content

Commit 597e4fa

Browse files
authored
Merge pull request #4 from mjakeman/qol-changes
v0.3 - Auto Updating / Misc Changes
2 parents 3d67c8f + a2a6de2 commit 597e4fa

File tree

9 files changed

+3173
-2665
lines changed

9 files changed

+3173
-2665
lines changed

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
run: npm install --global web-ext && web-ext build --no-config-discovery
3333

3434
- name: Validate Web Extension (Firefox)
35-
run: web-ext lint --no-config-discovery
35+
run: web-ext lint --self-hosted --no-config-discovery

css/Easel.module.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
background-color: #111;
4343
}
4444

45+
.SidebarItemActive {
46+
background: #49bfaa;
47+
}
48+
49+
.SidebarItemActive:hover {
50+
background: rgb(58, 184, 161);
51+
}
52+
4553
.Sidebar h2,
4654
.SidebarMessage {
4755
padding: 0 15px;

fx-updates.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
},
99
{
1010
"version": "0.2",
11-
"update_link": "https://github.com/mjakeman/easel/releases/download/v0.2/easel-firefox.xpi",
11+
"update_link": "https://github.com/mjakeman/easel/releases/download/v0.2/easel-firefox.xpi"
1212
},
1313
{
1414
"version": "0.2.1",
15-
"update_link": "https://github.com/mjakeman/easel/releases/download/v0.2.1/easel-firefox.xpi",
15+
"update_link": "https://github.com/mjakeman/easel/releases/download/v0.2.1/easel-firefox.xpi"
1616
}
1717
]
1818
}
1919
}
20-
}
20+
}

manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"manifest_version": 2,
33
"name": "Easel - Lecture Recordings (UoA)",
4-
"version": "0.2.1",
4+
"version": "0.3",
55
"author": "Matt Jakeman",
66
"description": "An unofficial enhancement suite for watching Lecture Recordings at the University of Auckland.",
77

88
"browser_specific_settings": {
99
"gecko": {
10-
"id": "easel@mattjakeman.com"
10+
"id": "easel@mattjakeman.com",
11+
"update_url": "https://raw.githubusercontent.com/mjakeman/easel/master/fx-updates.json"
1112
}
1213
},
1314

package-lock.json

Lines changed: 3129 additions & 2644 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,21 @@
2424
"webpack-dev-server": "^3.11.2"
2525
},
2626
"dependencies": {
27-
"typescript-plugin-css-modules": "^3.4.0",
28-
"@types/arrive": "^2.4.0",
29-
"@types/jest": "^26.0.23",
30-
"@types/node": "^12.20.15",
31-
"@types/react": "^17.0.11",
32-
"@types/react-dom": "^17.0.7",
27+
"@types/arrive": "^2.4.1",
28+
"@types/jest": "^26.0.24",
29+
"@types/node": "^12.20.17",
30+
"@types/react": "^17.0.15",
31+
"@types/react-dom": "^17.0.9",
3332
"arrive": "^2.4.1",
3433
"react": "^17.0.2",
3534
"react-dom": "^17.0.2",
3635
"react-scripts": "4.0.3",
37-
"ts-loader": "^9.2.3",
38-
"typescript": "^4.3.2",
36+
"ts-loader": "^9.2.4",
37+
"typescript": "^4.3.5",
38+
"typescript-plugin-css-modules": "^3.4.0",
39+
"web-ext": "^6.2.0",
3940
"web-vitals": "^1.1.2",
4041
"webextension-polyfill-ts": "^0.25.0",
41-
"webpack": "^5.38.1"
42+
"webpack": "^5.46.0"
4243
}
4344
}

src/components/SidebarItem.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ export interface SidebarItemProps {
1010
export class SidebarItem extends React.Component<SidebarItemProps, {}> {
1111
render() {
1212
let recording = this.props.recording;
13-
return <a className={Style.SidebarItem} href={recording.url}>{recording.title}</a>
13+
14+
// Check if the target URL matches our current URL
15+
let isActive = (recording.url === window.location.href);
16+
17+
var activeClass = isActive
18+
? Style.SidebarItemActive
19+
: "";
20+
21+
return <a className={`${Style.SidebarItem} ${activeClass}`} href={recording.url}>{recording.title}</a>
1422
}
1523
}

src/recordings.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ btn.onclick = function() {
3838
let title = titleAnchor.innerText;
3939
let url = titleAnchor.href;
4040

41+
// Replace mediastore URLs with mediaplayer
42+
if (url.includes("mediastore")) {
43+
url = url.replace("mediastore", "mediaplayer");
44+
}
45+
4146
let lectureInfo = lecture.querySelectorAll("td");
4247
if (lectureInfo === null)
4348
continue;

src/video.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ function load() {
1717
}
1818

1919
// Redirect to mediaplayer
20-
let url = window.location.href;
20+
// let url = window.location.href;
2121

22-
if (url.includes("mediastore")) {
23-
var newUrl = window.location.href.replace("mediastore", "mediaplayer");
24-
window.location.replace(newUrl);
25-
}
22+
// if (url.includes("mediastore")) {
23+
// var newUrl = window.location.href.replace("mediastore", "mediaplayer");
24+
// window.location.replace(newUrl);
25+
// }
2626

2727
document.arrive("video", load);

0 commit comments

Comments
 (0)