* @return The Sone ID
*/
function getMenuSone(element) {
- return $(element).closest(".sone-menu").find(".sone-id").text();
+ return $(element).closest(".sone-menu").find(".sone-menu-id").text();
}
/**
})
});
+ /* ajaxify author/post links */
+ $(".post-status-line .permalink a", postElement).click(function() {
+ if (!$(".create-reply", postElement).hasClass("hidden")) {
+ textArea = $("input.reply-input", postElement).focus().data("textarea");
+ $(textArea).replaceSelection($(this).attr("href"));
+ }
+ return false;
+ });
+
/* add “comment” link. */
addCommentLink(getPostId(postElement), getPostAuthor(postElement), postElement, $(postElement).find(".post-status-line .permalink-author"));
/* show Sone menu when hovering over the avatar. */
$(postElement).find(".post-avatar").mouseover(function() {
+ $(".sone-menu:visible").fadeOut();
$(".sone-post-menu", postElement).mouseleave(function() {
$(this).fadeOut();
}).fadeIn();
return false;
});
(function(postElement) {
- var soneId = $(".sone-id", postElement).text();
+ var soneId = $(".sone-menu-id", postElement).text();
$(".sone-post-menu .follow", postElement).click(function() {
var followElement = this;
ajaxGet("followSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() {
});
});
})(replyElement);
+
+ /* ajaxify author links */
+ $(".reply-status-line .permalink a", replyElement).click(function() {
+ if (!$(".create-reply", getPostElement(replyElement)).hasClass("hidden")) {
+ textArea = $("input.reply-input", getPostElement(replyElement)).focus().data("textarea");
+ $(textArea).replaceSelection($(this).attr("href"));
+ }
+ return false;
+ });
+
addCommentLink(getPostId(replyElement), getReplyAuthor(replyElement), replyElement, $(replyElement).find(".reply-status-line .permalink-author"));
/* convert “show source” link into javascript function. */
/* show Sone menu when hovering over the avatar. */
$(replyElement).find(".reply-avatar").mouseover(function() {
+ $(".sone-menu:visible").fadeOut();
$(".sone-reply-menu", replyElement).mouseleave(function() {
$(this).fadeOut();
}).fadeIn();
return false;
});
(function(replyElement) {
- var soneId = $(".sone-id", replyElement).text();
+ var soneId = $(".sone-menu-id", replyElement).text();
$(".sone-menu .follow", replyElement).click(function() {
var followElement = this;
ajaxGet("followSone.ajax", { "sone": soneId, "formPassword": getFormPassword() }, function() {
* The new notification element
*/
function checkForRemovedReplies(oldNotification, newNotification) {
- if (getNotificationId(oldNotification) != "new-replies-notification") {
+ if (getNotificationId(oldNotification) != "new-reply-notification") {
return;
}
oldIds = getElementIds(oldNotification, ".reply-id");
postId = $(this).text();
markPostAsKnown(getPost(postId), true);
});
- } else if (notificationId == "new-replies-notification") {
+ } else if (notificationId == "new-reply-notification") {
$(".reply-id", this).each(function(index, element) {
replyId = $(this).text();
markReplyAsKnown(getReply(replyId), true);
ajaxifyNotification($(this));
});
- /* disable all permalinks. */
- $(".permalink").click(function() {
- return false;
- });
-
/* activate status polling. */
setTimeout(getStatus, 5000);