From 2e8484ad4cfa936621e59d229ea2550c5a6eb4db Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Mar 2017 11:47:11 +0100 Subject: [PATCH] notes about what to improve. transform json on OT instead of just validating --- www/examples/canvas/main.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/www/examples/canvas/main.js b/www/examples/canvas/main.js index 55c7f4c68..6eb695e80 100644 --- a/www/examples/canvas/main.js +++ b/www/examples/canvas/main.js @@ -67,6 +67,7 @@ define([ var saveImage = module.saveImage = function () { $canvas[0].toBlob(function (blob) { var defaultName = "pretty-picture.png"; + // TODO make this translatable saveAs(blob, window.prompt("What would you like to name your image?", defaultName) || "pretty-picture.png"); }); @@ -78,22 +79,19 @@ define([ initialState: '{}', websocketURL: Cryptpad.getWebsocketURL(), validateKey: secret.keys.validateKey, - readOnly: false, // TODO + readOnly: false, // TODO, support read-only channel: secret.channel, crypto: Crypto.createEncryptor(secret.keys), - transformFunction: JsonOT.validate, + transformFunction: JsonOT.transform, }; var editHash; var onInit = config.onInit = function (info) { editHash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys); - Cryptpad.replaceHash(editHash); - - //window.location.hash = info.channel + secret.key; - //$(window).on('hashchange', function() { window.location.reload(); }); }; + // used for debugging, feel free to remove var Catch = function (f) { return function () { try {