|
|
@ -49,19 +49,21 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var vdom1 = Convert.dom.to.vdom(inner);
|
|
|
|
var vdom1 = Convert.dom.to.vdom(inner);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var onChange = function (shjson) {
|
|
|
|
|
|
|
|
var authDoc = JSON.parse(shjson);
|
|
|
|
|
|
|
|
var vdom2 = Convert.hjson.to.vdom(authDoc);
|
|
|
|
|
|
|
|
var patches = Vdom.diff(vdom1, vdom2);
|
|
|
|
|
|
|
|
Vdom.patch(inner, patches);
|
|
|
|
|
|
|
|
vdom1 = vdom2;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
window.rti = realtimeInput.start($textarea[0],
|
|
|
|
window.rti = realtimeInput.start($textarea[0],
|
|
|
|
Config.websocketURL,
|
|
|
|
Config.websocketURL,
|
|
|
|
Crypto.rand64(8),
|
|
|
|
Crypto.rand64(8),
|
|
|
|
key.channel,
|
|
|
|
key.channel,
|
|
|
|
key.cryptKey,
|
|
|
|
key.cryptKey,
|
|
|
|
inner,
|
|
|
|
inner,
|
|
|
|
function (shjson) {
|
|
|
|
onChange);
|
|
|
|
var authDoc = JSON.parse(shjson);
|
|
|
|
|
|
|
|
var vdom2 = Convert.hjson.to.vdom(authDoc);
|
|
|
|
|
|
|
|
var patches = Vdom.diff(vdom1, vdom2);
|
|
|
|
|
|
|
|
Vdom.patch(inner, patches);
|
|
|
|
|
|
|
|
vdom1 = vdom2;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$textarea.val(JSON.stringify(Convert.dom.to.hjson(inner)));
|
|
|
|
$textarea.val(JSON.stringify(Convert.dom.to.hjson(inner)));
|
|
|
|
|
|
|
|
|
|
|
|