diff --git a/README.md b/README.md index 0a764d5fd05..afd8cbc7c7e 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ loaded via http. If you clone/download the repository, use the Many dependencies are only provided via npm: - npm install # fetch dependencies + npm install # fetch dependencies npm run build # build application into build/app.js -Now point your browser to `index.html` to open the application. +Now point your browser to `index.html` to open the application. ## Usage as a Chrome Extension diff --git a/assets/css/styles.css b/assets/css/styles.css index 6fca6f0d0ee..b86ebc00a1a 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -71,7 +71,7 @@ code, pre { pre { padding:8px 15px; - background: #f8f8f8; + background: #f8f8f8; border-radius:5px; border:1px solid #e5e5e5; overflow-x: auto; @@ -110,9 +110,9 @@ header { header ul { list-style:none; height:40px; - + padding:0; - + background: #eee; background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd)); @@ -120,7 +120,7 @@ header ul { background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%); - + border-radius:5px; border:1px solid #d2d2d2; box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0; @@ -214,33 +214,33 @@ footer { } @media print, screen and (max-width: 960px) { - + div.wrapper { width:auto; margin:0; } - + header, section, footer { float:none; position:static; width:auto; } - + header { padding-right:320px; } - + section { border:1px solid #e5e5e5; border-width:1px 0; padding:20px 0; margin:0 0 20px; } - + header a small { display:inline; } - + header ul { position:absolute; right:50px; @@ -252,15 +252,15 @@ footer { body { word-wrap:break-word; } - + header { padding:0; } - + header ul, header p.view { position:static; } - + pre, code { word-wrap:normal; } @@ -270,7 +270,7 @@ footer { body { padding:15px; } - + header ul { display:none; } diff --git a/background.js b/background.js index 488d0da4d7a..72004071983 100644 --- a/background.js +++ b/background.js @@ -4,7 +4,7 @@ chrome.browserAction.onClicked.addListener(function(tab) { chrome.tabs.create({'url': chrome.extension.getURL('index.html')}, function(tab) { - // tab opened + // tab opened }); }); diff --git a/index.html b/index.html index d0f6ed7407d..fb6f651db7c 100644 --- a/index.html +++ b/index.html @@ -41,7 +41,7 @@ - +
@@ -107,20 +107,20 @@
- +
- + diff --git a/src/app.js b/src/app.js index 8bef3fe37b6..14da7f2f354 100644 --- a/src/app.js +++ b/src/app.js @@ -181,7 +181,7 @@ var run = function() { var untitledCount = ''; if (!getFiles().length || window.localStorage['sol-cache']) { if(loadingFromGist) return; - // Backwards-compatibility + // Backwards-compatibility while (window.localStorage[SOL_CACHE_UNTITLED + untitledCount]) untitledCount = (untitledCount - 0) + 1; SOL_CACHE_FILE = SOL_CACHE_UNTITLED + untitledCount; @@ -262,7 +262,7 @@ var run = function() { // ------------------ gist publish -------------- - + var packageFiles = function() { var files = {}; var filesArr = getFiles(); @@ -272,7 +272,7 @@ var run = function() { content: localStorage[filesArr[f]] }; } - return files; + return files; }; $('#gist').click(function(){ @@ -281,7 +281,7 @@ var run = function() { var files = packageFiles(); var description = "Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. \n Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=" + getQueryParams().version + "&optimize="+ getQueryParams().optimize +"&gist="; - $.ajax({ + $.ajax({ url: 'https://api.github.com/gists', type: 'POST', data: JSON.stringify({ @@ -397,7 +397,7 @@ var run = function() { for (var f in files) { $filesEl.append(fileTabTemplate(files[f])); } - + if (SOL_CACHE_FILE) { var active = fileTabFromKey(SOL_CACHE_FILE); active.addClass('active'); @@ -511,9 +511,9 @@ var run = function() { updateQueryParams({version: $('#versionSelector').val() }); loadVersion($('#versionSelector').val()); }); - + // ----------------- resizeable ui --------------- - + var EDITOR_SIZE_CACHE_KEY = "editor-size-cache"; var dragging = false; $('#dragbar').mousedown(function(e){ @@ -566,13 +566,13 @@ var run = function() { var hidingRHP = false; $('.toggleRHP').click(function(){ - hidingRHP = !hidingRHP; - setEditorSize( hidingRHP ? 0 : window.localStorage[EDITOR_SIZE_CACHE_KEY] ); - $('.toggleRHP i').toggleClass('fa-angle-double-right', !hidingRHP); - $('.toggleRHP i').toggleClass('fa-angle-double-left', hidingRHP); - if (!hidingRHP) compile(); + hidingRHP = !hidingRHP; + setEditorSize( hidingRHP ? 0 : window.localStorage[EDITOR_SIZE_CACHE_KEY] ); + $('.toggleRHP i').toggleClass('fa-angle-double-right', !hidingRHP); + $('.toggleRHP i').toggleClass('fa-angle-double-left', hidingRHP); + if (!hidingRHP) compile(); }); - + // ----------------- editor resize --------------- @@ -595,7 +595,7 @@ var run = function() { document.querySelector('#editor').addEventListener('change', onResize); document.querySelector('#editorWrap').addEventListener('change', onResize); - + // ----------------- compiler ---------------------- var compileJSON; @@ -637,13 +637,13 @@ var run = function() { if (errortype(err) !== 'warning') noFatalErrors = false; }); } - + if (missingInputs !== undefined && missingInputs.length > 0) compile(missingInputs); else if (noFatalErrors && !hidingRHP) renderContracts(data, editor.getValue()); }; - + var compileTimeout = null; var onChange = function() { var input = editor.getValue(); @@ -860,18 +860,18 @@ var run = function() { code += "var " + contractName + "Contract = web3.eth.contract(" + interface.replace("\n","") + ");" +"\nvar " + contractName + " = " + contractName + "Contract.new("; - + $.each(funABI.inputs, function(i, inp) { code += "\n " + inp.name + ","; }); - + code += "\n {"+ "\n from: web3.eth.accounts[0], "+ "\n data: '"+bytecode+"', "+ "\n gas: 3000000"+ "\n }, function(e, contract){"+ "\n console.log(e, contract);"+ - "\n if (typeof contract.address != 'undefined') {"+ + "\n if (typeof contract.address != 'undefined') {"+ "\n console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);" + "\n }" + "\n })"; @@ -1010,7 +1010,7 @@ var run = function() { return text; }; - + $('.asmOutput button').click(function() {$(this).parent().find('pre').toggle(); }); var getConstructorInterface = function(abi) { diff --git a/src/mode-solidity.js b/src/mode-solidity.js index ec0a38ebd13..d12d30cee01 100644 --- a/src/mode-solidity.js +++ b/src/mode-solidity.js @@ -11,7 +11,7 @@ var DocCommentHighlightRules = function() { "start" : [ { token : "comment.doc.tag", regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, + }, DocCommentHighlightRules.getTagRule(), { defaultToken : "comment.doc", @@ -341,8 +341,8 @@ var JavaScriptHighlightRules = function(options) { } ] }; - - + + if (!options || !options.noES6) { this.$rules.no_regex.unshift({ regex: "[{}]", onMatch: function(val, state, stack) { @@ -379,10 +379,10 @@ var JavaScriptHighlightRules = function(options) { }] }); } - + this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("no_regex") ]); - + this.normalizeRules(); }; @@ -717,7 +717,7 @@ var CstyleBehaviour = function() { }; - + CstyleBehaviour.isSaneInsertion = function(editor, session) { var cursor = editor.getCursorPosition(); var iterator = new TokenIterator(session, cursor.row, cursor.column); @@ -821,16 +821,16 @@ oop.inherits(FoldMode, BaseFoldMode); if (match[1]) return this.openingBracketBlock(session, match[1], row, i); - + var range = session.getCommentFoldRange(row, i + match[0].length, 1); - + if (range && !range.isMultiLine()) { if (forceMultiline) { range = this.getSectionRange(session, row); } else if (foldStyle != "all") range = null; } - + return range; } @@ -847,7 +847,7 @@ oop.inherits(FoldMode, BaseFoldMode); return session.getCommentFoldRange(row, i, -1); } }; - + this.getSectionRange = function(session, row) { var line = session.getLine(row); var startIndent = line.search(/\S/); @@ -864,7 +864,7 @@ oop.inherits(FoldMode, BaseFoldMode); if (startIndent > indent) break; var subRange = this.getFoldWidgetRange(session, "all", row); - + if (subRange) { if (subRange.start.row <= startRow) { break; @@ -876,7 +876,7 @@ oop.inherits(FoldMode, BaseFoldMode); } endRow = row; } - + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); }; @@ -898,7 +898,7 @@ var CStyleFoldMode = acequire("./folding/cstyle").FoldMode; var Mode = function() { this.HighlightRules = JavaScriptHighlightRules; - + this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); diff --git a/src/universal-dapp.js b/src/universal-dapp.js index dc96b3c26bd..de5f68406e0 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -150,7 +150,7 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar var $createInterface = $('
'); var appendFunctions = function (address, $el){ - + var $instance = $('
'); if (self.options.removable_instances) { var $close = $('
') @@ -185,8 +185,8 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar $.each(abi, function(i, funABI) { if (funABI.type !== 'event') return; - var hash = ethJSABI.eventID(funABI.name, funABI.inputs.map(function(item) { return item.type })) - eventABI[hash.toString('hex')] = { event: funABI.name, inputs: funABI.inputs }; + var hash = ethJSABI.eventID(funABI.name, funABI.inputs.map(function(item) { return item.type })) + eventABI[hash.toString('hex')] = { event: funABI.name, inputs: funABI.inputs }; }); self.vm.on('afterTx', function(response){ @@ -254,7 +254,7 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar } else { appendFunctions( address, $target ); } - + return $createInterface; } @@ -330,7 +330,7 @@ UniversalDApp.prototype.getCallButton = function(args) { var handleCallButtonClick = function(ev, $result) { if (!$result) { - $result = getOutput(); + $result = getOutput(); if (lookupOnly && !inputs.length) $outputOverride.empty().append( $result ); else @@ -423,7 +423,7 @@ UniversalDApp.prototype.getCallButton = function(args) { } else if (args.abi.constant && !isConstructor) { replaceOutput($result, getReturnOutput(result)); } else { - + function tryTillResponse (txhash, done) { web3.eth.getTransactionReceipt(result, testResult ); @@ -444,7 +444,7 @@ UniversalDApp.prototype.getCallButton = function(args) { $result.append(getReturnOutput(result)).append(getGasUsedOutput(result)); } }) - + } }); } @@ -517,7 +517,7 @@ UniversalDApp.prototype.clickNewContract = function ( self, $contract, contract } UniversalDApp.prototype.clickContractAt = function ( self, $output, contract ) { - var address = prompt( "What Address is this contract at in the Blockchain? ie: '0xdeadbeaf...'" ) + var address = prompt( "What Address is this contract at in the Blockchain? ie: '0xdeadbeaf...'" ) self.getInstanceInterface(contract, address, $output ); } @@ -539,7 +539,7 @@ UniversalDApp.prototype.runTx = function( data, args, cb) { return cb(e); } } - + if (!this.vm) { var tx = { from: self.options.getAddress ? self.options.getAddress() : web3.eth.accounts[0], @@ -585,4 +585,4 @@ UniversalDApp.prototype.runTx = function( data, args, cb) { } } -module.exports = UniversalDApp; \ No newline at end of file +module.exports = UniversalDApp;