X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=d9c2fb3d3d8d54d8ee673376f81a076608878dda;hp=100e9db33b1033d3da5b07c658922832ac3cb06d;hb=b4e1998759191eaa6378cd1b99113d95abac63dd;hpb=a02811cd7b38393e0d59f8a90a8a617fd8ca160a diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 100e9db..d9c2fb3 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -807,7 +807,7 @@ function ajaxifyPost(postElement) { $(".expand-post-text", getPostElement(this)).toggleClass("hidden"); $(".shrink-post-text", getPostElement(this)).toggleClass("hidden"); return false; - }) + }); }); /* ajaxify author/post links */ @@ -847,12 +847,14 @@ function ajaxifyPost(postElement) { }); /* mark everything as known on click. */ - $(postElement).click(function(event) { - if ($(event.target).hasClass("click-to-show")) { - return false; - } - markPostAsKnown(this); - }); + (function(postElement) { + $(postElement).click(function(event) { + if ($(event.target).hasClass("click-to-show")) { + return false; + } + markPostAsKnown(postElement, false); + }); + })(postElement); /* hide reply input field. */ $(postElement).find(".create-reply").addClass("hidden"); @@ -1063,7 +1065,7 @@ function ajaxifyNotification(notification) { } notification.find("form.mark-as-read button").click(function() { allIds = $(":input[name=id]", this.form).val().split(" "); - for (index = 0; index < allIds.length; index += 16) { + for (var 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}); } @@ -1536,7 +1538,7 @@ function markPostAsKnown(postElements, skipRequest) { } $(".click-to-show", postElement).removeClass("new"); }); - markReplyAsKnown($(postElements).find(".reply")); + markReplyAsKnown($(postElements).find(".reply"), true); } function markReplyAsKnown(replyElements, skipRequest) {