});
/* mark everything as known on click. */
- $(postElement).click(function() {
+ $(postElement).click(function(event) {
+ if ($(event.target).hasClass("click-to-show")) {
+ return false;
+ }
markPostAsKnown(this);
});
});
/* process new posts. */
$.each(data.newPosts, function(index, value) {
- loadNewPost(value.id, value.sone, value.recipient);
+ loadNewPost(value.id, value.sone, value.recipient, value.time);
});
/* process new replies. */
$.each(data.newReplies, function(index, value) {
return $("#sone .reply#" + replyId).length > 0;
}
-function loadNewPost(postId, soneId, recipientId) {
+function loadNewPost(postId, soneId, recipientId, time) {
if (hasPost(postId)) {
return;
}
}
}
}
+ if (getPostTime($("#sone .post").last()) > time) {
+ return;
+ }
$.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) {
if ((data != null) && data.success) {
if (hasPost(data.post.id)) {
(function(postElement) {
$.getJSON("markPostAsKnown.ajax", {"formPassword": getFormPassword(), "post": getPostId(postElement)}, function(data, textStatus) {
$(postElement).removeClass("new");
+ $(".click-to-show", postElement).removeClass("new");
});
})(postElement);
}