Commit 08c9ca8a authored by maik alms's avatar maik alms

fix fix bug fix bug #53832

parent 1d82043c
......@@ -211,7 +211,8 @@ a:hover, a:focus {
}
editor.prototype.loadPost = function(data) {
this.newSession(data.id, data.content);
console.log(data)
this.newSession(data.id, data.content.contents);
}
editor.prototype.postSaved = function(id) {
......@@ -265,6 +266,7 @@ a:hover, a:focus {
if (id && title) {
this.requestSavePost(id, title, this.ace.getValue());
}
return false;
}
editor.prototype.showPost = function(id) {
......
......@@ -21,19 +21,19 @@ function Ajax(request, response, write_cache) {
var ret = '{}';
switch (post.action) {
case 'postlist':
ret = postList();
ret = postList(response);
response.setContentType('application/json');
break;
case 'getpost':
ret = getPost(post).contents;
ret = getPost(response, post);
response.setContentType('application/json');
break;
case 'writepost':
ret = writePost(post);
ret = writePost(response, post);
response.setContentType('application/json');
break;
case 'previewpost':
ret = previewPost(post);
ret = previewPost(response, post);
response.setContentType('text/html');
break;
default:
......
......@@ -52,7 +52,9 @@ _responseWrapper.prototype.setResponseCode = function (code) {
}
_responseWrapper.prototype.updateLength = function () {
this.contentLength = Buffer.byteLength(this.data, 'utf8');
if (this.data) {
this.contentLength = Buffer.byteLength(this.data, 'utf8');
}
}
_responseWrapper.prototype.sendHeader = function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment