From d3e2a2f52e45c40eaaf56a8dbb8f3a49de4b5a2c Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 7 Mar 2016 11:59:36 +0100 Subject: [PATCH 1/6] make verbose logging switchable via a conditional --- www/common/realtime-input.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/common/realtime-input.js b/www/common/realtime-input.js index ecd19e015..db0b6126c 100644 --- a/www/common/realtime-input.js +++ b/www/common/realtime-input.js @@ -30,7 +30,11 @@ define([ var debug = function (x) { console.log(x); }, warn = function (x) { console.error(x); }, - verbose = function (x) { console.log(x); }; + verbose = function (x) { + if (window.verboseLogging) { + console.log(x); + } + }; // verbose = function () {}; // comment out to enable verbose logging // ------------------ Trapping Keyboard Events ---------------------- // From c67451bc1a0164a42fc2f5c4c8c4886167293e28 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 9 Mar 2016 10:29:51 +0100 Subject: [PATCH 2/6] Revert "remove broken functions from convert module" Because I forgot that the /render/ page was still using vdom This reverts commit 93fb944e1ff7802f1970bcad3cd3ca149a23cdf3. --- www/common/convert.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/common/convert.js b/www/common/convert.js index d37e98539..3363cf384 100644 --- a/www/common/convert.js +++ b/www/common/convert.js @@ -20,13 +20,19 @@ define([ methods = { dom:{ dom: Self, - hjson: hyperjson.fromDOM + hjson: hyperjson.fromDOM, + vdom: function (D) { + return hyperjson.callOn(hyperjson.fromDOM(D), vdom.h); + } }, hjson:{ hjson: Self, dom: function (H) { // hyperjson.fromDOM, return hyperjson.callOn(H, hyperscript); + }, + vdom: function (H) { + return hyperjson.callOn(H, vdom.h); } } }, From 8258018c1d8097dc7fc00041d062ee67637afbc2 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 9 Mar 2016 10:32:57 +0100 Subject: [PATCH 3/6] Revert "fix undefined reference" This reverts commit 7d65540123285addf0e27f3689a15b64f32f9afa. To restore functionality in convert.js --- www/common/convert.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/www/common/convert.js b/www/common/convert.js index 3363cf384..b95591e93 100644 --- a/www/common/convert.js +++ b/www/common/convert.js @@ -1,14 +1,16 @@ define([ + '/common/virtual-dom.js', '/common/hyperjson.js', '/common/hyperscript.js' -], function (hyperjson, hyperscript) { +], function (vdom, hyperjson, hyperscript) { // complain if you don't find the required APIs - if (!(hyperjson && hyperscript)) { throw new Error(); } - + if (!(vdom && hyperjson && hyperscript)) { throw new Error(); } + // Generate a matrix of conversions /* convert.dom.to.hjson, convert.hjson.to.dom, convert.dom.to.vdom, convert.vdom.to.dom, + convert.vdom.to.hjson, convert.hjson.to.vdom and of course, identify functions in case you try to convert a datatype to itself @@ -34,8 +36,17 @@ define([ vdom: function (H) { return hyperjson.callOn(H, vdom.h); } + }, + vdom:{ + vdom: Self, + dom: function (V) { + return vdom.create(V); + }, + hjson: function (V) { + return hyperjson.fromDOM(vdom.create(V)); + } } - }, + }, convert = {}; Object.keys(methods).forEach(function (method) { convert[method] = { to: methods[method] }; @@ -44,6 +55,7 @@ define([ }()); convert.core = { + vdom: vdom, hyperjson: hyperjson, hyperscript: hyperscript }; From 136e2d8cf27164685fe3525de015b1eb043d93e5 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 9 Mar 2016 11:02:12 +0100 Subject: [PATCH 4/6] pass in missing textarea argument so textpad starts working again --- www/text/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/text/main.js b/www/text/main.js index 4c84064c7..db753e8a7 100644 --- a/www/text/main.js +++ b/www/text/main.js @@ -20,6 +20,7 @@ define([ var $textarea = $('textarea'); var config = { + textarea: $textarea[0], websocketURL: Config.websocketURL, userName: Crypto.rand64(8), channel: key.channel, From 3a7af63c54adaa5106aa8c0c018d9ad671549443 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 10 Mar 2016 11:58:23 +0100 Subject: [PATCH 5/6] correct malformed json --- www/input/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/input/main.js b/www/input/main.js index 9be43e973..c61e312f2 100644 --- a/www/input/main.js +++ b/www/input/main.js @@ -33,7 +33,7 @@ define([ websocketURL: Config.websocketURL, userName: Crypto.rand64(8), channel: key.channel, - key.cryptKey + cryptKey: key.cryptKey }; var rttext = RTText.start(config); From 5cd118bdb0a3a99aafbbfb709c61e5ea0b3ec8b0 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 10 Mar 2016 12:00:36 +0100 Subject: [PATCH 6/6] ignore netflux since it's ecma6 and not our code --- .jshintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.jshintignore b/.jshintignore index 299e1ad54..29b53f0f4 100644 --- a/.jshintignore +++ b/.jshintignore @@ -11,3 +11,4 @@ www/code/rangy.js storage/kad.js www/common/otaml.js www/common/diffDOM.js +www/common/netflux.js