Added a 'set' method to change window settings for external applications

pull/84/head
obscuren 11 years ago
parent 76cd14ab7b
commit 9e481804a7
  1. 4
      ethereal/assets/ethereum.js
  2. 6
      ethereal/assets/qml/webapp.qml
  3. 2
      ethereal/assets/samplecoin/samplecoin.html

@ -71,6 +71,10 @@ window.eth = {
postData({call: "disconnect", args: [address, storageAddrOrCb]}); postData({call: "disconnect", args: [address, storageAddrOrCb]});
}, },
set: function(props) {
postData({call: "set", args: props});
},
on: function(event, cb) { on: function(event, cb) {
if(eth._onCallbacks[event] === undefined) { if(eth._onCallbacks[event] === undefined) {
eth._onCallbacks[event] = []; eth._onCallbacks[event] = [];

@ -91,6 +91,12 @@ ApplicationWindow {
require(1) require(1)
postData(data._seed, null) postData(data._seed, null)
break; break;
case "set":
for(var key in data.args) {
if(webview.hasOwnProperty(key)) {
window[key] = data.args[key];
}
}
} }
} catch(e) { } catch(e) {
console.log(data.call + ": " + e) console.log(data.call + ": " + e)

@ -21,6 +21,8 @@ function createTransaction() {
} }
function init() { function init() {
eth.set({width: 500, title: "Hello world"})
eth.getKey(function(key) { eth.getKey(function(key) {
eth.getStorageAt(jefcoinAddr, key, function(storage) { eth.getStorageAt(jefcoinAddr, key, function(storage) {
document.querySelector("#current-amount").innerHTML = storage; document.querySelector("#current-amount").innerHTML = storage;

Loading…
Cancel
Save