fixed validation
This commit is contained in:
@@ -34,7 +34,7 @@ body {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
ul{
|
||||
ul {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
@@ -51,9 +51,11 @@ ul{
|
||||
margin-right: 10px;
|
||||
border-radius: 7px;
|
||||
}
|
||||
.settings:hover{
|
||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
|
||||
.settings:hover {
|
||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
}
|
||||
|
||||
.matbut {
|
||||
border: none;
|
||||
outline: none;
|
||||
@@ -167,28 +169,30 @@ ul{
|
||||
animation: ripple 1s ease-out;
|
||||
}
|
||||
|
||||
input{
|
||||
input {
|
||||
width: 80px;
|
||||
border-radius: 5px;
|
||||
color: #ff691a;
|
||||
color: #FF0000;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
outline: 0;
|
||||
}
|
||||
input[type=number]::-webkit-inner-spin-button,
|
||||
input[type=number]::-webkit-outer-spin-button {
|
||||
|
||||
input[type=number]::-webkit-inner-spin-button,
|
||||
input[type=number]::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
margin: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
::placeholder{
|
||||
color:#ffbd9a;
|
||||
::placeholder {
|
||||
color: #FF0000;
|
||||
}
|
||||
|
||||
.select-style {
|
||||
border: 1.5px solid #ff691a;
|
||||
border: 1.5px solid #FF0000;
|
||||
width: 60px;
|
||||
margin-right: 5px;
|
||||
border-radius: 5px;
|
||||
@@ -201,7 +205,7 @@ input[type=number]::-webkit-outer-spin-button {
|
||||
padding: 5px 8px;
|
||||
width: 130%;
|
||||
border: none;
|
||||
color:#ff691a;
|
||||
color: #FF0000;
|
||||
box-shadow: none;
|
||||
background: transparent;
|
||||
background-image: none;
|
||||
|
||||
@@ -13,7 +13,25 @@ $(function () {
|
||||
]);
|
||||
const fadetime = 150;
|
||||
const butdelay = 75;
|
||||
$("#calendar").prepend('<div id="myModal" class="modal"><div class="modal-content"><span class="close">×</span><div class="card"><div id="colorStrip" style="height:10px;"></div><div class="cardcontainer"><div><div style="display:flex;"><h2 id="classname">Classname</h2></div><p id="prof">Prof</p></div><div id="timelines"></div><button id="info" class="matbut" style="font-size:medium; margin-right: auto; margin-left:auto; background: #2196F3;">More Info</button><button id="register" class="matbut" style="font-size:medium; margin-right: auto; margin-left:10px; background: #4CAF50;">Register</button><button id="remove" class="matbut" style="font-size:medium;margin:10px;background: #FF0000;">Remove</button></div></div></div></div>');
|
||||
$("#calendar").prepend(`<div id="myModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="close">×</span>
|
||||
<div class="card">
|
||||
<div id="colorStrip" style="height:10px;"></div>
|
||||
<div class="cardcontainer">
|
||||
<div>
|
||||
<div style="display:flex;">
|
||||
<h2 id="classname">Classname</h2>
|
||||
</div>
|
||||
<p id="prof">Prof</p>
|
||||
</div>
|
||||
<div id="timelines"></div>
|
||||
<button id="info" class="matbut" style="font-size:medium; margin-right: auto; margin-left:auto; background: #2196F3;">More Info</button>
|
||||
<button id="register" class="matbut" style="font-size:medium; margin-right: auto; margin-left:10px; background: #4CAF50;">Register</button>
|
||||
<button id="remove" class="matbut" style="font-size:medium;margin:10px;background: #FF0000;">Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>`);
|
||||
// Counter to iterate through material colors to avoid duplicates
|
||||
var colorCounter = 0;
|
||||
// Each schedule needs to store 'TITLE - START TIME - END TIME - COLOR'
|
||||
|
||||
@@ -278,7 +278,12 @@ $("#importOrig").change(function (e) {
|
||||
function validateObject(impCourses) {
|
||||
for (var i = 0; i < impCourses.length; i++) {
|
||||
var course = impCourses[i];
|
||||
var isValid = course["coursename"] && course["datetimearr"] && course["link"] && course["profname"] && course["status"] && course["unique"];
|
||||
var isValid = true;
|
||||
var props = ["coursename", "datetimearr", "link", "profname", "status", "unique"];
|
||||
console.log(course.coursename);
|
||||
for (let j = 0; j < props.length; j++) {
|
||||
isValid &= course.hasOwnProperty(props[j]);
|
||||
}
|
||||
console.log(isValid);
|
||||
if (!isValid) {
|
||||
return false;
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
<input type="file" id="importOrig" accept=".json" style="display:none" />
|
||||
<div class="settings">
|
||||
<div id='semcon' class="select-style">
|
||||
<select id="semesters" style="display: none;margin-right: 5px; border-color: #ff691a; margin-top: 3px;">
|
||||
<select id="semesters" style="display: none;margin-right: 5px; border-color: #FF0000; margin-top: 3px;">
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" id="class_id" name="class_id" maxlength="5" style="display:none;text-indent: 10px;border-style: solid; border-color:#ff691a;"
|
||||
<input type="text" id="class_id" name="class_id" maxlength="5" style="display:none;text-indent: 10px;border-style: solid; border-color:#FF0000;"
|
||||
placeholder="Unique #?"></input>
|
||||
|
||||
<button title='Search' style="background-color:white;" class="settingsbut" id='search'>
|
||||
@@ -40,12 +40,12 @@
|
||||
</i>
|
||||
</button>
|
||||
<button title='Export' style="background-color:white; display:none;" class="settingsbut" id='export'>
|
||||
<i style='color:#ff691a' class="material-icons">
|
||||
<i style='color:#FF0000' class="material-icons">
|
||||
arrow_downward
|
||||
</i>
|
||||
</button>
|
||||
<button title='Import' style="background-color:white; display:none;" class="settingsbut" id='import'>
|
||||
<i style='color:#ff691a' ; class="material-icons">
|
||||
<i style='color:#FF0000' ; class="material-icons">
|
||||
arrow_upward
|
||||
</i>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user