This commit is contained in:
Kenneth Jao 2016-08-29 23:32:25 -04:00
commit 044e63a889

View File

@ -11,6 +11,41 @@ var openValues = {
"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 = {
"normal": "#2E4F74",
"quiz": "#409333",
@ -19,6 +54,8 @@ var workColors = {
"other": "#852E6D"
};
// Sets defaults for new users
var defaults = {
"theme":"light",
"mode":"classes",
@ -26,6 +63,8 @@ var defaults = {
"done": true
};
//Creates variables for due dates
var ref = {
"1 Day":1,
"2 Days":2,
@ -164,10 +203,10 @@ Template.registerHelper('pref', (val) => {
});
Template.main.helpers({
schoolName() {
schoolName() { // Finds the name of the user's school
return " - " + Meteor.user().profile.school;
},
iconColor(icon) {
iconColor(icon) { //Sets the color of the user's icon
if (Session.get("sidebar") === icon + "Container") {
return themeColors[Meteor.user().profile.preferences.theme].statusIcons;
} else if (Session.get("sidebar") === "both") {
@ -176,19 +215,19 @@ Template.main.helpers({
return;
}
},
defaultMode() {
defaultMode() { //Loads the defaults for a new/uncustomized user
if(load) {
Session.set("mode",Meteor.user().profile.preferences.mode);
load = false;
}
return;
},
bgSrc() {
bgSrc() { // Adjusts for different, larger screen sizes
var dim = [window.innerWidth, window.innerHeight];
var pic = "Backgrounds/"+themeColors[Meteor.user().profile.preferences.theme].background;
return pic;
},
menuStatus() {
menuStatus() {
if (Session.get("sidebar") === "menuContainer") {
return "0%";
} else if (Session.get("sidebar") === "both") {
@ -221,7 +260,7 @@ Template.main.helpers({
return false;
}
},
calendarOptions() {
calendarOptions() { // Sets up and modifies the calendar code
return {
id: "fullcalendar",
height: window.innerHeight * 0.8,
@ -299,14 +338,19 @@ Template.main.helpers({
}
};
},
calCenter() {
calCenter() { // Centers the calendar
var width = window.innerWidth * 0.85;
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() {
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 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";
@ -327,7 +371,7 @@ Template.main.helpers({
return;
}
},
highlight() {
highlight() { // Lets someone highlight a section of the calendar
var hoverHighlight = Session.get("classDispHover");
var works = document.getElementsByClassName("workevent");
var work = $('.workevent');
@ -354,7 +398,7 @@ Template.main.helpers({
}
return;
},
workCenter() {
workCenter() { // Dimensions the work center
var w = window.innerWidth * 0.3;
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";
@ -434,7 +478,7 @@ Template.main.events({
}, 300);
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;
var modeHolder = document.getElementById("mainBody");
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;
serverData = Session.get("currentWork");
if(Session.get("newWork")) {
@ -897,7 +941,7 @@ function getReadableDate(date) {
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);
month = months.indexOf(date.substring(0,date.search(" ")));
day = date.substring(date.search(" ")+1,date.search(","));