X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=21f6803af437a2cf507579da37601326b4429ee1;hb=261a9356258c9c60059989e1dd6ec96f4659ee61;hp=67231968c57c66926011febca67b4f23c74d7fe8;hpb=68970fb016d46173a4e502ecac3cf693c495fa28;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 6723196..21f6803 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -981,6 +981,22 @@ function getStatus() { } }); if (!foundNotification) { + if (notificationId == "new-sone-notification") { + $(".sone-id", this).each(function(index, element) { + soneId = $(this).text(); + markSoneAsKnown(getSone(soneId), true); + }); + } else if (notificationId == "new-post-notification") { + $(".post-id", this).each(function(index, element) { + postId = $(this).text(); + markPostAsKnown(getPost(postId), true); + }); + } else if (notificationId == "new-replies-notification") { + $(".reply-id", this).each(function(index, element) { + replyId = $(this).text(); + markReplyAsKnown(getReply(replyId), true); + }); + } $(this).slideUp("normal", function() { $(this).remove(); }); @@ -996,6 +1012,9 @@ function getStatus() { notification.find(".short-text").toggleClass("hidden", opened); notification.find(".text").toggleClass("hidden", !opened); } + checkForRemovedSones(oldNotification, notification); + checkForRemovedPosts(oldNotification, notification); + checkForRemovedReplies(oldNotification, notification); oldNotification.replaceWith(notification.show()); } else { $("#sone #notification-area").append(notification);