Merge branch 'release-0.6.5'
[Sone.git] / src / main / resources / static / javascript / sone.js
index 0cc6480..d6c83ae 100644 (file)
@@ -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();
+                               }
                        }
                });
        });
@@ -1237,11 +1243,6 @@ function loadNewPost(postId, soneId, recipientId, time) {
                        newPost = $(data.post.html).addClass("hidden");
                        if ($(".post-author-local", newPost).text() == "true") {
                                newPost.removeClass("new");
-                               (function(newPost) {
-                                       setTimeout(function() {
-                                               markPostAsKnown(newPost, false);
-                                       }, 5000);
-                               })(newPost);
                        }
                        if (firstOlderPost != null) {
                                newPost.insertBefore(firstOlderPost);