This commit is contained in:
Yaman Qalieh 2016-10-19 21:12:08 -04:00
commit 174f70769a
10 changed files with 761 additions and 639 deletions

View File

@ -9,10 +9,9 @@ mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.12_1 # The database Meteor supports right now mongo@1.1.12_1 # The database Meteor supports right now
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
reactive-var@1.0.10 # Reactive variable for tracker reactive-var@1.0.10 # Reactive variable for tracker
jquery@1.11.9 # Helpful client-side library jquery # Helpful client-side library
tracker@1.1.0 # Meteor's client-side reactive programming library tracker@1.1.0 # Meteor's client-side reactive programming library
standard-minifier-css@1.2.0_1 # CSS minifier run for production mode
standard-minifier-js@1.2.0_1 # JS minifier run for production mode standard-minifier-js@1.2.0_1 # JS minifier run for production mode
es5-shim@4.6.14_1 # ECMAScript 5 compatibility for older browsers. es5-shim@4.6.14_1 # ECMAScript 5 compatibility for older browsers.
ecmascript@0.5.8_1 # Enable ECMAScript2015+ syntax in app code ecmascript@0.5.8_1 # Enable ECMAScript2015+ syntax in app code
@ -36,7 +35,6 @@ underscore@1.0.9
ahref:dragula ahref:dragula
harrison:papa-parse harrison:papa-parse
pfafman:filesaver pfafman:filesaver
flemay:less-autoprefixer
natestrauser:select2 natestrauser:select2
juliancwirko:s-alert juliancwirko:s-alert
juliancwirko:s-alert-stackslide juliancwirko:s-alert-stackslide
@ -44,3 +42,4 @@ aldeed:collection2
dburles:collection-helpers dburles:collection-helpers
yogiben:admin-edit yogiben:admin-edit
mfactory:admin-lte mfactory:admin-lte
standard-minifier-css

View File

@ -42,7 +42,6 @@ email@1.0.16
es5-shim@4.6.14_1 es5-shim@4.6.14_1
eternicode:bootstrap-datepicker@1.6.0_3 eternicode:bootstrap-datepicker@1.6.0_3
fastclick@1.0.12 fastclick@1.0.12
flemay:less-autoprefixer@1.2.0
fortawesome:fontawesome@4.5.0 fortawesome:fontawesome@4.5.0
geojson-utils@1.0.9 geojson-utils@1.0.9
google@1.1.14 google@1.1.14
@ -74,7 +73,7 @@ meteor-base@1.0.4
meteorhacks:meteorx@1.4.1 meteorhacks:meteorx@1.4.1
meteorhacks:unblock@1.1.0 meteorhacks:unblock@1.1.0
mfactory:admin-lte@0.0.2 mfactory:admin-lte@0.0.2
minifier-css@1.2.14 minifier-css@1.2.14_1
minifier-js@1.2.14_1 minifier-js@1.2.14_1
minimongo@1.0.17 minimongo@1.0.17
mizzao:autocomplete@0.5.1 mizzao:autocomplete@0.5.1

View File

@ -99,11 +99,6 @@ body {
position: absolute; position: absolute;
top: 0; top: 0;
z-index: 50; z-index: 50;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
} }
#mainHeader h1, #mainHeader h2 { #mainHeader h1, #mainHeader h2 {
@ -154,7 +149,7 @@ body {
.noScroll input, .noScroll textarea { .noScroll input, .noScroll textarea {
font-family: 'Raleway'; font-family: 'Raleway';
background-color: #EBEBEB; background-color: #EBEBEB;
border: 3px solid #EBEBEB; border: 3px solid #CECECE;
border-radius: 3px; border-radius: 3px;
resize: none; resize: none;
} }
@ -237,10 +232,10 @@ body {
z-index: 5; z-index: 5;
overflow: hidden; overflow: hidden;
-webkit-transition: left 0.5s ease, right 0.5s ease, background-color 0.5s ease; -webkit-transition: left 0.5s ease, right 0.5s ease;
-moz-transition: left 0.5s ease, right 0.5s ease, background-color 0.5s ease; -moz-transition: left 0.5s ease, right 0.5s ease
-ms-transition: left 0.5s ease, right 0.5s ease, background-color 0.5s ease; -ms-transition: left 0.5s ease, right 0.5s ease;
transition: left 0.5s ease, right 0.5s ease, background-color 0.5s ease; transition: left 0.5s ease, right 0.5s ease;
} }
#optionsContainer { #optionsContainer {
@ -476,8 +471,8 @@ body {
white-space: normal; white-space: normal;
word-break: break-all; word-break: break-all;
-webkit-filter: none; -webkit-filter: none !important;
filter: none; filter: none !important;
} }
.mainClassHour { .mainClassHour {
@ -489,7 +484,7 @@ body {
cursor: pointer; cursor: pointer;
box-shadow: 0px 5px 5px 1px #666; box-shadow: 0px 5px 5px 1px #666;
-webkit-transition: background-color 0.4s ease; -webkit-transition: background-color 0.4 ease;
-moz-transition: background-color 0.4s ease; -moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease; -ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease; transition: background-color 0.4s ease;
@ -555,8 +550,8 @@ body {
width: 50%; width: 50%;
margin-top: 0; margin-top: 0;
-webkit-filter: none; -webkit-filter: none !important;
filter: none; filter: none !important;
display: table-cell; display: table-cell;
white-space: normal; white-space: normal;
@ -574,10 +569,12 @@ body {
} }
input.clickModify, textarea.clickModify { input.clickModify, textarea.clickModify {
width: 100%;
font-size: 2.2vh; font-size: 2.2vh;
font-weight: 200; font-weight: 200;
background-color: rgba(0,0,0,0); background-color: rgba(0,0,0,0);
border-color: rgba(0,0,0,0); border-color: rgba(0,0,0,0);
cursor: pointer;
-webkit-transition: background-color 0.4s ease, border-color 0.4s ease; -webkit-transition: background-color 0.4s ease, border-color 0.4s ease;
-moz-transition: background-color 0.4s ease, border-color 0.4s ease; -moz-transition: background-color 0.4s ease, border-color 0.4s ease;
@ -586,9 +583,8 @@ input.clickModify, textarea.clickModify {
} }
input.clickModify:hover, textarea.clickModify:hover { input.clickModify:hover, textarea.clickModify:hover {
cursor: pointer; background-color: rgba(0,0,0,0.1);
background-color: rgba(255,255,255,0.1);
border-color: rgba(255,255,255,0.1);;
} }
textarea.clickModify { textarea.clickModify {
@ -607,12 +603,15 @@ textarea.clickModify {
#editWorkCont { #editWorkCont {
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 68vh;
position: relative; position: relative;
display: table; display: table;
} }
#workInfoContainer {
min-height: 68vh;
}
#workTypeBar { #workTypeBar {
background-color: rgba(0,0,0,0.1); background-color: rgba(0,0,0,0.1);
height: 2%; height: 2%;
@ -625,7 +624,16 @@ textarea.clickModify {
#wName { #wName {
font-weight: 400; font-weight: 400;
font-size: 2.5vh; font-size: 2.5vh;
width: 100%; width: 70%;
margin-right: 2%;
}
#wDescription {
margin-bottom: 1%;
}
.info {
font-size: 130%;
} }
.workTitle, .prefTitle { .workTitle, .prefTitle {
@ -645,20 +653,16 @@ textarea.clickModify {
position: relative; position: relative;
} }
#workNamerestrict, #workDescrestrict, #commentrestrict { .noneLeft {
display: none; color: red;
}
#workNamerestrict, #workDescrestrict {
margin-top: 1.5%;
float: right;
} }
.clickModify.dropdown { .clickModify.dropdown {
font-size: 2.5vh; font-size: 2.5vh;
width: 100%; width: 100%;
border: 1px solid #999797;
background-color: rgba(0,0,0,0.15); background-color: rgba(0,0,0,0.07);
cursor: pointer; cursor: pointer;
outline: 0; outline: 0;
@ -669,7 +673,7 @@ textarea.clickModify {
} }
.clickModify.dropdown:hover { .clickModify.dropdown:hover {
background-color: rgba(0,0,0,0.07); background-color: rgba(0,0,0,0.03);
} }
.clickModify.dropdown span { .clickModify.dropdown span {
@ -688,11 +692,14 @@ textarea.clickModify {
.optionHolder { .optionHolder {
width: 100%; width: 100%;
margin-top: -1px;
border: 1px solid #666; border: 1px solid #666;
border-top: none;
position: absolute; position: absolute;
z-index: 5; z-index: 5;
display: none;
opacity: 0; opacity: 0;
@ -702,12 +709,8 @@ textarea.clickModify {
transition: opacity 0.4s ease; transition: opacity 0.4s ease;
} }
.optionHolder:hover {
background-color: rgba(255,255,255,0.05);
}
.optionText { .optionText {
font-size: 150%; font-size: 120%;
min-width: 10%; min-width: 10%;
padding: 4% 7% 4% 7%; padding: 4% 7% 4% 7%;
margin: 0; margin: 0;
@ -720,12 +723,8 @@ textarea.clickModify {
transition: box-shadow 0.4s ease; transition: box-shadow 0.4s ease;
} }
.optionText:hover { .selectedOption {
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.1); box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.2);
}
.workOptions p:hover, .prefOptions p:hover {
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.1);
} }
#workInfoContainer, #workToggle { #workInfoContainer, #workToggle {
@ -752,12 +751,36 @@ textarea.clickModify {
} }
#workInfoNmCont div { #workInfoNmCont div {
margin-bottom: 5%; margin-bottom: 3%;
}
#workInfo1 div, #workInfo2 div {
margin-bottom: 3%;
}
#workInfo1 {
margin: 0;
padding: 3% 0 0 7%
}
#workInfo2 {
margin: 0;
padding: 0 0 3% 7%;
} }
#wType { #wType {
margin: 0 !important; margin: 0 !important;
padding: 2%; }
#typeWrapper {
margin: 0 !important;
min-width: 56%;
position: relative;
display: inline-block;
}
#typeWrapper .optionText:hover {
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.2);
} }
.datepicker { .datepicker {
@ -768,11 +791,7 @@ textarea.clickModify {
} }
.type { .type {
width: 95%; margin: -1px 0 0 0 !important;
margin-left: 1%;
}
.type p {
padding: 3% 5% 3% 5%;
} }
#workComments h3 { #workComments h3 {

View File

@ -146,48 +146,19 @@
<div id="editWork" style="width:{{screen '.4'}}"> <div id="editWork" style="width:{{screen '.4'}}">
<div id="editWorkCont" style="background-color:{{divColor 'mainColor'}};border-top:10px solid {{work 'typeColor'}}"> <div id="editWorkCont" style="background-color:{{divColor 'mainColor'}};border-top:10px solid {{work 'typeColor'}}">
<div id="workInfoContainer"> <div id="workInfoContainer">
<div id="workNameDiv"> {{#if inRole}}
<span id="workNamerestrict">{{commentLength}}</span> {{> workDisplayEdit}}
<!-- <span class="change req" id="workName" restrict="50">{{work 'name'}}</span> --> {{else}}
<input id="wName" class="clickModify" style="color:{{divColor 'textColor'}}" value="{{work 'name'}}"> {{> workDisplay}}
</div> {{/if}}
<div id="workInfoNmCont"> {{#unless newWork}}
<div> <div id="workInfo2">
<span class="workTitle">Due Date:</span><br>
<!-- <span class="change req" re="readonly" id="workDate">{{work 'dueDate'}}</span> -->
<input id="wDueDate" class="clickModify" style="color:{{divColor 'textColor'}}" value="{{work 'dueDate'}}">
</div>
<div>
<span class="workTitle">Description:</span><br>
<span id="workDescrestrict">{{commentLength}}</span>
<!-- <span class="change" type="textarea" id="workDesc" restrict="150">{{work 'description'}}</span> -->
<textarea id="wDescription" class="clickModify" style="color:{{divColor 'textColor'}}" value="{{work 'description'}}" rows="5"></textarea>
</div>
<div>
<span class="workTitle">Type:</span>
<div id="wType" class="clickModify dropdown">
<span>{{work 'type'}}</span>
<i class="fa fa-caret-down" aria-hidden="true"></i>
</div>
<div class="optionHolder type">
{{#each selectOptions 'type'}}
{{> option}}
{{/each}}
</div>
</div>
<!-- <div id="workAttach">Attach other files</div>
<div id="workAttachmentHolder">
{{#each work 'attachments'}}
<a href={{link}}>{{filename}}</a>
{{/each}}
</div> -->
{{#unless newWork}}
<div id="workComments"> <div id="workComments">
<h3>Comments</h3> <h3>Comments</h3>
<div> <div>
<textarea id="workComment" class="restrict" rows="4" cols="50" maxlength="200"></textarea><br> <textarea id="workComment" class="restrict" rows="4" cols="50" maxlength="200"></textarea><br>
<div> <div>
<span id="commentrestrict">{{commentLength}}</span> <span class="resText">{{restrict 'workComment'}}</span>
<div id="commentSubmit">Submit</div> <div id="commentSubmit">Submit</div>
</div> </div>
</div> </div>
@ -196,9 +167,9 @@
{{> comment}} {{> comment}}
{{/each}} {{/each}}
</div> </div>
</div> </div>
{{/unless}} </div>
</div> {{/unless}}
</div> </div>
{{#unless newWork}} {{#unless newWork}}
<div id="workToggle"> <div id="workToggle">
@ -275,7 +246,7 @@
<p>Send an help request, feature, or bug report.</p> <p>Send an help request, feature, or bug report.</p>
<textarea id="requestArea" class="restrict" rows="4" cols="50" maxlength="500" placeholder="Enter request here..."></textarea><br> <textarea id="requestArea" class="restrict" rows="4" cols="50" maxlength="500" placeholder="Enter request here..."></textarea><br>
<div id="requestCont" style="background-color:{{divColor 'secondaryColor'}}"> <div id="requestCont" style="background-color:{{divColor 'secondaryColor'}}">
<span id="requestrestrict">{{commentLength}}</span> <span class="resText">{{restrict 'requestArea'}}</span>
<div id="requestSubmit">Send</div> <div id="requestSubmit">Send</div>
</div> </div>
</div> </div>
@ -377,3 +348,68 @@
<template name="option"> <template name="option">
<p class="optionText" style="background-color:{{divColor 'mainColor'}}">{{alias}}</p> <p class="optionText" style="background-color:{{divColor 'mainColor'}}">{{alias}}</p>
</template> </template>
<template name="workDisplay">
<div id="workNameDiv">
<span id="wName" class="info">{{work 'name'}}</span>
</div>
<div id="workInfo1">
<div>
<span class="workTitle">Due Date:</span><br>
<span id="wDescription" class="info">{{work 'dueDate'}}</span>
</div>
<div>
<span class="workTitle">Description:</span><br>
<span id="wDueDate" class="info">{{work 'description'}}</span>
</div>
<div>
<span class="workTitle">Type:</span>
<span id="wType" class="info">{{work 'type'}}</span>
</div>
<!-- <div id="workAttach">Attach other files</div>
<div id="workAttachmentHolder">
{{#each work 'attachments'}}
<a href={{link}}>{{filename}}</a>
{{/each}}
</div> -->
</div>
</template>
<template name="workDisplayEdit">
<div id="workNameDiv">
<input id="wName" class="clickModify restrict" style="color:{{divColor 'textColor'}}" value="{{work 'name'}}" tabindex="10" maxLength="50">
<span class="resText">{{restrict 'wName'}}</span>
</div>
<div id="workInfo1">
<div>
<span class="workTitle">Due Date:</span><br>
<input id="wDueDate" class="clickModify" style="color:{{divColor 'textColor'}}" value="{{work 'dueDate'}}" tabindex="11" readonly>
</div>
<div>
<span class="workTitle">Description:</span><br>
<textarea id="wDescription" class="clickModify restrict" style="color:{{divColor 'textColor'}}" value="{{work 'description'}}" rows="5" tabindex="12" maxLength="150"></textarea>
<span style="opacity:0">.</span>
<span class="resText">{{restrict 'wDescription'}}</span>
</div>
<div>
<span class="workTitle">Type:</span>
<div id="typeWrapper">
<div id="wType" class="clickModify dropdown" tabindex="13">
<span>{{work 'type'}}</span>
<i class="fa fa-caret-down" aria-hidden="true"></i>
</div>
<div class="optionHolder type">
{{#each selectOptions 'type'}}
{{> option}}
{{/each}}
</div>
</div>
</div>
<!-- <div id="workAttach">Attach other files</div>
<div id="workAttachmentHolder">
{{#each work 'attachments'}}
<a href={{link}}>{{filename}}</a>
{{/each}}
</div> -->
</div>
</template>

View File

@ -39,10 +39,7 @@ Session.set("calendarClasses", []); // Stores calendar classes.
Session.set("sidebar", null); // Status of sidebar. Session.set("sidebar", null); // Status of sidebar.
Session.set("requests", false); // Status of requests. Session.set("requests", false); // Status of requests.
Session.set("newWork", null); // If user creating new work. Session.set("newWork", null); // If user creating new work.
Session.set("currentWorkId",null); // Stores current work Id.
Session.set("currentWork",null); Session.set("currentWork",null);
Session.set("currentReadableWork", null); // Stores readable selected work info.
Session.set("modifying", null); // Stores current open input.
Session.set("noclass", null); // If user does not have classes. Session.set("noclass", null); // If user does not have classes.
Session.set("calCreWork", null); // If user is creating a work from calendar. Session.set("calCreWork", null); // If user is creating a work from calendar.
Session.set("classDisp", []); // Stores current filter for classes. Session.set("classDisp", []); // Stores current filter for classes.
@ -50,7 +47,7 @@ Session.set("typeFilter", []); // Stores type filters for classes.
Session.set("typeFilterHover", null); // Stores current hovered type filter. Session.set("typeFilterHover", null); // Stores current hovered type filter.
Session.set("classDispHover", null); // Stores current hovered class filter. Session.set("classDispHover", null); // Stores current hovered class filter.
Session.set("refetchEvents", null); // Stores whether to get calendar events again. Session.set("refetchEvents", null); // Stores whether to get calendar events again.
Session.set("commentRestrict", ""); // Stores text for comment character restriction. Session.set("restrictText", {}); // Stores text for comment character restriction.
Template.login.rendered = function() { Template.login.rendered = function() {
@ -60,10 +57,26 @@ Template.login.rendered = function() {
Template.main.rendered = function() { Template.main.rendered = function() {
Accounts._loginButtonsSession.set('dropdownVisible', true); Accounts._loginButtonsSession.set('dropdownVisible', true);
setTimeout(startDragula, 300); setTimeout(startDragula, 300);
$(".optionText").hover(
function() {
$(this).addClass("selectedOption");
},
function() {
$(this).removeClass("selectedOption");
}
);
}; };
Template.profile.rendered = function() { Template.profile.rendered = function() {
Accounts._loginButtonsSession.set('dropdownVisible', true); Accounts._loginButtonsSession.set('dropdownVisible', true);
$(".optionText").hover(
function() {
$(this).addClass("selectedOption");
},
function() {
$(this).removeClass("selectedOption");
}
);
}; };
Template.registerHelper('userProfile', () => { Template.registerHelper('userProfile', () => {
@ -229,29 +242,46 @@ Template.registerHelper('pref', (val) => { // Obtains all user preferences.
})[0].alias; })[0].alias;
}); });
Template.registerHelper('commentLength', () => { // Returns characters left for comment length. Template.registerHelper('restrict', (input) => { // Returns characters left for comment length.
return Session.get("commentRestrict"); var restrict = Session.get("restrictText");
$(".resText").removeClass("noneLeft");
if(Object.keys(restrict).length === 0) return "";
if(restrict[restrict.selected][0] === "0") $(".resText").addClass("noneLeft");
return (restrict.selected === input) ? Session.get("restrictText")[input] : "";
}); });
function startDragula() { Template.registerHelper('selectOptions', (val) => {
dragula([document.querySelector('#classesMode'), document.querySelector('#nonexistant')], { if(val === "grade") {
moves: function(el, container, handle) { var grade = [];
// return handle.classList.contains("classInfo") || handle.classList.contains("mainClassName"); for(var i = 0; i < 5; i++) {
return _.intersection(["classInfo", "mainClassName", "mainClassHour", "mainClassTeacher"], handle.classList).length > 0; var year = (new Date).getFullYear() + i;
grade.push( { "val": year, "alias": year.toString() } );
} }
}) return grade;
.on('out', function(el) { } else if(val === "school") {
var els = document.getElementsByClassName("classWrapper"); var school = [];
var final = []; var schoolList = schools.find().fetch();
for (var i = 0; i < els.length; i++) { for(var i = 0; i < schoolList.length; i++) {
var classid = els[i].getElementsByClassName("creWork")[0].getAttribute("classid"); school.push( { "val": schoolList[i].name, "alias": schoolList[i].name } );
final.push(classid);
} }
}); return school;
} } else {
return options[val];
}
});
Template.registerHelper('work', (value) => {// Returns the specified work value.
var thisWork = Session.get("currentWork");
if (Session.equals("currentWork", null)) return;
if (Session.get("newWork") && (thisWork[value] === true || thisWork[value] === undefined)) {
return defaultWork[value];
} else {
return formReadable(thisWork,value);
}
});
Template.main.helpers({ Template.main.helpers({
themeName() { /*themeName() {
var vals = _.values(themeColors); var vals = _.values(themeColors);
var curtheme = Session.get("user").preferences.theme; var curtheme = Session.get("user").preferences.theme;
for (var i = 0; i < vals.length; i++) { for (var i = 0; i < vals.length; i++) {
@ -261,7 +291,7 @@ Template.main.helpers({
} }
} }
return "Custom"; return "Custom";
}, },*/
schoolName() { // Finds the name of the user's school. schoolName() { // Finds the name of the user's school.
if (Session.get("user").school === undefined || Session.get("user").school === null) return; if (Session.get("user").school === undefined || Session.get("user").school === null) return;
return " - " + Session.get("user").school; return " - " + Session.get("user").school;
@ -372,7 +402,7 @@ Template.main.helpers({
}, },
eventClick: function(event, jsEvent, view) { // On-click for work. eventClick: function(event, jsEvent, view) { // On-click for work.
Session.set("newWork", false); Session.set("newWork", false);
Session.set("currentWorkId", event.id); Session.set("currentWork", work.findOne({_id: event.id}));
openDivFade(document.getElementsByClassName("overlay")[0]); openDivFade(document.getElementsByClassName("overlay")[0]);
}, },
eventMouseover: function(event, jsEvent, view) { eventMouseover: function(event, jsEvent, view) {
@ -421,18 +451,6 @@ Template.main.helpers({
} }
return; return;
}, },
work(value) { // Returns the specified work value.
var thisWork = Session.get("currentWork");
if (Session.equals("currentWork", null)) return;
if (Session.get("newWork") && (thisWork[value] === "Missing field" || thisWork[value] === undefined)) {
return defaultWork[value];
} else {
return formReadable(thisWork,value);
}
},
selectOptions(val) {
return options[val];
},
newWork() { // If user is creating a new work. newWork() { // If user is creating a new work.
return Session.get("newWork"); return Session.get("newWork");
}, },
@ -449,8 +467,9 @@ Template.main.helpers({
return array; return array;
}, },
inRole() { // Checks correct permissions. inRole() { // Checks correct permissions.
if(Session.equals("currentWork",null)) return;
var thisWork = work.findOne({ var thisWork = work.findOne({
_id: Session.get("currentWorkId") _id: Session.get("currentWork")._id
}); });
if (Session.get("newWork")) { if (Session.get("newWork")) {
return true; return true;
@ -482,14 +501,13 @@ Template.main.events({
var e = event.target.className; var e = event.target.className;
if(modifyingInput !== null && event.target !== document.getElementById(modifyingInput)) { if(modifyingInput !== null && event.target !== document.getElementById(modifyingInput)) {
if (!_.contains(e, ["optionHolder", "optionText"])) { if (!(e.includes("optionHolder") || e.includes("optionText"))) {
if(document.getElementById(modifyingInput).className.includes("dropdown")) { if(document.getElementById(modifyingInput).className.includes("dropdown")) {
$(".optionHolder") $(".optionHolder")
.fadeOut('fast') .fadeOut(250, "linear");
.hide('fast');
dropOpen = false; $(".selectedOption").removeClass("selectedOption");
} else { } else {
closeInput(modifyingInput); closeInput(modifyingInput);
} }
modifyingInput = null; modifyingInput = null;
@ -514,12 +532,10 @@ Template.main.events({
if (e === "overlay") { // Overlay closing. if (e === "overlay") { // Overlay closing.
closeDivFade(document.getElementsByClassName("overlay")[0]); closeDivFade(document.getElementsByClassName("overlay")[0]);
Session.set("newWork",false);
if (!Session.get("newWork")) { if (!Session.get("newWork")) {
document.getElementById("workComment").value = ""; document.getElementById("workComment").value = "";
} }
Session.set("newWork", null);
$('.req').css("color", "");
Session.set("commentRestrict", null);
} }
if (!document.getElementById("userDropdown").contains(event.target)) closeDivFade(document.getElementById("userDropdown")); if (!document.getElementById("userDropdown").contains(event.target)) closeDivFade(document.getElementById("userDropdown"));
@ -584,14 +600,14 @@ Template.main.events({
attr = event.target.getAttribute("classid"); attr = event.target.getAttribute("classid");
} }
Session.set("newWork", true); Session.set("newWork", true);
Session.set("currentWork",{"class": attr}); Session.set("currentWork",{class: attr, dueDate: (new Date((new Date()).valueOf() + 1000*3600*24))});
openDivFade(document.getElementsByClassName("overlay")[0]); openDivFade(document.getElementsByClassName("overlay")[0]);
}, },
'click #dropdown' (event) { 'click #dropdown' (event) {
if (document.getElementById("userDropdown").style.display === "block") return; if (document.getElementById("userDropdown").style.display === "block") return;
setTimeout(function() { setTimeout(function() {
openDivFade(document.getElementById("userDropdown")); openDivFade(document.getElementById("userDropdown"));
}, 300); }, 100);
}, },
'click .workCard' (event) { // Display work information on work card click. 'click .workCard' (event) { // Display work information on work card click.
var dom = event.target; var dom = event.target;
@ -637,74 +653,6 @@ Template.main.events({
}, 750); }, 750);
}); });
}, },
// HANDLING INPUT CHANGING
'click .clickModify' (event) {
if(modifyingInput !== event.target.id) modifyingInput = event.target.id;
},
'focus .clickModify' (event) {
if(modifyingInput !== event.target.id) modifyingInput = event.target.id;
},
'keydown .dropdown' (event) {
console.log("hi");
},
'focus .dropdown' (event) {
if(event.target.id === modifyingInput) return;
event.target.click();
},
'click .dropdown' (event) {
console.log(dropOpen);
console.log(event.target.id === modifyingInput);
if(event.target.id === modifyingInput && dropOpen) {
dropOpen = false;
modifyingInput = null;
$("#" + modifyingInput).next()
.fadeOut(200)
.hide(200);
console.log("hiasdf");
return;
}
dropOpen = true;
$("#" + modifyingInput).next()
.css('opacity',0)
.slideDown(300)
.animate(
{ opacity: 1 },
{ queue: false, duration: 100 }
)
//event.target.focus();
},
'click .optionText' (event) { // Click each preferences setting.
var option = event.target.childNodes[0].nodeValue;
if(modifyingInput[0] === 'w') {
var newSetting = Session.get("currentWork");
newSetting[modifyingInput.charAt(1).toLowerCase() + modifyingInput.slice(2)] = option;
Session.set("currentWork", newSetting);
} else {
var newSetting = Session.get("user");
newSetting.preferences[modifyingInput] = (function() {
var value = options[modifyingInput].filter(function(entry) {
return option === entry.alias;
})[0].val;
return (modifyingInput === 'theme') ? themeColors[value] : value;
})();
Session.set("user", newSetting);
serverData = Session.get("user");
sendData("editProfile");
}
$("#" + modifyingInput).next()
.fadeOut('fast')
.hide('fast');
},
'click #workComment' (event) {
var restrict = event.target.maxLength;
Session.set("commentRestrict", restrict - event.target.value.length.toString() + " characters left");
var text = document.getElementById("commentrestrict");
text.style.display = "initial";
text.style.color = "#7E7E7E";
},
'click #exportDiv' (event) { 'click #exportDiv' (event) {
var events = []; var events = [];
var userClasses = Session.get("calendarClasses"); var userClasses = Session.get("calendarClasses");
@ -741,33 +689,108 @@ Template.main.events({
}); });
saveAs(eventBlob, "hourglass.csv"); saveAs(eventBlob, "hourglass.csv");
}, },
'keydown input' (event) { // Enter to close input. // HANDLING INPUT CHANGING
var modifyingInput = Session.get("modifying"); 'focus .clickModify' (event) {
if (event.keyCode == 13 && modifyingInput != "workDesc") { $(".optionHolder")
try { .fadeOut(250, "linear");
closeInput(modifyingInput);
} catch (err) {} if(modifyingInput !== null) {
if(!$("#"+modifyingInput)[0].className.includes("dropdown")) closeInput(modifyingInput);
}
modifyingInput = event.target.id;
if(!$("#"+modifyingInput)[0].className.includes("dropdown")) {
event.target.select();
event.target.style.cursor = "text";
} }
}, },
'keydown .dropdown' (event) {
var first = $("#"+modifyingInput).next().children("p:first-child");
var last = $("#"+modifyingInput).next().children("p:last-child");
var next = $(".selectedOption").next();
var prev = $(".selectedOption").prev();
var lastSel = $(".selectedOption");
if (event.keyCode === 38) {
event.preventDefault();
if (lastSel === undefined) {
last.addClass("selectedOption");
} else {
if (prev.length === 0) {
last.addClass("selectedOption");
lastSel.removeClass("selectedOption");
} else {
prev.addClass("selectedOption");
lastSel.removeClass("selectedOption");
}
}
} else if (event.keyCode === 40) {
event.preventDefault();
if (lastSel === undefined) {
first.addClass("selectedOption");
last.removeClass("selectedOption");
} else {
if (next.length === 0) {
first.addClass("selectedOption");
lastSel.removeClass("selectedOption");
} else {
next.addClass("selectedOption");
lastSel.removeClass("selectedOption");
}
}
} else if (event.keyCode === 13) {
lastSel[0].click();
}
},
'focus .dropdown' (event) {
$(".selectedOption").removeClass("selectedOption");
$("#" + modifyingInput).next()
.css('opacity',0)
.slideDown(300)
.animate(
{ opacity: 1 },
{ queue: false, duration: 100 }
);
},
'click .optionText' (event) { // Click each preferences setting.
var option = event.target.childNodes[0].nodeValue;
if(modifyingInput[0] === 'w') {
var newSetting = Session.get("currentWork");
newSetting[modifyingInput.charAt(1).toLowerCase() + modifyingInput.slice(2)] = option.toLowerCase();
Session.set("currentWork", newSetting);
serverData = Session.get("currentWork");
$("#" + modifyingInput).next()
.fadeOut(250, "linear");
$(".selectedOption").removeClass("selectedOption");
if(Session.get("newWork")) return;
if(checkMissing()) return;
sendData("editWork")
} else {
var newSetting = Session.get("user");
newSetting.preferences[modifyingInput] = (function() {
var value = options[modifyingInput].filter(function(entry) {
return option === entry.alias;
})[0].val;
return (modifyingInput === 'theme') ? themeColors[value] : value;
})();
Session.set("user", newSetting);
serverData = Session.get("user");
sendData("editProfile");
}
$("#" + modifyingInput).next()
.fadeOut(250, "linear");
$(".selectedOption").removeClass("selectedOption");
},
'input .restrict' (event) { 'input .restrict' (event) {
var restrict = event.target.maxLength; var restrict = event.target.maxLength;
var chars = restrict - event.target.value.length; var chars = restrict - event.target.value.length;
var text; var newSetting = Session.get("restrictText");
if (event.target.id === "workComment") { newSetting[event.target.id] = (chars === restrict) ? "" : (chars.toString() + ((chars === 1) ? " character " : " characters ") + "left");
text = document.getElementById("commentrestrict"); newSetting.selected = event.target.id;
} else if (event.target.id === "requestArea") { Session.set("restrictText", newSetting);
text = document.getElementById("requestrestrict");
} else {
text = document.getElementById(Session.get("modifying") + "restrict");
}
text.style.color = "#7E7E7E";
if (chars === restrict) { // Don't display if nothing in comment.
Session.set("commentRestrict", "");
return;
} else if (chars === 0) {
text.style.color = "#FF1A1A"; // Make text red if 0 characters left.
}
Session.set("commentRestrict", chars.toString() + " characters left");
}, },
'focus #wDueDate' () { // Open date picker. 'focus #wDueDate' () { // Open date picker.
$('#wDueDate').datepicker({ $('#wDueDate').datepicker({
@ -776,46 +799,43 @@ Template.main.events({
startDate: 'd', startDate: 'd',
todayHighlight: true, todayHighlight: true,
todayBtn: true, todayBtn: true,
autoclose: true
onSelect: function(dateText, inst) {
alert("asdf");
closeInput(modifyingInput);
}
}); });
}, },
// WORK OVERLAY BUTTONS // WORK OVERLAY BUTTONS
'click #commentSubmit' (event) { // Click to submit a comment. 'click #commentSubmit' (event) { // Click to submit a comment.
workId = Session.get("currentWorkId"); workId = Session.get("currentWork")._id;
var input = document.getElementById('workComment'); var input = document.getElementById('workComment');
comment = input.value; comment = input.value;
input.value = ""; input.value = "";
Session.set("commentRestrict", null);
if (comment !== "") { if (comment !== "") {
document.getElementById('workComment').value = ""; document.getElementById('workComment').value = "";
Meteor.call('addComment', [comment, workId]); serverData = [comment, workId];
sendData("addComment");
} }
}, },
'click #workSubmit' () { // Click submit work to create a work. 'click #workSubmit' () { // Click submit work to create a work.
serverData = Session.get("currentWork"); serverData = Session.get("currentWork");
if(checkMissing()) return;
sendData("createWork"); sendData("createWork");
Session.set("newWork", null); Session.set("newWork",false);
closeDivFade(document.getElementsByClassName("overlay")[0]); closeDivFade(document.getElementsByClassName("overlay")[0]);
}, },
'click #workDelete' () { 'click #workDelete' () {
serverData = Session.get("currentWorkId"); serverData = Session.get("currentWork")._id;
sendData("deleteWork"); sendData("deleteWork");
closeDivFade(document.getElementsByClassName("overlay")[0]); closeDivFade(document.getElementsByClassName("overlay")[0]);
}, },
'click #markDone' () { // Click done button. 'click #markDone' () { // Click done button.
serverData = [Session.get("currentWorkId"), "done"]; serverData = [Session.get("currentWork")._id, "done"];
sendData("toggleWork"); sendData("toggleWork");
}, },
'click #markConfirm' () { // Click confirm button. 'click #markConfirm' () { // Click confirm button.
serverData = [Session.get("currentWorkId"), "confirmations"]; serverData = [Session.get("currentWork")._id, "confirmations"];
sendData("toggleWork"); sendData("toggleWork");
}, },
'click #markReport' () { // Click report button. 'click #markReport' () { // Click report button.
serverData = [Session.get("currentWorkId"), "reports"]; serverData = [Session.get("currentWork")._id, "reports"];
sendData("toggleWork"); sendData("toggleWork");
}, },
// CLASS FILTERS // CLASS FILTERS
@ -831,7 +851,7 @@ Template.main.events({
var date = calWorkDate.split("-"); var date = calWorkDate.split("-");
date = new Date(date[0], parseInt(date[1]) - 1, date[2], 11, 59, 59); date = new Date(date[0], parseInt(date[1]) - 1, date[2], 11, 59, 59);
Session.set("newWork", true); Session.set("newWork", true);
Session.get("currentWorkId", classid); Session.set("currentWork", {class: classid, dueDate: date});
openDivFade(document.getElementsByClassName("overlay")[0]); openDivFade(document.getElementsByClassName("overlay")[0]);
} else { // Normal clicking turns on filter. } else { // Normal clicking turns on filter.
var array = Session.get("classDisp"); var array = Session.get("classDisp");
@ -897,6 +917,8 @@ Template.main.events({
} }
}); });
// Other Functions
function openDivFade(div) { function openDivFade(div) {
div.style.display = "block"; div.style.display = "block";
div.style.opacity = "0"; div.style.opacity = "0";
@ -913,19 +935,32 @@ function closeDivFade(div) {
} }
function sendData(funcName) { // Call Meteor function, and do actions after function is completed depending on function. function sendData(funcName) { // Call Meteor function, and do actions after function is completed depending on function.
Meteor.call(funcName, serverData); if(funcName === "editWork" || funcName === "createWork") {
for(var key in serverData) {
if(serverData[key] === true) serverData[key] = "";
}
}
Meteor.call(funcName, serverData, function(error, result) {
serverData = null;
currWork = Session.get("currentWork");
if(currWork !== null && currWork._id !== undefined) {
Session.set("currentWork", work.findOne({
_id: currWork._id
}));
}
});
} }
function closeInput() { // Close a changeable input and change it back to span. function closeInput() { // Close a changeable input and change it back to span.
var data = getHomeworkFormData(); var data = getHomeworkFormData();
Session.set("currentWork", data); Session.set("currentWork", data);
Session.set("restrictText", {});
$("#"+modifyingInput).css('cursor','pointer');
if(!Session.get("newWork")) { if(!Session.get("newWork")) {
serverData = Session.get("currentWork"); serverData = Session.get("currentWork");
//sendData("editWork"); if(checkMissing()) return;
} sendData("editWork");
console.log(serverData); }
} }
function getHomeworkFormData() { // Get all data relating to work creation. function getHomeworkFormData() { // Get all data relating to work creation.
@ -934,12 +969,50 @@ function getHomeworkFormData() { // Get all data relating to work creation.
var data = Session.get("currentWork"); var data = Session.get("currentWork");
for(var i = 0; i < inputs.length; i++) { for(var i = 0; i < inputs.length; i++) {
var title = inputs[i].charAt(1).toLowerCase() + inputs[i].slice(2); var title = inputs[i].charAt(1).toLowerCase() + inputs[i].slice(2);
var thisData = (title === 'type') ? $("#"+inputs[i]+" span")[0].childNodes[0].nodeValue : $("#"+inputs[i])[0].value; var thisData = (function() {
data[title] = (thisData.includes(defaultWork[title].slice(0,-3)) && !_.contains(optional, title)) ? "Missing field" : thisData; if(title === "type") {
return $("#"+inputs[i]+" span")[0].childNodes[0].nodeValue.toLowerCase();
} else if (title === "dueDate") {
var val = $("#"+inputs[i])[0].value;
return toDate(val);
} else {
return $("#"+inputs[i])[0].value;
}
})();
// True signifies missing field to prevent missing if value is'Missing field.'
data[title] = data[title] = (thisData.toString().includes(defaultWork[title].slice(0,-3)) && !_.contains(optional, title)) ? true : thisData;
} }
return data; return data;
} }
function checkMissing() {
var required = ["name","dueDate","type"]
var no = false;
if(serverData === null || Object.keys(serverData).length < 4) {
for(var i = 0; i < required.length; i++) {
var id = "w" + required[i].charAt(0).toUpperCase() + required[i].slice(1);
$("#"+id).addClass("formInvalid");
$("#"+id)[0].value = "";
$("#"+id)[0].placeholder = "Missing field";
}
return true;
}
for(var key in serverData) {
if(!_.contains(required, key)) continue;
var id = "w" + key.charAt(0).toUpperCase() + key.slice(1);
if(serverData[key] === true || serverData[key] === "" || serverData[key] === undefined) {
no = true;
$("#"+id).addClass("formInvalid");
$("#"+id)[0].value = "";
$("#"+id)[0].placeholder = "Missing field";
} else {
$("#"+id)[0].placeholder = "";
$("#"+id).removeClass("formInvalid");
}
}
return no;
}
var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
@ -1035,3 +1108,20 @@ function formReadable(input, val) { // Makes work information readable by users.
}).profile.name; }).profile.name;
} }
} }
function startDragula() {
dragula([document.querySelector('#classesMode'), document.querySelector('#nonexistant')], {
moves: function(el, container, handle) {
// return handle.classList.contains("classInfo") || handle.classList.contains("mainClassName");
return _.intersection(["classInfo", "mainClassName", "mainClassHour", "mainClassTeacher"], handle.classList).length > 0;
}
})
.on('out', function(el) {
var els = document.getElementsByClassName("classWrapper");
var final = [];
for (var i = 0; i < els.length; i++) {
var classid = els[i].getElementsByClassName("creWork")[0].getAttribute("classid");
final.push(classid);
}
});
}

View File

@ -1,9 +1,3 @@
.change {
font-size: 150%;
color: #BEBEBE;
cursor: pointer;
}
#profWrapper { #profWrapper {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -11,21 +5,6 @@
overflow-y: hidden; overflow-y: hidden;
} }
#profPage .change {
font-size: 2.5vh;
}
.radio {
cursor: pointer;
}
.changeInput {
font-size: 100%;
padding: 0;
color: #BEBEBE;
position: relative;
}
.profTitle { .profTitle {
font-size: 3vh; font-size: 3vh;
font-weight: 400; font-weight: 400;
@ -40,11 +19,6 @@
padding: 6% 6% 0 8%; padding: 6% 6% 0 8%;
} }
#motda {
font-size: 100%;
width: 30% !important;
}
#profPage { #profPage {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -102,47 +76,20 @@
color: #FFF; color: #FFF;
} }
#motdBox input {
width: 50% !important;
}
#description:hover {
background-color: rgba(255,255,255,0.1);
}
.username { .username {
margin-left: 20% !important; margin-left: 20% !important;
} }
#motdrestrict { .smallText p {
margin-right: 1% !important; font-size: 90%;
float: right;
}
.profOptions {
box-shadow: 2px 2px 5px 3px #666;
position: absolute;
display: none;
z-index: 5;
opacity: 0;
-webkit-transition: opacity 0.4s ease;
-moz-transition: opacity 0.4s ease;
-ms-transition: opacity 0.4s ease;
transition: opacity 0.4s ease;
}
.profOptionText {
font-size: 150%;
min-width: 10%;
padding: 20px;
margin: 0;
text-align: center;
cursor: pointer;
-webkit-transition: box-shadow 0.4s ease;
-moz-transition: box-shadow 0.4s ease;
-ms-transition: box-shadow 0.4s ease;
transition: box-shadow 0.4s ease;
}
.profOptions p:hover {
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.1);
} }
#profCards { #profCards {
@ -179,6 +126,15 @@
text-align: left; text-align: left;
} }
#profWrapper .clickModify span {
width: 80%;
padding: 3.5% 5% 3.5% 5%;
}
#profWrapper .clickModify, #profWrapper .optionHolder {
width: 90%;
}
#profInfo { #profInfo {
margin-left: 0; margin-left: 0;
border-top: 5px solid #CC4444; border-top: 5px solid #CC4444;
@ -188,16 +144,12 @@
padding: 3% 5% 7% 14%; padding: 3% 5% 7% 14%;
} }
.radioContainer {
position: relative;
}
#classes { #classes {
padding: 3% 5% 7% 7%; padding: 3% 5% 7% 7%;
} }
#profClasses { #profClasses {
height: 90%; height: 70%;
margin-right: 0; margin-right: 0;
border-top: 5px solid #2E4F74; border-top: 5px solid #2E4F74;
@ -242,11 +194,11 @@
} }
.profFunction i, .profFunction h4 { .profFunction i, .profFunction h4 {
padding: 1%; padding: 1% !important;
} }
.profFunction h4 { .profFunction h4 {
font-size: 120%; font-size: 120% !important;
} }
#searchBar { #searchBar {
@ -404,19 +356,37 @@
position: relative; position: relative;
} }
#formContainer .clickModify {
background-color: #EBEBEB;
border: 1px solid #CECECE;
}
#formContainer .optionText:hover {
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.2);
}
.formDiv { .formDiv {
margin: 3% 6% 5% 6%; margin: 3% 6% 5% 6%;
width: 35%; width: 35%;
position: relative;
display: inline-block; display: inline-block;
} }
.formDiv input {
width: 90%;
}
#formContainer .optionHolder {
width: 96%;
}
.creInput { .creInput {
font-size: 2vh; font-size: 2vh;
padding: 3%; padding: 3%;
} }
.creOp { .classDropdown {
margin: 0 !important; cursor: pointer;
} }
.formDiv .-autocomplete-container { .formDiv .-autocomplete-container {
@ -499,7 +469,7 @@
} }
#createdClasses { #createdClasses {
width: 500px; width: 600px;
height: 73vh; height: 73vh;
padding: 30px 0 30px 30px; padding: 30px 0 30px 30px;

View File

@ -11,8 +11,8 @@
<img id="profAvatar" src='{{avatar}}' alt="Avatar"> <img id="profAvatar" src='{{avatar}}' alt="Avatar">
<div id="motdBox"> <div id="motdBox">
<span class="username">{{username}} - </span> <span class="username">{{username}} - </span>
<span class="change mo" restrict="50" id="motd">{{motd}}</span> <input id="description" class="clickModify restrict" style="color:#fff" value="{{description}}" maxLength="50">
<span id="motdrestrict">{{commentLength}}</span> <span class="resText">{{restrict 'description'}}</span>
</div> </div>
</div> </div>
<div id="profCards"> <div id="profCards">
@ -21,87 +21,98 @@
<div id="profInfo" class="card" style="background-color:{{divColor 'secondaryColor'}}"> <div id="profInfo" class="card" style="background-color:{{divColor 'secondaryColor'}}">
<h3 class="profHea">About</h3> <h3 class="profHea">About</h3>
<div id="about"> <div id="about">
<div> <div class="prefWrapper">
<p class="profTitle">School Name:</p> <p class="profTitle">School Name:</p>
<span class="change" id="school">{{school}}</span> <div id="school" class="clickModify dropdown" tabindex="1">
</div> <span>{{school}}</span>
<i class="fa fa-caret-down" aria-hidden="true"></i>
</div>
<div class="optionHolder smallText">
{{#each selectOptions 'school'}}
{{> option}}
{{/each}}
</div>
</div>
<br> <br>
<div class="radioContainer"> <div class="prefWrapper">
<div> <p class="profTitle">Graduation Year:</p>
<p class="profTitle">Grade:</p> <div id="grade" class="clickModify dropdown" tabindex="2">
<span class="change radio" re="readonly" id="grade">{{grade}}</span> <span>{{grade}}</span>
</div> <i class="fa fa-caret-down" aria-hidden="true"></i>
<div class="profOptions"> </div>
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">9th</p> <div class="optionHolder">
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">10th</p> {{#each selectOptions 'grade'}}
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">11th</p> {{> option}}
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">12th</p> {{/each}}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Card 2 --> <!-- Card 2 -->
<div id="profPreferences" class="card" style="background-color:{{divColor 'secondaryColor'}}"> <div id="profPreferences" class="card" style="background-color:{{divColor 'secondaryColor'}}">
<h3 class="profHea">Preferences</h3> <h3 class="profHea">Preferences</h3>
<div id="preferences"> <div id="preferences">
<div class="radioContainer"> <div class="prefWrapper">
<div class="inputRadio"> <p class="prefTitle">Theme:</p>
<p class="profTitle">Theme:</p> <div id="theme" class="clickModify dropdown" tabindex="3">
<span class="change radio" re="readonly" id="prefTheme">{{themeName}}</span> <span>{{pref 'theme'}}</span>
</div> <i class="fa fa-caret-down" aria-hidden="true"></i>
<div class="profOptions"> </div>
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">Light</p> <div class="optionHolder">
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">Dark</p> {{#each selectOptions 'theme'}}
</div> {{> option}}
</div> {{/each}}
<br> </div>
<div class="radioContainer"> </div>
<div class="inputRadio"> <div class="prefWrapper">
<p class="profTitle">Default Mode:</p> <p class="prefTitle">Default Mode:</p>
<span class="change radio" re="readonly" id="prefMode">{{pref 'mode'}}</span> <div id="mode" class="clickModify dropdown" tabindex="4">
</div> <span>{{pref 'mode'}}</span>
<div class="profOptions"> <i class="fa fa-caret-down" aria-hidden="true"></i>
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">Classes</p> </div>
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">Calendar</p> <div class="optionHolder">
</div> {{#each selectOptions 'mode'}}
</div> {{> option}}
<br> {{/each}}
<div class="radioContainer"> </div>
<div class="inputRadio"> </div>
<p class="profTitle">Hide Homework:</p> <div class="prefWrapper">
<span class="change radio" re="readonly" id="prefHide">{{pref 'timeHide'}}</span> <p class="prefTitle">Hide Homework:</p>
</div> <div id="timeHide" class="clickModify dropdown" tabindex="5">
<div class="profOptions"> <span>{{pref 'timeHide'}}</span>
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">1 Day</p> <i class="fa fa-caret-down" aria-hidden="true"></i>
<P class="profOptionText" style="background-color:{{divColor 'mainColor'}}">2 Days</p> </div>
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">1 Week</p> <div class="optionHolder">
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">1 Month</p> {{#each selectOptions 'timeHide'}}
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">Never</p> {{> option}}
</div> {{/each}}
</div> </div>
<br> </div>
<div class="radioContainer"> <div class="prefWrapper">
<div class="inputRadio"> <p class="prefTitle">Hide Done:</p>
<p class="profTitle">Hide Done:</p> <div id="done" class="clickModify dropdown" tabindex="6">
<span class="change radio" re="readonly" id="prefDone">{{pref 'done'}}</span> <span>{{pref 'done'}}</span>
</div> <i class="fa fa-caret-down" aria-hidden="true"></i>
<div class="profOptions"> </div>
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">Yes</p> <div class="optionHolder">
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">No</p> {{#each selectOptions 'done'}}
</div> {{> option}}
</div> {{/each}}
<br> </div>
<div class="radioContainer"> </div>
<div class="inputRadio"> <div class="prefWrapper">
<p class="profTitle">Hide Reported:</p> <p class="prefTitle">Hide Reported:</p>
<span class="change radio" re="readonly" id="prefReport">{{pref 'hideReport'}}</span> <div id="hideReport" class="clickModify dropdown" tabindex="7">
</div> <span>{{pref 'hideReport'}}</span>
<div class="profOptions"> <i class="fa fa-caret-down" aria-hidden="true"></i>
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">Yes</p> </div>
<p class="profOptionText" style="background-color:{{divColor 'mainColor'}}">No</p> <div class="optionHolder">
</div> {{#each selectOptions 'hideReport'}}
</div> {{> option}}
</div> {{/each}}
</div>
</div>
</div>
</div> </div>
</div> </div>
<div id="cardColRight"> <div id="cardColRight">
@ -182,7 +193,7 @@
</div> </div>
<div class="formDiv"> <div class="formDiv">
<p class="profTitle">Hour:</p> <p class="profTitle">Hour:</p>
<input class="creInput" type="text" name="hour"> <input class="creInput" type="text">
</div> </div>
<div class="formDiv"> <div class="formDiv">
<p class="profTitle">Teacher:</p> <p class="profTitle">Teacher:</p>
@ -190,40 +201,25 @@
</div> </div>
<div class="formDiv"> <div class="formDiv">
<p class="profTitle">Class Name:</p> <p class="profTitle">Class Name:</p>
<input class="creInput" type="text" name="classname"> <input class="creInput" type="text">
</div> </div>
<div class="formDiv"> <div class="formDiv">
<p class="profTitle">Privacy:</p> <p class="profTitle">Privacy:</p>
<input id="privacy" class="creInput clickModify dropdown" type="text" readonly>
<!-- <script type="text/javascript"> --> <div class="optionHolder">
<!-- $(document).ready(function() { --> {{#each selectOptions 'privacy'}}
<!-- $(".js-example-basic-single").select2(); --> {{> option}}
<!-- $('select').on('select2:open', function (e) { --> {{/each}}
<!-- console.log("hello"); --> </div>
<!-- $('.select2-dropdown').hide(); -->
<!-- setTimeout(function(){ $('.select2-dropdown').slideDown("slow", "easeInOutQuint"); }, 200); -->
<!-- }); -->
<!-- }); -->
<!-- </script>-->
<!-- <select class="js-example-basic-single"> -->
<!-- <option value="AL">Alabama</option> -->
<!-- <option value="WY">Wyoming</option> -->
<!-- </select> -->
<input class="creInput radio op" type="text" name="privacy" readonly>
<div class="profOptions creOp">
<p class="profOptionText cre" style="background-color:{{divColor 'mainColor'}}">Public</p>
<p class="profOptionText cre" style="background-color:{{divColor 'mainColor'}}">Private</p>
</div>
</div> </div>
<div class="formDiv"> <div class="formDiv">
<p class="profTitle">Category:</p> <p class="profTitle">Category:</p>
<input class="creInput radio op" type="text" name="category" readonly> <input id="category" class="creInput clickModify dropdown" type="text" readonly>
<div class="profOptions creOp"> <div class="optionHolder">
<p class="profOptionText cre" style="background-color:{{divColor 'mainColor'}}">Class</p> {{#each selectOptions 'category'}}
<p class="profOptionText cre" style="background-color:{{divColor 'mainColor'}}">Club</p> {{> option}}
<p class="profOptionText cre" style="background-color:{{divColor 'mainColor'}}">Other</p> {{/each}}
</div> </div>
</div> </div>
</div> </div>
<h3 id="creSubmit">Submit Request</h3> <h3 id="creSubmit">Submit Request</h3>
@ -321,3 +317,4 @@
<template name="teacherList"> <template name="teacherList">
{{teacher}} {{teacher}}
</template> </template>

View File

@ -4,7 +4,7 @@ import {
} from 'meteor/templating'; } from 'meteor/templating';
var openValues = { var openValues = {
"owned": "-540px", "owned": "-650px",
"priv": "-160px" "priv": "-160px"
}; };
@ -25,7 +25,7 @@ Session.set("noclass", null); // If user doesn't have classes.
Session.set("notfound", null); // If no results for autocomplete. Session.set("notfound", null); // If no results for autocomplete.
Template.profile.helpers({ Template.profile.helpers({
themeName() { /* themeName() {
var vals = _.values(themeColors); var vals = _.values(themeColors);
var curtheme = Session.get("user").preferences.theme; var curtheme = Session.get("user").preferences.theme;
for (var i = 0; i < vals.length; i++) { for (var i = 0; i < vals.length; i++) {
@ -35,7 +35,7 @@ Template.profile.helpers({
} }
} }
return "Custom"; return "Custom";
}, },*/
classSettings() { // Returns autocomplete array for classes. classSettings() { // Returns autocomplete array for classes.
return { return {
position: "bottom", position: "bottom",
@ -86,7 +86,7 @@ Template.profile.helpers({
username() { //Returns current user's username username() { //Returns current user's username
return Session.get("user").name; return Session.get("user").name;
}, },
motd() { // Returns the current user's description description() { // Returns the current user's description
if (Session.get("user").description !== undefined && Session.get("user").description !== null && Session.get("user").description !== "") return Session.get("user").description; if (Session.get("user").description !== undefined && Session.get("user").description !== null && Session.get("user").description !== "") return Session.get("user").description;
return "Say something about yourself!"; return "Say something about yourself!";
}, },
@ -95,10 +95,10 @@ Template.profile.helpers({
return "Click here to edit..."; return "Click here to edit...";
}, },
grade() { // Returns the current user's grade grade() { // Returns the current user's grade
if (Session.get("user").grade !== undefined && Session.get("user").grade !== null && Session.get("user").grade !== "") return Session.get("user").grade + "th"; if (Session.get("user").grade !== undefined && Session.get("user").grade !== null && Session.get("user").grade !== "") return Session.get("user").grade;
return "Click here to edit..."; return "Click here to edit...";
}, },
classes() { // Loads all of the possible classes ( Limit of twenty shown ) ( Sorts by class size ) classes() { // Loads all of the possible classes ( Limit of twenty shown ) ( Sorts by class size ) ( Only your school)
var array = classes.find({ var array = classes.find({
status: { status: {
$eq: true $eq: true
@ -107,7 +107,10 @@ Template.profile.helpers({
$eq: false $eq: false
}, },
_id: { _id: {
$nin: Meteor.user().profile.classes $nin: Session.get("user").classes
},
school: {
$eq: Session.get("user").school
} }
}, { }, {
sort: { sort: {
@ -136,12 +139,12 @@ Template.profile.helpers({
return "0px"; return "0px";
}, },
profClassTabColor(status) {  // Change this [Supposed to show the current mode that's selected via color]     profClassTabColor(status) {  // Change this [Supposed to show the current mode that's selected via color]    
if (Session.equals("profClassTab", status)) { if (Session.equals("profClassTab", status)) {
return Meteor.user().profile.preferences.theme.modeHighlight; return Meteor.user().profile.preferences.theme.modeHighlight;
} else { } else {
return; return;
} }
}, },
profClassTab(tab) { // Tells current class profClassTab(tab) { // Tells current class
if (Session.equals("profClassTab", tab)) { if (Session.equals("profClassTab", tab)) {
return true; return true;
@ -174,23 +177,29 @@ Template.profile.helpers({
}); });
Template.profile.events({ Template.profile.events({
'click' (event) { // Whenever a click happens 'click' (event) { // Whenever a click happens'
var modifyingInput = Session.get("modifying"); var e = event.target.className;
if (event.target.id !== modifyingInput && if(modifyingInput !== null && event.target !== document.getElementById(modifyingInput)) {
event.target.id !== modifyingInput + "a" && if (!(e.includes("optionHolder") || e.includes("optionText"))) {
!Session.equals("modifying", null) && if(document.getElementById(modifyingInput).className.includes("dropdown")) {
!event.target.parentNode.className.includes("profOptions")) { $(".optionHolder")
closeInput(modifyingInput); .fadeOut(250, "linear");
}
if (!event.target.className.includes("radio") && $(".selectedOption").removeClass("selectedOption");
!event.target.parentNode.className.includes("profOptions") && } else {
event.target.readOnly !== true) { if(modifyingInput === "description") {
for (var i = 0; i < document.getElementsByClassName("profOptions").length; i++) { Session.set("restrictText", {});
try { $("#"+modifyingInput).css('cursor','pointer');
closeDivFade(document.getElementsByClassName("profOptions")[i]); var newSetting = Session.get("user");
} catch (err) {} newSetting[modifyingInput] = document.getElementById(modifyingInput).value;
serverData = newSetting;
sendData("editProfile");
}
}
modifyingInput = null;
} }
} }
if (!document.getElementById("createdClasses").contains(event.target) && if (!document.getElementById("createdClasses").contains(event.target) &&
!Session.equals("code", null) && !Session.equals("code", null) &&
!event.target.className.includes("fa-times-circle-o")) { !event.target.className.includes("fa-times-circle-o")) {
@ -219,39 +228,39 @@ Template.profile.events({
} }
}, },
'click .addClass' () {  'click .addClass' () { 
if (Session.equals("profClassTab", "addClass")) return;          if (Session.equals("profClassTab", "addClass")) return;         
var functionHolder = document.getElementById("profClassInfoHolder"); var functionHolder = document.getElementById("profClassInfoHolder");
closeDivFade(functionHolder); closeDivFade(functionHolder);
var div = document.getElementById("profClasses"); var div = document.getElementById("profClasses");
div.style.height = "50%"; div.style.height = "50%";
setTimeout(function() {             setTimeout(function() {            
Session.set("profClassTab", "addClass"); Session.set("profClassTab", "addClass");
div.style.height = "90%";           div.style.height = "70%";          
openDivFade(functionHolder);         openDivFade(functionHolder);        
}, 400); }, 400);
}, },
    'click .manageClass' () {      'click .manageClass' () { 
if (Session.equals("profClassTab", "manClass")) return;       if (Session.equals("profClassTab", "manClass")) return;      
var functionHolder = document.getElementById("profClassInfoHolder"); var functionHolder = document.getElementById("profClassInfoHolder");
closeDivFade(functionHolder); closeDivFade(functionHolder);
var div = document.getElementById("profClasses"); var div = document.getElementById("profClasses");
div.style.height = "50%";      div.style.height = "50%";     
setTimeout(function() {             setTimeout(function() {            
Session.set("profClassTab", "manClass");  Session.set("profClassTab", "manClass"); 
div.style.height = "90%";            div.style.height = "70%";           
openDivFade(functionHolder);         openDivFade(functionHolder);        
}, 400); }, 400);
}, },
    'click .createClass' () {     'click .createClass' () {
if (Session.equals("profClassTab", "creClass")) return; if (Session.equals("profClassTab", "creClass")) return;
var functionHolder = document.getElementById("profClassInfoHolder");         var functionHolder = document.getElementById("profClassInfoHolder");        
closeDivFade(functionHolder); closeDivFade(functionHolder);
var div = document.getElementById("profClasses"); var div = document.getElementById("profClasses");
div.style.height = "50%"; div.style.height = "50%";
setTimeout(function() { setTimeout(function() {
Session.set("profClassTab", "creClass"); Session.set("profClassTab", "creClass");
div.style.height = "90%"; div.style.height = "70%";
openDivFade(functionHolder); openDivFade(functionHolder);
}, 400); }, 400);
}, },
'click .classBox' (event) { // When you click on a box that holds class 'click .classBox' (event) { // When you click on a box that holds class
@ -281,6 +290,7 @@ Template.profile.events({
} else { } else {
var attribute = event.target.getAttribute("classid"); var attribute = event.target.getAttribute("classid");
} }
if(attribute === Meteor.userId()) return;
Session.set("selectedClass", null); Session.set("selectedClass", null);
var usertype = ["moderators", "banned"]; var usertype = ["moderators", "banned"];
var array = classes.findOne({ var array = classes.findOne({
@ -364,7 +374,7 @@ Template.profile.events({
input.className.replace(" formInvalid", ""); input.className.replace(" formInvalid", "");
var value = input.value; var value = input.value;
var classid = document.getElementById("createdClasses").getAttribute("classid"); var classid = document.getElementById("createdClasses").getAttribute("classid");
input.value = ""; input.value = " ";
if (checkUser(value, classid)) { if (checkUser(value, classid)) {
input.className += " formInvalid"; input.className += " formInvalid";
input.placeholder = "Not a valid user"; input.placeholder = "Not a valid user";
@ -446,102 +456,108 @@ Template.profile.events({
confirm = null; confirm = null;
}, },
// INPUT HANDLING // INPUT HANDLING
'click .change' (event) { // Click changable inputs. Creates an input where the span is. 'focus .clickModify' (event) {
var ele = event.target; $(".optionHolder")
var modifyingInput = Session.get("modifying"); .fadeOut(250, "linear");
if (ele.id !== modifyingInput && modifyingInput !== null) closeInput(modifyingInput);
Session.set("modifying", ele.id); if(modifyingInput !== null) {
var dim = ele.getBoundingClientRect(); if(!$("#"+modifyingInput)[0].className.includes("dropdown")) closeInput(modifyingInput);
ele.style.display = "none"; }
var input = document.createElement("input"); modifyingInput = event.target.id;
if(!$("#"+modifyingInput)[0].className.includes("dropdown")) {
if (ele.getAttribute("type") !== null) { event.target.select();
input.type = ele.getAttribute("type"); event.target.style.cursor = "text";
} else {
input.type = "text";
}
input.value = ele.childNodes[0].nodeValue;
input.className = "changeInput";
input.style.height = 0.9 * dim.height.toString() + "px";
input.style.width = "55%";
input.style.padding = "0.1%";
input.id = ele.id + "a";
input.setAttribute("opc", ele.getAttribute("opc"));
ele.parentNode.appendChild(input);
if (ele.getAttribute("re") == "readonly") {
input.readOnly = true;
input.className += " op";
input.style.cursor = "pointer";
} else {
input.select();
}
input.focus();
var restrict = ele.getAttribute("restrict");
if (restrict !== null) {
input.maxLength = restrict;
input.className += " restrict";
Session.set("commentRestrict", restrict - input.value.length.toString() + " characters left");
var text = document.getElementById(Session.get("modifying") + "restrict");
text.style.display = "inherit";
text.style.color = "#7E7E7E";
} }
}, },
'click .radio' (event) { // Click dropdown input. Opens the dropdown menu. 'keydown .dropdown' (event) {
var op = event.target; event.preventDefault();
try { var first = $("#"+modifyingInput).next().children("p:first-child");
for (var i = 0; i < document.getElementsByClassName("profOptions").length; i++) { var last = $("#"+modifyingInput).next().children("p:last-child");
var curr = document.getElementsByClassName("profOptions")[i]; var next = $(".selectedOption").next();
if (curr.childNodes[1] !== op.nextSibling.nextSibling.childNodes[1] && var prev = $(".selectedOption").prev();
curr.childNodes[1] !== op.parentNode.parentNode.childNodes[3].childNodes[1]) { var lastSel = $(".selectedOption");
closeDivFade(document.getElementsByClassName("profOptions")[i]);
if (event.keyCode === 38) {
event.preventDefault();
if (lastSel === undefined) {
last.addClass("selectedOption");
} else {
if (prev.length === 0) {
last.addClass("selectedOption");
lastSel.removeClass("selectedOption");
} else {
prev.addClass("selectedOption");
lastSel.removeClass("selectedOption");
} }
} }
} catch (err) {} } else if (event.keyCode === 40) {
event.preventDefault();
if (event.target.className.includes("op")) { if (lastSel === undefined) {
openDivFade(op.nextSibling.nextSibling); first.addClass("selectedOption");
} else { last.removeClass("selectedOption");
openDivFade(op.parentNode.parentNode.childNodes[3]); } else {
if (next.length === 0) {
first.addClass("selectedOption");
lastSel.removeClass("selectedOption");
} else {
next.addClass("selectedOption");
lastSel.removeClass("selectedOption");
}
}
} else if (event.keyCode === 13) {
lastSel[0].click();
} }
}, },
'keydown input' (event) { // Restricts characters for certain inputs. 'focus .dropdown' (event) {
var modifyingInput = Session.get("modifying"); $(".selectedOption").removeClass("selectedOption");
if (event.keyCode == 13) {
try { $("#" + modifyingInput).next()
closeInput(modifyingInput); .css('opacity',0)
} catch (err) {} .slideDown(300)
.animate(
{ opacity: 1 },
{ queue: false, duration: 100 }
);
},
'click .optionText' (event) { // Click each preferences setting.
var option = event.target.childNodes[0].nodeValue;
var userSettings = ["description","school","grade"];
var newSetting = Session.get("user");
if(modifyingInput === "privacy" || modifyingInput === "category") {
document.getElementById(modifyingInput).value = option;
$("#" + modifyingInput).next()
.fadeOut(250, "linear");
$(".selectedOption").removeClass("selectedOption");
return;
} }
if(_.contains(userSettings, modifyingInput)) {
newSetting[modifyingInput] = (modifyingInput === "grade") ? parseInt(option) : option;
} else {
newSetting.preferences[modifyingInput] = (function() {
var value = options[modifyingInput].filter(function(entry) {
return option === entry.alias;
})[0].val;
return (modifyingInput === 'theme') ? themeColors[value] : value;
})();
}
Session.set("user", newSetting);
serverData = Session.get("user");
sendData("editProfile");
$("#" + modifyingInput).next()
.fadeOut(250, "linear");
$(".selectedOption").removeClass("selectedOption");
}, },
'input .restrict' (event) { 'input .restrict' (event) {
var restrict = event.target.maxLength; var restrict = event.target.maxLength;
var chars = restrict - event.target.value.length; var chars = restrict - event.target.value.length;
var text = document.getElementById(Session.get("modifying") + "restrict"); var newSetting = Session.get("restrictText");
text.style.color = "#7E7E7E"; newSetting[event.target.id] = (chars === restrict) ? "" : (chars.toString() + ((chars === 1) ? " character " : " characters ") + "left");
if (chars === restrict) { // Don't display if nothing in comment. newSetting.selected = event.target.id;
Session.set("commentRestrict", ""); Session.set("restrictText", newSetting);
return;
} else if (chars === 0) {
text.style.color = "#FF1A1A"; // Make text red if 0 characters left.
text.style.opacity = "0";
}
Session.set("commentRestrict", chars.toString() + " characters left");
},
'click .profOptionText' (event) { // Click each profile option setting.
var modifyingInput = Session.get("modifying");
var p = event.target;
if (p.className.includes("cre")) {
var input = p.parentNode.parentNode.childNodes[3];
} else {
var input = p.parentNode.parentNode.childNodes[1].childNodes[5];
}
input.value = p.childNodes[0].nodeValue;
try {
closeInput(modifyingInput);
} catch (err) {}
closeDivFade(p.parentNode);
input.focus();
}, },
// AUTOCOMPLETE HANDLING // AUTOCOMPLETE HANDLING
'keyup #profClassSearch' (event) { // Auto-complete updater 'keyup #profClassSearch' (event) { // Auto-complete updater
@ -572,10 +588,7 @@ Template.profile.events({
Session.set("autocompleteDivs", divs); Session.set("autocompleteDivs", divs);
} }
} catch (err) {} } catch (err) {}
}, }
'focus .op' (event) { // Selects input for next tabbing.
event.target.click();
},
}); });
function openDivFade(div) { function openDivFade(div) {
@ -593,27 +606,6 @@ function closeDivFade(div) {
}, 100); }, 100);
} }
function closeInput(modifyingInput) { // Closes current modifying input.
var input = document.getElementById(modifyingInput + "a");
var span = document.getElementById(modifyingInput);
input.parentNode.removeChild(input);
Session.set("commentRestrict", "");
try {
document.getElementById("modifyingInput" + "restrict").style.display = "none";
} catch (err) {}
if (input.value === "") {
span.childNodes[0].nodeValue = "Click here to edit...";
} else {
span.childNodes[0].nodeValue = input.value;
}
span.style.display = "initial";
Session.set("modifying", null);
Session.set("user", getProfileData());
serverData = Session.get("user");
sendData("editProfile");
}
function sendData(funcName) { function sendData(funcName) {
Meteor.call(funcName, serverData, function(err, result) { Meteor.call(funcName, serverData, function(err, result) {
if (funcName === "trackUserInClass") { if (funcName === "trackUserInClass") {

View File

@ -1,8 +1,8 @@
themeColors = { themeColors = {
"light": { "lux": {
"background": "White.jpg", "background": "White.jpg",
"mainColor": "#EBEBEB", "mainColor": "#D9D9D9",
"secondaryColor": "#FEFEFE", "secondaryColor": "#E8E8E8",
"sidebarColor": "#65839A", "sidebarColor": "#65839A",
"userDropdownColor": "#E6E6E6", "userDropdownColor": "#E6E6E6",
"iconHighlight": "#33ADFF", "iconHighlight": "#33ADFF",
@ -10,7 +10,7 @@ themeColors = {
"classCardColor":"#EBEBEB", "classCardColor":"#EBEBEB",
"textColor": "#000" "textColor": "#000"
}, },
/*"dark": { "nox": {
"background": "Black.jpg", "background": "Black.jpg",
"mainColor": "#373A56", "mainColor": "#373A56",
"secondaryColor": "#151A2B", "secondaryColor": "#151A2B",
@ -20,57 +20,61 @@ themeColors = {
"modeHighlight": "#FF1A1A", "modeHighlight": "#FF1A1A",
"classCardColor":"#46396E", "classCardColor":"#46396E",
"textColor": "#F6F6F6" "textColor": "#F6F6F6"
},*/ },
/*"dark": { "requom": {
"background": "RedBlack.jpg", "background": "RedBlack.jpg",
"mainColor": "#302c36", "mainColor": "#302C36",
"secondaryColor": "#151313", "secondaryColor": "#B93A3A",
"sidebarColor": "#327c5a", "sidebarColor": "#327C5A",
"userDropdownColor": "#cc3333", "userDropdownColor": "#CC3333",
"iconHighlight": "#327c5a", "iconHighlight": "#327C5A",
"modeHighlight": "#c9fe62", "modeHighlight": "#C9fE62",
"classCardColor":"#302c36", "classCardColor":"#302c36",
"textColor": "#fcf0f0" "textColor": "#FCF0F0"
},*/ },
/*"dark": { "aequor": {
"background": "Sea.jpg", "background": "Sea.jpg",
"mainColor": "#1e926c", "mainColor": "#1E926C",
"secondaryColor": "#1c564f", "secondaryColor": "#1C564F",
"sidebarColor": "#3cb08a", "sidebarColor": "#3CB08A",
"userDropdownColor": "#2ea96a", "userDropdownColor": "#2EA96A",
"iconHighlight": "#61d9a3", "iconHighlight": "#61D9A3",
"modeHighlight": "#c9fe62", "modeHighlight": "#C9FE62",
"classCardColor":"#2567a1", "classCardColor":"#2567A1",
"textColor": "#fcf0f0" "textColor": "#FCF0F0"
},*/ },
/*"dark": { "fresva": {
"background": "Earth.jpg", "background": "Earth.jpg",
"mainColor": "#dea743", "mainColor": "#DEA743",
"secondaryColor": "#496234", "secondaryColor": "#496234",
"sidebarColor": "#6d9957", "sidebarColor": "#6D9957",
"userDropdownColor": "#89bb52", "userDropdownColor": "#89BB52",
"iconHighlight": "#91ee61", "iconHighlight": "#91EE61",
"modeHighlight": "#b9f643", "modeHighlight": "#B9f643",
"classCardColor":"#c18311", "classCardColor":"#C18311",
"textColor": "#fcf0f0" "textColor": "#FCF0F0"
},*/ },
"dark": { "atlaneon": {
"background": "NeonBlue.jpg", "background": "NeonBlue.jpg",
"mainColor": "#1d1c23", "mainColor": "#1D1C23",
"secondaryColor": "#1f212f", "secondaryColor": "#1F212f",
"sidebarColor": "#312e32", "sidebarColor": "#312E32",
"userDropdownColor": "#2e312b", "userDropdownColor": "#2e312b",
"iconHighlight": "#70e6e6", "iconHighlight": "#70E6E6",
"modeHighlight": "#70e6e6", "modeHighlight": "#70E6E6",
"classCardColor":"#1faab1", "classCardColor":"#1FAAB1",
"textColor": "#fcf0f0" "textColor": "#FCF0F0"
} }
}; };
options = { options = {
"theme": [ "theme": [
{"val": "light", "alias": "Light"}, {"val": "lux", "alias": "Lux"},
{"val": "dark", "alias": "Dark"} {"val": "nox", "alias": "Nox"},
{"val": "requom", "alias": "Recoum"},
{"val": "aequor", "alias": "Aequor"},
{"val": "fresva", "alias": "Fresva"},
{"val": "atlaneon", "alias": "Atlaneon"}
], ],
"mode": [ "mode": [
{"val": "classes", "alias": "Classes"}, {"val": "classes", "alias": "Classes"},
@ -90,6 +94,22 @@ options = {
"hideReport": [ "hideReport": [
{"val": true, "alias": "Yes"}, {"val": true, "alias": "Yes"},
{"val": false, "alias": "No"} {"val": false, "alias": "No"}
],
"type": [
{"val": "normal", "alias": "Normal"},
{"val": "quiz", "alias": "Quiz"},
{"val": "test", "alias": "Test"},
{"val": "project", "alias": "Project"},
{"val": "other", "alias": "Other"},
],
"privacy": [
{"val": false, "alias": "Public"},
{"val": true, "alias": "Private"}
],
"category": [
{"val": "class", "alias": "Class"},
{"val": "club", "alias": "Club"},
{"val": "other", "alias": "Other"}
] ]
} }

View File

@ -494,7 +494,7 @@ Meteor.methods({
current.banner = "/Banners/defaultcover.jpg"; current.banner = "/Banners/defaultcover.jpg";
current.classes = [userId]; current.classes = [userId];
current.preferences = { current.preferences = {
"theme": themeColors.light, "theme": themeColors.lux,
"mode": "classes", "mode": "classes",
"timeHide": 1, "timeHide": 1,
"done": true, "done": true,