diff --git a/assets/css/browser-solidity.css b/assets/css/browser-solidity.css index 6be828a0c4..bbc23adf12 100644 --- a/assets/css/browser-solidity.css +++ b/assets/css/browser-solidity.css @@ -305,16 +305,12 @@ body { content: "\25B6"; } -#output .poweredBy, -#output .legend { display: none; } - #output .udapp { border: 0 none; box-shadow: none; border-bottom: 3px solid #F4F6FF; } - .crow { overflow: auto; display: block; diff --git a/assets/css/universal-dapp.css b/assets/css/universal-dapp.css index d42aa985c3..19f263da29 100644 --- a/assets/css/universal-dapp.css +++ b/assets/css/universal-dapp.css @@ -1,9 +1,8 @@ - .udapp { padding: 1em; border: 1px dotted #4D5686; position: relative; - box-shadow: 0 0 5px rgba(0,0,0,0.3); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); box-sizing: border-box; overflow: auto; } @@ -25,7 +24,7 @@ width: 100%; padding: 0.6em; box-sizing: border-box; - border: 1px solid rgba( 0,0,0,0.3 ); + border: 1px solid rgba(0, 0, 0, 0.3); border-radius: 3px; } @@ -55,7 +54,7 @@ .udapp .title { margin-bottom: 0.4em; padding: 0.2em; - background-color: rgba( 255,255,255,0.5 ); + background-color: rgba(255, 255, 255, 0.5); display: block; font-weight: bold; padding-right: 2em; @@ -90,7 +89,10 @@ white-space: pre; } -.udapp .result { position: relative; } +.udapp .result { + position: relative; +} + .udapp .output .result .returned, .udapp .output .result .value, .udapp .output .result .waiting, @@ -100,14 +102,16 @@ } .udapp .output .result .debugTx { - position: absolute; - top: 0.4em; - right: 1.4em; - height: 1.5em; - width: 2.5em; + position: absolute; + top: 0.4em; + right: 1.4em; + height: 1.5em; + width: 2.5em; } -.udapp .output .result:last-child { margin: 0; } +.udapp .output .result:last-child { + margin: 0; +} .udapp .output:empty { display: none; @@ -162,13 +166,11 @@ content: "\25B6"; } - .udapp .contractProperty { overflow: auto; margin-bottom: 0.4em; } - .udapp input, .udapp button { width: 33%; @@ -184,7 +186,10 @@ border-radius: 3px; } -.udapp input { border-left: 0 none;} +.udapp input { + border-left: 0 none; +} + .udapp button { background-color: #666; color: #4C4B4B; @@ -269,9 +274,9 @@ white-space: pre; } -.udapp .events .event .name { margin-right: 0.5em; } - - +.udapp .events .event .name { + margin-right: 0.5em; +} .udapp .legend { font-size: 12px; @@ -282,7 +287,9 @@ .udapp .legend div { display: inline-block; margin-right: 0.5em; + margin-bottom: 1em; } + .udapp .legend div:before { content: "."; color: transparent; @@ -293,12 +300,14 @@ width: 1em; } -.udapp .legend .attach:before { background-color: #62B762; } -.udapp .legend .transact:before { background-color: #D42828; } -.udapp .legend .call:before { background-color: #556DF3; } +.udapp .legend .attach:before { + background-color: #62B762; +} -.udapp .poweredBy { - float: right; - color: #666; - font-size: 12px; +.udapp .legend .transact:before { + background-color: #D42828; +} + +.udapp .legend .call:before { + background-color: #556DF3; } diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 2b58c4fe41..3b9805552f 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -135,6 +135,19 @@ UniversalDApp.prototype.getBalance = function (address, cb) { UniversalDApp.prototype.render = function () { var self = this; + // NOTE: don't display anything if there are no contracts to display + if (self.contracts.length === 0) { + return self.$el; + } + + var $legend = $('
') + .append($('').text('Attach')) + .append($('').text('Transact')) + .append($('').text('Call')); + + self.$el.append($legend); + + // NOTE: this might be used in the future if (self.contracts.length === 0) { self.$el.append(self.getABIInputForm()); } else { @@ -153,15 +166,7 @@ UniversalDApp.prototype.render = function () { self.$el.append(self.renderOutputModifier(self.contracts[c].name, $contractEl)); } } - var $legend = $('') - .append($('').text('Attach')) - .append($('').text('Transact')) - .append($('').text('Call')); - self.$el.append($('') - .html('Universal ÐApp powered by The Blockchain')); - - self.$el.append($legend); return self.$el; }; @@ -179,7 +184,7 @@ UniversalDApp.prototype.getABIInputForm = function (cb) { var self = this; var $el = $(''); var $jsonInput = $(''); - var $createButton = $('').text('Create a Universal ÐApp'); + var $createButton = $('').text('Render ABI'); $createButton.click(function (ev) { var contracts = $.parseJSON($jsonInput.val()); if (cb) {