diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-30 20:25:12 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-30 20:25:12 +0800 |
commit | c03d403437c20584bcbf3cf3fa9d79ac7a0a8ca7 (patch) | |
tree | 137343143b03e4b76bbbfa269c2fc7d35f9f6a35 /cmd/mist/assets | |
parent | c48644490f039fb9756b4cd1fedf11fbb1c4a16f (diff) | |
download | dexon-c03d403437c20584bcbf3cf3fa9d79ac7a0a8ca7.tar.gz dexon-c03d403437c20584bcbf3cf3fa9d79ac7a0a8ca7.tar.zst dexon-c03d403437c20584bcbf3cf3fa9d79ac7a0a8ca7.zip |
Added whisper interface for xeth, added examples, updated RPC
* Added RPC methods for whisper
* Added whisper example
Diffstat (limited to 'cmd/mist/assets')
-rw-r--r-- | cmd/mist/assets/examples/coin.html | 2 | ||||
-rw-r--r-- | cmd/mist/assets/examples/whisper.html | 42 | ||||
-rw-r--r-- | cmd/mist/assets/qml/main.qml | 2 | ||||
-rw-r--r-- | cmd/mist/assets/qml/views/browser.qml | 5 |
4 files changed, 48 insertions, 3 deletions
diff --git a/cmd/mist/assets/examples/coin.html b/cmd/mist/assets/examples/coin.html index 572f6959d..edeabe5e8 100644 --- a/cmd/mist/assets/examples/coin.html +++ b/cmd/mist/assets/examples/coin.html @@ -1,6 +1,6 @@ <!doctype> <html> - +<title>JevCoin</title> <head> <script type="text/javascript" src="../ext/bignumber.min.js"></script> <script type="text/javascript" src="../ext/ethereum.js/dist/ethereum.js"></script> diff --git a/cmd/mist/assets/examples/whisper.html b/cmd/mist/assets/examples/whisper.html new file mode 100644 index 000000000..51d7004de --- /dev/null +++ b/cmd/mist/assets/examples/whisper.html @@ -0,0 +1,42 @@ +<!doctype> +<html> +<title>Whisper test</title> +<head> +<script type="text/javascript" src="../ext/bignumber.min.js"></script> +<script type="text/javascript" src="../ext/ethereum.js/dist/ethereum.js"></script> +</head> +<body> + +<h1>Whisper test</h1> + +<button onclick="test()">Send</button> + +<table width="100%" id="table"> + <tr> + <td>ID</td> + <td id="id"></td> + </tr> +</table> +</body> + +<script type="text/javascript"> + var web3 = require('web3'); + web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080')); + + var shh = web3.shh; + + var id = shh.newIdentity(); + document.querySelector("#id").innerHTML = id; + + shh.watch({topics: ["test"]}).arrived(function(message) { + document.querySelector("#table").innerHTML += "<tr><td colspan='2'>"+JSON.stringify(message)+"</td></tr>"; + }); + + function test() { + shh.post({topics: ["test"], payload: web3.fromAscii("test it")}) + } +</script> + +</html> + + diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 1a8885e58..da1f4a0c6 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -110,7 +110,7 @@ ApplicationWindow { function newBrowserTab(url) { var window = addPlugin("./views/browser.qml", {noAdd: true, close: true, section: "apps", active: true}); window.view.url = url; - window.menuItem.title = "Browser Tab"; + window.menuItem.title = "Mist"; activeView(window.view, window.menuItem); } diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml index d6a762278..277a5b7eb 100644 --- a/cmd/mist/assets/qml/views/browser.qml +++ b/cmd/mist/assets/qml/views/browser.qml @@ -11,7 +11,7 @@ Rectangle { anchors.fill: parent color: "#00000000" - property var title: "DApps" + property var title: "" property var iconSource: "../browser.png" property var menuItem property var hideUrl: true @@ -154,6 +154,9 @@ Rectangle { onLoadingChanged: { if (loadRequest.status == WebEngineView.LoadSucceededStatus) { + webview.runJavaScript("document.title", function(pageTitle) { + menuItem.title = pageTitle; + }); webview.runJavaScript(eth.readFile("bignumber.min.js")); webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js")); } |