});
}
+var translations = {};
+
/**
* Retrieves the translation for the given key and calls the callback function.
* The callback function takes a single parameter, the translated string.
* The callback function
*/
function getTranslation(key, callback) {
+ if (key in translations) {
+ callback(translations[key]);
+ return;
+ }
$.getJSON("ajax/getTranslation.ajax", {"key": key}, function(data, textStatus) {
if ((data != null) && data.success) {
+ translations[key] = data.value;
callback(data.value);
}
}, function(xmlHttpRequest, textStatus, error) {
var soneList = "";
$.each(sones, function() {
if (soneList != "") {
- soneList += "\n";
+ soneList += ", ";
}
soneList += this.name;
});
}
function getPostElement(element) {
- return $(element).parents(".post");
+ return $(element).hasClass("post") ? $(element) : $(element).parents(".post");
}
function getPostId(element) {
return getPostElement(element).attr("id");
}
+function getPostTime(element) {
+ return getPostElement(element).find(".storage-time").text();
+}
+
function getReplyElement(element) {
return $(element).parents(".reply");
}
return getReplyElement(element).attr("id");
}
+function getReplyTime(element) {
+ return getReplyElement(element).find(".storage-time").text();
+}
+
function likePost(postId) {
$.getJSON("ajax/like.ajax", { "type": "post", "post" : postId, "formPassword": getFormPassword() }, function(data, textStatus) {
if ((data == null) || !data.success) {