/* 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() {
/* 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) {
}
function getSoneElement(element) {
- return $(element).parent(".sone");
+ return $(element).parents(".sone");
}
/**
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);
}
});