Lots of tiny bug fixes, such as display, naming, and functionality

This commit is contained in:
Kenneth Jao 2016-08-27 18:53:47 -04:00
parent 96e413f005
commit 416eafcd4c
5 changed files with 80 additions and 51 deletions

View File

@ -27,6 +27,7 @@
#loginTitle {
font-size: 255%;
color: #000 !important;
padding: 1.4%;
padding-left: 1%;
}

View File

@ -286,7 +286,6 @@ input, textarea {
#classListHolder {
max-height: 48%;
width: 100%;
margin-bottom: 30%;
padding-right: 50%;
position: absolute;
@ -325,7 +324,7 @@ input, textarea {
.sideClassHour {
font-weight: 400;
color: #444;
color: #CCC;
margin: 0;
display: table-row;
}
@ -402,20 +401,18 @@ input, textarea {
width: 100%;
margin-right: 0;
margin-bottom: 5%;
background-color: rgba(255,255,255,0.3);
box-shadow: 2px 2px 5px 3px #666;
cursor: pointer;
-webkit-transition: background-color 0.4s ease, transform 0.3s ease;
-moz-transition: background-color 0.4s ease, transform 0.3s ease;
-ms-transition: background-color 0.4s ease, transform 0.3s ease;
transition: background-color 0.4s ease, transform 0.3s ease;
-webkit-transition: box-shadow 0.4s ease, transform 0.3s ease;
-moz-transition: box-shadow 0.4s ease, transform 0.3s ease;
-ms-transition: box-shadow 0.4s ease, transform 0.3s ease;
transition: box-shadow 0.4s ease, transform 0.3s ease;
}
.workCard:hover {
background-color: rgba(0,0,0,0.05);
box-shadow: 2px 2px 5px 3px #666, inset 0 0 0 99999px rgba(0,0,0,0.09);
}
.cWorkCont {
@ -449,9 +446,8 @@ input, textarea {
.workTitle, .prefTitle {
font-size: 150%;
font-weight: 400;
margin: 0;
margin-right: 3%;
margin-bottom: 1%;
margin: 0 3% 1% 0;
cursor: default;
}
.prefTitle {
@ -759,14 +755,16 @@ input, textarea {
}
.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;
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.1);
-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;
}
.fc-day:not(.fc-past):not(.fc-other-month):hover {
background-color: rgba(0,0,0,0.1);
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.15);
}
#prefCont {

View File

@ -71,9 +71,10 @@
<span class="change radio" opc="2" op="2" re="readonly" id="prefHide">{{pref 'timeHide'}}</span>
</div>
<div class="prefOptions" style="background-color:{{divColor 'header'}}">
<p class="prefOptionText">A Day</p>
<p class="prefOptionText">A Week</p>
<p class="prefOptionText">A Month</p>
<p class="prefOptionText">1 Day</p>
<P class="prefOptionText">2 Days</p>
<p class="prefOptionText">1 Week</p>
<p class="prefOptionText">1 Month</p>
<p class="prefOptionText">Never</p>
</div>
</div>
@ -96,6 +97,7 @@
</div>
{{/if}}
</div>
<div class="overlay">
<div id="editWork">
<div id="editWorkCont" style="{{workCenter}};background-color:{{divColor 'header'}}">
@ -195,7 +197,7 @@
<div class="cWorkType" style="background-color:{{typeColor}}"></div>
<div class="cWorkCont">
<p class="cWorkName">{{name}}</p>
<span class="cWorkDate">{{dueDate}}</span>
<span class="cWorkDate" style="font-weight:{{cardDate}}">{{dueDate}}</span>
</div>
</div>
</template>

View File

@ -50,13 +50,14 @@ var workColors = {
var defaults = {
"theme":"light",
"mode":"classes",
"timeHide":"A Day"
"timeHide":"1 Day"
};
var ref = {
"A Day":1,
"A Week":7,
"A Month":30,
"1 Day":1,
"2 Days":2,
"1 Week":7,
"1 Month":30,
"Never":0
};
@ -81,12 +82,12 @@ Template.registerHelper('divColor', (div) => {
});
Template.registerHelper("textColor", () => {
document.getElementsByTagName("html")[0].style.color = themeColors[Meteor.user().profile.preferences.theme].text;
document.getElementsByTagName("body")[0].style.color = themeColors[Meteor.user().profile.preferences.theme].text;
return;
});
Template.registerHelper('overlayDim', (part) => {
var dim = [window.innerWidth * 0.2, window.innerHeight * 0.25];
var dim = [window.innerWidth * 0.25, window.innerHeight * 0.2];
var width = "width:" + dim[0].toString() + "px;";
var height = "height:" + dim[1].toString() + "px;";
var margin = "margin-left:" + (-dim[0] / 2).toString() + "px;";
@ -105,7 +106,7 @@ Template.registerHelper('myClasses', () => {
var hide = ref[Meteor.user().profile.preferences.timeHide];
for(var i = 0; i < courses.length; i++) {
found = classes.findOne({_id:courses[i]});
found.subscribers = found.subscribers.length/17;
found.subscribers = found.subscribers.length;
found.mine = true;
if(found.admin === Meteor.userId()) {
found.box = " owned";
@ -146,6 +147,11 @@ Template.registerHelper('myClasses', () => {
lastWeek: '[Last] dddd',
sameElse: 'MMMM Do'
});
if(thisWork[j].dueDate === "Today") {
thisWork[j].cardDate = "600";
} else if(thisWork[j].dueDate === "Tomorrow") {
thisWork[j].cardDate = "400";
}
thisWork[j].typeColor = workColors[thisWork[j].type];
var hoverHighlight = Session.get("classDispHover");
if(hoverHighlight !== null && hoverHighlight === found._id) {
@ -248,15 +254,18 @@ Template.main.helpers({
}
var inRole = false;
var currClass = classes.findOne({_id: current.class})
if(Meteor.userId() === current.creator ||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
classes.findOne({_id: current._id}).moderators.indexOf(Meteor.userId()) !== -1||
classes.findOne({_id: current._id}).blockEdit.indexOf(Meteor.userId()) !== -1 ||
classes.findOne({_id: current._id}).banned.indexOf(Meteor.userId()) !== -1
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
currClass.banned.indexOf(Meteor.userId()) !== -1
) inRole = true;
backgroundColor = workColors[current.type];
title = current.name;
duedate = current.dueDate.toISOString().slice(0, 10);
if(disp) {
events.push({
id: current._id,
@ -324,15 +333,15 @@ Template.main.helpers({
highlight() {
var hoverHighlight = Session.get("classDispHover");
var works = document.getElementsByClassName("workevent");
var work = $('.workevent');
if(hoverHighlight === null) {
work.css('-webkit-transform','');
work.css('-ms-transform','');
work.css('transform','');
return;
}
for(var i = 0; i < works.length; i++) {
if(hoverHighlight === null) {
try {
works[i].style.webkitTransform = '';
works[i].style.msTransform = '';
works[i].style.transform = '';
} catch(err) {}
return;
}
var id = works[i].className;
var index = id.indexOf("workevent");
id = id.substring(index+10,index+27);
@ -341,11 +350,9 @@ Template.main.helpers({
works[i].style.msTransform = 'scale(1.12)';
works[i].style.transform = 'scale(1.12)';
} else {
try {
works[i].style.webkitTransform = '';
works[i].style.msTransform = '';
works[i].style.transform = '';
} catch(err) {}
works[i].style.webkitTransform = '';
works[i].style.msTransform = '';
works[i].style.transform = '';
}
}
return;
@ -376,11 +383,11 @@ Template.main.helpers({
if(Session.get("newWork")) {
return true;
} else {
var currClass = classes.findOne({_id: Session.get("currentWork")["class"]})
if(Meteor.userId() === Session.get("currentWork").creator ||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
classes.findOne({_id: Session.get("currentWork")._id}).moderators.indexOf(Meteor.userId()) !== -1||
classes.findOne({_id: Session.get("currentWork")._id}).blockEdit.indexOf(Meteor.userId()) !== -1 ||
classes.findOne({_id: Session.get("currentWork")._id}).banned.indexOf(Meteor.userId()) !== -1
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
currClass.banned.indexOf(Meteor.userId()) !== -1
) return true;
}
},
@ -517,11 +524,11 @@ Template.main.events({
},
'click .change' (event) {
if(!Session.get("newWork") && !document.getElementById("optionsContainer").contains(event.target)) {
var currClass = classes.findOne({_id: Session.get("currentWork")["class"]});
if(!(Meteor.userId() === Session.get("currentWork").creator ||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
classes.findOne({_id: Session.get("currentWork")._id}).moderators.indexOf(Meteor.userId()) !== -1 ||
classes.findOne({_id: Session.get("currentWork")._id}).blockEdit.indexOf(Meteor.userId()) !== -1 ||
classes.findOne({_id: Session.get("currentWork")._id}).banned.indexOf(Meteor.userId()) !== -1
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
currClass.banned.indexOf(Meteor.userId()) !== -1
)) return;
}
@ -578,6 +585,15 @@ Template.main.events({
}
},
'click .radio' (event) {
if(!Session.get("newWork") && !document.getElementById("optionsContainer").contains(event.target)) {
var currClass = classes.findOne({_id: Session.get("currentWork")["class"]});
if(!(Meteor.userId() === Session.get("currentWork").creator ||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
currClass.banned.indexOf(Meteor.userId()) !== -1
)) return;
}
var op = event.target;
Session.set("radioDiv", op.getAttribute("op"));
Session.set("radioOffset", op.getAttribute("opc"));
@ -679,11 +695,23 @@ Template.main.events({
var dom = event.target;
while(event.target.className !== "workCard") event.target = event.target.parentNode;
workid = event.target.getAttribute("workid");
Session.set("newWork",false);
var thisWork = work.findOne({_id:workid});
Session.set("currentWork",thisWork);
var thisReadWork = formReadable(thisWork);
Session.set("currentReadableWork",thisReadWork);
if(!Session.get("newWork") && !document.getElementById("optionsContainer").contains(event.target)) {
var currClass = classes.findOne({_id: Session.get("currentWork")["class"]});
if(!(Meteor.userId() === Session.get("currentWork").creator ||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
currClass.banned.indexOf(Meteor.userId()) !== -1)) {
var inputs = $('#editWork .change').css("cursor","default");
};
}
openDivFade(document.getElementsByClassName("overlay")[0]);
},
'focus #workDatea' () {

View File

@ -538,7 +538,7 @@ Meteor.methods({
found !== null &&
pass === found.code &&
prof.classes.indexOf(change) === -1) {
foundsubs = found.subscribers + '';
foundsubs = found.subscribers;
classes.update({
_id: found._id
}, {