/* Sone JavaScript functions. */
+/* jQuery overrides. */
+oldGetJson = jQuery.prototype.getJSON;
+jQuery.prototype.getJSON = function(url, data, successCallback, errorCallback) {
+ if (typeof errorCallback == "undefined") {
+ return oldGetJson(url, data, successCallback);
+ }
+ if (jQuery.isFunction(data)) {
+ errorCallback = successCallback;
+ successCallback = data;
+ data = null;
+ }
+ return jQuery.ajax({
+ data: data,
+ error: errorCallback,
+ success: successCallback,
+ url: url
+ });
+}
+
function isOnline() {
return $("#sone").hasClass("online");
}
if (data != null) {
callback(data.value);
}
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
setTimeout(function() {
getSoneStatus(soneId, local);
}, updateInterval * 1000);
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
} else if (data.error == "not-authorized") {
alert("You are not allowed to delete this post.");
}
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
});
}
} else if (data.error == "not-authorized") {
alert("You are not allowed to delete this reply.");
}
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
});
}
$("#sone .post#" + postId + " > .inner-part > .status-line .like").addClass("hidden");
$("#sone .post#" + postId + " > .inner-part > .status-line .unlike").removeClass("hidden");
updatePostLikes(postId);
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
$("#sone .post#" + postId + " > .inner-part > .status-line .unlike").addClass("hidden");
$("#sone .post#" + postId + " > .inner-part > .status-line .like").removeClass("hidden");
updatePostLikes(postId);
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
$("#sone .post#" + postId + " > .inner-part > .status-line .likes span.like-count").text(data.likes);
$("#sone .post#" + postId + " > .inner-part > .status-line .likes > span").attr("title", generateSoneList(data.sones));
}
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
$("#sone .reply#" + replyId + " .status-line .like").addClass("hidden");
$("#sone .reply#" + replyId + " .status-line .unlike").removeClass("hidden");
updateReplyLikes(replyId);
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
$("#sone .reply#" + replyId + " .status-line .unlike").addClass("hidden");
$("#sone .reply#" + replyId + " .status-line .like").removeClass("hidden");
updateReplyLikes(replyId);
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
$("#sone .reply#" + replyId + " .status-line .likes span.like-count").text(data.likes);
$("#sone .reply#" + replyId + " .status-line .likes > span").attr("title", generateSoneList(data.sones));
}
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
} else {
callbackFunction(false, data.error);
}
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
if ((data != null) && data.success) {
callbackFunction(data.soneId, data.soneName, data.time, data.displayTime, data.text, data.html);
}
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}
$.getJSON("ajax/dismissNotification.ajax", { "formPassword" : getFormPassword(), "notification" : notification.attr("id") }, function(data, textStatus) {
/* dismiss in case of error, too. */
notification.slideUp();
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
});
return notification;
} else {
setTimeout(getNotifications, 30000);
}
+ }, function(xmlHttpRequest, textStatus, error) {
+ /* ignore error. */
});
}