More resources translated ...

This commit is contained in:
Paulo Gustavo Veiga
2012-06-30 15:25:24 -03:00
parent 7b6293dc46
commit cc9f57a153
9 changed files with 113 additions and 155 deletions

View File

@@ -28,30 +28,34 @@
var tableElem = $('#historyTable');
jQuery.ajax("service/maps/${mindmapId}/history", {
async:false,
dataType: 'json',
type: 'GET',
dataType:'json',
type:'GET',
contentType:"text/plain",
success : function(data, textStatus, jqXHR) {
$(data.changes).each(function() {
tableElem.append('\
success:function (data, textStatus, jqXHR) {
if (data.changes.length > 0) {
$(data.changes).each(function () {
tableElem.append('\
<tr data-history-id="' + this.id + '">\
<td>' + this.creator + '</td>\
<td><abbr class="timeago" title="' + this.creationTime + '">' + jQuery.timeago(this.creationTime) + '</abbr></td>\
<td><a class="view" href="#">view</a></td>\
<td><a class="revert" href="#">revert</a></td>\
</tr>');
});
});
} else {
$('#historyContainer').text("<spring:message code="NO_HISTORY_RESULTS"/>");
}
tableElem.find('tr a.view').each(function() {
$(this).click(function(event) {
tableElem.find('tr a.view').each(function () {
$(this).click(function (event) {
window.open("/c/maps/${mindmapId}/" + $(this).closest("tr").attr("data-history-id") + "/view");
event.preventDefault();
});
});
tableElem.find('tr a.revert').each(function() {
$(this).click(function(event) {
tableElem.find('tr a.revert').each(function () {
$(this).click(function (event) {
var url = "service/maps/${mindmapId}/history/" + $(this).closest("tr").attr("data-history-id");
jQuery.post(url, function(data) {
jQuery.post(url, function (data) {
window.parent.location = "c/maps/${mindmapId}/edit";
});
event.preventDefault();
@@ -59,8 +63,8 @@
});
},
error:function(jqXHR, textStatus, errorThrown) {
alert(textStatus);
error:function (jqXHR, textStatus, errorThrown) {
console.log(textStatus);
}
});
</script>