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 | |
parent | 5f958a582d1326ada1cb34b4c6578590a7c40e6c (diff) | |
download | go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.gz go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.bz2 go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.lz go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.xz go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.tar.zst go-tangerine-4a0ade4788b0e8d53c6b0eabaf9652643b6a073a.zip |
Fixed some whisper issues
Diffstat (limited to 'cmd/mist/assets')
-rw-r--r-- | cmd/mist/assets/ext/eth.js/main.js | 1 | ||||
-rw-r--r-- | cmd/mist/assets/qml/browser.qml | 44 |
2 files changed, 26 insertions, 19 deletions
diff --git a/cmd/mist/assets/ext/eth.js/main.js b/cmd/mist/assets/ext/eth.js/main.js index 5c7ca0603..71e304a55 100644 --- a/cmd/mist/assets/ext/eth.js/main.js +++ b/cmd/mist/assets/ext/eth.js/main.js @@ -352,6 +352,7 @@ web3.provider = new ProviderManager(); web3.setProvider = function(provider) { + console.log("setprovider", provider) provider.onmessage = messageHandler; web3.provider.set(provider); web3.provider.sendQueued(); 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) |