|
|
@ -9,8 +9,8 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var useDoc = function (err, doc) {
|
|
|
|
var useDoc = function (err, doc) {
|
|
|
|
if (err) { return console.error(err); }
|
|
|
|
if (err) { return console.error(err); }
|
|
|
|
console.log(doc);
|
|
|
|
//console.log(doc);
|
|
|
|
$dest.text(doc);
|
|
|
|
$('#putter').val(doc);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$('#get').click(function () {
|
|
|
|
$('#get').click(function () {
|
|
|
@ -19,5 +19,17 @@ define([
|
|
|
|
Crypt.get(val, useDoc);
|
|
|
|
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); }
|
|
|
|
if (window.location.hash) { Crypt.get(void 0, useDoc); }
|
|
|
|
});
|
|
|
|
});
|
|
|
|