1
0
Fork 0
mirror of https://github.com/SunRed/haste-server.git synced 2024-11-23 17:50:19 +01:00

Change uuid to key

This commit is contained in:
John Crepezzi 2011-11-18 16:25:18 -05:00
parent 6597dba36d
commit 8a8b438163
2 changed files with 4 additions and 5 deletions

View file

@ -32,11 +32,10 @@ DocumentHandler.prototype.handlePost = function(request, response) {
}); });
request.on('end', function(end) { request.on('end', function(end) {
winston.verbose('added document', { key: key }); winston.verbose('added document', { key: key });
response.end(JSON.stringify({ uuid: key })); response.end(JSON.stringify({ key: key }));
}); });
request.on('error', function(error) { request.on('error', function(error) {
// TODO handle error // TODO handle error
// TODO rename key to uuid everywhere behind the scenes
// TODO finish all TODOs // TODO finish all TODOs
}); });
}; };

View file

@ -20,7 +20,7 @@ heist_document.prototype.load = function(key, callback) {
var high = hljs.highlightAuto(res.data); var high = hljs.highlightAuto(res.data);
callback({ callback({
value: high.value, value: high.value,
uuid: key, key: key,
language: high.language language: high.language
}); });
} }
@ -48,7 +48,7 @@ heist_document.prototype.save = function(data, callback) {
var high = hljs.highlightAuto(data); var high = hljs.highlightAuto(data);
callback({ callback({
value: high.value, value: high.value,
uuid: res.uuid, key: res.key,
language: high.language language: high.language
}); });
} }
@ -115,7 +115,7 @@ heist.prototype.lockDocument = function() {
if (ret) { if (ret) {
_this.$code.html(ret.value); _this.$code.html(ret.value);
_this.setTitle(ret.language ? ret.language : 'unknown'); _this.setTitle(ret.language ? ret.language : 'unknown');
window.history.pushState(null, _this.appName + '-' + ret.uuid, '/' + ret.uuid); window.history.pushState(null, _this.appName + '-' + ret.key, '/' + ret.key);
_this.$textarea.val('').hide(); _this.$textarea.val('').hide();
_this.$box.show(); _this.$box.show();
} }