implement errors onto client

This commit is contained in:
Yaman Qalieh 2016-10-28 23:47:26 -04:00
parent fcdbca066c
commit 4a6b765086
3 changed files with 10 additions and 3 deletions

View File

@ -4,6 +4,7 @@
</head>
<template name="main">
{{> sAlert}}
<div class="noScroll">
<img id="bg" src={{bgSrc}} style="min-width:{{screen}}">
<div id="divLeftBar">

View File

@ -787,7 +787,7 @@ Template.main.events({
})();
Session.set("user", newSetting);
serverData = Session.get("user");
sendData("editProfile");
sendData("editProfile");
}
$("#" + modifyingInput).next()
@ -972,11 +972,17 @@ function sendData(funcName) { // Call Meteor function, and do actions after func
} else {
Session.set("currentWork",null);
}
if (error !== undefined) {
sAlert.error(error.error[1] || error.message, {
effect: 'stackslide',
position: 'top'
});
}
});
}
function closeInput() { // Close a changeable input and change it back to span.
var data = getHomeworkFormData();
var data = getHomeworkFormData();
Session.set("currentWork", data);
Session.set("restrictText", {});
$("#"+modifyingInput).css('cursor','pointer');

View File

@ -218,7 +218,7 @@ function securityCheck(checklist, input) {
break;
// Comment too long
case 15:
if (typeof input.comment !== "string" || input.comment > 200) error = 13;
if (typeof input.comment !== "string" || input.comment.length > 200) error = 13;
break;
// Private class
case 16: