diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-28 23:53:31 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-28 23:53:31 +0800 |
commit | 0b10cbd713faf56240f3da6940c58c17159849a9 (patch) | |
tree | 8f2932a0a458f423406bf86a62d827b5719c666d | |
parent | 3119be908c0d637bdc579f0a025da79efeae0cbe (diff) | |
download | dexon-0b10cbd713faf56240f3da6940c58c17159849a9.tar dexon-0b10cbd713faf56240f3da6940c58c17159849a9.tar.gz dexon-0b10cbd713faf56240f3da6940c58c17159849a9.tar.bz2 dexon-0b10cbd713faf56240f3da6940c58c17159849a9.tar.lz dexon-0b10cbd713faf56240f3da6940c58c17159849a9.tar.xz dexon-0b10cbd713faf56240f3da6940c58c17159849a9.tar.zst dexon-0b10cbd713faf56240f3da6940c58c17159849a9.zip |
http renamed to httprpc
-rw-r--r-- | httprpc.js (renamed from http.js) | 13 | ||||
-rw-r--r-- | index.html | 2 |
2 files changed, 8 insertions, 7 deletions
@@ -1,5 +1,5 @@ (function () { - var HttpProvider = function (host) { + var HttpRpcProvider = function (host) { this.handlers = []; this.host = host; }; @@ -22,7 +22,7 @@ }; }; - HttpProvider.prototype.sendRequest = function (payload, cb) { + HttpRpcProvider.prototype.sendRequest = function (payload, cb) { var data = formatJsonRpcObject(payload); var request = new XMLHttpRequest(); @@ -35,7 +35,7 @@ } }; - HttpProvider.prototype.send = function (payload) { + HttpRpcProvider.prototype.send = function (payload) { var self = this; this.sendRequest(payload, function (request) { self.handlers.forEach(function (handler) { @@ -44,7 +44,7 @@ }); }; - HttpProvider.prototype.poll = function (payload, id) { + HttpRpcProvider.prototype.poll = function (payload, id) { var self = this; this.sendRequest(payload, function (request) { var parsed = JSON.parse(request.responseText); @@ -57,13 +57,14 @@ }); }; - Object.defineProperty(HttpProvider.prototype, "onmessage", { + Object.defineProperty(HttpRpcProvider.prototype, "onmessage", { set: function (handler) { this.handlers.push(handler); } }); if (typeof(web3) !== "undefined" && web3.providers !== undefined) { - web3.providers.HttpProvider = HttpProvider; + web3.providers.HttpRpcProvider = HttpRpcProvider; } })(); + diff --git a/index.html b/index.html index 70f788d0d..2b3f50a14 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ <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" src="http.js"></script> +<script type="text/javascript" src="httprpc.js"></script> <script type="text/javascript"> function registerName() { var name = document.querySelector("#name").value; |