From 9d1adbf077765d0eeebfea2b453808540eeb7f8c Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 May 2019 11:30:06 +0200 Subject: [PATCH 01/35] fix toaster --- src/app/files/fileManager.js | 11 ++++++----- src/app/ui/tooltip.js | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 9031a418d9..41da3187bb 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -135,9 +135,9 @@ class FileManager extends FileSystemApi { if (this.currentRequest) { let reject = false let savedAsAnotherFile = false - let warnToaster - const actions = yo`
- + let actions = (toaster) => { + return yo`
+
` - warnToaster = await toaster(yo`
${this.currentRequest.from} is modyfing ${path}
`, actions, { time: 4000 }) + } + await toaster(yo`
${this.currentRequest.from} is modyfing ${path}
`, actions, { time: 4000 }) if (reject) throw new Error(`set file operation on ${path} aborted by user.`) if (savedAsAnotherFile) return } diff --git a/src/app/ui/tooltip.js b/src/app/ui/tooltip.js index 4632193c8f..8c44f905e8 100644 --- a/src/app/ui/tooltip.js +++ b/src/app/ui/tooltip.js @@ -5,11 +5,11 @@ var modal = require('./modal-dialog-custom') /** * Open a tooltip * @param {string} tooltipText The text shown by the tooltip - * @param {HTMLElement} [action] An HTMLElement to display for action + * @param {function} [action] Returns An HTMLElement to display for action */ module.exports = function addTooltip (tooltipText, action, opts) { let t = new Toaster() - return t.render(tooltipText, action, opts) + return t.render(tooltipText, action(t), opts) } class Toaster { From c1fe2ad7c8e34327e2eeb2d42cc1f6dc6d0f128c Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 21 May 2019 12:25:29 +0200 Subject: [PATCH 02/35] remix-plugin-v0.0.2-alpha.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d0e6636a7..d42e788637 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ }, "dependencies": { "http-server": "^0.11.1", - "remix-plugin": "0.0.2-alpha.8", + "remix-plugin": "0.0.2-alpha.9", "remixd": "0.1.8-alpha.6" }, "repository": { From 29bb5faea720de79b8b102066af418090d7245c1 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Tue, 21 May 2019 13:17:07 +0200 Subject: [PATCH 03/35] fixes publish Swarm --- src/app/tabs/compile-tab.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index e8b9734d1a..cacd994331 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -182,14 +182,17 @@ class CompileTab extends CompilerApi { * @param {string[]} contractList Names of the compiled contracts */ contractSelection (contractList = [], sourceFile) { - return contractList.length !== 0 + let selectEl = yo` + + ` + let result = contractList.length !== 0 ? yo`
@@ -220,6 +223,10 @@ class CompileTab extends CompilerApi { : yo`
No Contract Compiled Yet
` + + if (0 !== contractList.length) + this.selectedContract = selectEl.value + return result; } // TODO : Add success alert when compilation succeed From 3e66e47af9d5490eeb3f3fccc8d87a43f0fff47e Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Tue, 21 May 2019 13:18:30 +0200 Subject: [PATCH 04/35] update link to remixd docs and update css of link to docs in title --- src/app/components/side-panel.js | 9 +++------ src/app/files/remixd-handle.js | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/app/components/side-panel.js b/src/app/components/side-panel.js index 619f4d6df7..8b1c848e42 100644 --- a/src/app/components/side-panel.js +++ b/src/app/components/side-panel.js @@ -11,12 +11,9 @@ const css = csjs` text-transform: uppercase; white-space: nowrap; } - .swapitTitle a{ - cursor: help; - } .swapitTitle i{ - padding-left:4px; - font-size:10px; + padding-left: 6px; + font-size: 14px; } .swapitHeader { height: 35px; @@ -67,7 +64,7 @@ export class SidePanel extends AbstractPanel { const { profile } = this.store.getOne(this.active) name = profile.displayName ? profile.displayName : profile.name const docsRoot = 'https://remix.readthedocs.io/en/latest/' - docLink = profile.documentation ? yo`` : '' + docLink = profile.documentation ? yo`` : '' } return yo` diff --git a/src/app/files/remixd-handle.js b/src/app/files/remixd-handle.js index a31af0c61b..d411eb621e 100644 --- a/src/app/files/remixd-handle.js +++ b/src/app/files/remixd-handle.js @@ -93,7 +93,7 @@ function remixdDialog () { return yo`
Interact with your file system from Remix. Click connect and find shared folder in the Remix file explorer (under localhost). - Before you get started, check out Tutorial_remixd_filesystem + Before you get started, check out the Remixd tutorial. to find out how to run Remixd.
Connection will start a session between ${window.location.href} and your local file system ws://127.0.0.1:65520 From f6198c319d48c9cad0f778fc4e1959e3d92e9531 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 May 2019 13:25:34 +0200 Subject: [PATCH 05/35] fallback to txt --- src/app/editor/editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index f447b940a7..ba3b643917 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -219,7 +219,9 @@ class Editor { */ _getMode (path) { let ext = path.indexOf('.') !== -1 ? /[^.]+/.exec(path) : null - if (ext) ext = path.replace(ext[0] + '.', '') // we get + if (ext) { + ext = path.replace(ext[0] + '.', '') // we get + } else ext = 'txt' ext = ext.split('#') if (!ext.length) return this.modes['txt'] ext = ext[0] From 7b66aec43f96de9ad969e659e118d3eb9210d837 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 May 2019 13:25:45 +0200 Subject: [PATCH 06/35] show metadatafile in explorer --- src/app/contract/publishOnSwarm.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/contract/publishOnSwarm.js b/src/app/contract/publishOnSwarm.js index cd4bdb3bac..d072f72288 100644 --- a/src/app/contract/publishOnSwarm.js +++ b/src/app/contract/publishOnSwarm.js @@ -56,6 +56,12 @@ module.exports = (contract, fileManager, cb, swarmVerifiedPublishCallBack) => { }) }, () => { swarmVerifiedPublish(JSON.stringify(metadata), '', (error, result) => { + if (!error && swarmVerifiedPublishCallBack) { + swarmVerifiedPublishCallBack({ + content: contract.metadata, + hash: contract.metadataHash + }) + } uploaded.push({ content: contract.metadata, hash: contract.metadataHash, From f438cde3edd928b31e6513d6bb53c06ddb53c1b5 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Tue, 21 May 2019 14:23:05 +0200 Subject: [PATCH 07/35] standard --- src/app/tabs/compile-tab.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index cacd994331..047f9b5672 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -187,7 +187,7 @@ class CompileTab extends CompilerApi { ${contractList.map((name) => yo``)} ` - let result = contractList.length !== 0 + let result = !contractList.length ? yo`
` - if (0 !== contractList.length) - this.selectedContract = selectEl.value - return result; + if (!contractList.length) this.selectedContract = selectEl.value + return result } // TODO : Add success alert when compilation succeed From a3d602305103a14df9c648fb9c5ed0b6751d0a87 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Tue, 21 May 2019 16:16:58 +0200 Subject: [PATCH 08/35] removed see more button restyle debuger -> tx N field --- src/app/debugger/debuggerUI/TxBrowser.js | 13 ++++++++++++- src/app/tabs/compile-tab.js | 13 ++++++++++--- src/app/ui/tooltip.js | 10 +++++++++- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/app/debugger/debuggerUI/TxBrowser.js b/src/app/debugger/debuggerUI/TxBrowser.js index 6cdcc45e85..d58c9e5a95 100644 --- a/src/app/debugger/debuggerUI/TxBrowser.js +++ b/src/app/debugger/debuggerUI/TxBrowser.js @@ -18,6 +18,10 @@ var css = csjs` } .txinput { width: inherit; + font-size: small; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .txbuttons { width: 100%; @@ -80,7 +84,14 @@ TxBrowser.prototype.render = function () { var view = yo`
- +
diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 047f9b5672..4eb001bb70 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -183,11 +183,14 @@ class CompileTab extends CompilerApi { */ contractSelection (contractList = [], sourceFile) { let selectEl = yo` - ${contractList.map((name) => yo``)} ` - let result = !contractList.length + let result = contractList.length ? yo`
` - if (!contractList.length) this.selectedContract = selectEl.value + if (contractList.length) { + this.selectedContract = selectEl.value + } else { + delete this.selectedContract + } return result } diff --git a/src/app/ui/tooltip.js b/src/app/ui/tooltip.js index 8c44f905e8..508357725f 100644 --- a/src/app/ui/tooltip.js +++ b/src/app/ui/tooltip.js @@ -8,6 +8,7 @@ var modal = require('./modal-dialog-custom') * @param {function} [action] Returns An HTMLElement to display for action */ module.exports = function addTooltip (tooltipText, action, opts) { + action = action || function () { return yo`
` } let t = new Toaster() return t.render(tooltipText, action(t), opts) } @@ -27,9 +28,16 @@ class Toaster { return new Promise((resolve, reject) => { const shortTooltipText = tooltipText.length > 201 ? tooltipText.substring(0, 200) + '...' : tooltipText + let button = tooltipText.length > 201 ? yo` + + ` : `` + this.tooltip = yo`
{ over() }} onmouseleave=${() => { out() }}> - ${shortTooltipText} + + ${shortTooltipText} + ${button} + ${action}
` let timeOut = () => { From 76ecb3aba4789a7da5eab2589f2a1386bdaff27c Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 21 May 2019 23:10:43 +0200 Subject: [PATCH 09/35] fix publish on swarm --- src/app/contract/publishOnSwarm.js | 15 +++++++++++++-- src/app/files/basicReadOnlyExplorer.js | 6 +++--- src/app/files/file-explorer.js | 3 ++- src/app/files/styles/file-explorer-styles.js | 7 ++++++- src/app/tabs/compile-tab.js | 2 +- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/app/contract/publishOnSwarm.js b/src/app/contract/publishOnSwarm.js index d072f72288..f4dc32b833 100644 --- a/src/app/contract/publishOnSwarm.js +++ b/src/app/contract/publishOnSwarm.js @@ -47,6 +47,11 @@ module.exports = (contract, fileManager, cb, swarmVerifiedPublishCallBack) => { var uploaded = [] async.eachSeries(sources, function (item, cb) { swarmVerifiedPublish(item.content, item.hash, (error, result) => { + try { + item.hash = result.url.match('bzz-raw://(.+)')[1] + } catch (e) { + item.hash = ' - ' + item.fileName + } if (!error && swarmVerifiedPublishCallBack) swarmVerifiedPublishCallBack(item) item.output = result uploaded.push(item) @@ -55,10 +60,16 @@ module.exports = (contract, fileManager, cb, swarmVerifiedPublishCallBack) => { cb(error) }) }, () => { - swarmVerifiedPublish(JSON.stringify(metadata), '', (error, result) => { + const metadataContent = JSON.stringify(metadata) + swarmVerifiedPublish(metadataContent, '', (error, result) => { + try { + contract.metadataHash = result.url.match('bzz-raw://(.+)')[1] + } catch (e) { + contract.metadataHash = ' - metadata.json' + } if (!error && swarmVerifiedPublishCallBack) { swarmVerifiedPublishCallBack({ - content: contract.metadata, + content: metadataContent, hash: contract.metadataHash }) } diff --git a/src/app/files/basicReadOnlyExplorer.js b/src/app/files/basicReadOnlyExplorer.js index df4f17c11c..67a1a1f874 100644 --- a/src/app/files/basicReadOnlyExplorer.js +++ b/src/app/files/basicReadOnlyExplorer.js @@ -41,13 +41,13 @@ class BasicReadOnlyExplorer { } set (path, content, cb) { - var unprefixedPath = this.removePrefix(path) - this.addReadOnly(unprefixedPath, content) + this.addReadOnly(path, content) if (cb) cb() return true } addReadOnly (path, content, rawPath) { + path = this.removePrefix(path) try { // lazy try to format JSON content = JSON.stringify(JSON.parse(content), null, '\t') } catch (e) {} @@ -67,7 +67,7 @@ class BasicReadOnlyExplorer { this.paths[this.type][split] = { isDirectory: folder } this.files[path] = content this.normalizedNames[rawPath] = path - this.event.trigger('fileAdded', [path, true]) + this.event.trigger('fileAdded', [this.type + '/' + path, true]) return true } diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index 891e5a1692..007073f351 100644 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -158,7 +158,8 @@ function fileExplorer (localRegistry, files, menuItems) { return yo`