From 9b7763af4b36e2b63687ec52578441f7f1a5f9b8 Mon Sep 17 00:00:00 2001 From: 10001shh Date: Fri, 24 Aug 2018 12:16:39 -0500 Subject: [PATCH] fixed login/out bug --- css/styles.css | 13 ++++++------- js/content.js | 13 +++++++++---- todo | 13 +++++++++++++ 3 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 todo diff --git a/css/styles.css b/css/styles.css index 7e79f05a..d8126f12 100644 --- a/css/styles.css +++ b/css/styles.css @@ -22,6 +22,7 @@ } /* The Close Button */ + .close { color: #aaaaaa; float: right; @@ -37,6 +38,7 @@ padding-left: 5px; margin: 5px 0px 5px 0px; } + .description { padding: 5px; font-size: 15px; @@ -58,7 +60,7 @@ #chart { min-width: auto; - max-width: 800px; + max-width: 100%; height: 250px; margin: 0 auto; z-index: 1; @@ -67,13 +69,11 @@ .card { transition: 0.3s; margin-bottom: 10px; - box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), - 0 2px 10px 0 rgba(0, 0, 0, 0.12); + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); } .card:hover { - box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2), - 0 4px 20px 0 rgba(0, 0, 0, 0.19); + box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(0, 0, 0, 0.19); } .cardcontainer { @@ -164,7 +164,6 @@ #snackbar.show { visibility: visible; - -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; animation: fadein 0.5s, fadeout 0.5s 2.5s; } @@ -211,4 +210,4 @@ bottom: 0; opacity: 0; } -} +} \ No newline at end of file diff --git a/js/content.js b/js/content.js index 096feb33..21c7bf3a 100644 --- a/js/content.js +++ b/js/content.js @@ -12,6 +12,8 @@ var datetimearr = []; var chart; var description; var status; +var semesterCode; +var isIndividual = false; const days = new Map([ ["M", "Monday"], @@ -174,6 +176,7 @@ function Course(coursename, unique, profname, datetimearr, status, link) { /*For a row, get all the course information and add the date-time-lines*/ function getCourseInfo(row) { + semesterCode = new URL(window.location.href).pathname.split('/')[4]; $(".dateTimePlace").remove(); $('table').find('tr').each(function () { if ($(this).find('td').hasClass("course_header")) { @@ -199,11 +202,13 @@ function getCourseInfo(row) { return false; } }); - /*Handle if on the individual course page*/ - if (typeof coursename == 'undefined') { + /*Handle if on the individual course page, ie if the textbook button exists*/ + console.log($("#textbook_button").length); + if ($("#textbook_button").length) { coursename = $("#details h2").text(); profinit = $("table").find("td[data-th='Instructor']").text().split(", ")[1].substring(0, 1); profurl = document.URL; + console.log(profurl); } getDescription(); department = coursename.substring(0, coursename.search(/\d/) - 2); @@ -471,6 +476,8 @@ function prettifyName() { /*Get the course description from the profurl and highlight the important elements, as well as set the eCIS, and rmp links.*/ function getDescription() { + console.log(window.location.href); + console.log(profurl); chrome.runtime.sendMessage({ method: "GET", action: "xhttp", @@ -524,9 +531,7 @@ function getDescription() { eCISLink = "http://utdirect.utexas.edu/ctl/ecis/results/index.WBX?"; } }); - } - /* Load the database*/ function loadDataBase() { sql = window.SQL; diff --git a/todo b/todo new file mode 100644 index 00000000..ce21027b --- /dev/null +++ b/todo @@ -0,0 +1,13 @@ +TODO as of 8/24/18 + +FEATURES: +- Textbook button (amber) +- Calendar popup +- something to fill the space to the rght of the main popup window + +BUGS TO FIX: +- RMP not working on individual course pages + +DONE/FIXED: +- unneeded Logout message on individual course pages +