Don’t add comment links when nobody is logged in.
[Sone.git] / src / main / resources / static / javascript / sone.js
index f1603ac..9bb379c 100644 (file)
@@ -1,5 +1,9 @@
 /* Sone JavaScript functions. */
 
+function isOnline() {
+       return $("#sone").hasClass("online");
+}
+
 function registerInputTextareaSwap(inputSelector, defaultText, inputFieldName, optional) {
        $(inputSelector).each(function() {
                textarea = $("<textarea name=\"" + inputFieldName + "\"></textarea>").blur(function() {
@@ -42,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) {