diff --git a/www/read/index.html b/www/read/index.html index 32f6f5a06..326e46158 100644 --- a/www/read/index.html +++ b/www/read/index.html @@ -30,6 +30,9 @@ pre { - -

+
+ + + + diff --git a/www/read/main.js b/www/read/main.js index 4a8d36eeb..9bce1ebe7 100644 --- a/www/read/main.js +++ b/www/read/main.js @@ -9,8 +9,8 @@ define([ var useDoc = function (err, doc) { if (err) { return console.error(err); } - console.log(doc); - $dest.text(doc); + //console.log(doc); + $('#putter').val(doc); }; $('#get').click(function () { @@ -19,5 +19,17 @@ define([ Crypt.get(val, useDoc); }); + $('#put').click(function () { + var hash = $target.val().trim(); + Crypt.put(hash, $('#putter').val(), function (e) { + if (e) { console.error(e); } + $('#get').click(); + }); + }); + + $('#open').click(function () { + window.open('/code/#' + $target.val()); + }); + if (window.location.hash) { Crypt.get(void 0, useDoc); } });