Added adding work from calendar, fixed #38
This commit is contained in:
parent
12e9017959
commit
1bdd65c4bf
@ -276,6 +276,8 @@ input, textarea {
|
|||||||
#classListHolder h3 {
|
#classListHolder h3 {
|
||||||
font-weight: 200;
|
font-weight: 200;
|
||||||
margin: 5%;
|
margin: 5%;
|
||||||
|
margin-right: 4%;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sideClass {
|
.sideClass {
|
||||||
@ -668,3 +670,49 @@ input, textarea {
|
|||||||
padding: 2%;
|
padding: 2%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#calCreWork {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
color: #fff;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
-webkit-animation: neonglow 1.5s ease-in-out infinite alternate;
|
||||||
|
-moz-animation: neonglow 1.5s ease-in-out infinite alternate;
|
||||||
|
animation: neonglow 1.5s ease-in-out infinite alternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes neonglow {
|
||||||
|
from {
|
||||||
|
text-shadow:
|
||||||
|
0 0 10px #fff,
|
||||||
|
0 0 20px #fff,
|
||||||
|
0 0 30px #fff,
|
||||||
|
0 0 40px #228DFF,
|
||||||
|
0 0 70px #228DFF,
|
||||||
|
0 0 80px #228DFF,
|
||||||
|
0 0 100px #228DFF,
|
||||||
|
0 0 150px #228DFF;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
text-shadow:
|
||||||
|
0 0 5px #fff,
|
||||||
|
0 0 10px #fff,
|
||||||
|
0 0 15px #fff,
|
||||||
|
0 0 20px #228DFF,
|
||||||
|
0 0 35px #228DFF,
|
||||||
|
0 0 40px #228DFF,
|
||||||
|
0 0 50px #228DFF,
|
||||||
|
0 0 75px #228DFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-day:not(.fc-past):not(.fc-other-month) {
|
||||||
|
-webkit-transition: background-color 0.4s ease;
|
||||||
|
-moz-transition: background-color 0.4s ease;
|
||||||
|
-ms-transition: background-color 0.4s ease;
|
||||||
|
transition: background-color 0.4s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-day:not(.fc-past):not(.fc-other-month):hover {
|
||||||
|
background-color: rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
@ -32,7 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="classListHolder">
|
<div id="classListHolder">
|
||||||
<h3>Enrolled</h3>
|
<h3>Enrolled</h3><h3 id="calCreWork">{{calCreWork}}</h3>
|
||||||
{{#each myClasses}}
|
{{#each myClasses}}
|
||||||
{{> sidebarClasses}}
|
{{> sidebarClasses}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
@ -119,7 +119,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="sidebarClasses">
|
<template name="sidebarClasses">
|
||||||
<div class="sideClass">
|
<div class="sideClass" classid="{{_id}}">
|
||||||
<p class="sideClassName">{{name}}</p>
|
<p class="sideClassName">{{name}}</p>
|
||||||
<p class="sideClassHour">{{hour}}</p>
|
<p class="sideClassHour">{{hour}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -42,7 +42,8 @@ Session.set("radioDiv",null);
|
|||||||
Session.set("radioOffset",null);
|
Session.set("radioOffset",null);
|
||||||
Session.set("serverData",null);
|
Session.set("serverData",null);
|
||||||
Session.set("noclass",null);
|
Session.set("noclass",null);
|
||||||
Session.set("updateCalWork",true);
|
Session.set("creCalWork",null);
|
||||||
|
Session.set("calWorkDate",null);
|
||||||
|
|
||||||
Template.registerHelper('divColor', (div) => {
|
Template.registerHelper('divColor', (div) => {
|
||||||
return themeColors[Cookie.get("theme")][div];
|
return themeColors[Cookie.get("theme")][div];
|
||||||
@ -191,21 +192,14 @@ Template.main.helpers({
|
|||||||
var thisReadWork = formReadable(thisWork);
|
var thisReadWork = formReadable(thisWork);
|
||||||
Session.set("currentReadableWork",thisReadWork);
|
Session.set("currentReadableWork",thisReadWork);
|
||||||
openDivFade(document.getElementsByClassName("overlay")[0]);
|
openDivFade(document.getElementsByClassName("overlay")[0]);
|
||||||
|
},
|
||||||
|
dayClick: function(date, jsEvent, view) {
|
||||||
|
if(Session.get("sidebar") !== null) return;
|
||||||
|
if(jsEvent.target.className.includes("fc-other-month") || jsEvent.target.className.includes("fc-past")) return;
|
||||||
|
Session.set("calCreWork",true);
|
||||||
|
Session.set("calWorkDate",date.format());
|
||||||
|
Session.set("sidebar","menuContainer");
|
||||||
}
|
}
|
||||||
/*dayClick: function(date, jsEvent, view) {
|
|
||||||
//Make user select class
|
|
||||||
Session.set("newWork", true);
|
|
||||||
Session.set("currentReadableWork",
|
|
||||||
{
|
|
||||||
name:"Name | Click here to edit...",
|
|
||||||
class:attr,
|
|
||||||
dueDate:"Click here to edit...",
|
|
||||||
description:"Click here to edit...",
|
|
||||||
type:"Click here to edit..."
|
|
||||||
});
|
|
||||||
Session.set("currentWork",{class:attr});
|
|
||||||
openDivFade(document.getElementsByClassName("overlay")[0]);
|
|
||||||
}*/
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
calCenter() {
|
calCenter() {
|
||||||
@ -217,6 +211,13 @@ Template.main.helpers({
|
|||||||
var height = window.innerHeight * 0.76;
|
var height = window.innerHeight * 0.76;
|
||||||
return "width:" + width.toString() + "px;height:" + height.toString() + "px;margin-left:" + (0.5 * window.innerWidth - 0.5 * width).toString() + "px;margin-top:" + (0.47 * window.innerHeight - 0.5 * height).toString() + "px";
|
return "width:" + width.toString() + "px;height:" + height.toString() + "px;margin-left:" + (0.5 * window.innerWidth - 0.5 * width).toString() + "px;margin-top:" + (0.47 * window.innerHeight - 0.5 * height).toString() + "px";
|
||||||
},
|
},
|
||||||
|
calCreWork() {
|
||||||
|
if(Session.get("calCreWork")) {
|
||||||
|
return " -- Pick a Class";
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
},
|
||||||
workCenter() {
|
workCenter() {
|
||||||
var w = window.innerWidth * 0.3;
|
var w = window.innerWidth * 0.3;
|
||||||
var h = window.innerHeight * 0.7;
|
var h = window.innerHeight * 0.7;
|
||||||
@ -228,6 +229,7 @@ Template.main.helpers({
|
|||||||
},
|
},
|
||||||
workType() {
|
workType() {
|
||||||
if(Session.get("currentWork") === null) return;
|
if(Session.get("currentWork") === null) return;
|
||||||
|
if(Session.get("currentWork").type === undefined) return;
|
||||||
type = Session.get("currentWork").type;
|
type = Session.get("currentWork").type;
|
||||||
if(type.includes("edit")) {
|
if(type.includes("edit")) {
|
||||||
return;
|
return;
|
||||||
@ -302,8 +304,12 @@ Template.main.events({
|
|||||||
!e.includes("fa-cog") &&
|
!e.includes("fa-cog") &&
|
||||||
!e.includes("fa-bars") &&
|
!e.includes("fa-bars") &&
|
||||||
!document.getElementById("menuContainer").contains(event.target) &&
|
!document.getElementById("menuContainer").contains(event.target) &&
|
||||||
!document.getElementById("optionsContainer").contains(event.target)) {
|
!document.getElementById("optionsContainer").contains(event.target) &&
|
||||||
Session.set("sidebar", null);
|
!event.target.className.includes("fc-day")) {
|
||||||
|
if(Session.get("calCreWork")) {
|
||||||
|
Session.set("calCreWork",false);
|
||||||
|
}
|
||||||
|
Session.set("sidebar",null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(e === "overlay") {
|
if(e === "overlay") {
|
||||||
@ -506,6 +512,31 @@ Template.main.events({
|
|||||||
todayHighlight: true,
|
todayHighlight: true,
|
||||||
autoclose: true
|
autoclose: true
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
'click .sideClass' (event) {
|
||||||
|
if(!Session.equals("mode","calendar")) return;
|
||||||
|
var div = event.target
|
||||||
|
while(div.getAttribute("classid") === null) div = div.parentNode;
|
||||||
|
var classid = div.getAttribute("classid");
|
||||||
|
|
||||||
|
if(Session.get("calCreWork")) {
|
||||||
|
Session.set("calCreWork",null);
|
||||||
|
Session.set("sidebar",null);
|
||||||
|
|
||||||
|
var date = Session.get("calWorkDate").split("-");
|
||||||
|
var date = new Date(date[0],parseInt(date[1])-1,date[2],11,59,59);
|
||||||
|
Session.set("newWork", true);
|
||||||
|
Session.set("currentReadableWork",
|
||||||
|
{
|
||||||
|
name:"Name | Click here to edit...",
|
||||||
|
class:classid,
|
||||||
|
dueDate:getReadableDate(date),
|
||||||
|
description:"Click here to edit...",
|
||||||
|
type:"Click here to edit..."
|
||||||
|
});
|
||||||
|
Session.set("currentWork",{class:classid,dueDate:date});
|
||||||
|
openDivFade(document.getElementsByClassName("overlay")[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -525,10 +556,11 @@ function closeDivFade(div) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sendData(funcName) {
|
function sendData(funcName) {
|
||||||
Meteor.call(funcName, Session.get("serverData"));
|
Meteor.call(funcName, Session.get("serverData") , function(err,result) {
|
||||||
if(funcName.includes("Work") && Session.get("mode") === "calendar") {
|
if((funcName === "editWork" || funcName === "createWork") && Session.get("mode") === "calendar") {
|
||||||
$("#fullcalendar").fullCalendar( 'refetchEvents' );
|
$("#fullcalendar").fullCalendar( 'refetchEvents' );
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeInput(sessval) {
|
function closeInput(sessval) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user