X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=be7deaa074a21800c90274564c5609039fca55e8;hb=c80d8668e387886c7fbda86e4196f65ba2e3a49c;hp=cd27cc3e86c472c888ceabd319134bec1dfb6e04;hpb=a19c6f5632d28cdcdf5023666d926d5929c347a1;p=Sone.git diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index cd27cc3..be7deaa 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -46,6 +46,9 @@ function registerInputTextareaSwap(inputSelector, defaultText, inputFieldName, o /* hide all the “create reply” forms until a link is clicked. */ function addCommentLinks() { + if (!isOnline()) { + return; + } $("#sone .post").each(function() { postId = $(this).attr("id"); commentElement = (function(postId) { @@ -283,6 +286,7 @@ function unlikePost(postId) { function updatePostLikes(postId) { $.getJSON("ajax/getPostLikes.ajax", { "post": postId }, function(data, textStatus) { if (data.success) { + $("#sone .post#" + postId + " > .status-line .likes").toggleClass("hidden", data.likes == 0) $("#sone .post#" + postId + " > .status-line .likes span.like-count").text(data.likes); } });