X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=d6c83ae600689b8a32f7c0ba0a3efd0b70c7ba38;hb=47ed7eaf00c35889781831d33d04e9f91c9ad266;hp=375fc53abe883414aeec772479369352248e330c;hpb=723a7eb494e3833334bd4800f7e3b3a7ba290d10;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 375fc53..d6c83ae 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -868,7 +868,11 @@ function ajaxifyNotification(notification) { notification.find(".text").addClass("hidden"); } notification.find("form.mark-as-read button").click(function() { - ajaxGet("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": $(":input[name=type]", this.form).val(), "id": $(":input[name=id]", this.form).val()}); + allIds = $(":input[name=id]", this.form).val().split(" "); + for (index = 0; index < allIds.length; index += 16) { + ids = allIds.slice(index, index + 16).join(" "); + ajaxGet("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": $(":input[name=type]", this.form).val(), "id": ids}); + } }); notification.find("a[class^='link-']").each(function() { linkElement = $(this); @@ -1079,8 +1083,10 @@ function loadNotifications(notificationIds) { oldNotification.replaceWith(notification.show()); } else { $("#sone #notification-area").append(notification); - notification.slideDown(); - setActivity(); + if (value.id.substring(0, 5) != "local") { + notification.slideDown(); + setActivity(); + } } }); }); @@ -1271,8 +1277,13 @@ function loadNewReply(replyId, soneId, postId, postSoneId) { } }); newReply = $(data.reply.html).addClass("hidden"); - if ($(".reply-author-local", newPost).text() == "true") { - newPost.removeClass("new"); + if ($(".reply-author-local", newReply).text() == "true") { + newReply.removeClass("new"); + (function(newReply) { + setTimeout(function() { + markReplyAsKnown(newReply, false); + }, 5000); + })(newReply); } if (firstNewerReply != null) { newReply.insertBefore(firstNewerReply);