X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=d5db8efc61ea8a5795c4405d3aafa7a72ab19db9;hb=74223530641d7581c7d8f572e98eff1a01946ebd;hp=562a7444a779f321b017445cd6f212d3f5c86097;hpb=0d9237f934ca9ac87ff7e5b62223bf21023b6069;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 562a744..d5db8ef 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1079,8 +1079,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 +1273,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); @@ -1314,7 +1321,7 @@ function markSoneAsKnown(soneElement, skipRequest) { function markPostAsKnown(postElements, skipRequest) { $(postElements).each(function() { postElement = this; - if ($(postElement).hasClass("new")) { + if ($(postElement).hasClass("new") || ((typeof skipRequest != "undefined") && !skipRequest)) { (function(postElement) { $(postElement).removeClass("new"); if ((typeof skipRequest == "undefined") || !skipRequest) { @@ -1330,7 +1337,7 @@ function markPostAsKnown(postElements, skipRequest) { function markReplyAsKnown(replyElements, skipRequest) { $(replyElements).each(function() { replyElement = this; - if ($(replyElement).hasClass("new")) { + if ($(replyElement).hasClass("new") || ((typeof skipRequest != "undefined") && !skipRequest)) { (function(replyElement) { $(replyElement).removeClass("new"); if ((typeof skipRequest == "undefined") || !skipRequest) {