Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: manifest v3 #39

Open
wants to merge 43 commits into
base: legacy
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1aa31b2
Initial Commit
Lukas-Zenick Jul 31, 2022
4eaac83
getCurrentSemesters() progress
Lukas-Zenick Jul 31, 2022
335b0c4
add and remove
Lukas-Zenick Aug 1, 2022
22be515
a lot is working
Lukas-Zenick Aug 1, 2022
cf96ca6
GetCurrentDepartments works now
Lukas-Zenick Aug 23, 2022
dc846ce
KEEPALIVE WORKS FOR SEMESTERS
Lukas-Zenick Aug 23, 2022
40013fc
Keepalive for getDepartments() now works too
Lukas-Zenick Aug 23, 2022
fb763ac
Revert "Keepalive for getDepartments() now works too"
Lukas-Zenick Aug 23, 2022
f24e680
Small bugfix
Lukas-Zenick Aug 23, 2022
1cc3c71
Hotfix: cache bug
Lukas-Zenick Aug 24, 2022
dfc0fa7
MoveFilesToDesktop
Lukas-Zenick Aug 27, 2022
ec2a4eb
GRADES LOADING WORKS
Lukas-Zenick Aug 27, 2022
d8ea4c4
Cleanup and merged master
Lukas-Zenick Aug 27, 2022
722d6f4
Merge remote-tracking branch 'upstream/master' into Alternate-Course-…
Lukas-Zenick Aug 28, 2022
04e8b25
Merge remote-tracking branch 'upstream/master' into manifest-v3
Lukas-Zenick Aug 28, 2022
ce84b0a
Merge remote-tracking branch 'upstream/master' into manifest-v3
Lukas-Zenick Aug 28, 2022
1de5b92
most fixes done
Lukas-Zenick Aug 28, 2022
c85d258
Update manifest.json
Lukas-Zenick Aug 28, 2022
6781acb
Revert "Update manifest.json"
Lukas-Zenick Aug 28, 2022
1b94c35
updateTabs() function
Lukas-Zenick Aug 29, 2022
20f478e
Merge remote-tracking branch 'upstream/master' into Alternate-Course-…
Lukas-Zenick Aug 29, 2022
7fdeed5
some changes
Lukas-Zenick Oct 24, 2022
8b18b74
Merge branch 'manifest-v3' into Alternate-Course-Search-Method
Lukas-Zenick Oct 24, 2022
464895e
Button actually switches now
Lukas-Zenick Oct 24, 2022
cdbf583
Actually works for course lookup
Lukas-Zenick Oct 24, 2022
a5ad1d3
style fix
Lukas-Zenick Oct 24, 2022
28f3c65
wrap hotfix
Lukas-Zenick Oct 24, 2022
b663c99
button switches to unfinished popup page
Lukas-Zenick Oct 25, 2022
7b8fcec
donates!
Lukas-Zenick Oct 25, 2022
a6488e7
Back btn
Lukas-Zenick Oct 25, 2022
a3e5d90
!excitement
Lukas-Zenick Oct 25, 2022
5b8700e
addMyTag
Lukas-Zenick Oct 25, 2022
19a439d
hotfix
Lukas-Zenick Oct 25, 2022
3f21f80
color change
Lukas-Zenick Oct 25, 2022
50bd612
Donate Button: loading icon, smooth
Lukas-Zenick Oct 27, 2022
8a781c7
hotfix: 0 Courses caused bug
Lukas-Zenick Nov 27, 2022
0ee3a8c
redundant line
Lukas-Zenick Nov 27, 2022
bf06e18
cleanup
Lukas-Zenick Nov 27, 2022
627ef01
Tiny bugfix on semester name
Lukas-Zenick Dec 12, 2022
bf6a187
fixed importing waitlist and importing courses from WL page
Lukas-Zenick Dec 13, 2022
2827363
Location fix for near-identical class-days
Lukas-Zenick Dec 13, 2022
8db6a99
removed search for now (buggy)
sghsri May 28, 2024
5f5eb20
removed wrong comment
sghsri May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
303 changes: 169 additions & 134 deletions js/background.js → background.js

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion css/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,30 @@
margin: 0;
}

.creator-contributor-name {
font-weight: bold;
margin: 0;
border-style: outset;
border-color: goldenrod;
background-color: gold;
}

.mv3-contributor-name {
font-weight: bold;
margin: 0;
border-style: outset;
border-color: grey;
background-color: silver;
}

.title {
font-weight: bold;
font-size: small;
margin: -0.4rem;
}

.contributor-username {
margin: 0 0 5px 0;
margin: -2px 0 5px 0;
font-style: italic;
}

Expand Down
19 changes: 18 additions & 1 deletion js/Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Template.Main = class {
</div>`;
}
static extension_button() {
return `<td data-th="Plus"><input type="image" class="distButton" id="distButton" width="20" height="20" src='${chrome.extension.getURL("images/disticon.png")}'/></td>`;
//getting here okay
Lukas-Zenick marked this conversation as resolved.
Show resolved Hide resolved
return `<td data-th="Plus"><input type="image" class="distButton" id="distButton" width="20" height="20" src='${chrome.runtime.getURL("images/disticon.png")}'/></td>`;
}
};
Template.Catalog = class {
Expand Down Expand Up @@ -187,6 +188,22 @@ Template.Options = class {
}

static contributor_card(username, name, image_url, profile_url) {
if(name === "Sriram Hariharan") {
return `<div class='card contributor-card' id="${username}" data-url="${profile_url}">
<img class='contributor-image' src="${image_url}"></img>
${name ? `<p class='creator-contributor-name'>${name}</p>` : ""}
<p class='title'>Creator of UTRP</p>
<p class='contributor-username'>${username}</p>
</div>`;
} else if (name === "Lukas Zenick") {
return `<div class='card contributor-card' id="${username}" data-url="${profile_url}">
<img class='contributor-image' src="${image_url}"></img>
${name ? `<p class='mv3-contributor-name'>${name}</p>` : ""}
<p class='title'>Manifest V3</p>
<p class='contributor-username'>${username}</p>
</div>`;
}

return `<div class='card contributor-card' id="${username}" data-url="${profile_url}">
<img class='contributor-image' src="${image_url}"></img>
${name ? `<p class='contributor-name'>${name}</p>` : ""}
Expand Down
2 changes: 1 addition & 1 deletion js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Export.png_options = {
};

class Popup {}
Popup.num_semesters = 2;
Popup.num_semesters = 3;

class Text {}
Text.emptyText = function () {
Expand Down
3 changes: 3 additions & 0 deletions js/courseCatalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ if (!$("#kw_results_table").length) {
// now add to the table
$("table thead th:last-child").after('<th scope=col>Plus</th>');
$('table').find('tr').each(function () {



if (!($(this).find('td').hasClass("course_header")) && $(this).has('th').length == 0) {
$(this).append(Template.Main.extension_button());
}
Expand Down
47 changes: 32 additions & 15 deletions js/popup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var courses;

setCourseList();
getSemesters();
getSemesters(); //goes blank after the service worker dies. Requires closing and reopening popup to repopulate semester data
getDepartments();

var can_remove = true;
Expand Down Expand Up @@ -409,12 +409,22 @@ function getSemesters() {
command: "currentSemesters",
},
function (response) {
let { semesters } = response;
let semester_names = Object.keys(semesters);
for (let i = 0; i < semester_names.length; i++) {
let name = semester_names[i];
$("#semesters").append(`<option value='${semesters[name]}'>${name}</option>`);
}
var { sems } = response;

chrome.storage.local.get("semesterCache", function (data) {
chrome.storage.local.set({
semesterCache: sems
});

semesters = data.semesterCache;

let semester_names = Object.keys(semesters);
for (let i = 0; i < semester_names.length; i++) {
let name = semester_names[i];
$("#semesters").append(`<option value='${semesters[name]}'>${name}</option>`);
}
});

}
);
}
Expand All @@ -425,13 +435,20 @@ function getDepartments() {
command: "currentDepartments",
},
function (response) {
let { departments } = response;
console.log(departments);
for (let i = 0; i < departments.length; i++) {
let abv = departments[i];
$("#department").append(`<option value='${abv}'>${abv}</option>`);
}
// $("#department").val('C S');
let { deps } = response;

chrome.storage.local.get("deptCache", function (data) {
chrome.storage.local.set({
deptCache: deps
});

departments = data.deptCache;

for (let i = 0; i < departments.length; i++) {
let abv = departments[i];
$("#department").append(`<option value='${abv}'>${abv}</option>`);
}
});
}
);
}
}
15 changes: 8 additions & 7 deletions js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,18 @@ function isIndividualCoursePage(){


function updateAllTabsCourseList() {
chrome.tabs.query({}, function (tabs) {
for (var i = 0; i < tabs.length; i++) {
chrome.tabs.sendMessage(tabs[i].id, {
command: "updateCourseList"
});
}
});
// chrome.tabs.query({}, function (tabs) {
// for (var i = 0; i < tabs.length; i++) {
// chrome.tabs.sendMessage(tabs[i].id, {
// command: "updateCourseList"
// });
// }
// });
Lukas-Zenick marked this conversation as resolved.
Show resolved Hide resolved
}

function htmlToNode(response) {
return $('<div/>').html(response).contents();
//return fetch(html(response).contents());
Lukas-Zenick marked this conversation as resolved.
Show resolved Hide resolved
}

function setCurrentTabUrl(link) {
Expand Down
20 changes: 12 additions & 8 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"manifest_version": 2,
"manifest_version": 3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

"name": "UT Registration Plus",
"version": "1.2.2.7",
"version": "1.3.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

"options_page": "options.html",
"description": "Improves the course registration process at the University of Texas at Austin!",
"permissions": [
"storage",
"host_permissions": [
"*://*.utdirect.utexas.edu/apps/registrar/course_schedule/*",
"*://*.utexas.collegescheduler.com/*",
"*://*.catalog.utexas.edu/ribbit/",
"*://*.registrar.utexas.edu/schedules/*",
"*://*.login.utexas.edu/login/*"
],
"permissions": [
Lukas-Zenick marked this conversation as resolved.
Show resolved Hide resolved
"storage"
],
"content_scripts": [
{
"css": ["css/styles.css"],
Expand Down Expand Up @@ -47,12 +49,14 @@
"matches": ["https://utdirect.utexas.edu/registrar/waitlist/wl_see_my_waitlists.WBX", "https://utdirect.utexas.edu/registration/classlist.WBX*"]
}
],
"web_accessible_resources": ["grades.db", "images/disticon.png"],
"web_accessible_resources": [{
"resources": ["grades.db", "images/disticon.png"],
"matches": ["https://*/*"]
}],
"background": {
"scripts": ["js/lib/jquery-3.3.1.min.js", "js/lib/sql-memory-growth.js", "js/lib/moment.min.js", "js/config.js", "js/util.js", "js/background.js"],
"persistent": true
"service_worker": "background.js"
},
"browser_action": {
"action": {
"default_popup": "popup.html",
"default_icon": {
"16": "icons/icon16.png",
Expand Down