cleaning up readme file and fixing bugs in editing of posts ("asdf" anyone?)

This commit is contained in:
Julian Lam
2013-06-05 13:34:44 -04:00
parent 812cdd28bf
commit 6f16088cd6
6 changed files with 53 additions and 56 deletions

View File

@@ -323,15 +323,36 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
});
});
} else if (parseInt(data.pid) > 0) {
posts.getRawContent(data.pid, function(raw) {
async.parallel([
function(next) {
posts.getRawContent(data.pid, function(raw) {
next(null, raw);
});
},
function(next) {
topics.getTitle(data.pid, function(title) {
next(null, title);
});
}
], function(err, results) {
socket.emit('api:composer.push', {
title: 'asdf',
title: results[1],
pid: data.pid,
body: raw
body: results[0]
});
});
}
});
socket.on('api:composer.editCheck', function(pid) {
posts.get_tid_by_pid(pid, function(tid) {
postTools.isMain(pid, tid, function(isMain) {
socket.emit('api:composer.editCheck', {
titleEditable: isMain
});
})
})
});
});
}(SocketIO));