From 84d5e4b35ddec565d177dd55d82543927a8f8828 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 22 Dec 2016 11:03:44 +0100 Subject: [PATCH] better tools for playing with template code --- www/read/index.html | 7 +++++-- www/read/main.js | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) 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); } });