Merge branch 'master' of https://github.com/ksjdragon/hourglass
This commit is contained in:
commit
044e63a889
@ -11,6 +11,41 @@ var openValues = {
|
|||||||
"options": "-20%"
|
"options": "-20%"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
// Sets values for the different themes
|
||||||
|
|
||||||
|
Session.set('themeColors', {
|
||||||
|
"light": {
|
||||||
|
"background": "White.jpg",
|
||||||
|
"header": "#EBEBEB",
|
||||||
|
"sidebar": "#65839A",
|
||||||
|
"funcButton": "#849CAE",
|
||||||
|
"statusIcons": "#33ADFF",
|
||||||
|
"highlightText": "#FF1A1A",
|
||||||
|
"cards": "#FEFEFE",
|
||||||
|
"classes":"#EBEBEB",
|
||||||
|
"calendar": "#000",
|
||||||
|
"text": "#000"
|
||||||
|
},
|
||||||
|
"dark": {
|
||||||
|
"background": "Black.jpg",
|
||||||
|
"header": "#373A56",
|
||||||
|
"sidebar": "#35435D",
|
||||||
|
"funcButton": "#5d75A2",
|
||||||
|
"statusIcons": "#33ADFF",
|
||||||
|
"highlightText": "#FF1A1A",
|
||||||
|
"cards": "#151A2B",
|
||||||
|
"classes":"#46396E",
|
||||||
|
"calendar": "#000",
|
||||||
|
//30313B
|
||||||
|
"text": "#F6F6F6"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//Sets colors for different assignment statuses
|
||||||
|
|
||||||
|
=======
|
||||||
|
>>>>>>> origin/master
|
||||||
var workColors = {
|
var workColors = {
|
||||||
"normal": "#2E4F74",
|
"normal": "#2E4F74",
|
||||||
"quiz": "#409333",
|
"quiz": "#409333",
|
||||||
@ -19,6 +54,8 @@ var workColors = {
|
|||||||
"other": "#852E6D"
|
"other": "#852E6D"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Sets defaults for new users
|
||||||
|
|
||||||
var defaults = {
|
var defaults = {
|
||||||
"theme":"light",
|
"theme":"light",
|
||||||
"mode":"classes",
|
"mode":"classes",
|
||||||
@ -26,6 +63,8 @@ var defaults = {
|
|||||||
"done": true
|
"done": true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Creates variables for due dates
|
||||||
|
|
||||||
var ref = {
|
var ref = {
|
||||||
"1 Day":1,
|
"1 Day":1,
|
||||||
"2 Days":2,
|
"2 Days":2,
|
||||||
@ -164,10 +203,10 @@ Template.registerHelper('pref', (val) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Template.main.helpers({
|
Template.main.helpers({
|
||||||
schoolName() {
|
schoolName() { // Finds the name of the user's school
|
||||||
return " - " + Meteor.user().profile.school;
|
return " - " + Meteor.user().profile.school;
|
||||||
},
|
},
|
||||||
iconColor(icon) {
|
iconColor(icon) { //Sets the color of the user's icon
|
||||||
if (Session.get("sidebar") === icon + "Container") {
|
if (Session.get("sidebar") === icon + "Container") {
|
||||||
return themeColors[Meteor.user().profile.preferences.theme].statusIcons;
|
return themeColors[Meteor.user().profile.preferences.theme].statusIcons;
|
||||||
} else if (Session.get("sidebar") === "both") {
|
} else if (Session.get("sidebar") === "both") {
|
||||||
@ -176,19 +215,19 @@ Template.main.helpers({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaultMode() {
|
defaultMode() { //Loads the defaults for a new/uncustomized user
|
||||||
if(load) {
|
if(load) {
|
||||||
Session.set("mode",Meteor.user().profile.preferences.mode);
|
Session.set("mode",Meteor.user().profile.preferences.mode);
|
||||||
load = false;
|
load = false;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
bgSrc() {
|
bgSrc() { // Adjusts for different, larger screen sizes
|
||||||
var dim = [window.innerWidth, window.innerHeight];
|
var dim = [window.innerWidth, window.innerHeight];
|
||||||
var pic = "Backgrounds/"+themeColors[Meteor.user().profile.preferences.theme].background;
|
var pic = "Backgrounds/"+themeColors[Meteor.user().profile.preferences.theme].background;
|
||||||
return pic;
|
return pic;
|
||||||
},
|
},
|
||||||
menuStatus() {
|
menuStatus() {
|
||||||
if (Session.get("sidebar") === "menuContainer") {
|
if (Session.get("sidebar") === "menuContainer") {
|
||||||
return "0%";
|
return "0%";
|
||||||
} else if (Session.get("sidebar") === "both") {
|
} else if (Session.get("sidebar") === "both") {
|
||||||
@ -221,7 +260,7 @@ Template.main.helpers({
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
calendarOptions() {
|
calendarOptions() { // Sets up and modifies the calendar code
|
||||||
return {
|
return {
|
||||||
id: "fullcalendar",
|
id: "fullcalendar",
|
||||||
height: window.innerHeight * 0.8,
|
height: window.innerHeight * 0.8,
|
||||||
@ -299,14 +338,19 @@ Template.main.helpers({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
calCenter() {
|
calCenter() { // Centers the calendar
|
||||||
var width = window.innerWidth * 0.85;
|
var width = window.innerWidth * 0.85;
|
||||||
return "width:" + width.toString() + "px;margin-left:" + (0.5 * window.innerWidth - 0.5 * width).toString() + "px;";
|
return "width:" + width.toString() + "px;margin-left:" + (0.5 * window.innerWidth - 0.5 * width).toString() + "px;";
|
||||||
},
|
},
|
||||||
|
<<<<<<< HEAD
|
||||||
|
calColor() { // Sets the color of the calendar according to theme
|
||||||
|
return "color:"+Session.get("themeColors")[Meteor.user().profile.preferences.theme].calendar;
|
||||||
|
=======
|
||||||
calColor() {
|
calColor() {
|
||||||
return "color:"+themeColors[Meteor.user().profile.preferences.theme].calendar;
|
return "color:"+themeColors[Meteor.user().profile.preferences.theme].calendar;
|
||||||
|
>>>>>>> origin/master
|
||||||
},
|
},
|
||||||
calbg() {
|
calbg() { //Sets size of the calendar
|
||||||
var width = window.innerWidth * 0.865;
|
var width = window.innerWidth * 0.865;
|
||||||
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";
|
||||||
@ -327,7 +371,7 @@ Template.main.helpers({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
highlight() {
|
highlight() { // Lets someone highlight a section of the calendar
|
||||||
var hoverHighlight = Session.get("classDispHover");
|
var hoverHighlight = Session.get("classDispHover");
|
||||||
var works = document.getElementsByClassName("workevent");
|
var works = document.getElementsByClassName("workevent");
|
||||||
var work = $('.workevent');
|
var work = $('.workevent');
|
||||||
@ -354,7 +398,7 @@ Template.main.helpers({
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
workCenter() {
|
workCenter() { // Dimensions the work center
|
||||||
var w = window.innerWidth * 0.3;
|
var w = window.innerWidth * 0.3;
|
||||||
var h = window.innerHeight * 0.7;
|
var h = window.innerHeight * 0.7;
|
||||||
return "width:"+w.toString()+"px;height:"+h.toString()+"px;margin-left:"+-0.5*w.toString()+"px;margin-top:"+-0.5*h.toString()+"px";
|
return "width:"+w.toString()+"px;height:"+h.toString()+"px;margin-left:"+-0.5*w.toString()+"px;margin-top:"+-0.5*h.toString()+"px";
|
||||||
@ -434,7 +478,7 @@ Template.main.events({
|
|||||||
}, 300);
|
}, 300);
|
||||||
Session.set("sidebar",null);
|
Session.set("sidebar",null);
|
||||||
},
|
},
|
||||||
'click .calendar' () {
|
'click .calendar' () { // Applies on a click of the calendar. First checks if the mode is currently the calendar, and then sets it to that if it isn't.
|
||||||
if (Session.get("mode") === "calendar") return;
|
if (Session.get("mode") === "calendar") return;
|
||||||
var modeHolder = document.getElementById("mainBody");
|
var modeHolder = document.getElementById("mainBody");
|
||||||
closeDivFade(modeHolder);
|
closeDivFade(modeHolder);
|
||||||
@ -673,7 +717,7 @@ Template.main.events({
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
'click #workSubmit' () {
|
'click #workSubmit' () { // Apples on the work submit button. If the current value, then terminate. Otherwise, create a new work or edit the current piece of work
|
||||||
if(getHomeworkFormData() === null) return;
|
if(getHomeworkFormData() === null) return;
|
||||||
serverData = Session.get("currentWork");
|
serverData = Session.get("currentWork");
|
||||||
if(Session.get("newWork")) {
|
if(Session.get("newWork")) {
|
||||||
@ -897,7 +941,7 @@ function getReadableDate(date) {
|
|||||||
return days[date.getDay()]+", "+months[date.getMonth()]+" "+date.getDate()+", "+date.getFullYear();
|
return days[date.getDay()]+", "+months[date.getMonth()]+" "+date.getDate()+", "+date.getFullYear();
|
||||||
}
|
}
|
||||||
|
|
||||||
function toDate(date) {
|
function toDate(date) { //Formats the date into the format needed for niceness
|
||||||
date = date.substring(date.search(",")+2,date.length);
|
date = date.substring(date.search(",")+2,date.length);
|
||||||
month = months.indexOf(date.substring(0,date.search(" ")));
|
month = months.indexOf(date.substring(0,date.search(" ")));
|
||||||
day = date.substring(date.search(" ")+1,date.search(","));
|
day = date.substring(date.search(" ")+1,date.search(","));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user