Step 2: Peer Review
").addClass("comment-delete mdi mdi-delete-circle"); const levelMarker = $("") .addClass("mdi mdi-numeric-"+level+"-box-multiple-outline") .prop("title", "Level " + level); const name = $("").text(data.user + ": "); const comment = $("
").addClass("comment my_comment") .attr("data-id", data.cID) .append(deleteButton) .append(levelMarker) .append(" ") .append(name) .append(data.text); comments.prepend(comment.prop("outerHTML")); const num = comments.children(".comment").length > 0 ? comments.children(".comment").length : ""; lastCommentEditor.prev(".comments_number").addClass("hasComment").text(num); const msg = { type: "comment", eventID: eventID, verse: lastCommentEditor.data("chunk"), text: data.text, level: level, cID: data.cID }; socket.emit("system message", msg); } commentChanged = false; commentSent = true; } else { if(data.error !== undefined) { renderPopup(data.error, function () { window.location.reload(); }); } } }) .error(function () { renderPopup(Language.commonError); }) .always(function() { $(".commentEditorLoader").hide(); }); } } });