From 9102c79206aa41d92e5054f29e88defdb1e85fc8 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 12 Jan 2017 12:42:07 +0100 Subject: [PATCH 1/7] Copy static dapps from static (no build) --- js/webpack/app.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/webpack/app.js b/js/webpack/app.js index 2d2d15c7027..2fe5fc4732f 100644 --- a/js/webpack/app.js +++ b/js/webpack/app.js @@ -151,6 +151,8 @@ module.exports = { const plugins = Shared.getPlugins().concat( new CopyWebpackPlugin([{ from: './error_pages.css', to: 'styles.css' }], {}), + new CopyWebpackPlugin([{ from: './dapps/static/*' }], {}), + new WebpackErrorNotificationPlugin(), new webpack.DllReferencePlugin({ From 4ae2b75aa80d2ee223340d9ea52df27c78ebf43f Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 12 Jan 2017 12:53:35 +0100 Subject: [PATCH 2/7] Console sources --- js/src/dapps/static/console.css | 221 +++++++++ js/src/dapps/static/console.html | 20 + js/src/dapps/static/console.jpeg | Bin 0 -> 1476 bytes js/src/dapps/static/console.js | 580 ++++++++++++++++++++++ js/src/dapps/static/console.manifest.json | 8 + 5 files changed, 829 insertions(+) create mode 100755 js/src/dapps/static/console.css create mode 100755 js/src/dapps/static/console.html create mode 100755 js/src/dapps/static/console.jpeg create mode 100755 js/src/dapps/static/console.js create mode 100755 js/src/dapps/static/console.manifest.json diff --git a/js/src/dapps/static/console.css b/js/src/dapps/static/console.css new file mode 100755 index 00000000000..6b138a938cc --- /dev/null +++ b/js/src/dapps/static/console.css @@ -0,0 +1,221 @@ +#full-screen { +} + +textarea:focus, input:focus{ + outline: none; +} + +* { padding: 0; margin: 0; } + +html, body, #full-screen { + height: 100%; +} + +body { + margin: 0; +} + +#full-screen { + display: flex; + flex-direction: column; + justify-content: flex-end; + + overflow: hidden; +} + +#history-wrap { + overflow: auto; +} + +#history { + flex: 1 1 auto; + + display: flex; + min-height: min-content; + flex-direction: column; + justify-content: flex-end; +} + +.entry, #input { + margin: 0; + padding: 0.25em; + + display: flex; + flex-direction: row; + align-items: flex-start; + width: 100%; +} + +.type { + color: #ccc; + font-weight: bold; + font-family: "Lucida Console", Monaco, monospace; + font-size: 11pt; + padding: 0 0.5em 0 0.25em; +} + +.command .type { + color: #aaa; +} + +.result .type { + color: #ccc; +} + +#input .type { + color: #59f; +} + +.addwatch { + background-color: #cfc; + border-top: 1px solid #6e6; +} +.addwatch .type { + color: #040; +} +.addwatch .text { + color: #080; +} + +.log.logLevel .type { + color: blue; +} +.log.debugLevel .text { + color: blue; +} +.log.infoLevel .type { + color: #00c; +} +.log.warnLevel { + background-color: #fff8dd; + border-top: 1px solid #fe8; + border-bottom: 1px solid #fe8; +} +.log.warnLevel .text { + color: #440; +} +.log.warnLevel .type { + color: #880; +} +.log.errorLevel, .error { + background-color: #fee; + border-top: 1px solid #fbb; + border-bottom: 1px solid #fbb; +} +.log.errorLevel .text, .error .text { + color: #c00; +} +.log.errorLevel .type, .error .type { + color: #800; +} + + +span.text { + color: black; +} +.text { + border: 0; + margin: 0; + padding: 0; + + color: black; + font-weight: 1000; + font-family: "Lucida Console", Monaco, monospace; + font-size: 11pt; + + flex-grow: 1; +} +div.error { + background-color: #fee; + border-top: 1px solid #fbb; + color: red; +} +div.command { + border-top: 1px solid #eee; +} +div#input { + border-top: 1px solid #eee; +} + +#status { + background: #eee; + padding: 0.25em; + font-family: "Lucida Console", Monaco, monospace; + font-size: 8pt; + color: #888; + flex: 0 0 auto; +} + +#input { + flex: 0 0 auto; +} + +#status { + display: flex; +} +.watch { + padding-left: 1em; + padding-right: 1em; +} +.watch:not(:first-child) { + border-left: 1px solid #ccc; +} +.expr { + color: #888; + margin-right: 0.5em; +} +.res { + font-weight: bold; + color: black; +} + +.stringType { + color: #c00; +} +.numberType { + color: #00f; +} +.eObject { + color: #00f; +} +.objectType { + font-style: italic; +} +.fieldType { + color: #808; +} +.undefinedType { + color: #888; +} +.functionType { + color: #666; + font-style: italic; +} + +#autocomplete-anchor { + position: relative; +} +#autocomplete { + position: absolute; + left: 1.5em; + bottom: 0; + background: #f8f8f8; + box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.5); + max-height: 20em; + overflow: scroll; +} +#autocomplete div { + font-size: small; + font-family: "Lucida Console", Monaco, monospace; + padding: 0.1em 1em 0.1em 0; + border-top: 1px solid #eee; +} +.ac-already { + font-weight: bold; +} +.ac-new { + color: #666; +} +.ac-selected { + background-color: #ccddff; +} \ No newline at end of file diff --git a/js/src/dapps/static/console.html b/js/src/dapps/static/console.html new file mode 100755 index 00000000000..3c60d5217dd --- /dev/null +++ b/js/src/dapps/static/console.html @@ -0,0 +1,20 @@ + + + + + JS Console dapp + + + + + +
+
+
+
+
>
+
+
+ + + diff --git a/js/src/dapps/static/console.jpeg b/js/src/dapps/static/console.jpeg new file mode 100755 index 0000000000000000000000000000000000000000..e0e1fad3ea4882912b3cc760be0bc76dd39f7bff GIT binary patch literal 1476 zcmX|BeLT~79RJO(-;}vxa+#s1DKD`Hna~+?|Rcj`5A`ADrdAPgjO2g{4 z9yVTjSZ6fZ4rO+fl*usCZEih~9`G8nq9eraH(vGqzFyxy-k*o}=kxtMnDnN8V8yPm zonZh1fdI@GFg*i8080==flDk=DAdxWmdns~)@Um$w1X{Xxt$Z%#n}mq!>wNH<-Xe0 z(+!7PPubu}Ao}?DxVUc)^dkj$k$p&}dw`WCAP3|KgbiS725@HoFar`MSUd>80tF(! zT4D)Hzg+=XAdm-JzTPCuAJ=_3P?<-b?0|YpYc3LD%mH|}nttBQw5ulgcuU35hc<=K1E2#1=uO9dob=2i&CF;T9nBD$J~hlC_% zEJ3s=S*zXA%=1z4>>(P7(Zt20+d&MTxg~c;6;oIhuYb_2){-~U=``77=&-W(ZTHtK zK~E9|Khvo()Yc3akw)3BsrZh_H`Jcl1S6;WHI2w<5`fSu0y7rkk~BoRis%1u9oFkq zfw-mYp@P?@t3tP1Py_u zl7>-drdP#^X+u=b$xKe)WJ+ZS(tB5D{mBykf&Aj=3dQ~t51olE%WtX$AX;etToU|m zo-{H!JSv^nBcrnBlxND7+d8OFiy@C&H-1=wz1tm?5ur>fmMOdnxTn{*_-@mQ}2(eYc7OK2TwOL znMW(r9t;Q7;2{SyIT#0%$5zMJ>+eRSPX3-W#0vNnPWmNbSefmA=Um^EQ#}%e`ToA* z6qg^G&q=wV*tWhfAU?k^yELz~zgN@Qs^Ax}oHD$2ou28k9#6?q47gAdJ(OjJ8us!q zR#`XOZ908V@6?@#1rpaHy0F*cbJ`-fruNVX2caHx>VT4xsj{Afxu=y!oX?0WPP~_8 z8pg&7Ytw#A4R%cMt$>~!@MUjuY-1f~X`Cotx+hRh#~An5q#)gJ@sW~mCWhbnr4Q&I zh;x?U;%jB(`SUJ7#uOpH>!MvY(H`L{B-s4`>W+{YcHSY961%xb^Ekcw^c>Kz!~Gj{+jS zyGcRT2SZ-Uipr%4vZ5POifXqc_|fN1fN06YV>;#~fZFOM*Sn%FsgrK8~*wQ~Tq|H^p${H@DzaAP@Kgp0Z`rXp!7+tW{_Y2;&O z#JaZfAx=z_d_8Nvu5(`1Ro8H>V&=8~EG6jG_#g6-eB;E}g(U>2$RKk2X&bOxO props[n] = true); + } while (obj = Object.getPrototypeOf(obj)); + return Object.keys(props); +} + +function htmlToElement(html) { + var template = document.createElement('template'); + template.innerHTML = html; + return template.content.firstChild; +} + +function evaluate(x) { + try { + return eval(x); + } + catch (err) { + return eval('(()=>{var x = ' + x + "; return x;})()") + } +} + +function displayReady(x) { + if (x === undefined) + return 'undefined'; + if (x === null) + return 'null'; + if (typeof(x) == "string") + return `"${escapeHtml(x)}"`; + if (Object.prototype.toString.call(x) === '[object Array]') + return `[${x.map(displayReady).join(', ')}]`; + if (typeof(x) == "function") + return `function () { /* ... */ }`; + if (typeof(x) == "object") { + if (x.toString().indexOf('[object ') != 0) + return `${escapeHtml(x.toString())}`; + return `${x.constructor.name} {${Object.keys(x).map(f => `${escapeHtml(f)}: ${displayReady(x[f])}`).join(', ')}}`; + } + return `${escapeHtml(JSON.stringify(x))}`; +} + +if (!localStorage.history) + localStorage.history = "[]"; +window.historyData = JSON.parse(localStorage.history); +window.historyIndex = window.historyData.length; +if (!localStorage.watches) + localStorage.watches = "[]"; +window.watches = {}; + +function watch(name, f) { + let status = document.getElementById("status"); + let cleanName = name.replace(/[^a-zA-Z0-9]/, ''); + status.innerHTML += `
${escapeHtml(name)}
`; + window.watches[name] = f; +} + +var savedWatches = JSON.parse(localStorage.watches); +savedWatches.forEach(w => watch(w[1], () => evaluate(w[0]))); + +if (typeof(window.web3) == 'object' && window.watches.latest == undefined) + watch('latest', () => window.web3.eth.blockNumber); + + +function refreshWatches() { + for (n in window.watches) { + let r = window.watches[n](); + let cn = n.replace(/[^a-zA-Z0-9]/, ''); + let e = document.getElementById(`res_${cn}`); + if (typeof(r) == 'object' && r.constructor.name == "Promise") + r.then(r => e.innerHTML = displayReady(r)); + else + e.innerHTML = displayReady(r); + } +} + +function removeWatch(name) { + let e = document.getElementById(`watch_${name}`); + e.parentNode.removeChild(e); + delete window.watches[name]; +} + +function newLog(level, text) { + let icon = { + debug: " ", + log: " ", + warn: "⚠", + error: "✖", + info: "ℹ" + }; + pushLine('
' + icon[level] + '' + escapeHtml(text) + '
'); +} + +function exec() { + let command = document.getElementById("command"); + let c = command.value; + + if (c != '') { + command.value = ""; + window.historyData.push(c); + while (window.historyData.length > 1000) + window.historyData.shift; + localStorage.history = JSON.stringify(window.historyData); + window.historyIndex = window.historyData.length; + + var html = ''; + if (c.indexOf("//") == 0) { + let n = c.substr(2); + savedWatches = savedWatches.filter(x => x[1] != n); + localStorage.watches = JSON.stringify(savedWatches); + removeWatch(n); + } + else if (c.indexOf("//") != -1) { + x = c.split("//"); + let e = x[0]; + savedWatches.push(x); + localStorage.watches = JSON.stringify(savedWatches); + watch(x[1], () => evaluate(e)); + pushLine('
>' + escapeHtml(c) + '
'); + pushLine('
Watch added
'); + } + else { + pushLine('
>' + escapeHtml(c) + '
'); + let res; + try { + res = evaluate(c); + if (typeof(res) == 'object' && res !== null && res.constructor.name == "Promise") { + let id = window.historyData.length; + pushLine('
<...
'); + res.then(r => document.getElementById('pending' + id).innerHTML = displayReady(r)); + } else { + pushLine('
<' + displayReady(res) + '
'); + } + } + catch (err) { + pushLine('
Unhandled exception: ' + escapeHtml(err.message) + '
'); + } + } + } + refreshWatches(); +} + +function pushLine(l) { + document.getElementById("history").innerHTML += l + var h = document.getElementById("history-wrap"); + h.scrollTop = h.scrollHeight; +} + +var autocompletes = []; +var currentAuto = null; +var currentPots = []; +var currentStem = null; + +function updateAutocomplete() { + let v = document.getElementById("command").value; + if (v.length == 0) { + cancelAutocomplete(); + return; + } + let t = v.split('.'); + let last = t.pop(); + let tj = t.join('.'); + let ex = t.length > 0 ? tj : 'window'; + if (currentStem != tj) { + autocompletes = eval('getAllPropertyNames('+ex+')'); + currentStem = tj; + } + let dl = document.getElementById("autocomplete"); + currentPots = autocompletes.filter(n => n.startsWith(last)); + if (currentPots.length > 0) { + if (currentPots.indexOf(currentAuto) == -1) + currentAuto = currentPots[0]; + dl.innerHTML = currentPots +// .map(n => `${tj != '' ? tj + '.' : ''}${n}`) + .map((n, i) => `
${escapeHtml(last)}${escapeHtml(n.substr(last.length))}
`) + .join(''); + dl.hidden = false; + } else { + cancelAutocomplete(); + } +} + +function enactAutocomplete() { + if (currentAuto != null) { + document.getElementById("command").value = (currentStem != '' ? currentStem + '.' : '') + currentAuto; + cancelAutocomplete(); + } +} + +function cancelAutocomplete() { + document.getElementById("autocomplete").hidden = true; + currentAuto = null; +} + +function scrollAutocomplete(positive) { + if (currentAuto != null) { + var i = currentPots.indexOf(currentAuto); + document.getElementById('pot' + i).classList = ['ac-unselected']; + if (positive && i < currentPots.length - 1) + ++i; + else if (!positive && i > 0) + --i; + currentAuto = currentPots[i]; + let sel = document.getElementById('pot' + i); + sel.classList = ['ac-selected']; + sel.scrollIntoViewIfNeeded(); + } +} + +document.getElementById("command").addEventListener("paste", updateAutocomplete); +document.getElementById("command").addEventListener("input", updateAutocomplete); +document.getElementById("command").addEventListener("focusout", cancelAutocomplete); +document.getElementById("command").addEventListener("blur", cancelAutocomplete); + +document.getElementById("command").addEventListener("keydown", function(event) { + let el = document.getElementById("command"); + if (currentAuto != null) { + if (event.keyCode == 38 || event.keyCode == 40) { + event.preventDefault(); + scrollAutocomplete(event.keyCode == 40); + } + else if ((event.keyCode == 39 || event.keyCode == 9 || event.keyCode == 13) && el.selectionStart == el.value.length) { + event.preventDefault(); + enactAutocomplete(); + } + else if (event.keyCode == 27) { + event.preventDefault(); + cancelAutocomplete(); + } + } else { + let command = document.getElementById("command"); + if (event.keyCode == 38 && window.historyIndex > 0) { + event.preventDefault(); + window.historyIndex--; + command.value = window.historyData[window.historyIndex]; + } + if (event.keyCode == 40 && window.historyIndex < window.historyData.length) { + event.preventDefault(); + window.historyIndex++; + command.value = window.historyIndex < window.historyData.length ? window.historyData[window.historyIndex] : ""; + } + } + if (event.keyCode >= 48 || event.keyCode == 8) { + let t = document.getElementById("command").value; + setTimeout(() => { + if (t != document.getElementById("command").value) + updateAutocomplete(); + }, 0); + } + else { + setTimeout(() => { + if (el.selectionStart != el.value.length) + cancelAutocomplete(); + }, 0); + } +}); + +document.getElementById("command").addEventListener("keyup", function(event) { + if (event.keyCode == 13) { + event.preventDefault(); + exec(); + } +}); + +if (typeof(window.parity) == 'object') { + document.getElementById("command").focus(); + window.web3 = web3; + window.parity = parity; +} +refreshWatches(); + +["debug", "error", "info", "log", "warn"].forEach(n => { let old = window.console[n]; window.console[n] = x => { old(x); newLog(n, x); }; }); + + + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///// Home comforts. + + +// Usage example: +// web3.eth.traceCall({ +// to: theChicken.address, +// data: theChicken.withdraw.getData(100000000000000000), +// gas: 100000 +// }, +// `["trace", "vmTrace", "stateDiff"] +// ) +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'traceCall', + call: 'trace_call', + params: 2, + inputFormatter: [web3._extend.formatters.inputCallFormatter, null] + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'traceSendRawTransaction', + call: 'trace_rawTransaction', + params: 2, + inputFormatter: [null, null] + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'traceReplayTransaction', + call: 'trace_replayTransaction', + params: 2, + inputFormatter: [null, null] + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'setMode', + call: 'ethcore_setMode', + params: 1, + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'mode', + call: 'ethcore_mode', + params: 0, + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'traceTransaction', + call: 'trace_Transaction', + params: 1, + inputFormatter: [null] + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'gasPriceStatistics', + call: 'ethcore_gasPriceStatistics', + params: 0, + outputFormatter: function(a) { return a.map(web3.toBigNumber); } + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'registryAddress', + call: 'ethcore_registryAddress', + params: 0 + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'accountsInfo', + call: 'personal_accountsInfo', + outputFormatter: function(m) { Object.keys(m).forEach(k => { + m[k].meta = JSON.parse(m[k].meta); + m[k].meta.name = m[k].name; + m[k].meta.uuid = m[k].uuid; + m[k] = m[k].meta; + }); return m; }, + params: 0 + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'setAccountName', + call: 'personal_setAccountName', + params: 2, + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'setAccountMeta', + call: 'personal_setAccountMeta', + params: 2, + inputFormatter: [a => a, JSON.stringify] + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'postTransaction', + call: 'eth_postTransaction', + params: 1, + inputFormatter: [web3._extend.formatters.inputCallFormatter] + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'postSign', + call: 'eth_postSign', + params: 1 + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'encryptMessage', + call: 'ethcore_encryptMessage', + params: 2 + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'checkRequest', + call: 'eth_checkRequest', + params: 1 + }) + ] +}); + +web3._extend({ + property: 'eth', + methods: [ + new web3._extend.Method({ + name: 'listAccounts', + call: 'ethcore_listAccounts', + params: 0 + }) + ] +}); + +{ + var postTransaction = web3.eth.postTransaction.bind(web3.eth); + var sendTransaction = web3.eth.sendTransaction.bind(web3.eth); + web3.eth.sendTransaction = function(options, f) { + // No callback - do sync API. + if (typeof f != "function") + return sendTransaction(options); + // Callback - use async API. + var id = postTransaction(options); + console.log("Posted trasaction id=" + id); + var timerId = window.setInterval(check, 500); + function check() { + try { + let r = web3.eth.checkRequest(id); + if (typeof r == 'string') { + clearInterval(timerId); + if (r == "0x0000000000000000000000000000000000000000000000000000000000000000") + f("Rejected", r); + else + f(null, r); + } else if (r !== null) { + console.log("checkRequest returned: " + r); + } + } + catch (e) { + clearInterval(timerId); + f("Rejected", null); + } + } + } +} + +web3.eth.installInterceptor = function(interceptor) { + var oldSendTransaction = web3.eth.sendTransaction.bind(web3.eth); + web3.eth.sendTransaction = function(options, f) { + if (interceptor(options) == false) + return "0x0000000000000000000000000000000000000000000000000000000000000000"; + return oldSendTransaction(options, f); + }; +} + +web3.eth.reporter = function(e, r) { + if (e) { + console.log("Error confirming transaction: " + e); + } else { + var addr = r; + var confirmed = false; + var timer_id = window.setInterval(check, 500); + function check() { + var receipt = web3.eth.getTransactionReceipt(addr); + if (receipt != null) { + if (!confirmed) { + console.log("Transaction confirmed (" + r + "); used " + receipt.gasUsed + " gas; left " + receipt.logs.length + " logs; mining..."); + confirmed = true; + } + if (typeof receipt.blockHash == 'string') { + clearInterval(timer_id); + console.log("Mined into block " + receipt.blockNumber); + } + } + } + } +} + +{ + var oldSha3 = web3.sha3 + web3.sha3 = function(data, format) { + if (typeof format !== 'string' || (format != 'hex' && format != 'bin')) + format = data.startsWith('0x') ? 'hex' : 'bin'; + return oldSha3(data, {encoding: format}); + } +} + +{ + var Registry = web3.eth.contract([{"constant":false,"inputs":[{"name":"_new","type":"address"}],"name":"setOwner","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"confirmReverse","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"}],"name":"reserve","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_key","type":"string"},{"name":"_value","type":"bytes32"}],"name":"set","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"}],"name":"drop","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_key","type":"string"}],"name":"getAddress","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"setFee","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_to","type":"address"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"}],"name":"reserved","outputs":[{"name":"reserved","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"drain","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_who","type":"address"}],"name":"proposeReverse","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_key","type":"string"}],"name":"getUint","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_key","type":"string"}],"name":"get","outputs":[{"name":"","type":"bytes32"}],"type":"function"},{"constant":true,"inputs":[],"name":"fee","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"reverse","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_key","type":"string"},{"name":"_value","type":"uint256"}],"name":"setUint","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"removeReverse","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"bytes32"},{"name":"_key","type":"string"},{"name":"_value","type":"address"}],"name":"setAddress","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Drained","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"FeeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"},{"indexed":true,"name":"owner","type":"address"}],"name":"Reserved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"},{"indexed":true,"name":"oldOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"Transferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"},{"indexed":true,"name":"owner","type":"address"}],"name":"Dropped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"bytes32"},{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"key","type":"string"},{"indexed":false,"name":"plainKey","type":"string"}],"name":"DataChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"string"},{"indexed":true,"name":"reverse","type":"address"}],"name":"ReverseProposed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"string"},{"indexed":true,"name":"reverse","type":"address"}],"name":"ReverseConfirmed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"name","type":"string"},{"indexed":true,"name":"reverse","type":"address"}],"name":"ReverseRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"old","type":"address"},{"indexed":true,"name":"current","type":"address"}],"name":"NewOwner","type":"event"}]); + web3.eth.registry = Registry.at(web3.eth.registryAddress()); + web3.eth.registry.lookup = (name, field) => web3.eth.registry.get(web3.sha3(name), field); + web3.eth.registry.lookupAddress = (name, field) => web3.eth.registry.getAddress(web3.sha3(name), field); + web3.eth.registry.lookupUint = (name, field) => web3.eth.registry.getUint(web3.sha3(name), field); + + var TokenReg = web3.eth.contract([{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"token","outputs":[{"name":"addr","type":"address"},{"name":"tla","type":"string"},{"name":"base","type":"uint256"},{"name":"name","type":"string"},{"name":"owner","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_new","type":"address"}],"name":"setOwner","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"},{"name":"_tla","type":"string"},{"name":"_base","type":"uint256"},{"name":"_name","type":"string"}],"name":"register","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"},{"name":"_key","type":"bytes32"}],"name":"meta","outputs":[{"name":"","type":"bytes32"}],"type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"},{"name":"_tla","type":"string"},{"name":"_base","type":"uint256"},{"name":"_name","type":"string"},{"name":"_owner","type":"address"}],"name":"registerAs","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_tla","type":"string"}],"name":"fromTLA","outputs":[{"name":"id","type":"uint256"},{"name":"addr","type":"address"},{"name":"base","type":"uint256"},{"name":"name","type":"string"},{"name":"owner","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[],"name":"drain","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"tokenCount","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"unregister","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_addr","type":"address"}],"name":"fromAddress","outputs":[{"name":"id","type":"uint256"},{"name":"tla","type":"string"},{"name":"base","type":"uint256"},{"name":"name","type":"string"},{"name":"owner","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_key","type":"bytes32"},{"name":"_value","type":"bytes32"}],"name":"setMeta","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"fee","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"tla","type":"string"},{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"addr","type":"address"},{"indexed":false,"name":"name","type":"string"}],"name":"Registered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"tla","type":"string"},{"indexed":true,"name":"id","type":"uint256"}],"name":"Unregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":true,"name":"key","type":"bytes32"},{"indexed":false,"name":"value","type":"bytes32"}],"name":"MetaChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"old","type":"address"},{"indexed":true,"name":"current","type":"address"}],"name":"NewOwner","type":"event"}]); + web3.eth.tokenReg = TokenReg.at(web3.eth.registry.lookupAddress('tokenreg', 'A')); +} \ No newline at end of file diff --git a/js/src/dapps/static/console.manifest.json b/js/src/dapps/static/console.manifest.json new file mode 100755 index 00000000000..4eeef0372e4 --- /dev/null +++ b/js/src/dapps/static/console.manifest.json @@ -0,0 +1,8 @@ +{ + "id": "console", + "name": "Parity/Web3 console", + "description": "A Javascript development console complete with web3 and parity objects.", + "version": "0.3", + "author": "Gav Wood ", + "iconUrl": "console.jpeg" +} From e2e0029a63fa686f4935d20b7a01f337fde74b72 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 12 Jan 2017 12:53:48 +0100 Subject: [PATCH 3/7] Add console to builtins --- js/src/views/Dapps/builtin.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/src/views/Dapps/builtin.json b/js/src/views/Dapps/builtin.json index 2b617ae3294..477678156a7 100644 --- a/js/src/views/Dapps/builtin.json +++ b/js/src/views/Dapps/builtin.json @@ -73,5 +73,14 @@ "author": "Parity Team ", "version": "1.0.0", "visible": true + }, + { + "id": "0xa635a9326814bded464190eddf0bdb90ce92d40ea2359cf553ea80e3c5a4076c", + "url": "console", + "name": "Parity/Web3 console", + "description": "A Javascript development console complete with web3 and parity objects.", + "version": "0.3", + "author": "Gav Wood ", + "visible": true } ] From ecbc3db5a653a060217990fd53f314fbce14ef3e Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 12 Jan 2017 12:59:04 +0100 Subject: [PATCH 4/7] Remove console assets --- js/src/dapps/static/console.jpeg | Bin 1476 -> 0 bytes js/src/dapps/static/console.manifest.json | 8 -------- 2 files changed, 8 deletions(-) delete mode 100755 js/src/dapps/static/console.jpeg delete mode 100755 js/src/dapps/static/console.manifest.json diff --git a/js/src/dapps/static/console.jpeg b/js/src/dapps/static/console.jpeg deleted file mode 100755 index e0e1fad3ea4882912b3cc760be0bc76dd39f7bff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1476 zcmX|BeLT~79RJO(-;}vxa+#s1DKD`Hna~+?|Rcj`5A`ADrdAPgjO2g{4 z9yVTjSZ6fZ4rO+fl*usCZEih~9`G8nq9eraH(vGqzFyxy-k*o}=kxtMnDnN8V8yPm zonZh1fdI@GFg*i8080==flDk=DAdxWmdns~)@Um$w1X{Xxt$Z%#n}mq!>wNH<-Xe0 z(+!7PPubu}Ao}?DxVUc)^dkj$k$p&}dw`WCAP3|KgbiS725@HoFar`MSUd>80tF(! zT4D)Hzg+=XAdm-JzTPCuAJ=_3P?<-b?0|YpYc3LD%mH|}nttBQw5ulgcuU35hc<=K1E2#1=uO9dob=2i&CF;T9nBD$J~hlC_% zEJ3s=S*zXA%=1z4>>(P7(Zt20+d&MTxg~c;6;oIhuYb_2){-~U=``77=&-W(ZTHtK zK~E9|Khvo()Yc3akw)3BsrZh_H`Jcl1S6;WHI2w<5`fSu0y7rkk~BoRis%1u9oFkq zfw-mYp@P?@t3tP1Py_u zl7>-drdP#^X+u=b$xKe)WJ+ZS(tB5D{mBykf&Aj=3dQ~t51olE%WtX$AX;etToU|m zo-{H!JSv^nBcrnBlxND7+d8OFiy@C&H-1=wz1tm?5ur>fmMOdnxTn{*_-@mQ}2(eYc7OK2TwOL znMW(r9t;Q7;2{SyIT#0%$5zMJ>+eRSPX3-W#0vNnPWmNbSefmA=Um^EQ#}%e`ToA* z6qg^G&q=wV*tWhfAU?k^yELz~zgN@Qs^Ax}oHD$2ou28k9#6?q47gAdJ(OjJ8us!q zR#`XOZ908V@6?@#1rpaHy0F*cbJ`-fruNVX2caHx>VT4xsj{Afxu=y!oX?0WPP~_8 z8pg&7Ytw#A4R%cMt$>~!@MUjuY-1f~X`Cotx+hRh#~An5q#)gJ@sW~mCWhbnr4Q&I zh;x?U;%jB(`SUJ7#uOpH>!MvY(H`L{B-s4`>W+{YcHSY961%xb^Ekcw^c>Kz!~Gj{+jS zyGcRT2SZ-Uipr%4vZ5POifXqc_|fN1fN06YV>;#~fZFOM*Sn%FsgrK8~*wQ~Tq|H^p${H@DzaAP@Kgp0Z`rXp!7+tW{_Y2;&O z#JaZfAx=z_d_8Nvu5(`1Ro8H>V&=8~EG6jG_#g6-eB;E}g(U>2$RKk2X&bOxO", - "iconUrl": "console.jpeg" -} From 3c21da16e3a7ea7ef27ee29716a084c2b9585555 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 12 Jan 2017 13:04:36 +0100 Subject: [PATCH 5/7] Disable eslint on console.js --- js/src/dapps/static/console.js | 37 +++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/js/src/dapps/static/console.js b/js/src/dapps/static/console.js index b674b73044e..64bb1a62587 100755 --- a/js/src/dapps/static/console.js +++ b/js/src/dapps/static/console.js @@ -1,3 +1,22 @@ +// Copyright 2015, 2016 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +/* eslint disable */ +// TODO: Fix linting issues + if (typeof(window.parity) == 'object') window.parity.api.subscribe('eth_blockNumber', function (error, blockNumber) { if (error) { @@ -38,9 +57,9 @@ function evaluate(x) { function displayReady(x) { if (x === undefined) - return 'undefined'; + return 'undefined'; if (x === null) - return 'null'; + return 'null'; if (typeof(x) == "string") return `"${escapeHtml(x)}"`; if (Object.prototype.toString.call(x) === '[object Array]') @@ -103,13 +122,13 @@ function newLog(level, text) { error: "✖", info: "ℹ" }; - pushLine('
' + icon[level] + '' + escapeHtml(text) + '
'); + pushLine('
' + icon[level] + '' + escapeHtml(text) + '
'); } function exec() { let command = document.getElementById("command"); let c = command.value; - + if (c != '') { command.value = ""; window.historyData.push(c); @@ -158,7 +177,7 @@ function exec() { function pushLine(l) { document.getElementById("history").innerHTML += l var h = document.getElementById("history-wrap"); - h.scrollTop = h.scrollHeight; + h.scrollTop = h.scrollHeight; } var autocompletes = []; @@ -184,7 +203,7 @@ function updateAutocomplete() { currentPots = autocompletes.filter(n => n.startsWith(last)); if (currentPots.length > 0) { if (currentPots.indexOf(currentAuto) == -1) - currentAuto = currentPots[0]; + currentAuto = currentPots[0]; dl.innerHTML = currentPots // .map(n => `${tj != '' ? tj + '.' : ''}${n}`) .map((n, i) => `
${escapeHtml(last)}${escapeHtml(n.substr(last.length))}
`) @@ -199,7 +218,7 @@ function enactAutocomplete() { if (currentAuto != null) { document.getElementById("command").value = (currentStem != '' ? currentStem + '.' : '') + currentAuto; cancelAutocomplete(); - } + } } function cancelAutocomplete() { @@ -228,7 +247,7 @@ document.getElementById("command").addEventListener("focusout", cancelAutocomple document.getElementById("command").addEventListener("blur", cancelAutocomplete); document.getElementById("command").addEventListener("keydown", function(event) { - let el = document.getElementById("command"); + let el = document.getElementById("command"); if (currentAuto != null) { if (event.keyCode == 38 || event.keyCode == 40) { event.preventDefault(); @@ -577,4 +596,4 @@ web3.eth.reporter = function(e, r) { var TokenReg = web3.eth.contract([{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"token","outputs":[{"name":"addr","type":"address"},{"name":"tla","type":"string"},{"name":"base","type":"uint256"},{"name":"name","type":"string"},{"name":"owner","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_new","type":"address"}],"name":"setOwner","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"},{"name":"_tla","type":"string"},{"name":"_base","type":"uint256"},{"name":"_name","type":"string"}],"name":"register","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"},{"name":"_key","type":"bytes32"}],"name":"meta","outputs":[{"name":"","type":"bytes32"}],"type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"},{"name":"_tla","type":"string"},{"name":"_base","type":"uint256"},{"name":"_name","type":"string"},{"name":"_owner","type":"address"}],"name":"registerAs","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_tla","type":"string"}],"name":"fromTLA","outputs":[{"name":"id","type":"uint256"},{"name":"addr","type":"address"},{"name":"base","type":"uint256"},{"name":"name","type":"string"},{"name":"owner","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[],"name":"drain","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"tokenCount","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"unregister","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_addr","type":"address"}],"name":"fromAddress","outputs":[{"name":"id","type":"uint256"},{"name":"tla","type":"string"},{"name":"base","type":"uint256"},{"name":"name","type":"string"},{"name":"owner","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_key","type":"bytes32"},{"name":"_value","type":"bytes32"}],"name":"setMeta","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"fee","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"tla","type":"string"},{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"addr","type":"address"},{"indexed":false,"name":"name","type":"string"}],"name":"Registered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"tla","type":"string"},{"indexed":true,"name":"id","type":"uint256"}],"name":"Unregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":true,"name":"key","type":"bytes32"},{"indexed":false,"name":"value","type":"bytes32"}],"name":"MetaChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"old","type":"address"},{"indexed":true,"name":"current","type":"address"}],"name":"NewOwner","type":"event"}]); web3.eth.tokenReg = TokenReg.at(web3.eth.registry.lookupAddress('tokenreg', 'A')); -} \ No newline at end of file +} From ca5f293b397332a1c534eb9af97f24088b6734a7 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 12 Jan 2017 14:00:52 +0100 Subject: [PATCH 6/7] Enable eslint after disable --- js/src/dapps/static/console.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/src/dapps/static/console.js b/js/src/dapps/static/console.js index 64bb1a62587..41f00aef65b 100755 --- a/js/src/dapps/static/console.js +++ b/js/src/dapps/static/console.js @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -/* eslint disable */ +/* eslint-disable */ // TODO: Fix linting issues if (typeof(window.parity) == 'object') @@ -597,3 +597,5 @@ web3.eth.reporter = function(e, r) { var TokenReg = web3.eth.contract([{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"token","outputs":[{"name":"addr","type":"address"},{"name":"tla","type":"string"},{"name":"base","type":"uint256"},{"name":"name","type":"string"},{"name":"owner","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_new","type":"address"}],"name":"setOwner","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"},{"name":"_tla","type":"string"},{"name":"_base","type":"uint256"},{"name":"_name","type":"string"}],"name":"register","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"},{"name":"_key","type":"bytes32"}],"name":"meta","outputs":[{"name":"","type":"bytes32"}],"type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"},{"name":"_tla","type":"string"},{"name":"_base","type":"uint256"},{"name":"_name","type":"string"},{"name":"_owner","type":"address"}],"name":"registerAs","outputs":[{"name":"","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"_tla","type":"string"}],"name":"fromTLA","outputs":[{"name":"id","type":"uint256"},{"name":"addr","type":"address"},{"name":"base","type":"uint256"},{"name":"name","type":"string"},{"name":"owner","type":"address"}],"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"type":"function"},{"constant":false,"inputs":[],"name":"drain","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"tokenCount","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"unregister","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"_addr","type":"address"}],"name":"fromAddress","outputs":[{"name":"id","type":"uint256"},{"name":"tla","type":"string"},{"name":"base","type":"uint256"},{"name":"name","type":"string"},{"name":"owner","type":"address"}],"type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_key","type":"bytes32"},{"name":"_value","type":"bytes32"}],"name":"setMeta","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"fee","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"tla","type":"string"},{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"addr","type":"address"},{"indexed":false,"name":"name","type":"string"}],"name":"Registered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"tla","type":"string"},{"indexed":true,"name":"id","type":"uint256"}],"name":"Unregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":true,"name":"key","type":"bytes32"},{"indexed":false,"name":"value","type":"bytes32"}],"name":"MetaChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"old","type":"address"},{"indexed":true,"name":"current","type":"address"}],"name":"NewOwner","type":"event"}]); web3.eth.tokenReg = TokenReg.at(web3.eth.registry.lookupAddress('tokenreg', 'A')); } + +/* eslint-enable */ From 18eb93a3472b955c1ad3776c09691633d8b55cc8 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 12 Jan 2017 14:01:02 +0100 Subject: [PATCH 7/7] Webpack copy --- js/webpack/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/webpack/app.js b/js/webpack/app.js index 2fe5fc4732f..0db813fbfe7 100644 --- a/js/webpack/app.js +++ b/js/webpack/app.js @@ -150,8 +150,10 @@ module.exports = { }); const plugins = Shared.getPlugins().concat( - new CopyWebpackPlugin([{ from: './error_pages.css', to: 'styles.css' }], {}), - new CopyWebpackPlugin([{ from: './dapps/static/*' }], {}), + new CopyWebpackPlugin([ + { from: './error_pages.css', to: 'styles.css' }, + { from: 'dapps/static' } + ], {}), new WebpackErrorNotificationPlugin(),