From 9673364130dcbbdb2be754203b4cdd5f9774366e Mon Sep 17 00:00:00 2001 From: Sriram Hariharan Date: Thu, 10 Jan 2019 22:16:10 -0600 Subject: [PATCH] More memes --- js/background.js | 12 +++++++++--- js/popup.js | 19 ++++++++++++++----- todo | 1 - 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/js/background.js b/js/background.js index 22ed00fb..681a3d24 100644 --- a/js/background.js +++ b/js/background.js @@ -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 +" diff --git a/js/popup.js b/js/popup.js index 5b5513e4..bfa2c30e 100644 --- a/js/popup.js +++ b/js/popup.js @@ -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(); diff --git a/todo b/todo index bd6c1bc7..1214c552 100644 --- a/todo +++ b/todo @@ -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