aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.html7
-rw-r--r--qt.js4
-rw-r--r--websocket.js2
3 files changed, 9 insertions, 4 deletions
diff --git a/index.html b/index.html
index c4f989537..fc658c00a 100644
--- a/index.html
+++ b/index.html
@@ -3,12 +3,15 @@
<head>
<script type="text/javascript" src="main.js"></script>
+<script type="text/javascript" src="websocket.js"></script>
+<script type="text/javascript" src="qt.js"></script>
<script type="text/javascript">
function registerName() {
var name = document.querySelector("#name").value;
- name = eth.fromAscii(name);
+ name = web3.fromAscii(name);
- eth.transact({to: "NameReg", gas: "10000", gasPrice: eth.gasPrice, data: [eth.fromAscii("register"), name]}).then(function(tx) {
+ var eth = web3.eth;
+ eth.transact({to: "NameReg", gas: "10000", gasPrice: eth.gasPrice, data: [web3.fromAscii("register"), name]}).then(function(tx) {
document.querySelector("#result").innerHTML = "Registered name. Please wait for the next block to come through.";
}, function(err) {
console.log(err);
diff --git a/qt.js b/qt.js
index 214a0ee23..39c0a89a9 100644
--- a/qt.js
+++ b/qt.js
@@ -3,6 +3,7 @@
QtProvider.prototype.send = function(payload) {
navigator.qt.postData(JSON.stringify(payload));
};
+
Object.defineProperty(QtProvider.prototype, "onmessage", {
set: function(handler) {
navigator.qt.onmessage = handler;
@@ -10,6 +11,7 @@
});
if(typeof(web3) !== "undefined" && web3.providers !== undefined) {
- web3.QtProvider = QtProvider;
+ web3.providers.QtProvider = QtProvider;
}
})();
+
diff --git a/websocket.js b/websocket.js
index e06d127e8..297690b33 100644
--- a/websocket.js
+++ b/websocket.js
@@ -46,6 +46,6 @@
});
if(typeof(web3) !== "undefined" && web3.providers !== undefined) {
- web3.WebSocketProvider = WebSocketProvider;
+ web3.providers.WebSocketProvider = WebSocketProvider;
}
})();