More memes

This commit is contained in:
Sriram Hariharan
2019-01-10 22:16:10 -06:00
parent 99ecac6f5d
commit 9673364130
3 changed files with 23 additions and 9 deletions

View File

@@ -3,7 +3,9 @@ chrome.storage.sync.get('savedCourses', function (data) {
chrome.browserAction.setBadgeBackgroundColor({
color: '#bf5700'
});
chrome.browserAction.setBadgeText({ text: "" + data.savedCourses.length });
chrome.browserAction.setBadgeText({
text: "" + data.savedCourses.length
});
}
});
/* Handle messages and their commands from content and popup scripts*/
@@ -160,7 +162,9 @@ function add(request, sender, sendResponse) {
chrome.browserAction.setBadgeBackgroundColor({
color: '#bf5700'
});
chrome.browserAction.setBadgeText({ text: "" + courses.length });
chrome.browserAction.setBadgeText({
text: "" + courses.length
});
sendResponse({
done: "Added: (" + request.course.unique + ") " + request.course.coursename,
label: "Remove Course -"
@@ -183,7 +187,9 @@ function remove(request, sender, sendResponse) {
chrome.browserAction.setBadgeBackgroundColor({
color: '#bf5700'
});
chrome.browserAction.setBadgeText({ text: "" + courses.length });
chrome.browserAction.setBadgeText({
text: "" + courses.length
});
sendResponse({
done: "Removed: (" + request.course.unique + ") " + request.course.coursename,
label: "Add Course +"

View File

@@ -66,8 +66,10 @@ function showEmpty() {
"No Work Happens On PCL 5th Floor.", "Sophomore But Freshman By Credit.", "Pain is temporary, GPA is forever.",
"You've Yee'd Your Last Haw.", "lol everything is already waitlisted.", "At Least You're Not At A&M.",
`It's ${moment().format("h:mm")} and OU Still Sucks.`, 'TeXAs iS BaCK GuYZ', "'Academically Challenged'",
'Does McCombs teach Parseltongue?'
'Does McCombs teach Parseltongue?', 'Lets make Daddy Fenves proud.', 'Feel bad if you say Wampus.', 'No Cruce Enfrente Del Bus.',
'Midterm 1 has been Unmuted', 'Omae Wa Mou Shindeiru...', 'Bevo Bucks are the new Bitcoin'
]
// console.log(emptyText.length);
$("#courseList").hide();
$("#empty").fadeIn(200);
$("#main").html(emptyText[Math.floor(Math.random() * emptyText.length)]);
@@ -218,8 +220,11 @@ $(document).ready(function () {
type: "octet/stream"
}));
exportlink.setAttribute('href', url);
exportlink.setAttribute('download', 'my_courses.json');
exportlink.click();
var name = prompt('W');
if (name) {
exportlink.setAttribute('download', name + '.json');
exportlink.click();
}
} else {
alert('You have no Saved Courses to export.');
}
@@ -264,7 +269,9 @@ $("#importOrig").change(function (e) {
chrome.browserAction.setBadgeBackgroundColor({
color: '#bf5700'
});
chrome.browserAction.setBadgeText({ text: "" + impCourses.length });
chrome.browserAction.setBadgeText({
text: "" + impCourses.length
});
chrome.tabs.query({}, function (tabs) {
for (var i = 0; i < tabs.length; i++) {
chrome.tabs.sendMessage(tabs[i].id, {
@@ -376,7 +383,9 @@ function clear() {
chrome.browserAction.setBadgeBackgroundColor({
color: '#bf5700'
});
chrome.browserAction.setBadgeText({ text: "" });
chrome.browserAction.setBadgeText({
text: ""
});
$("#courseList").empty()
console.log("cleared");
showEmpty();

1
todo
View File

@@ -7,7 +7,6 @@ FEATURES:
- clean upcalendar export and add more options to screen
- maybe show how many people have a class in their cart
- more 'at a glance info'
- start saving the semester
BUGS TO FIX:
- Fix the update/install bug