X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=b6987c369539217025dce8fba76fee93d07e0392;hb=701e2dedb4d32876e6bfd0761edb4603889d8661;hp=8065b73d6da01d59fe1011c93eea5593a70822be;hpb=403bcebd8de71dcb793c3f15138bc2df6431ae06;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 8065b73..b6987c3 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -277,7 +277,7 @@ function getFormPassword() { */ function getSone(soneId) { return $("#sone .sone").filter(function(index) { - return $(".id").text() == soneId; + return $(".id", this).text() == soneId; }); } @@ -1280,11 +1280,10 @@ function loadNewReply(replyId, soneId, postId, postSoneId) { * request */ function markSoneAsKnown(soneElement, skipRequest) { - if ($(".new", soneElement).length > 0) { - if ((typeof skipRequest != "undefined") && !skipRequest) { - $.getJSON("maskAsKnown.ajax", {"formPassword": getFormPassword(), "type": "sone", "id": getSoneId(soneElement)}, function(data, textStatus) { - $(soneElement).removeClass("new"); - }); + if ($(soneElement).is(".new")) { + $(soneElement).removeClass("new"); + if ((typeof skipRequest == "undefined") || !skipRequest) { + $.getJSON("markAsKnown.ajax", {"formPassword": getFormPassword(), "type": "sone", "id": getSoneId(soneElement)}); } } } @@ -1692,6 +1691,11 @@ $(document).ready(function() { ajaxifyNotification($(this)); }); + /* disable all permalinks. */ + $(".permalink").click(function() { + return false; + }); + /* activate status polling. */ setTimeout(getStatus, 5000);