});
});
+ /* mark everything as known on click. */
+ $(postElement).click(function() {
+ markPostAsKnown(this);
+ });
+
/* hide reply input field. */
$(postElement).find(".create-reply").addClass("hidden");
}
});
})(replyElement);
addCommentLink(getPostId(replyElement), replyElement, $(replyElement).find(".reply-status-line .time"));
+
+ /* mark post and all replies as known on click. */
+ $(replyElement).click(function() {
+ markPostAsKnown(getPostElement(replyElement));
+ });
}
/**
return false;
}
});
- newPost = $(data.post.html).addClass("hidden").click(function() {
- markPostAsKnown(this);
- });
+ newPost = $(data.post.html).addClass("hidden");
if (firstOlderPost != null) {
newPost.insertBefore(firstOlderPost);
} else {
return false;
}
});
- newReply = $(data.reply.html).addClass("hidden").click(function() {
- markPostAsKnown(getPostElement(this));
- });
+ newReply = $(data.reply.html).addClass("hidden");
if (firstNewerReply != null) {
newReply.insertBefore(firstNewerReply);
} else {
});
});
+ /* ajaxify input field on “view Sone” page. */
+ getTranslation("WebInterface.DefaultText.Message", function(defaultText) {
+ registerInputTextareaSwap("#sone #post-message input[name=text]", defaultText, "text", false, false);
+ $("#sone #post-message").submit(function() {
+ text = $(this).find(":input:enabled").val();
+ $.getJSON("ajax/createPost.ajax", { "formPassword": getFormPassword(), "recipient": $("#sone #sone-id").text(), "text": text }, function(data, textStatus) {
+ if ((data != null) && data.success) {
+ loadNewPost(data.postId);
+ }
+ });
+ $(this).find(":input:enabled").val("").blur();
+ return false;
+ });
+ });
+
/* Ajaxifies all posts. */
/* calling getTranslation here will cache the necessary values. */
getTranslation("WebInterface.Confirmation.DeletePostButton", function(text) {