diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-09 04:41:32 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-09 04:41:32 +0800 |
commit | 4a0ade4788b0e8d53c6b0eabaf9652643b6a073a (patch) | |
tree | 57a477ec1419547130ca75638fb2df71f883b4f4 /cmd/mist/assets/qml | |
parent | 5f958a582d1326ada1cb34b4c6578590a7c40e6c (diff) | |
download | go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.gz go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.zst go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.zip |
Fixed some whisper issues
Diffstat (limited to 'cmd/mist/assets/qml')
-rw-r--r-- | cmd/mist/assets/qml/browser.qml | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/cmd/mist/assets/qml/browser.qml b/cmd/mist/assets/qml/browser.qml index 4cf6b2470..c2f8741bc 100644 --- a/cmd/mist/assets/qml/browser.qml +++ b/cmd/mist/assets/qml/browser.qml @@ -59,7 +59,7 @@ Rectangle { } Component.onCompleted: { - webview.url = "/Users/jeffrey/test.html" + webview.url = "http://etherian.io" } signal messages(var messages, int id); @@ -153,7 +153,9 @@ Rectangle { } function injectJs(js) { - experimental.evaluateJavaScript(js) + //webview.experimental.navigatorQtObjectEnabled = true; + //webview.experimental.evaluateJavaScript(js) + //webview.experimental.javascriptEnabled = true; } function sendMessage(data) { @@ -164,7 +166,7 @@ Rectangle { experimental.preferences.javascriptEnabled: true experimental.preferences.navigatorQtObjectEnabled: true experimental.preferences.developerExtrasEnabled: true - //experimental.userScripts: ["../ext/q.js", "../ext/eth.js/main.js", "../ext/eth.js/qt.js", "../ext/setup.js"] + experimental.userScripts: ["../ext/q.js", "../ext/eth.js/main.js", "../ext/eth.js/qt.js", "../ext/setup.js"] experimental.onMessageReceived: { console.log("[onMessageReceived]: ", message.data) // TODO move to messaging.js @@ -344,24 +346,28 @@ Rectangle { break; case "newIdentity": - postData(data._id, shh.newIdentity()) - break + var id = shh.newIdentity() + console.log("newIdentity", id) + postData(data._id, id) + + break case "post": - require(1); - var params = data.args[0]; - var fields = ["payload", "to", "from"]; - for(var i = 0; i < fields.length; i++) { - params[fields[i]] = params[fields[i]] || ""; - } - if(typeof params.payload !== "object") { params.payload = [params.payload]; } //params.payload = params.payload.join(""); } - params.topics = params.topics || []; - params.priority = params.priority || 1000; - params.ttl = params.ttl || 100; - - console.log(JSON.stringify(params)) - shh.post(params.payload, params.to, params.from, params.topics, params.priority, params.ttl); - break; + require(1); + + var params = data.args[0]; + var fields = ["payload", "to", "from"]; + for(var i = 0; i < fields.length; i++) { + params[fields[i]] = params[fields[i]] || ""; + } + if(typeof params.payload !== "object") { params.payload = [params.payload]; } //params.payload = params.payload.join(""); } + params.topics = params.topics || []; + params.priority = params.priority || 1000; + params.ttl = params.ttl || 100; + + shh.post(params.payload, params.to, params.from, params.topics, params.priority, params.ttl); + + break; } } catch(e) { console.log(data.call + ": " + e) |