reorganization

This commit is contained in:
Sriram Hariharan
2018-07-16 17:28:01 -05:00
parent 5f13c60923
commit add9171851
14 changed files with 727 additions and 718 deletions

View File

@@ -1,197 +1,197 @@
/* The Modal (background) */ /* The Modal (background) */
.modal { .modal {
display: none; /* Hidden by default */ display: none; /* Hidden by default */
position: fixed; /* Stay in place */ position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */ z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */ padding-top: 100px; /* Location of the box */
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
height: 100%; /* Full height */ height: 100%; /* Full height */
background-color: rgb(0,0,0); /* Fallback color */ background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
} }
.modal-content { .modal-content {
background-color: #fefefe; background-color: #fefefe;
margin: auto; margin: auto;
max-height: 85%; max-height: 85%;
overflow-y: auto; overflow-y: auto;
padding: 20px; padding: 20px;
border: 1px solid #888; border: 1px solid #888;
width: 50%; width: 50%;
} }
/* The Close Button */ /* The Close Button */
.close { .close {
color: #aaaaaa; color: #aaaaaa;
float: right; float: right;
padding: 5px; padding: 5px;
font-size: 28px; font-size: 28px;
font-weight: bold; font-weight: bold;
} }
.title { .title {
font-size: x-large; font-size: x-large;
font-weight: bold ; font-weight: bold ;
padding-top: 5px; padding-top: 5px;
padding-left: 5px; padding-left: 5px;
margin:5px 0px 5px 0px; margin:5px 0px 5px 0px;
} }
.description { .description {
padding: 5px; padding: 5px;
font-size: 15px; font-size: 15px;
font-weight: normal; font-weight: normal;
} }
.profname { .profname {
margin-left: 5px; margin-left: 5px;
padding-bottom: 5px; padding-bottom: 5px;
font-size: medium; font-size: medium;
margin-top: 10px; margin-top: 10px;
} }
.dateTimePlace { .dateTimePlace {
margin-left: 5px; margin-left: 5px;
font-size: smaller; font-size: smaller;
font-weight: bold; font-weight: bold;
} }
#chart { #chart {
min-width: auto; min-width: auto;
max-width: 800px; max-width: 800px;
height: 250px; height: 250px;
margin: 0 auto margin: 0 auto
z-index:1; z-index:1;
} }
.card { .card {
/* Add shadows to create the "card" effect */ /* Add shadows to create the "card" effect */
transition: 0.3s; transition: 0.3s;
margin-bottom: 10px; 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)
} }
/* On mouse-over, add a deeper shadow */ /* On mouse-over, add a deeper shadow */
.card:hover { .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)
} }
/* Add some padding inside the card container */ /* Add some padding inside the card container */
.cardcontainer { .cardcontainer {
padding: 2px 16px; padding: 2px 16px;
transition:width 300ms ease-in-out, height 300ms ease-in-out; transition:width 300ms ease-in-out, height 300ms ease-in-out;
} }
.description { .description {
padding: 10px; padding: 10px;
} }
.close:hover, .close:hover,
.close:focus { .close:focus {
color: #000; color: #000;
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
} }
.topbuttons .matbut { .topbuttons .matbut {
display:inline-block; display:inline-block;
} }
/* Material style */ /* Material style */
.matbut { .matbut {
border: none; border: none;
outline: none; outline: none;
cursor: pointer; cursor: pointer;
color: white; color: white;
margin: 10px 10px 10px 0px; margin: 10px 10px 10px 0px;
padding: 10px 10px; padding: 10px 10px;
border-radius: 10px; border-radius: 10px;
font-size: medium; font-size: medium;
font-style: bold; font-style: bold;
box-shadow: 2px 2px 4px rgba(0, 0, 0, .4); box-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
background: #FF9800; background: #FF9800;
} }
/* Ripple magic */ /* Ripple magic */
.matbut{ .matbut{
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.matbut:after { .matbut:after {
content: ''; content: '';
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
width: 5px; width: 5px;
height: 5px; height: 5px;
background: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .5);
opacity: 0; opacity: 0;
border-radius: 100%; border-radius: 100%;
transform: scale(1, 1) translate(-50%); transform: scale(1, 1) translate(-50%);
transform-origin: 50% 50%; transform-origin: 50% 50%;
} }
@keyframes ripple { @keyframes ripple {
0% { 0% {
transform: scale(0, 0); transform: scale(0, 0);
opacity: 1; opacity: 1;
} }
20% { 20% {
transform: scale(25, 25); transform: scale(25, 25);
opacity: 1; opacity: 1;
} }
100% { 100% {
opacity: 0; opacity: 0;
transform: scale(40, 40); transform: scale(40, 40);
} }
} }
.matbut:focus:not(:active)::after { .matbut:focus:not(:active)::after {
animation: ripple 1s ease-out; animation: ripple 1s ease-out;
} }
#snackbar { #snackbar {
visibility: hidden; visibility: hidden;
min-width: 250px; min-width: 250px;
margin-left: -200px; margin-left: -200px;
background-color: #333; background-color: #333;
color: #fff; color: #fff;
border-radius: 2px; border-radius: 2px;
padding: 16px; padding: 16px;
position: fixed; position: fixed;
z-index: 1; z-index: 1;
left: 50%; left: 50%;
bottom: 30px; bottom: 30px;
} }
#snackbar.show { #snackbar.show {
visibility: visible; visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s; animation: fadein 0.5s, fadeout 0.5s 2.5s;
} }
@-webkit-keyframes fadein { @-webkit-keyframes fadein {
from {bottom: 0; opacity: 0;} from {bottom: 0; opacity: 0;}
to {bottom: 30px; opacity: 1;} to {bottom: 30px; opacity: 1;}
} }
@keyframes fadein { @keyframes fadein {
from {bottom: 0; opacity: 0;} from {bottom: 0; opacity: 0;}
to {bottom: 30px; opacity: 1;} to {bottom: 30px; opacity: 1;}
} }
@-webkit-keyframes fadeout { @-webkit-keyframes fadeout {
from {bottom: 30px; opacity: 1;} from {bottom: 30px; opacity: 1;}
to {bottom: 0; opacity: 0;} to {bottom: 0; opacity: 0;}
} }
@keyframes fadeout { @keyframes fadeout {
from {bottom: 30px; opacity: 1;} from {bottom: 30px; opacity: 1;}
to {bottom: 0; opacity: 0;} to {bottom: 0; opacity: 0;}
} }

BIN
grades.db

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -8,7 +8,7 @@ chrome.runtime.onMessage.addListener(function(request, sender, response) {
} }
} }
else if(request.command == "isSingleConflict"){ else if(request.command == "isSingleConflict"){
isSingleConflict(request.dtarr,response); isSingleConflict(request.dtarr,request.unique,response);
} }
else if(request.command == "checkConflicts"){ else if(request.command == "checkConflicts"){
checkConflicts(response); checkConflicts(response);
@@ -58,16 +58,25 @@ function checkConflicts(sendResponse) {
}); });
} }
function isSingleConflict(currdatearr, sendResponse){ function isSingleConflict(currdatearr, unique, sendResponse){
chrome.storage.sync.get('savedCourses', function(data) { chrome.storage.sync.get('savedCourses', function(data) {
var courses = data.savedCourses; var courses = data.savedCourses;
var conflict = false;
for(var i = 0; i<courses.length;i++){ for(var i = 0; i<courses.length;i++){
if(isConflict(currdatearr,courses[i].datetimearr)){ if(isConflict(currdatearr,courses[i].datetimearr)){
sendResponse({isConflict:true}); conflict = true;
return false; break;
} }
} }
sendResponse({isConflict:false}); var contains = false;
var i = 0;
while(i < courses.length && !contains){
if(courses[i].unique == unique){
contains = true;
}
i++;
}
sendResponse({isConflict:conflict,alreadyContains:contains});
}); });
} }

File diff suppressed because it is too large Load Diff

View File

View File

@@ -85,9 +85,7 @@ $(document).ready(function() {
} }
updateConflicts(); updateConflicts();
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
for(var i = 0; i<tabs.length;i++){ chrome.tabs.sendMessage(tabs[0].id, {command: "update"});
chrome.tabs.sendMessage(tabs[i].id, {command: "update"});
}
}); });
}); });
}); });
@@ -145,9 +143,7 @@ function makeLine(index){
function clear(){ function clear(){
chrome.storage.sync.set({savedCourses: []}); chrome.storage.sync.set({savedCourses: []});
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
for(var i = 0; i<tabs.length;i++){ chrome.tabs.sendMessage(tabs[0].id, {command: "update"});
chrome.tabs.sendMessage(tabs[i].id, {command: "update"});
}
}); });
console.log("cleared"); console.log("cleared");
$("#courseList").fadeOut(300,function(){ $("#courseList").fadeOut(300,function(){

View File

@@ -8,18 +8,17 @@
"declarativeContent", "declarativeContent",
"storage", "storage",
"*://*.utdirect.utexas.edu/apps/registrar/course_schedule/*", "*://*.utdirect.utexas.edu/apps/registrar/course_schedule/*",
"*://*.ratemyprofessors.com/*",
"*://*.catalog.utexas.edu/ribbit/" "*://*.catalog.utexas.edu/ribbit/"
], ],
"content_scripts": [{ "content_scripts": [{
"css": ["styles.css"], "css": ["css/styles.css"],
"js": ["moment.min.js","sql-memory-growth.js","highcharts.js","jquery-3.3.1.min.js","content.js"], "js": ["js/moment.min.js","js/sql-memory-growth.js","js/highcharts.js","js/jquery-3.3.1.min.js","js/content.js"],
"matches": ["https://utdirect.utexas.edu/apps/registrar/course_schedule/*"] "matches": ["https://utdirect.utexas.edu/apps/registrar/course_schedule/*"]
}], }],
"web_accessible_resources": [ "web_accessible_resources": [
"grades.db","disticon.png"], "grades.db","images/disticon.png"],
"background": { "background": {
"scripts": ["background.js"], "scripts": ["js/background.js"],
"persistent": true "persistent": true
}, },
"browser_action": { "browser_action": {

View File

@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="popup.css"> <link rel="stylesheet" href="css/popup.css">
</head> </head>
<body> <body>
<div class="card" id="header"> <div class="card" id="header">
@@ -15,8 +15,8 @@
<ul id= "courseList" style="list-style-type: none;padding: 5px;"></ul> <ul id= "courseList" style="list-style-type: none;padding: 5px;"></ul>
<h2 id="empty" style="font-weight: normal;font-size: large;margin: 60px 30px 40px 30px ;">Doesn't Look Like Anything To Me.<br> <h2 id="empty" style="font-weight: normal;font-size: large;margin: 60px 30px 40px 30px ;">Doesn't Look Like Anything To Me.<br>
<span style="font-size: small;display:table;margin:0 auto;font-weight: bold">(No Courses Saved)</span><h2> <span style="font-size: small;display:table;margin:0 auto;font-weight: bold">(No Courses Saved)</span><h2>
<script src="jquery-3.3.1.min.js"></script> <script src="js/jquery-3.3.1.min.js"></script>
<script src="moment.min.js"></script> <script src="js/moment.min.js"></script>
<script src="popup.js"></script> <script src="js/popup.js"></script>
</body> </body>
</html> </html>

6
todo
View File

@@ -1,8 +1,7 @@
TODO as of 7/10/18: TODO as of 7/10/18:
- eureka integration - eureka integration
- use maps for schedule conflict - use maps for schedule conflict
- update page with schedule conflict information - descriiption when not loading properly, whne need to refresh page
CLEAN UP: CLEAN UP:
Everything lmao Everything lmao
@@ -45,5 +44,4 @@ FIXED/DONE as of 7/10/18:
- FIX toast bug - FIX toast bug
- FIX save course when no times blank - FIX save course when no times blank
- FIX Open popup flickering - FIX Open popup flickering
- update page with schedule conflict information
chrome.tabs.create({ 'url': 'chrome://extensions/?options=' + chrome.runtime.id });