minor bug fixes, visual issues
This commit is contained in:
parent
d5fbaf950d
commit
134fc05b7e
@ -32,7 +32,7 @@ Session.set("confirmText", ""); // Stores text for confirmations.
|
||||
|
||||
// On render actions
|
||||
|
||||
Meteor.autorun(function () {
|
||||
Meteor.autorun(function () { // Disconnect checking
|
||||
if (Meteor.status().status !== "connected" && Meteor.status().status !== "connecting" && !disconnect) {
|
||||
disconnect = true;
|
||||
var div = document.createElement("div");
|
||||
@ -51,6 +51,16 @@ Meteor.autorun(function () {
|
||||
div.appendChild(h5);
|
||||
document.getElementsByTagName("body")[0].appendChild(div);
|
||||
$("#disconnect").velocity("fadeIn", 150);
|
||||
} else if(Meteor.status().status === "connected" && disconnect) {
|
||||
disconnect = false;
|
||||
$("#disconnect").velocity("fadeOut", 150, function() {
|
||||
document.getElementsByTagName("body")[0].removeChild(document.getElementById("disconnect"));
|
||||
sAlert.success("You're back!", {
|
||||
effect: 'stackslide',
|
||||
position: 'bottom-right',
|
||||
timeout: 1500
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -220,6 +230,7 @@ Template.registerHelper('work', (value) => {// Returns the specified work value.
|
||||
switch(value) {
|
||||
case "class":
|
||||
var id = thisWork["class"];
|
||||
if(!id) return;
|
||||
return (id === Meteor.userId()) ? "Personal" : classes.findOne({_id: id}).name;
|
||||
case "dueDate":
|
||||
return getReadableDate(thisWork.dueDate);
|
||||
@ -432,8 +443,8 @@ Template.main.helpers({
|
||||
if (jsEvent.target.className.includes("fc-past")) return;
|
||||
var realDate = date;
|
||||
date.startOf("day");
|
||||
date.hour(12);
|
||||
realDate = realDate._d;
|
||||
Session.set("newWork", true);
|
||||
Session.set("currentWork", {dueDate: realDate, type: "normal"});
|
||||
if(!Session.equals("sidebarMode", "create")) toggleToSidebar("create");
|
||||
}
|
||||
@ -480,7 +491,8 @@ Template.main.helpers({
|
||||
if (Meteor.userId() === thisWork.creator ||
|
||||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
|
||||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.admin === Meteor.userId()
|
||||
) return true;
|
||||
}
|
||||
} catch(err) {}
|
||||
@ -736,7 +748,6 @@ Template.main.events({
|
||||
return names.alias === option;
|
||||
})[0].val;
|
||||
Session.set("currentWork", newSetting);
|
||||
console.log(newSetting);
|
||||
closeInput();
|
||||
toggleOptionMenu(false, modifyingInput);
|
||||
modifyingInput = null;
|
||||
@ -963,7 +974,7 @@ toDate = function(date) { // Turns formatted date back to Date constructor.
|
||||
month = months.indexOf(date.substring(0, date.search(" ")));
|
||||
day = date.substring(date.search(" ") + 1, date.search(","));
|
||||
year = date.substring(date.search(",") + 2, date.length);
|
||||
return new Date(year, month, day, 0,0,0);
|
||||
return new Date(year, month, day, 12,0,0);
|
||||
}
|
||||
|
||||
checkComplete = function(required, inputs) {
|
||||
@ -1182,6 +1193,11 @@ filterWork = function() {
|
||||
}
|
||||
});
|
||||
Session.set("myWork", displayWork.sort(function(a,b) { // Display work.
|
||||
if(Date.parse(a.dueDate) === Date.parse(b.dueDate)) {
|
||||
var x = a.name.toLowerCase();
|
||||
var y = b.name.toLowerCase();
|
||||
return (x < y) ? -1 : (x > y) ? 1 : 0;
|
||||
}
|
||||
return Date.parse(a.dueDate) - Date.parse(b.dueDate);
|
||||
}));
|
||||
Session.set("filterWork", hideWork); // Not displayed
|
||||
@ -1203,7 +1219,8 @@ function calendarEvents() {
|
||||
Meteor.userId() === work.creator ||
|
||||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
|
||||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.admin === Meteor.userId()
|
||||
) inRole = true;
|
||||
|
||||
events.push({
|
||||
|
||||
@ -196,8 +196,9 @@ Template.sidebarCreatePlate.events({
|
||||
var classid = event.target.getAttribute("classid");
|
||||
var newSetting = Session.get("currentWork");
|
||||
newSetting.class = classid;
|
||||
Session.set("newWork", true);
|
||||
Session.set("currentWork", newSetting);
|
||||
$(".overlay").fadeIn(250);
|
||||
$(".overlay").velocity("fadeIn", 150);
|
||||
}
|
||||
});
|
||||
|
||||
@ -477,7 +478,7 @@ Template.joinClass.events({
|
||||
serverData = [event.target.parentNode.getAttribute("classid"), ""];
|
||||
confirm = "joinClass";
|
||||
Session.set("confirmText", "Join this class?");
|
||||
$("#confirmOverlay").fadeIn(250);
|
||||
$("#confirmOverlay").velocity("fadeIn", 150);
|
||||
},
|
||||
'click #private' () {
|
||||
$("#privateCode").css('display', 'inline-block');
|
||||
@ -692,17 +693,17 @@ toggleToSidebar = function(sidebar) {
|
||||
};
|
||||
|
||||
toggleToClassInfo = function(classId) {
|
||||
$("#changeAdminWrapper").fadeOut(150);
|
||||
$("#infoClassCont").fadeOut(150, function() {
|
||||
$("#changeAdminWrapper").velocity("fadeOut", 150);
|
||||
$("#infoClassCont").velocity("fadeOut", 150, function() {
|
||||
Session.set("classInfo", classId);
|
||||
Session.set("classInfoMode", "general");
|
||||
$(this).fadeIn(150);
|
||||
$(this).velocity("fadeIn", 150);
|
||||
});
|
||||
};
|
||||
|
||||
toggleToClassInfoMode = function(mode) {
|
||||
$("#infoClassCont").fadeOut(150, function() {
|
||||
$("#infoClassCont").velocity("fadeOut", 150, function() {
|
||||
Session.set("classInfoMode", mode);
|
||||
$(this).fadeIn(150);
|
||||
$(this).velocity("fadeIn",150);
|
||||
});
|
||||
};
|
||||
|
||||
@ -311,7 +311,8 @@ Template.mobileClass.rendered = function() {
|
||||
if (Meteor.userId() === thisWork.creator ||
|
||||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
|
||||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.admin === Meteor.userId()
|
||||
) {
|
||||
inRole = true;
|
||||
}
|
||||
@ -353,7 +354,8 @@ Template.mobileClass.helpers({
|
||||
if (Meteor.userId() === thisWork.creator ||
|
||||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
|
||||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1
|
||||
currClass.banned.indexOf(Meteor.userId()) !== -1 ||
|
||||
currClass.admin === Meteor.userId()
|
||||
) return true;
|
||||
|
||||
} catch(err) {}
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
background-color: #282933;
|
||||
color: #FCF0F0 !important;
|
||||
position: absolute;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.mSelect {
|
||||
@ -166,13 +168,12 @@
|
||||
#mProfSubmit {
|
||||
font-size: 4vw;
|
||||
width: 15vw;
|
||||
margin: auto;
|
||||
margin: 5vh auto 5vh auto;
|
||||
padding: 3%;
|
||||
|
||||
background-color: rgba(255,255,255,0.2);
|
||||
text-align: center;
|
||||
|
||||
position: absolute;
|
||||
bottom: 3vh;
|
||||
left: 42.5vw;
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
<template name="mProfile">
|
||||
<div class="noScroll">
|
||||
<div class="noScroll mProfCont">
|
||||
<div id="mProfWrapper">
|
||||
<div id="mProfMain">
|
||||
<div id="schoolCont">
|
||||
|
||||
@ -27,7 +27,7 @@ themeColors = {
|
||||
"background": "RedBlack.jpg",
|
||||
"mainColor": "#302C36",
|
||||
"secondaryColor": "#B93A3A",
|
||||
"sidebarColor": "#327C5A",
|
||||
"sidebarColor": "#302C36",
|
||||
"userDropdownColor": "#CC3333",
|
||||
"iconHighlight": "#CBDF58",
|
||||
"modeHighlight": "#C9FE62",
|
||||
|
||||
@ -589,18 +589,36 @@ Meteor.methods({
|
||||
var security = securityCheck([[16, 9, false], 23, true],
|
||||
Object.assign({}, workobject, currentclass || {}, {userId: Meteor.userId(), toggle: input[1]}));
|
||||
if (!security) {
|
||||
var userindex = workobject[input[1]].indexOf(Meteor.userId());
|
||||
if (userindex === -1) {
|
||||
workobject[input[1]] = workobject[input[1]].concat(Meteor.userId());
|
||||
if (input[1] === "confirmations" &&
|
||||
_.contains(workobject.reports, Meteor.userId())) {
|
||||
workobject.reports.splice(userindex, 1);
|
||||
} else if (input[1] === "reports" &&
|
||||
_.contains(workobject.confirmations, Meteor.userId())) {
|
||||
workobject.confirmations.splice(userindex, 1);
|
||||
var type = input[1];
|
||||
var index = workobject[type].indexOf(Meteor.userId());
|
||||
var cIndex = workobject["confirmations"].indexOf(Meteor.userId());
|
||||
var rIndex = workobject["reports"].indexOf(Meteor.userId());
|
||||
var dIndex = workobject["done"].indexOf(Meteor.userId());
|
||||
switch(type) {
|
||||
case "confirmations":
|
||||
if(index === -1) { // User hasn't confirmed.
|
||||
workobject[type] = workobject[type].concat(Meteor.userId());
|
||||
if(rIndex !== -1) workobject["reports"].splice(rIndex, 1);
|
||||
} else { // Used has confirmed.
|
||||
workobject[type].splice(index, 1);
|
||||
}
|
||||
} else {
|
||||
workobject[input[1]].splice(userindex, 1);
|
||||
break;
|
||||
case "reports":
|
||||
if(index === -1) { // User hasn't reported.
|
||||
workobject[type] = workobject[type].concat(Meteor.userId());
|
||||
if(cIndex !== -1) workobject["confirmations"].splice(cIndex, 1);
|
||||
} else { // Used has reported.
|
||||
workobject[type].splice(index, 1);
|
||||
}
|
||||
break;
|
||||
case "done":
|
||||
if(index === -1) { // User isn't done.
|
||||
workobject[type] = workobject[type].concat(Meteor.userId());
|
||||
if(cIndex === -1) workobject["confirmations"] = workobject["confirmations"].concat(Meteor.userId());
|
||||
} else { // User is done
|
||||
workobject[type].splice(index, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
work.update({
|
||||
_id: input[0]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user