From c6062c5355e3daec6cc9730c675d2f424c4ebf4e Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 8 Oct 2015 13:20:31 +0200 Subject: [PATCH] Automatically deploy and link required libraries. --- index.html | 5 +-- libs/universal-dapp.js | 78 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 5ba6e7f740..2b5064a3e1 100644 --- a/index.html +++ b/index.html @@ -533,10 +533,7 @@ THE SOFTWARE. $('#txorigin').text(accounts[0]); }); - $contractOutput.find('.title').click(function(ev){ - console.log($(this)); - $(this).closest('.contract').toggleClass('hide'); - }); + $contractOutput.find('.title').click(function(ev){ $(this).closest('.contract').toggleClass('hide'); }); $('#output').append( $contractOutput ); $('.col2 input,textarea').click(function() { this.select(); }); }; diff --git a/libs/universal-dapp.js b/libs/universal-dapp.js index 0f03553a72..68a3dda8b9 100644 --- a/libs/universal-dapp.js +++ b/libs/universal-dapp.js @@ -60,10 +60,17 @@ UniversalDApp.prototype.render = function () { return this.$el; } +UniversalDApp.prototype.getContractByName = function(contractName) { + for (var c in this.contracts) + if (this.contracts[c].name == contractName) + return this.contracts[c]; + return null; +}; + UniversalDApp.prototype.getABIInputForm = function (cb){ var self = this; var $el = $('
'); - var $jsonInput = $('