diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-22 20:54:27 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-22 20:54:27 +0800 |
commit | b4bd70c402e75f933e694e9f9df14912df468e69 (patch) | |
tree | 99bb9d0219a9ed9f4a617e01db4eb5c84a0a34b3 /mist/assets/ext/pre.js | |
parent | 8585e59718e6b75a38833801f1725730c1b9fb01 (diff) | |
download | dexon-b4bd70c402e75f933e694e9f9df14912df468e69.tar dexon-b4bd70c402e75f933e694e9f9df14912df468e69.tar.gz dexon-b4bd70c402e75f933e694e9f9df14912df468e69.tar.bz2 dexon-b4bd70c402e75f933e694e9f9df14912df468e69.tar.lz dexon-b4bd70c402e75f933e694e9f9df14912df468e69.tar.xz dexon-b4bd70c402e75f933e694e9f9df14912df468e69.tar.zst dexon-b4bd70c402e75f933e694e9f9df14912df468e69.zip |
Re-wrote ethereum.js
Diffstat (limited to 'mist/assets/ext/pre.js')
-rw-r--r-- | mist/assets/ext/pre.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/mist/assets/ext/pre.js b/mist/assets/ext/pre.js index 528149f6b..f298fe9a1 100644 --- a/mist/assets/ext/pre.js +++ b/mist/assets/ext/pre.js @@ -1,41 +1,3 @@ -// Helper function for generating pseudo callbacks and sending data to the QML part of the application -function postData(data, cb) { - data._seed = Math.floor(Math.random() * 1000000) - if(cb) { - eth._callbacks[data._seed] = cb; - } - - if(data.args === undefined) { - data.args = []; - } - - navigator.qt.postMessage(JSON.stringify(data)); -} - -navigator.qt.onmessage = function(ev) { - var data = JSON.parse(ev.data) - - if(data._event !== undefined) { - eth.trigger(data._event, data.data); - } else { - if(data._seed) { - var cb = eth._callbacks[data._seed]; - if(cb) { - // Figure out whether the returned data was an array - // array means multiple return arguments (multiple params) - if(data.data instanceof Array) { - cb.apply(this, data.data) - } else { - cb.call(this, data.data) - } - - // Remove the "trigger" callback - delete eth._callbacks[ev._seed]; - } - } - } -} - if(typeof(Promise) === "undefined") { window.Promise = Q.Promise; } |