From: David ‘Bombe’ Roden Date: Sat, 18 Jun 2011 15:06:31 +0000 (+0200) Subject: Split up element marking into blocks of 16 elements. X-Git-Tag: 0.6.5^2~4 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=79f00c3316155eaa91a92cd9c7ad99b288548367;p=Sone.git Split up element marking into blocks of 16 elements. This should make it work with several thousand elements at once. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index d5db8ef..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);