deconstructing class

This commit is contained in:
sghsri
2019-10-27 10:20:21 -05:00
parent 8e4e1a3ecd
commit 05623b947c
5 changed files with 245 additions and 250 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -133,11 +133,23 @@
cursor: pointer; cursor: pointer;
} }
.topbuttons .matbut { .topbuttons .material-button {
display: inline-block; display: inline-block;
} }
.matbut { .rmp-button {
}
.ecis-button {
}
.textbook-button{
}
.material-button {
border: none; border: none;
outline: none; outline: none;
cursor: pointer; cursor: pointer;
@@ -149,14 +161,11 @@
font-style: bold; font-style: bold;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
background: #ff9800; background: #ff9800;
}
.matbut {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.matbut:after { .material-button:after {
content: ""; content: "";
position: absolute; position: absolute;
top: 50%; top: 50%;
@@ -187,7 +196,7 @@
} }
} }
.matbut:focus:not(:active)::after { .material-button:focus:not(:active)::after {
animation: ripple 1s ease-out; animation: ripple 1s ease-out;
} }

View File

@@ -1,5 +1,6 @@
class Template { class Template{}
static Main = class Main {
Template.Main = class {
static modal() { static modal() {
return `<div class=modal id=myModal> return `<div class=modal id=myModal>
<div class=modal-content> <div class=modal-content>
@@ -9,11 +10,11 @@ class Template {
<h2 class=title id="title">Computer Fluency (C S 302)</h2> <h2 class=title id="title">Computer Fluency (C S 302)</h2>
<h2 class=profname id="profname">with Bruce Porter</h2> <h2 class=profname id="profname">with Bruce Porter</h2>
<div id="topbuttons" class=topbuttons> <div id="topbuttons" class=topbuttons>
<button class=matbut id="rateMyProf" style="background: #4CAF50;"> RMP </button> <button class=material-button id="rateMyProf" style="background: #4CAF50;"> RMP </button>
<button class=matbut id="eCIS" style="background: #CDDC39;"> eCIS </button> <button class=material-button id="eCIS" style="background: #CDDC39;"> eCIS </button>
<button class=matbut id="textbook" style="background: #FFC107;"> Textbook </button> <button class=material-button id="textbook" style="background: #FFC107;"> Textbook </button>
<button class=matbut id="Syllabi"> Past Syllabi </button> <button class=material-button id="Syllabi"> Past Syllabi </button>
<button class=matbut id="saveCourse" value="add" style="background: #F44336;"> Save Course +</button> <button class=material-button id="saveCourse" value="add" style="background: #F44336;"> Save Course +</button>
</div> </div>
</div> </div>
</div> </div>
@@ -41,9 +42,8 @@ class Template {
static extension_button() { 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>` return `<td data-th="Plus"><input type="image" class="distButton" id="distButton" width="20" height="20" src='${chrome.extension.getURL('images/disticon.png')}'/></td>`
} }
} }
Template.Catalog = class {
static Catalog = class Catalog {
static loading() { static loading() {
return `<div style="text-align:center"> return `<div style="text-align:center">
<div class="loader" id='loader'></div> <div class="loader" id='loader'></div>
@@ -51,13 +51,11 @@ class Template {
<h1 id="nextlabel"style="color: #FF9800;display:none;">Loading Courses</h1> <h1 id="nextlabel"style="color: #FF9800;display:none;">Loading Courses</h1>
<h1 id="retrylabel"style="color: #F44336;display:none;">Failed to Load Courses</h1> <h1 id="retrylabel"style="color: #F44336;display:none;">Failed to Load Courses</h1>
<br> <br>
<button class=matbut id="retry" style="background: #F44336;display:none;">Retry</button> <button class=material-button id="retry" style="background: #F44336;display:none;">Retry</button>
</div>` </div>`
} }
} }
Template.UTPlanner = class {
static UTPlanner = class UTPlanner{
static modal(){ static modal(){
return `<div class=modal id=myModal> return `<div class=modal id=myModal>
<div class=modal-content> <div class=modal-content>
@@ -67,10 +65,10 @@ class Template {
<h2 class=title id="title">Computer Fluency (C S 302)</h2> <h2 class=title id="title">Computer Fluency (C S 302)</h2>
<h2 class=profname id="profname" style="margin-bottom:0px;">with Bruce Porter</h2> <h2 class=profname id="profname" style="margin-bottom:0px;">with Bruce Porter</h2>
<div id="topbuttons" class=topbuttons> <div id="topbuttons" class=topbuttons>
<button class=matbut id="moreInfo" style="background: #2196F3;"> More Info </button> <button class=material-button id="moreInfo" style="background: #2196F3;"> More Info </button>
<button class=matbut id="textbook" style="background: #FFC107;"> Textbook </button> <button class=material-button id="textbook" style="background: #FFC107;"> Textbook </button>
<button class=matbut id="Syllabi"> Past Syllabi </button> <button class=material-button id="Syllabi"> Past Syllabi </button>
<button class=matbut id="saveCourse" value="add" style="background: #F44336;opacity:.4;"> Unable to Save</button> <button class=material-button id="saveCourse" value="add" style="background: #F44336;opacity:.4;"> Unable to Save</button>
</div> </div>
</div> </div>
</div> </div>
@@ -87,10 +85,8 @@ class Template {
</div> </div>
</div>` </div>`
} }
} }
Template.Calendar = class {
static Calendar = class Calendar {
static line(line) { static line(line) {
let { let {
days, days,
@@ -127,9 +123,8 @@ class Template {
</div> </div>
</div>` </div>`
} }
} }
Template.Popup = class {
static Popup = class Popup {
static list_item(i, list_tile_color, unique, department, number, profname, list_sub_color, line) { static list_item(i, list_tile_color, unique, department, number, profname, list_sub_color, line) {
return `<li id='${i}' class='course_list_item'> return `<li id='${i}' class='course_list_item'>
<div class='card course_list_card'> <div class='card course_list_card'>
@@ -174,21 +169,17 @@ class Template {
</span> </span>
<br>` <br>`
} }
} }
Template.Import = class {
static Import = class Import {
static button_text_default = "<span style='font-size:small'>Import to </span><b>UT Reg +<b>"; static button_text_default = "<span style='font-size:small'>Import to </span><b>UT Reg +<b>";
static waitlist_button_text_default = "<span style='font-size:small'>Import Waitlists to </span><b>UT Reg +<b>"; static waitlist_button_text_default = "<span style='font-size:small'>Import Waitlists to </span><b>UT Reg +<b>";
static button_success = "Courses Saved!"; static button_success = "Courses Saved!";
static import_button() { static import_button() {
return `<button class='matbut' id='import' style='margin:15px 0px;'>${this.button_text_default}</button><br>`; return `<button class='material-button' id='import' style='margin:15px 0px;'>${this.button_text_default}</button><br>`;
} }
static waitlist_import_button() { static waitlist_import_button() {
return `<button class='matbut' id='import_waitlist' style='margin:0px'>${this.waitlist_button_text_default}</button><br>`; return `<button class='material-button' id='import_waitlist' style='margin:0px'>${this.waitlist_button_text_default}</button><br>`;
} }
}
} }

View File

@@ -1,52 +1,48 @@
class Timing { class Timing{}
static fade_time = 100; Timing.fade_time = 100;
static calendar_fade_time = 100; Timing.calendar_fade_time = 100;
static button_delay = 75; Timing.button_delay = 75;
}
class Colors { class Colors{}
static material_colors = ['#4CAF50', '#CDDC39', Colors.material_colors = ['#4CAF50', '#CDDC39',
'#FFC107', '#2196F3', '#F57C00', '#9C27B0', '#FF5722', '#673AB7', '#FFC107', '#2196F3', '#F57C00', '#9C27B0', '#FF5722', '#673AB7',
'#FF5252', '#E91E63', '#009688', '#00BCD4', '#FF5252', '#E91E63', '#009688', '#00BCD4',
'#4E342E', '#424242', '#9E9E9E' '#4E342E', '#424242', '#9E9E9E'
]; ];
static open = "#4CAF50"; Colors.open = "#4CAF50";
static waitlisted = "#FF9800"; Colors.waitlisted = "#FF9800";
static closed = "#FF5722"; Colors.closed = "#FF5722";
static no_status = "#607D8B"; Colors.no_status = "#607D8B";
static open_light = "#C8E6C9"; Colors.open_light = "#C8E6C9";
static waitlisted_light = "#FFE0B2"; Colors.waitlisted_light = "#FFE0B2";
static closed_light = "#FFCCBC"; Colors.closed_light = "#FFCCBC";
static no_status_light = "#CFD8DC"; Colors.no_status_light = "#CFD8DC";
static highlight_conflict = "#F44336"; Colors.highlight_conflict = "#F44336";
static highlight_default = "#333333"; Colors.highlight_default = "#333333";
static highlight_saved = "#4CAF50"; Colors.highlight_saved = "#4CAF50";
static badge_flash = "#FF5722"; Colors.badge_flash = "#FF5722";
static badge_default = "#bf5700"; Colors.badge_default = "#bf5700";
}
class Export {
static png_options = { class Export{}
Export.png_options = {
foreignObjectRendering: true, foreignObjectRendering: true,
logging: true, logging: true,
removeContainer: true, removeContainer: true,
async: true, async: true,
}
} }
class Popup { class Popup {}
static num_semesters = 2; Popup.num_semesters = 2;
}
class Text{}
class Text { Text.emptyText = function(){
static emptyText() {
let arr = ["Doesn't Look Like Anything To Me.", "You Can't Fail Classes You're Not In.", "Pro-Tip: Don't Take O-Chem.", let arr = ["Doesn't Look Like Anything To Me.", "You Can't Fail Classes You're Not In.", "Pro-Tip: Don't Take O-Chem.",
"No Work Happens On PCL 5th Floor.", "Sophomore But Freshman By Credit.", "Pain is temporary, GPA is forever.", "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.", "You've Yee'd Your Last Haw.", "lol everything is already waitlisted.", "At Least You're Not At A&M.",
@@ -57,5 +53,4 @@ class Text {
let index = Math.floor(Math.random() * arr.length); let index = Math.floor(Math.random() * arr.length);
return arr[index]; return arr[index];
}
} }

View File

@@ -12,12 +12,12 @@
<div> <div>
<h2 style="padding: 5px 16px 5px 16px; font-weight: normal;display: inline-block;text-align:left;">Conflict <h2 style="padding: 5px 16px 5px 16px; font-weight: normal;display: inline-block;text-align:left;">Conflict
Highlighting</h2> Highlighting</h2>
<button id="togglecourseConflictHighlight" class="matbut" <button id="togglecourseConflictHighlight" class="material-button"
style="float:right; display:inline-block;font-size:medium;background:#F44336;">Turn style="float:right; display:inline-block;font-size:medium;background:#F44336;">Turn
Off</button> Off</button>
<h2 style="padding: 5px 16px 16px 16px; font-weight: normal;display: inline-block;text-align:left;">Scroll To <h2 style="padding: 5px 16px 16px 16px; font-weight: normal;display: inline-block;text-align:left;">Scroll To
Load More Courses</h2> Load More Courses</h2>
<button id="toggleloadAll" class="matbut" <button id="toggleloadAll" class="material-button"
style="float: right;display:inline-block;font-size:medium;background:#F44336;">Turn style="float: right;display:inline-block;font-size:medium;background:#F44336;">Turn
Off</button> Off</button>
</div> </div>