diff --git a/ethereal/assets/ethereum.js b/ethereal/assets/ethereum.js new file mode 100644 index 0000000000..b8908913d1 --- /dev/null +++ b/ethereal/assets/ethereum.js @@ -0,0 +1,48 @@ +// 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; + } + + navigator.qt.postMessage(JSON.stringify(data)); +} + +// Main Ethereum library +window.eth = { + prototype: Object(), + + send: function(cb) { + document.getElementById("out").innerHTML = "clicked"; + postData({message: "Hello world"}, cb); + } +} +window.eth._callbacks = {} + +function debug(/**/) { + var args = arguments; + var msg = "" + for(var i=0; i + +Epic Works (TM) + +

It just works!

+ +

Play with me...

+ + +
+
+
+ + + + + +