From 8a15fb7ce38d973fb155e1576980ac08b168e247 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Thu, 3 Jan 2019 14:33:16 +0100 Subject: [PATCH 001/636] with Yann --- src/app.js | 199 +++++++++++++----- src/app/components/plugin-manager-api.js | 26 +++ .../components/plugin-manager-component.js | 62 ++++++ src/app/components/swap-panel-api.js | 26 +++ src/app/components/swap-panel-component.js | 57 +++++ src/app/components/vertical-icons-api.js | 23 ++ .../components/vertical-icons-component.js | 39 ++++ src/app/panels/left-icon-panel.js | 183 ++++++++++++++++ 8 files changed, 558 insertions(+), 57 deletions(-) create mode 100644 src/app/components/plugin-manager-api.js create mode 100644 src/app/components/plugin-manager-component.js create mode 100644 src/app/components/swap-panel-api.js create mode 100644 src/app/components/swap-panel-component.js create mode 100644 src/app/components/vertical-icons-api.js create mode 100644 src/app/components/vertical-icons-component.js create mode 100644 src/app/panels/left-icon-panel.js diff --git a/src/app.js b/src/app.js index a0bcec313e..dc8893a67e 100644 --- a/src/app.js +++ b/src/app.js @@ -37,7 +37,17 @@ var toolTip = require('./app/ui/tooltip') var TransactionReceiptResolver = require('./transactionReceiptResolver') const CompilerAbstract = require('./app/compiler/compiler-abstract') -const PluginManager = require('./app/plugin/pluginManager') +// const PluginManager = require('./app/plugin/pluginManager') + +// var IconPanel = require('./app/panels/left-icon-panel') + +const VerticalIconsComponent = require('./app/components/vertical-icons-component') +const VerticalIconsApi = require('./app/components/vertical-icons-api') +// var VerticalIconsProfile = require('./app/panels/vertical-icons-profile') + +const SwapPanelComponent = require('./app/component/swap-panel-component') +const SwapPanelComponent = require('./app/component/swap-panel-api') + const CompileTab = require('./app/tabs/compile-tab') const SettingsTab = require('./app/tabs/settings-tab') const AnalysisTab = require('./app/tabs/analysis-tab') @@ -46,6 +56,8 @@ const SupportTab = require('./app/tabs/support-tab') const TestTab = require('./app/tabs/test-tab') const RunTab = require('./app/tabs/run-tab') +const appManager = require('remix-plugin').appManager + var styleGuide = require('./app/ui/styles-guide/theme-chooser') var styles = styleGuide.chooser() @@ -188,46 +200,53 @@ class App { } } if (direction === 'left') { - self._view.leftpanel.style.width = delta + 'px' - self._view.centerpanel.style.left = delta + 'px' - } - if (direction === 'right') { - self._view.rightpanel.style.width = delta + 'px' - self._view.centerpanel.style.right = delta + 'px' + self._view.swappanel.style.width = delta + 'px' + self._view.mainpanel.style.left = delta + 'px' } + // if (direction === 'right') { + // self._view.mainpanel.style.width = delta + 'px' + // self._view.swappanel.style.right = delta + 'px' + // } } init () { var self = this run.apply(self) } + render () { var self = this if (self._view.el) return self._view.el - self._view.leftpanel = yo` -
- ${''} + // not resizable + self._view.iconpanel = yo` +
+ ${''}
` - self._view.centerpanel = yo` -
+ + // center panel, resizable + self._view.swappanel = yo` +
${''}
` - self._view.rightpanel = yo` -
+ + // handle the editor + terminal + self._view.mainpanel = yo` +
${''}
` + self._view.el = yo`
- ${self._view.leftpanel} - ${self._view.centerpanel} - ${self._view.rightpanel} + ${self._view.iconpanel} + ${self._view.swappanel} + ${self._view.mainpanel}
` // INIT self._adjustLayout('left', self.data._layout.left.offset) - self._adjustLayout('right', self.data._layout.right.offset) + // self._adjustLayout('right', self.data._layout.right.offset) return self._view.el } startdebugging (txHash) { @@ -362,23 +381,113 @@ Please make a backup of your contracts and start using http://remix.ethereum.org var fileManager = self._components.fileManager registry.put({api: fileManager, name: 'filemanager'}) - // ---------------- Plugin Manager ------------------------------- - - let pluginManager = new PluginManager( - self, - self._components.compilersArtefacts, - txlistener, - self._components.fileProviders, - self._components.fileManager, - udapp) - registry.put({api: pluginManager, name: 'pluginmanager'}) - - pluginManager.event.register('sendCompilationResult', (file, source, languageVersion, data) => { - // TODO check whether the tab is configured - let compiler = new CompilerAbstract(languageVersion, data, source) - self._components.compilersArtefacts['__last'] = compiler + // ----------------- app manager ---------------------------- + const VerticalIconsProfile = { + type: 'verticalIcons', + methods: ['addIcon', 'removeIcon'], + } + + const SwapPanelProfile = { + type: 'swapPanel', + methods: ['addView', 'showContent'], + } + + const PluginManagerProfile = { + type: 'pluginManager', + methods: [], + } + + const FileManagerProfile = { + type: 'fileManager', + methods: [], + } + + const SettingsProfile = { + type: 'settings', + methods: [], + } + + const appManager = new appManager() + + const swapPanelComponent = new SwapPanelComponent() + const pluginManagerComponent = new PluginManagerComponent(appManager) + const verticalIconComponent = new VerticalIconsComponent(appManager) + + const swapPanelApi = new SwapPanelApi(swapPanelComponent) + const verticalIconApi = new VerticalsIconApi(verticalIconComponent) + const pluginManagerAPI = new pluginManagerAPI(pluginManagerComponent) + + self._components.filePanel = new FilePanel() + registry.put({api: self._components.filePanel, name: 'filepanel'}) + + var settings = new SettingsTab() + + // All Plugins and Modules are registered in the contructor + // You cannot add module after + appManager.init({ + // Module should be activated by default + modules: [ + { json: VerticalIconsProfile, api: verticalIconApi }, + { json: SwapPanelProfile, api: swapPanelApi }, + { json: PluginManagerProfile, api: pluginManagerApi }, + { json: FileManagerProfile, api: self._components.filePanel }, + { json: SettingsProfile, api: settings } + ], + // Plugins need to be activated + plugins: [], + options: { + bootstrap: 'pluginManager' + } }) + const compileTab = new CompileTab(self._components.registry) + const compileTabProfile = { + type: 'solidityCompile', + methods: [], + } + appManager.addPlugin({json: compileTabProfile, api: compileTab}) + + const testTab = new TestTab(self._components.registry, compileTab) + const testTabProfile = { + type: 'solidityUnitTesting', + methods: [], + } + appManager.addPlugin({json: testTabProfile, api: testTab}) + + const runTab = new RunTab(self._components.registry) + const runTabProfile = { + type: 'runTransaction', + methods: [], + } + appManager.addPlugin({json: runTabProfile, api: runTab}) + + const analysisTab = new AnalysisTab(self._components.registry) + const analysisTabProfile = { + type: 'solidityStaticAnalisys', + methods: [], + } + appManager.addPlugin({json: analysisTabProfile, api: analysisTab}) + + const debuggerTab = new DebuggerTab(self._components.registry) + const debuggerTabProfile = { + type: 'debugger', + methods: [], + } + appManager.addPlugin({json: debuggerTabProfile, api: debuggerTab}) + + const supportTab = new SupportTab(self._components.registry) + const supportTabProfile = { + type: 'support', + methods: [], + } + appManager.addPlugin({json: supportTabProfile, api: supportTab}) + + self._components.iconpanel.appendChild(verticalIconComponent.render()) + self._components.iconpanel.event.register('resize', delta => self._adjustLayout('left', delta)) + + self._components.swappanel.appendChild(swapPanelComponent.render()) + self._components.swappanel.event.register('resize', delta => self._adjustLayout('center', delta)) + self._components.editorpanel.init() self._components.fileManager.init() @@ -406,34 +515,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org self.loadFiles(filesToLoad) } - // ---------------- FilePanel -------------------- - self._components.filePanel = new FilePanel() - self._view.leftpanel.appendChild(self._components.filePanel.render()) - self._components.filePanel.event.register('resize', delta => self._adjustLayout('left', delta)) - registry.put({api: self._components.filePanel, name: 'filepanel'}) - // ----------------- Renderer ----------------- var renderer = new Renderer() registry.put({api: renderer, name: 'renderer'}) - // ---------------- Tabs ------------------------------- - let compileTab = new CompileTab(self._components.registry) - let tabs = { - compile: compileTab, - run: new RunTab(self._components.registry), - settings: new SettingsTab(self._components.registry), - analysis: new AnalysisTab(self._components.registry), - debug: new DebuggerTab(self._components.registry), - support: new SupportTab(self._components.registry), - test: new TestTab(self._components.registry, compileTab) - } - - // ---------------- Righthand-panel -------------------- - self._components.righthandpanel = new RighthandPanel({ tabs, pluginManager }) - self._view.rightpanel.appendChild(self._components.righthandpanel.render()) - self._components.righthandpanel.init() - self._components.righthandpanel.event.register('resize', delta => self._adjustLayout('right', delta)) - var txLogger = new TxLogger() // eslint-disable-line var queryParams = new QueryParams() diff --git a/src/app/components/plugin-manager-api.js b/src/app/components/plugin-manager-api.js new file mode 100644 index 0000000000..3cadd1bdb1 --- /dev/null +++ b/src/app/components/plugin-manager-api.js @@ -0,0 +1,26 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +const EventManager = remixLib.EventManager + +class SwapPanelApi { + constructor (swapPanelComponent) { + this.component = swapPanelComponent + } + + /* + viewTitle: string + content: DOM element + */ + addView(viewTitle, content) { + // add the DOM to the swappanel + this.component.addView(viewTitle, contents) + } +} + + +module.exports = SwapPanelApi diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js new file mode 100644 index 0000000000..59de442953 --- /dev/null +++ b/src/app/components/plugin-manager-component.js @@ -0,0 +1,62 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +const EventManager = remixLib.EventManager + +class PluginManagerComponent { + constructor (appManager) { + this.appManager = appManager + appManager.event.register('pluginLoaded', () => { + // call this.renderItem + }) + } + + render () { + var self = this + // loop over all this.modules and this.plugins + var view = yo` +
+
+ ` + } + + _activate(item) { + this.appManager.activate(item) + } + + _deactivate(item) { + this.appManager.deactivate(item) + } + + renderItem (item) { + var self = this + + var view = yo` +
+ ${item.name} + ${item.url} +
+ ` + } +} + +module.exports = SwapPanelComponent + +const css = csjs` + .plugins { + width : 300px; + } + .plugItIn { + display : none; + } + .plugItIn.active { + display :block; + } + .clearFunds { background-color: lightblue; } +` diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js new file mode 100644 index 0000000000..3cadd1bdb1 --- /dev/null +++ b/src/app/components/swap-panel-api.js @@ -0,0 +1,26 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +const EventManager = remixLib.EventManager + +class SwapPanelApi { + constructor (swapPanelComponent) { + this.component = swapPanelComponent + } + + /* + viewTitle: string + content: DOM element + */ + addView(viewTitle, content) { + // add the DOM to the swappanel + this.component.addView(viewTitle, contents) + } +} + + +module.exports = SwapPanelApi diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js new file mode 100644 index 0000000000..bb6c213e09 --- /dev/null +++ b/src/app/components/swap-panel-component.js @@ -0,0 +1,57 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +const EventManager = remixLib.EventManager + +class SwapPanelComponent { + constructor () { + } + + showContent (moduleName) { + // hiding the current view and display the `moduleName` + } + + addView (title, content) { + // add the DOM to the swappanel + } + + render () { + var self = this + + var view = yo` +
+
+

Plugin 1

+
  • Some Text
+
+
+

Plugin 2

+
  • Some Text
+
+
+

Plugin 3

+
  • Some Text
+
+
+ ` + } +} + +module.exports = SwapPanelComponent + +const css = csjs` + .plugins { + width : 300px; + } + .plugItIn { + display : none; + } + .plugItIn.active { + display :block; + } + .clearFunds { background-color: lightblue; } +` diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js new file mode 100644 index 0000000000..ec4438d734 --- /dev/null +++ b/src/app/components/vertical-icons-api.js @@ -0,0 +1,23 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +// API +class VerticalIconsApi { + + constructor(verticalIconsComponent) { + this.component = verticalIconsComponent + } + + addIcon(icon) { + this.component.event.trigger('addIcon', icon) + } + + removeIcon(icon) { + this.component.event.trigger('removeIcon', icon) + } +} +module.exports = VerticalIconsApi diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js new file mode 100644 index 0000000000..57e375272f --- /dev/null +++ b/src/app/components/vertical-icons-component.js @@ -0,0 +1,39 @@ + +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + + // Component + class VerticalIconComponent { + + constructor(appManager) { + this.appManager = appManager + appManager.event.register('activated', (item) => { + this.addIcon(item) + }) + appManager.event.register('deactivated', (item) => { + this.removeIcon(item) + }) + } + + addIcon (item) { + + } + + removeIcon (item) { + + } + + render() { + yo` +
+

example

+
+ ` + } + } + + module.exports = VerticalIconComponent diff --git a/src/app/panels/left-icon-panel.js b/src/app/panels/left-icon-panel.js new file mode 100644 index 0000000000..10601dc9da --- /dev/null +++ b/src/app/panels/left-icon-panel.js @@ -0,0 +1,183 @@ +const yo = require('yo-yo') +const csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +var globalRegistry = require('../../global/registry') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() +// const PluginManager = require('../plugin/pluginManager') +// const TabbedMenu = require('../tabs/tabbed-menu') +// const CompileTab = require('../tabs/compile-tab') +// const SettingsTab = require('../tabs/settings-tab') +// const AnalysisTab = require('../tabs/analysis-tab') +// const DebuggerTab = require('../tabs/debugger-tab') +// const SupportTab = require('../tabs/support-tab') +// const PluginTab = require('../tabs/plugin-tab') +// const TestTab = require('../tabs/test-tab') +// const RunTab = require('../tabs/run-tab') +// const DraggableContent = require('../ui/draggableContent') + +const EventManager = remixLib.EventManager + +// var async = require('async') + +// var tooltip = require('../ui/tooltip') + +// var styleGuide = require('../ui/styles-guide/theme-chooser') + +// var css = require('./styles/file-panel-styles') + +// var canUpload = window.File || window.FileReader || window.FileList || window.Blob +// var ghostbar = yo`
` + +/* + Overview of APIs: + * fileManager: @args fileProviders (browser, shared-folder, swarm, github, etc ...) & config & editor + - listen on browser & localhost file provider (`fileRenamed` & `fileRemoved`) + - update the tabs, switchFile + - trigger `currentFileChanged` + - set the current file in the config + * fileProvider: currently browser, swarm, localhost, github, gist + - link to backend + - provide properties `type`, `readonly` + - provide API `resolveDirectory`, `remove`, `exists`, `rename`, `get`, `set` + - trigger `fileExternallyChanged`, `fileRemoved`, `fileRenamed`, `fileRenamedError`, `fileAdded` + * file-explorer: treeview @args fileProvider + - listen on events triggered by fileProvider + - call fileProvider API +*/ + +module.exports = class LeftIconPanel { + constructor (localRegistry) { + const self = this + self._components = {} + self._components.registry = localRegistry || globalRegistry + + self._components.registry.put({api: this, name: 'lefticonpanel'}) + self.event = new EventManager() + self._view = { + element: null, + tabbedMenu: null, + tabbedMenuViewport: null, + dragbar: null + } + + self.plugins = [ + {type: 'fileManager', displayName: 'File Manger', icon: 'fa fa-files-o fa-2x'}, + {type: 'pluginManager', displayName: 'Plugin Manger', icon: 'fa fa-puzzle-piece fa-2x'}, + {type: 'settings', displayName: 'setting', icon: 'fa fa-cog fa-2x'} + ] + } + + + swapPlugin (name) { + console.log(name) + } + + render () { + const self = this + // if (self._view.element) return self._view.element + // return self._view.element + return yo` +
+
    + ${self.plugins.map(function (pi) { + return yo`
  • + { self.swapPlugin(pi.type) }} style="size: 24px;" class="${pi.icon} ${css.plugin}"> +
  • ` + }) + } +
+
+ ` + } + + init () { + // @TODO: init is for resizable drag bar only and should be refactored in the future + const self = this + const limit = 60 + self._view.dragbar.addEventListener('mousedown', mousedown) + const ghostbar = yo`
` + function mousedown (event) { + event.preventDefault() + if (event.which === 1) { + moveGhostbar(event) + document.body.appendChild(ghostbar) + document.addEventListener('mousemove', moveGhostbar) + document.addEventListener('mouseup', removeGhostbar) + document.addEventListener('keydown', cancelGhostbar) + } + } + function cancelGhostbar (event) { + if (event.keyCode === 27) { + document.body.removeChild(ghostbar) + document.removeEventListener('mousemove', moveGhostbar) + document.removeEventListener('mouseup', removeGhostbar) + document.removeEventListener('keydown', cancelGhostbar) + } + } + function getPosition (event) { + const lhp = window['filepanel'].offsetWidth + const max = document.body.offsetWidth - limit + var newpos = (event.pageX > max) ? max : event.pageX + newpos = (newpos > (lhp + limit)) ? newpos : lhp + limit + return newpos + } + function moveGhostbar (event) { // @NOTE VERTICAL ghostbar + ghostbar.style.left = getPosition(event) + 'px' + } + function removeGhostbar (event) { + document.body.removeChild(ghostbar) + document.removeEventListener('mousemove', moveGhostbar) + document.removeEventListener('mouseup', removeGhostbar) + document.removeEventListener('keydown', cancelGhostbar) + self.event.trigger('resize', [document.body.offsetWidth - getPosition(event)]) + } + } +} + +const css = csjs` + .lefticonpanel { + display : flex; + flex-direction : column; + top : 0; + right : 0; + bottom : 0; + box-sizing : border-box; + overflow : hidden; + height : 100%; + } + .header { + height : 100%; + } + .dragbar { + position : absolute; + width : 0.5em; + top : 3em; + bottom : 0; + cursor : col-resize; + z-index : 999; + border-left : 2px solid ${styles.rightPanel.bar_Dragging}; + } + .ghostbar { + width : 3px; + background-color : ${styles.rightPanel.bar_Ghost}; + opacity : 0.5; + position : absolute; + cursor : col-resize; + z-index : 9999; + top : 0; + bottom : 0; + } + i.plugin { + cursor : pointer; + } + .container ul { + margin-top : 10px; + } + .container ul li { + text-align : center; + margin-top : 10px; + } +` From 7aee52fc88b03186f10e0fdd4eb4223695b51f4e Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Thu, 3 Jan 2019 15:28:26 +0100 Subject: [PATCH 002/636] slight update of code from our conversation --- src/app.js | 2 +- src/app/components/plugin-manager-component.js | 9 +++++++-- src/app/components/swap-panel-api.js | 7 ++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app.js b/src/app.js index dc8893a67e..4052771094 100644 --- a/src/app.js +++ b/src/app.js @@ -445,7 +445,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org type: 'solidityCompile', methods: [], } - appManager.addPlugin({json: compileTabProfile, api: compileTab}) + appManager.addPlugin({json: compileTabProfile, api: new InternalModule(compileTab) }) const testTab = new TestTab(self._components.registry, compileTab) const testTabProfile = { diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 59de442953..85d62a46c1 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -25,11 +25,15 @@ class PluginManagerComponent { } _activate(item) { - this.appManager.activate(item) + this.event.emit('activation', item) } _deactivate(item) { - this.appManager.deactivate(item) + this.event.emit('deactivation', item) + } + + _addPlugin(url){ + this.event.emit('plugin loading', url) } renderItem (item) { @@ -42,6 +46,7 @@ class PluginManagerComponent {
+
- +
` } } -module.exports = SwapPanelComponent +module.exports = PluginManagerComponent const css = csjs` .plugins { diff --git a/src/app/components/plugin-manager-proxy.js b/src/app/components/plugin-manager-proxy.js new file mode 100644 index 0000000000..f4849aa534 --- /dev/null +++ b/src/app/components/plugin-manager-proxy.js @@ -0,0 +1,24 @@ +var yo = require('yo-yo') + +var registry = require('../../global/registry') + +const CompilerAbstract = require('../compiler/compiler-abstract') + +const EventManager = require('remix-lib').EventManager + +class PluginManagerProxy { + + constructor () { + this.event = new EventManager + } + + register (mod, instance) { + instance.event.on('compilationFinished', (file, source, languageVersion, data) => { + registry.get('compilersartefacts').api['__last'] = new CompilerAbstract(languageVersion, data, source) + this.event.trigger('sendCompilationResult', [file, source, languageVersion, data]) + }) + } + +} + +module.exports = PluginManagerProxy diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index b09809c98c..376f016f10 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -5,25 +5,30 @@ const remixLib = require('remix-lib') const styleguide = require('../ui/styles-guide/theme-chooser') const styles = styleguide.chooser() -const EventManager = remixLib.EventManager +const EventEmmitter = require('events') class SwapPanelApi { - constructor (swapPanelComponent, pluginManagerApi) { + constructor (swapPanelComponent, verticalIconsComponent, pluginManagerComponent) { this.component = swapPanelComponent + verticalIconsComponent.event.on('showContent', (moduleName) => { + this.component.showContent(moduleName) + }) + pluginManagerComponent.event.on('internalActivated', (mod, content) => { + this.add(mod.name, content) + }) } /* - viewTitle: string content: DOM element + by appManager */ - addView(viewTitle, content) { + add (moduleName, content) { // add the DOM to the swappanel - this.component.addView(viewTitle, contents) + return this.component.add(moduleName, content) } - activate() { - this.event.emit(activated) - this.pluginManagerApi.activated(this.type) + reference (modulename, domElement) { + this.nodes[modulename] = domElement } } diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index bb6c213e09..c10bfbe715 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -5,39 +5,40 @@ const remixLib = require('remix-lib') const styleguide = require('../ui/styles-guide/theme-chooser') const styles = styleguide.chooser() -const EventManager = remixLib.EventManager - class SwapPanelComponent { constructor () { + // list of contents + this.contents = {} + // name of the current displayed content + this.currentNode } showContent (moduleName) { // hiding the current view and display the `moduleName` + if (this.contents[moduleName]) { + this.contents[moduleName].style.display = 'block' + if (this.currentNode) { + this.contents[this.currentNode].style.display = 'none' + } + this.currentNode = moduleName + return + } + console.log(`${moduleName} not found`) } - addView (title, content) { - // add the DOM to the swappanel - } + + add (moduleName, content) { + this.contents[moduleName] = yo`
${content}
` + this.view.appendChild(this.contents[moduleName]) + this.showContent(moduleName) + } render () { - var self = this - - var view = yo` + this.view = yo`
-
-

Plugin 1

-
  • Some Text
-
-
-

Plugin 2

-
  • Some Text
-
-
-

Plugin 3

-
  • Some Text
-
` + return this.view } } @@ -45,7 +46,6 @@ module.exports = SwapPanelComponent const css = csjs` .plugins { - width : 300px; } .plugItIn { display : none; diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index a11d8a43a3..3cb69883d5 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -8,17 +8,9 @@ const styles = styleguide.chooser() // API class VerticalIconsApi { - constructor(verticalIconsComponent, pluginManagerApi) { - pluginManagerApi.event.on('activate', (module) => verticalIconsComponent.addIcon(module) ) + constructor(verticalIconsComponent, pluginManagerComponent) { this.component = verticalIconsComponent - } - - addIcon(icon) { - this.component.event.trigger('addIcon', icon) - } - - removeIcon(icon) { - this.component.event.trigger('removeIcon', icon) - } + pluginManagerComponent.event.on('internalActivated', (mod, content) => verticalIconsComponent.addIcon(mod) ) + } } module.exports = VerticalIconsApi diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index 57e375272f..3364da36e9 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -5,34 +5,39 @@ const remixLib = require('remix-lib') const styleguide = require('../ui/styles-guide/theme-chooser') const styles = styleguide.chooser() +const EventEmmitter = require('events') // Component class VerticalIconComponent { - constructor(appManager) { - this.appManager = appManager - appManager.event.register('activated', (item) => { - this.addIcon(item) - }) - appManager.event.register('deactivated', (item) => { - this.removeIcon(item) - }) + constructor() { + this.event = new EventEmmitter } - addIcon (item) { - + addIcon (mod) { + let self = this + this.view.appendChild(yo`
{ self._iconClick(mod.name)}} title=${mod.name}>${mod.name}
`) } removeIcon (item) { } + select (name) { + this.event.emit('showContent', name) + } + + _iconClick (name) { + // called when an icon has been clicked + this.event.emit('showContent', name) + } + render() { - yo` -
-

example

+ this.view = yo` +
` + return this.view } } diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 8c4b2ef55d..6906222f01 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -244,12 +244,10 @@ class EditorPanel { function toggleLHP (event) { this.children[0].classList.toggle('fa-angle-double-right') this.children[0].classList.toggle('fa-angle-double-left') - self.event.trigger('resize', ['left']) } function toggleRHP (event) { this.children[0].classList.toggle('fa-angle-double-right') this.children[0].classList.toggle('fa-angle-double-left') - self.event.trigger('resize', ['right']) } function increase () { self._components.editor.editorFontSize(1) } function decrease () { self._components.editor.editorFontSize(-1) } diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index a1586dd56b..49433f1065 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -263,7 +263,6 @@ function filepanel (localRegistry) { document.removeEventListener('mousemove', moveGhostbar) document.removeEventListener('mouseup', removeGhostbar) document.removeEventListener('keydown', cancelGhostbar) - self.event.trigger('resize', [getPosition(event)]) } function createNewFile () { diff --git a/src/app/panels/left-icon-panel.js b/src/app/panels/left-icon-panel.js index 10601dc9da..c68a84235f 100644 --- a/src/app/panels/left-icon-panel.js +++ b/src/app/panels/left-icon-panel.js @@ -132,7 +132,6 @@ module.exports = class LeftIconPanel { document.removeEventListener('mousemove', moveGhostbar) document.removeEventListener('mouseup', removeGhostbar) document.removeEventListener('keydown', cancelGhostbar) - self.event.trigger('resize', [document.body.offsetWidth - getPosition(event)]) } } } diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js deleted file mode 100644 index b995c77d73..0000000000 --- a/src/app/panels/righthand-panel.js +++ /dev/null @@ -1,161 +0,0 @@ -const yo = require('yo-yo') -const csjs = require('csjs-inject') -const EventManager = require('../../lib/events') - -var globalRegistry = require('../../global/registry') - -const styleguide = require('../ui/styles-guide/theme-chooser') -const TabbedMenu = require('../tabs/tabbed-menu') -const PluginTab = require('../tabs/plugin-tab') -const DraggableContent = require('../ui/draggableContent') - -const styles = styleguide.chooser() - -module.exports = class RighthandPanel { - constructor ({pluginManager, tabs}, localRegistry) { - const self = this - self._components = {} - self._components.registry = localRegistry || globalRegistry - self._components.registry.put({api: this, name: 'righthandpanel'}) - self.event = new EventManager() - self._view = { - element: null, - tabbedMenu: null, - tabbedMenuViewport: null, - dragbar: null - } - - var tabbedMenu = new TabbedMenu(self._components.registry) - - self._components = { - tabbedMenu: tabbedMenu, - tabs - } - - self._components.tabs.settings.event.register('plugin-loadRequest', json => { - self.loadPlugin(json) - }) - - self.loadPlugin = function (json) { - var modal = new DraggableContent(() => { - pluginManager.unregister(json) - }) - var tab = new PluginTab(json) - var content = tab.render() - document.querySelector('body').appendChild(modal.render(json.title, json.url, content)) - pluginManager.register(json, modal, content) - } - - self._view.dragbar = yo`
` - self._view.element = yo` -
- ${self._view.dragbar} - -
` - - const { compile, run, settings, analysis, debug, support, test } = tabs - self._components.tabbedMenu.addTab('Compile', 'compileView', compile.render()) - self._components.tabbedMenu.addTab('Run', 'runView', run.render()) - self._components.tabbedMenu.addTab('Analysis', 'staticanalysisView', analysis.render()) - self._components.tabbedMenu.addTab('Testing', 'testView', test.render()) - self._components.tabbedMenu.addTab('Debugger', 'debugView', debug.render()) - self._components.tabbedMenu.addTab('Settings', 'settingsView', settings.render()) - self._components.tabbedMenu.addTab('Support', 'supportView', support.render()) - self._components.tabbedMenu.selectTabByTitle('Compile') - } - - render () { - const self = this - if (self._view.element) return self._view.element - return self._view.element - } - - debugger () { - return this._components.tabs.debug.debugger() - } - - focusOn (x) { - if (this._components.tabbedMenu) this._components.tabbedMenu.selectTabByClassName(x) - } - - init () { - // @TODO: init is for resizable drag bar only and should be refactored in the future - const self = this - const limit = 60 - self._view.dragbar.addEventListener('mousedown', mousedown) - const ghostbar = yo`
` - function mousedown (event) { - event.preventDefault() - if (event.which === 1) { - moveGhostbar(event) - document.body.appendChild(ghostbar) - document.addEventListener('mousemove', moveGhostbar) - document.addEventListener('mouseup', removeGhostbar) - document.addEventListener('keydown', cancelGhostbar) - } - } - function cancelGhostbar (event) { - if (event.keyCode === 27) { - document.body.removeChild(ghostbar) - document.removeEventListener('mousemove', moveGhostbar) - document.removeEventListener('mouseup', removeGhostbar) - document.removeEventListener('keydown', cancelGhostbar) - } - } - function getPosition (event) { - const lhp = window['filepanel'].offsetWidth - const max = document.body.offsetWidth - limit - var newpos = (event.pageX > max) ? max : event.pageX - newpos = (newpos > (lhp + limit)) ? newpos : lhp + limit - return newpos - } - function moveGhostbar (event) { // @NOTE VERTICAL ghostbar - ghostbar.style.left = getPosition(event) + 'px' - } - function removeGhostbar (event) { - document.body.removeChild(ghostbar) - document.removeEventListener('mousemove', moveGhostbar) - document.removeEventListener('mouseup', removeGhostbar) - document.removeEventListener('keydown', cancelGhostbar) - self.event.trigger('resize', [document.body.offsetWidth - getPosition(event)]) - } - } -} - -const css = csjs` - .righthandpanel { - display : flex; - flex-direction : column; - top : 0; - right : 0; - bottom : 0; - box-sizing : border-box; - overflow : hidden; - height : 100%; - } - .header { - height : 100%; - } - .dragbar { - position : absolute; - width : 0.5em; - top : 3em; - bottom : 0; - cursor : col-resize; - z-index : 999; - border-left : 2px solid ${styles.rightPanel.bar_Dragging}; - } - .ghostbar { - width : 3px; - background-color : ${styles.rightPanel.bar_Ghost}; - opacity : 0.5; - position : absolute; - cursor : col-resize; - z-index : 9999; - top : 0; - bottom : 0; - } -` diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index f5b9aa5365..e2fba7c881 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -1,4 +1,5 @@ /* global Worker */ +const EventEmitter = require('events') const async = require('async') const $ = require('jquery') const yo = require('yo-yo') @@ -25,6 +26,7 @@ const styles = styleGuide.chooser() module.exports = class CompileTab { constructor (localRegistry) { const self = this + self.event = new EventEmitter() self._view = { el: null, autoCompile: null, @@ -115,9 +117,11 @@ module.exports = class CompileTab { self._view.compileIcon.setAttribute('title', '') }) self._components.compiler.event.register('compilationFinished', function finish (success, data, source) { + if (success) { + // forwarding the event to the appManager infra + self.event.emit('compilationFinished', null, source, 'Solidity', data) + } if (self._view.compileIcon) { - const compileTab = document.querySelector('.compileView') - compileTab.style.color = styles.colors.black self._view.compileIcon.style.color = styles.colors.black self._view.compileIcon.classList.remove(`${css.spinningIcon}`) self._view.compileIcon.classList.remove(`${css.bouncingIcon}`) @@ -129,7 +133,6 @@ module.exports = class CompileTab { self._view.contractNames.innerHTML = '' if (success) { // TODO consider using compile tab as a proper module instead of just forwarding event - self._deps.pluginManager.receivedDataFrom('sendCompilationResult', 'solidity-compiler', [data.target, source, self.data.selectedVersion, data]) self._view.contractNames.removeAttribute('disabled') self._components.compiler.visitContracts(contract => { self.data.contractsDetails[contract.name] = parseContracts(contract.name, contract.object, self._components.compiler.getSource(contract.file)) @@ -139,22 +142,16 @@ module.exports = class CompileTab { } else { self._view.contractNames.setAttribute('disabled', true) } - // hightlight the tab if error - if (success) document.querySelector('.compileView').style.color = '' // @TODO: compileView tab - else document.querySelector('.compileView').style.color = styles.colors.red // @TODO: compileView tab - // display warning error if any var error = false if (data['error']) { error = true self._deps.renderer.error(data['error'].formattedMessage, self._view.errorContainer, {type: data['error'].severity || 'error'}) if (data['error'].mode === 'panic') { - /* return modalDialogCustom.alert(yo`
The compiler returned with the following internal error:
${data['error'].formattedMessage}.
The compiler might be in a non-sane state, please be careful and do not use further compilation data to deploy to mainnet. It is heavily recommended to use another browser not affected by this issue (Firefox is known to not be affected).

Please join remix gitter channel for more information.
`) - */ } } if (data.errors && data.errors.length) { @@ -185,6 +182,13 @@ module.exports = class CompileTab { } }) } + profile () { + return { + type: 'solidityCompile', + methods: {}, + events: ['compilationFinished'] + } + } addWarning (msg, settings) { const self = this self._deps.renderer.error(msg, self._view.errorContainerHead, settings) diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index b8f38ed79c..525cd33c39 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -205,7 +205,6 @@ module.exports = class SettingsTab { const css = csjs` .settingsTabView { padding: 2%; - display: flex; } .info { ${styles.rightPanel.settingsTab.box_SolidityVersionInfo}; diff --git a/src/app/ui/renderer.js b/src/app/ui/renderer.js index f90e756971..b5b968c72c 100644 --- a/src/app/ui/renderer.js +++ b/src/app/ui/renderer.js @@ -16,7 +16,6 @@ function Renderer (localRegistry) { self._components.registry = localRegistry || globlalRegistry // dependencies self._deps = { - editor: self._components.registry.get('editor').api, fileManager: self._components.registry.get('filemanager').api, config: self._components.registry.get('config').api } @@ -27,13 +26,15 @@ function Renderer (localRegistry) { Renderer.prototype._error = function (file, error) { const self = this + const editor = self._components.registry.get('editor').api if (file === self._deps.config.get('currentFile')) { - self._deps.editor.addAnnotation(error) + editor.addAnnotation(error) } } Renderer.prototype._errorClick = function (errFile, errLine, errCol) { const self = this + const editor = self._components.registry.get('editor').api if (errFile !== self._deps.config.get('currentFile')) { // TODO: refactor with this._components.contextView.jumpTo var provider = self._deps.fileManager.fileProviderOf(errFile) @@ -41,11 +42,11 @@ Renderer.prototype._errorClick = function (errFile, errLine, errCol) { provider.exists(errFile, (error, exist) => { if (error) return console.log(error) self._deps.fileManager.switchFile(errFile) - self._deps.editor.gotoLine(errLine, errCol) + editor.gotoLine(errLine, errCol) }) } } else { - self._deps.editor.gotoLine(errLine, errCol) + editor.gotoLine(errLine, errCol) } } From 33da4e0d8ad0c0983efa22a7e846f8c8528f963f Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 7 Jan 2019 15:04:39 +0100 Subject: [PATCH 006/636] add minimal API for plugin --- package.json | 1 + src/app.js | 81 ++++++++++++++++--- .../components/plugin-manager-component.js | 35 +++++--- src/app/components/swap-panel-api.js | 2 +- src/app/components/vertical-icons-api.js | 2 +- src/app/editor/SourceHighlighters.js | 35 ++++++++ src/app/editor/editor.js | 3 + src/app/files/browser-files-tree.js | 7 ++ src/app/files/fileManager.js | 49 +++++++++++ src/app/panels/editor-panel.js | 48 +++++------ src/app/tabs/compile-tab.js | 5 +- src/universal-dapp.js | 36 +++++++++ 12 files changed, 257 insertions(+), 47 deletions(-) create mode 100644 src/app/editor/SourceHighlighters.js diff --git a/package.json b/package.json index c7fbb313fc..3b186abf8d 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "csslint": "^1.0.2", "deep-equal": "^1.0.1", "ethereumjs-util": "^5.1.2", + "events": "^3.0.0", "execr": "^1.0.1", "exorcist": "^0.4.0", "fast-async": "6.3.1", diff --git a/src/app.js b/src/app.js index 88ce6c1211..efc62d8c9b 100644 --- a/src/app.js +++ b/src/app.js @@ -6,6 +6,7 @@ var async = require('async') var request = require('request') var remixLib = require('remix-lib') var EventManager = require('./lib/events') +var EventEmitter = require('events') var registry = require('./global/registry') var UniversalDApp = require('./universal-dapp.js') @@ -203,6 +204,13 @@ class App { var self = this run.apply(self) } + + profile () { + return { + type: 'app', + methods: ['getExecutionContextProvider', 'getProviderEndpoint', 'detectNetWork', 'addProvider', 'removeProvider'] + } + } render () { var self = this @@ -283,6 +291,34 @@ class App { if (callback) callback(error) }) } + + getExecutionContextProvider (cb) { + cb(null, executionContext.getProvider()) + } + + getProviderEndpoint (cb) { + if (executionContext.getProvider() === 'web3') { + cb(null, executionContext.web3().currentProvider.host) + } else { + cb('no endpoint: current provider is either injected or vm') + } + } + + detectNetWork (cb) { + executionContext.detectNetwork((error, network) => { + cb(error, network) + }) + } + + addProvider (name, url, cb) { + executionContext.addProvider({ name, url }) + cb() + } + + removeProvider (name, cb) { + executionContext.removeProvider(name) + cb() + } } module.exports = App @@ -359,33 +395,60 @@ Please make a backup of your contracts and start using http://remix.ethereum.org }) registry.put({api: eventsDecoder, name: 'eventsdecoder'}) + /* + that proxy is used by appManager to broadcast new transaction event + */ + const txListenerModuleProxy = { + event: new EventEmitter(), + profile() { + return { + type: 'txListener', + events: ['newTransaction'] + } + } + } + txlistener.event.register('newTransaction', (tx) => { + txListenerModule.event.emit('newTransaction', tx) + }) + txlistener.startListening() // TODO: There are still a lot of dep between editorpanel and filemanager - // ----------------- editor panel ---------------------- - self._components.editorpanel = new EditorPanel() - registry.put({ api: self._components.editorpanel, name: 'editorpanel' }) - // ----------------- file manager ---------------------------- self._components.fileManager = new FileManager() var fileManager = self._components.fileManager registry.put({api: fileManager, name: 'filemanager'}) + // ----------------- editor panel ---------------------- + self._components.editorpanel = new EditorPanel() + registry.put({ api: self._components.editorpanel, name: 'editorpanel' }) + // ----------------- Renderer ----------------- var renderer = new Renderer() registry.put({api: renderer, name: 'renderer'}) // ----------------- app manager ---------------------------- - const PluginManagerProfile = { - type: 'pluginManager', - methods: [] - } + + /* + TODOs: + - for each activated plugin, + an internal module (associated only with the plugin) should be created for accessing specific part of the UI. detail to be discussed + - the current API is not optimal. For instance methods of `app` only refers to `executionContext`, wich does not make really sense. + */ const appManager = new AppManager({modules: [],plugins : []}) const swapPanelComponent = new SwapPanelComponent() - const pluginManagerComponent = new PluginManagerComponent() + const pluginManagerComponent = new PluginManagerComponent( + { + app: this, + udapp: udapp, + fileManager: fileManager, + sourceHighlighters: registry.get('editor').api.sourceHighlighters, + config: self._components.filesProviders['config'], + txListener: txListenerModuleProxy + }) registry.put({api: pluginManagerComponent.proxy(), name: 'pluginmanager'}) self._components.editorpanel.init() diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 08ede7bc40..1ca95bf82f 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -21,11 +21,20 @@ const EventEmitter = require ('events') class PluginManagerComponent { - constructor () { + constructor ({ app, udapp, fileManager, sourceHighlighters, config, txListener }) { this.event = new EventEmitter() this.modulesDefinition = { - 'FilePanel': { name: 'FilePanel', Type: FilePanel, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwb2x5bGluZSBmaWxsPSJub25lIiBwb2ludHM9IjQ0LDIxIDQ0LDQ5IDYsNDkgICA2LDIxICIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBvbHlsaW5lIGZpbGw9Im5vbmUiIHBvaW50cz0iMTksNDkgMTksMjggMzEsMjggICAzMSw0OSAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjxwb2x5Z29uIHBvaW50cz0iMzUsNSAzNSw4LjAxNiAzNywxMC4wOTQgMzcsNyAzOSw3IDM5LDEyLjIwMyA0MSwxNC4yNjYgNDEsNSAiLz48cG9seWxpbmUgZmlsbD0ibm9uZSIgcG9pbnRzPSIgIDEuMTEsMjUuOTQyIDI1LDEuMDUzIDQ4Ljg5LDI1Ljk0MyAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' }, + // service module. They can be seen as daemon + // they usually don't have UI and only represent the minimal API a plugins can access. + 'App': { name: 'App', target: app }, + 'Udapp': { name: 'Udapp', target: udapp }, + 'FileManager': { name: 'FileManager', target: fileManager }, + 'SourceHighlighters': { name: 'SourceHighlighters', target: sourceHighlighters }, + 'Config': { name: 'Config', target: config }, + 'TxListener': { name: 'TxListener', target: txListener }, + // internal components. They are mostly views, they don't provide external API for plugins 'Solidity Compile': { name: 'Solidity Compile', class: 'evm-compiler', Type: CompileTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkve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jbGUgY3g9IjQ4IiBjeT0iNSIgcj0iMiIvPjxjaXJjbGUgY3g9IjIiIGN5PSIzOSIgcj0iMiIvPjxjaXJjbGUgY3g9IjE1IiBjeT0iNDEiIHI9IjIiLz48Y2lyY2xlIGN4PSIyNSIgY3k9IjMzIiByPSIyIi8+PGNpcmNsZSBjeD0iMzUiIGN5PSI0MyIgcj0iMiIvPjxjaXJjbGUgY3g9IjQ4IiBjeT0iMzEiIHI9IjIiLz48cG9seWxpbmUgZmlsbD0ibm9uZSIgcG9pbnRzPSIyLDI1IDE1LDE5IDI1LDExICAgMzUsMTcgNDgsNSAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjxwb2x5bGluZSBmaWxsPSJub25lIiBwb2ludHM9IjIsMzkgMTUsNDEgMjUsMzMgICAzNSw0MyA0OCwzMSAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' }, @@ -45,6 +54,13 @@ class PluginManagerComponent { } initDefault () { + this.activateInternal('App') + this.activateInternal('Udapp') + this.activateInternal('FileManager') + this.activateInternal('SourceHighlighters') + this.activateInternal('Config') + this.activateInternal('TxListener') + this.activateInternal('FilePanel') this.activateInternal('Solidity Compile') this.activateInternal('Run') @@ -63,13 +79,12 @@ class PluginManagerComponent { ` } - activatePlugin (name, api) { - let profile = { json: Plugin1Profile, api: pluginManagerApi } + activatePlugin (jsonProfile, api) { + let profile = { json: jsonProfile, api } let plugin = new Plugin(profile, api) this.appManager.addPlugin(plugin) - // Plugin1Profile.location - // mainpanel or swappanel or bottom-bar - // plugin.render() // plugin.create() + this.event.emit('displayableModuleActivated', jsonProfile, plugin.render()) + this.activated[jsonProfile.name] = plugin } activateInternal (name) { @@ -78,12 +93,14 @@ class PluginManagerComponent { if (mod.dep) dep = this.activateInternal(mod.dep) let instance = mod.target if (!instance && mod.Type) instance = new mod.Type(registry, dep) - if (!instance) return console.log('PluginManagerComponent: no Type or instance to add') + if (!instance) return console.log(`PluginManagerComponent: no Type or instance to add: ${JSON.stringify(mod)}`) registry.put({api: instance, name: mod.name.toLocaleLowerCase()}) if (instance.profile && typeof instance.profile === 'function') { this.event.emit('requestActivation', instance.profile(), instance) } - this.event.emit('internalActivated', mod, instance.render()) + if (mod.icon && instance.render && typeof instance.render === 'function') { + this.event.emit('requestContainer', mod, instance.render()) + } // if of type evm-compiler, we forward to the internal components if (mod.class === 'evm-compiler') { this.data.proxy.register(mod, instance) diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index 376f016f10..24cbd40ce5 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -13,7 +13,7 @@ class SwapPanelApi { verticalIconsComponent.event.on('showContent', (moduleName) => { this.component.showContent(moduleName) }) - pluginManagerComponent.event.on('internalActivated', (mod, content) => { + pluginManagerComponent.event.on('requestContainer', (mod, content) => { this.add(mod.name, content) }) } diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index 3cb69883d5..0ddd3c21bc 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -10,7 +10,7 @@ class VerticalIconsApi { constructor(verticalIconsComponent, pluginManagerComponent) { this.component = verticalIconsComponent - pluginManagerComponent.event.on('internalActivated', (mod, content) => verticalIconsComponent.addIcon(mod) ) + pluginManagerComponent.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod) ) } } module.exports = VerticalIconsApi diff --git a/src/app/editor/SourceHighlighters.js b/src/app/editor/SourceHighlighters.js new file mode 100644 index 0000000000..e5eaa3d92b --- /dev/null +++ b/src/app/editor/SourceHighlighters.js @@ -0,0 +1,35 @@ +'use strict' +var SourceHighlighter = require('./sourceHighlighter') + +module.exports = class SourceHighlighters { + + constructor () { + this.highlighters = {} + } + + profile () { + return { + type: 'sourcehighlighter', + methods: ['highlight', 'discardHighlight'] + } + } + + // TODO what to do with mod? + highlight (mod, lineColumnPos, filePath, hexColor, cb) { + var position + try { + position = JSON.parse(lineColumnPos) + } catch (e) { + return cb(e.message) + } + if (!highlighters[mod]) highlighters[mod] = new SourceHighlighter() + highlighters[mod].currentSourceLocation(null) + highlighters[mod].currentSourceLocationFromfileName(position, filePath, hexColor) + cb() + } + + discardHighlight (mod, cb) { + if (highlighters[mod]) highlighters[mod].currentSourceLocation(null) + cb() + } +} \ No newline at end of file diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index e2d27838c4..bdb9734a2a 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -7,6 +7,7 @@ var ace = require('brace') require('brace/theme/tomorrow_night_blue') var globalRegistry = require('../../global/registry') +const SourceHighlighters = require('./SourceHighlighters') var Range = ace.acequire('ace/range').Range require('brace/ext/language_tools') @@ -317,6 +318,8 @@ function Editor (opts = {}, localRegistry) { editor.commands.bindKeys({ 'ctrl-t': null }) editor.setShowPrintMargin(false) editor.resize(true) + + this.sourceHighlighters = new SourceHighlighters() } function editorOnChange (self) { diff --git a/src/app/files/browser-files-tree.js b/src/app/files/browser-files-tree.js index bc434e0561..b527d4cd71 100644 --- a/src/app/files/browser-files-tree.js +++ b/src/app/files/browser-files-tree.js @@ -130,6 +130,13 @@ function FilesTree (name, storage) { if (path[0] === '/') return path.substring(1) return path } + + this.profile = function () { + return { + type: this.type, + methods: ['get', 'set', 'remove'] + } + } } module.exports = FilesTree diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 5361093123..65b8d19cb2 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -2,6 +2,7 @@ var $ = require('jquery') var yo = require('yo-yo') +var EventEmitter = require ('events') var EventManager = require('../../lib/events') var globalRegistry = require('../../global/registry') var CompilerImport = require('../compiler/compiler-imports') @@ -15,6 +16,7 @@ class FileManager { constructor (localRegistry) { this.tabbedFiles = {} this.event = new EventManager() + this.nodeEvent = new EventEmitter() this._components = {} this._components.compilerImport = new CompilerImport() this._components.registry = localRegistry || globalRegistry @@ -42,6 +44,18 @@ class FileManager { self._deps.gistExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) self._deps.localhostExplorer.event.register('errored', (event) => { this.removeTabsOf(self._deps.localhostExplorer) }) self._deps.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(self._deps.localhostExplorer) }) + + self.event.register('currentFileChanged', (file, provider) => { + this.nodeEvent.emit('currentFileChanged', file) + }) + } + + profile () { + return { + type: 'fileManager', + methods: ['getFilesFromPath', 'getCurrentFile', 'getFile', 'setFile'], + events: ['currentFileChanged'] + } } fileRenamedEvent (oldName, newName, isFolder) { @@ -94,6 +108,41 @@ class FileManager { return path ? path[1] : null } + getCurrentFile (cb) { + var path = this.currentFile() + if (!path) { + cb('no file selected') + } else { + cb(null, path) + } + } + + getFile (path, cb) { + var provider = this.fileProviderOf(path) + if (provider) { + // TODO add approval to user for external plugin to get the content of the given `path` + provider.get(path, (error, content) => { + cb(error, content) + }) + } else { + cb(path + ' not available') + } + } + + setFile (path, content, cb) { + var provider = this.fileProviderOf(path) + if (provider) { + // TODO add approval to user for external plugin to set the content of the given `path` + provider.set(path, content, (error) => { + if (error) return cb(error) + this.syncEditor(path) + cb() + }) + } else { + cb(path + ' not available') + } + } + removeTabsOf (provider) { for (var tab in this.tabbedFiles) { if (this.fileProviderOf(tab).type === provider.type) { diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 6906222f01..6dc8f84467 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -15,9 +15,11 @@ var css = styles.css class EditorPanel { constructor (localRegistry) { var self = this + self.event = new EventManager() self._components = {} self._components.registry = localRegistry || globalRegistry - self.event = new EventManager() + self._components.editor = new Editor({}) + self._components.registry.put({api: self._components.editor, name: 'editor'}) } init () { var self = this @@ -38,32 +40,26 @@ class EditorPanel { } } self._view = {} - var editor = new Editor({}) - self._components.registry.put({api: editor, name: 'editor'}) - - var contextualListener = new ContextualListener({editor, pluginManager: self._deps.pluginManager}) - var contextView = new ContextView({contextualListener, editor}) + + var contextualListener = new ContextualListener({editor: self._components.editor, pluginManager: self._deps.pluginManager}) + var contextView = new ContextView({contextualListener, editor: self._components.editor}) - self._components = { - editor: editor, - contextualListener: contextualListener, - contextView: contextView, - // TODO list of compilers is always empty; should find a path to add plugin compiler here - terminal: new Terminal({ - udapp: self._deps.udapp, - compilers: {} - }, - { - getPosition: (event) => { - var limitUp = 36 - var limitDown = 20 - var height = window.innerHeight - var newpos = (event.pageY < limitUp) ? limitUp : event.pageY - newpos = (newpos < height - limitDown) ? newpos : height - limitDown - return newpos - } - }) - } + self._components.contextualListener = contextualListener + self._components.contextView = contextView + self._components.terminal = new Terminal({ + udapp: self._deps.udapp, + compilers: {} + }, + { + getPosition: (event) => { + var limitUp = 36 + var limitDown = 20 + var height = window.innerHeight + var newpos = (event.pageY < limitUp) ? limitUp : event.pageY + newpos = (newpos < height - limitDown) ? newpos : height - limitDown + return newpos + } + }) self._components.terminal.event.register('filterChanged', (type, value) => { this.event.trigger('terminalFilterChanged', [type, value]) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index e2fba7c881..262a78a4f1 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -182,10 +182,13 @@ module.exports = class CompileTab { } }) } + getCompilationResult (cb) { + cb(null, self._components.compiler.lastCompilationResult) + } profile () { return { type: 'solidityCompile', - methods: {}, + methods: ['getCompilationResult'], events: ['compilationFinished'] } } diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 7c77508a65..f15cb7d2b7 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -51,6 +51,13 @@ function UniversalDApp (opts, localRegistry) { self.resetEnvironment() } +UniversalDApp.prototype.profile = function () { + return { + type: 'udapp', + methods: ['runTestTx', 'getAccounts', 'createVMAccount'] + } +} + UniversalDApp.prototype.resetEnvironment = function () { this.accounts = {} if (executionContext.isVM()) { @@ -77,6 +84,7 @@ UniversalDApp.prototype.resetAPI = function (transactionContextAPI) { } UniversalDApp.prototype.createVMAccount = function (privateKey, balance, cb) { + if (executionContext.getProvider() !== 'vm') return cb('plugin API does not allow creating a new account through web3 connection. Only vm mode is allowed') this._addAccount(privateKey, balance) executionContext.vm().stateManager.cache.flush(function () {}) privateKey = Buffer.from(privateKey, 'hex') @@ -286,6 +294,34 @@ UniversalDApp.prototype.getInputs = function (funABI) { return txHelper.inputParametersDeclarationToString(funABI.inputs) } +/** + * This function send a tx only to javascript VM or testnet, will return an error for the mainnet + * SHOULD BE TAKEN CAREFULLY! + * + * @param {Object} tx - transaction. + * @param {Function} callback - callback. + */ +UniversalDApp.prototype.runTestTx = function (tx, cb) { + executionContext.detectNetwork((error, network) => { + if (error) return cb(error) + if (network.name === 'Main' && network.id === '1') { + return cb('It is not allowed to make this action against mainnet') + } + udapp.silentRunTx(tx, (error, result) => { + if (error) return cb(error) + cb(null, { + transactionHash: result.transactionHash, + status: result.result.status, + gasUsed: '0x' + result.result.gasUsed.toString('hex'), + error: result.result.vm.exceptionError, + return: result.result.vm.return ? '0x' + result.result.vm.return.toString('hex') : '0x', + createdAddress: result.result.createdAddress ? '0x' + result.result.createdAddress.toString('hex') : undefined + }) + }) + }) +} + + /** * This function send a tx without alerting the user (if mainnet or if gas estimation too high). * SHOULD BE TAKEN CAREFULLY! From 622ce311b389f45481f28c60f41b9c36e4f4b94e Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Wed, 9 Jan 2019 12:54:21 +0100 Subject: [PATCH 007/636] update with commented out code, errors for discussion and a question --- src/app.js | 34 +++---- src/app/components/plugin-manager-api.js | 24 ++--- .../components/plugin-manager-component.js | 86 +++++++++++------ src/app/components/plugin-manager-proxy.js | 4 +- src/app/components/swap-panel-api.js | 9 +- src/app/components/swap-panel-component.js | 11 +-- src/app/components/vertical-icons-api.js | 13 +-- .../components/vertical-icons-component.js | 92 +++++++++++-------- src/app/editor/SourceHighlighters.js | 50 +++++----- src/app/files/fileManager.js | 4 +- src/app/panels/editor-panel.js | 2 +- src/app/panels/left-icon-panel.js | 1 - src/universal-dapp.js | 1 - 13 files changed, 170 insertions(+), 161 deletions(-) diff --git a/src/app.js b/src/app.js index efc62d8c9b..dd36032dc0 100644 --- a/src/app.js +++ b/src/app.js @@ -39,12 +39,12 @@ const PluginManagerComponent = require('./app/components/plugin-manager-componen const PluginManagerApi = require('./app/components/plugin-manager-api') const VerticalIconsComponent = require('./app/components/vertical-icons-component') -const VerticalIconsApi = require('./app/components/vertical-icons-api') +// const VerticalIconsApi = require('./app/components/vertical-icons-api') const SwapPanelComponent = require('./app/components/swap-panel-component') -const SwapPanelApi = require('./app/components/swap-panel-api') +// const SwapPanelApi = require('./app/components/swap-panel-api') -const AppManager = require('remix-plugin').AppManager +// const AppManager = require('remix-plugin').AppManager var styleGuide = require('./app/ui/styles-guide/theme-chooser') var styles = styleGuide.chooser() @@ -178,7 +178,7 @@ class App { } } _adjustLayout (direction, delta) { - /*var self = this + /* var self = this var layout = self.data._layout[direction] if (layout) { if (delta === undefined) { @@ -211,7 +211,7 @@ class App { methods: ['getExecutionContextProvider', 'getProviderEndpoint', 'detectNetWork', 'addProvider', 'removeProvider'] } } - + render () { var self = this if (self._view.el) return self._view.el @@ -235,7 +235,7 @@ class App { ${''}
` - + self._view.el = yo`
${self._view.iconpanel} @@ -310,12 +310,12 @@ class App { }) } - addProvider (name, url, cb) { + addProvider (name, url, cb) { executionContext.addProvider({ name, url }) cb() } - removeProvider (name, cb) { + removeProvider (name, cb) { executionContext.removeProvider(name) cb() } @@ -400,7 +400,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org */ const txListenerModuleProxy = { event: new EventEmitter(), - profile() { + profile () { return { type: 'txListener', events: ['newTransaction'] @@ -427,21 +427,21 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // ----------------- Renderer ----------------- var renderer = new Renderer() registry.put({api: renderer, name: 'renderer'}) - + // ----------------- app manager ---------------------------- /* TODOs: - for each activated plugin, an internal module (associated only with the plugin) should be created for accessing specific part of the UI. detail to be discussed - - the current API is not optimal. For instance methods of `app` only refers to `executionContext`, wich does not make really sense. + - the current API is not optimal. For instance methods of `app` only refers to `executionContext`, wich does not make really sense. */ - const appManager = new AppManager({modules: [],plugins : []}) + // const appManager = new AppManager({modules: [], plugins: []}) const swapPanelComponent = new SwapPanelComponent() const pluginManagerComponent = new PluginManagerComponent( - { + { app: this, udapp: udapp, fileManager: fileManager, @@ -452,12 +452,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org registry.put({api: pluginManagerComponent.proxy(), name: 'pluginmanager'}) self._components.editorpanel.init() - self._components.fileManager.init() - + self._components.fileManager.init() + const verticalIconComponent = new VerticalIconsComponent() - const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, pluginManagerComponent) - const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, pluginManagerComponent) + // const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, pluginManagerComponent) + // const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, pluginManagerComponent) const pluginManagerAPI = new PluginManagerApi(pluginManagerComponent) self._view.mainpanel.appendChild(self._components.editorpanel.render()) diff --git a/src/app/components/plugin-manager-api.js b/src/app/components/plugin-manager-api.js index 865c0b3ce6..66acb32242 100644 --- a/src/app/components/plugin-manager-api.js +++ b/src/app/components/plugin-manager-api.js @@ -1,31 +1,19 @@ -var yo = require('yo-yo') -var csjs = require('csjs-inject') -const remixLib = require('remix-lib') - -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() +// const remixLib = require('remix-lib') class PluginManagerApi { constructor (pluginManagerComponent) { + this.component = pluginManagerComponent pluginManagerComponent.event.on('activation', (item) => this.event.emit('activation', item)) // listen by appManager pluginManagerComponent.event.on('deactivation', (item) => this.event.emit('deactivation', item)) // listen by appManager } - /* - function called by appManager - */ - addItem (item) { - // add to appManager and then render - this.renderItem(item) - } - init (data) { - for (var m in data.modules) { - this.renderItem(item) + for (var m in data.modules) { + this.renderItem(m) } - for (var m in data.plugins) { - this.renderItem(item) + for (var n in data.plugins) { + this.renderItem(n) } } } diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 1ca95bf82f..9f2b842639 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -12,12 +12,12 @@ const RunTab = require('../tabs/run-tab') var registry = require('../../global/registry') -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() +// const styleguide = require('../ui/styles-guide/theme-chooser') +// const styles = styleguide.chooser() const PluginManagerProxy = require('./plugin-manager-proxy') -const EventEmitter = require ('events') +const EventEmitter = require('events') class PluginManagerComponent { @@ -44,9 +44,13 @@ class PluginManagerComponent { 'Settings': { name: 'Settings', Type: SettingsTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00OSwyNy45NTR2LTZsLTcuMTQxLTEuMTY3ICBjLTAuNDIzLTEuNjkxLTEuMDg3LTMuMjgxLTEuOTYyLTQuNzM3bDQuMTYyLTUuOTMybC00LjI0My00LjI0MWwtNS44NTYsNC4yMWMtMS40Ni0wLjg4NC0zLjA2LTEuNTU4LTQuNzYzLTEuOTgybC0xLjI0NS03LjEwNmgtNiAgbC0xLjE1Niw3LjA4M2MtMS43MDQsMC40MTgtMy4zMTMsMS4wODMtNC43NzcsMS45NjNMMTAuMTgsNS44NzNsLTQuMjQzLDQuMjQxbDQuMTA3LDUuODc0Yy0wLjg4OCwxLjQ3LTEuNTYzLDMuMDc3LTEuOTkyLDQuNzkyICBMMSwyMS45NTR2Nmw3LjA0NCwxLjI0OWMwLjQyNSwxLjcxMSwxLjEwMSwzLjMxOCwxLjk5Miw0Ljc5bC00LjE2Myw1LjgyM2w0LjI0MSw0LjI0NWw1Ljg4MS00LjExOSAgYzEuNDY4LDAuODgyLDMuMDczLDEuNTUyLDQuNzc3LDEuOTczbDEuMTgsNy4wODdoNmwxLjI2MS03LjEwNWMxLjY5NS0wLjQzLDMuMjk3LTEuMTA1LDQuNzUxLTEuOTlsNS45MjIsNC4xNTVsNC4yNDItNC4yNDUgIGwtNC4yMjctNS44N2MwLjg3NS0xLjQ1NiwxLjUzOS0zLjA0OCwxLjk1OC00LjczOUw0OSwyNy45NTR6IE0yNSwzM2MtNC40MTgsMC04LTMuNTgyLTgtOHMzLjU4Mi04LDgtOHM4LDMuNTgyLDgsOFMyOS40MTgsMzMsMjUsMzMgIHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' } } this.activated = {} // list all activated modules + // this.activated = [] // list all activated modules this.plugins = [] this.data = {} this.data.proxy = new PluginManagerProxy() + + // This load the state from localstorage first then from the second parameter is nothing is found in localstorage + // this.store = Store.fromLocal('***', {}) // Or EntityStore.fromLocal('***', {}, 'id') } proxy () { @@ -70,21 +74,52 @@ class PluginManagerComponent { } render () { - var self = this + // var self = this // loop over all this.modules and this.plugins - return yo` + let pluginManagerDiv = yo`
- list all modules / plugins that can be activated +

Plugin Manager

+
+ ` + for (var mod in this.modulesDefinition) { + if (this.modulesDefinition[mod].icon) pluginManagerDiv.appendChild(this.renderItem(mod)) + } + console.log(this.activated) + return pluginManagerDiv + } + + renderItem (item) { + let ctrBtns + if (this.activated.hasOwnProperty(item)) { + ctrBtns = yo` + + ` + } else { + ctrBtns = yo` + + ` + } + this.plugins.push(item) + // var self = this + return yo` +
+ ${this.modulesDefinition[item].name} + ${ctrBtns}
` } activatePlugin (jsonProfile, api) { - let profile = { json: jsonProfile, api } - let plugin = new Plugin(profile, api) - this.appManager.addPlugin(plugin) - this.event.emit('displayableModuleActivated', jsonProfile, plugin.render()) - this.activated[jsonProfile.name] = plugin + // let profile = { json: jsonProfile, api } + // let plugin = new Plugin(profile, api) + // this.appManager.addPlugin(plugin) + // this.event.emit('displayableModuleActivated', jsonProfile, plugin.render()) + // this.activated[jsonProfile.name] = plugin + } + + deactivateInternal (name) { + delete this.activated[name] + this.event.emit('removingItem', name) } activateInternal (name) { @@ -116,32 +151,23 @@ class PluginManagerComponent { _deactivate (item) { this.event.emit('deactivation', item) } - - renderItem (item) { - this.plugins.push(item) - var self = this - var view = yo` -
- ${item.name} - ${item.url} - - -
- ` - } } module.exports = PluginManagerComponent const css = csjs` - .plugins { + .plugins { width : 300px; } - .plugItIn { - display : none; + .plugin { + border-bottom: 1px black solid; + padding: 10px 20px; + margin-bottom: 20px; + } + .plugItIn.active { + display: block; } - .plugItIn.active { - display :block; + .plugin button { + cursor: pointer; } - .clearFunds { background-color: lightblue; } ` diff --git a/src/app/components/plugin-manager-proxy.js b/src/app/components/plugin-manager-proxy.js index f4849aa534..2aa9508235 100644 --- a/src/app/components/plugin-manager-proxy.js +++ b/src/app/components/plugin-manager-proxy.js @@ -1,5 +1,3 @@ -var yo = require('yo-yo') - var registry = require('../../global/registry') const CompilerAbstract = require('../compiler/compiler-abstract') @@ -9,7 +7,7 @@ const EventManager = require('remix-lib').EventManager class PluginManagerProxy { constructor () { - this.event = new EventManager + this.event = new EventManager() } register (mod, instance) { diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index 24cbd40ce5..9a37f76075 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -1,11 +1,4 @@ -var yo = require('yo-yo') -var csjs = require('csjs-inject') -const remixLib = require('remix-lib') - -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() - -const EventEmmitter = require('events') +// const EventEmmitter = require('events') class SwapPanelApi { constructor (swapPanelComponent, verticalIconsComponent, pluginManagerComponent) { diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index c10bfbe715..525c2e8667 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -1,9 +1,9 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') -const remixLib = require('remix-lib') +// const remixLib = require('remix-lib') -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() +// const styleguide = require('../ui/styles-guide/theme-chooser') +// const styles = styleguide.chooser() class SwapPanelComponent { constructor () { @@ -26,15 +26,14 @@ class SwapPanelComponent { console.log(`${moduleName} not found`) } - add (moduleName, content) { this.contents[moduleName] = yo`
${content}
` this.view.appendChild(this.contents[moduleName]) this.showContent(moduleName) - } + } render () { - this.view = yo` + this.view = yo`
` diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index 0ddd3c21bc..3c4ba39ef0 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -1,16 +1,9 @@ -var yo = require('yo-yo') -var csjs = require('csjs-inject') -const remixLib = require('remix-lib') - -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() - // API class VerticalIconsApi { - constructor(verticalIconsComponent, pluginManagerComponent) { + constructor (verticalIconsComponent, pluginManagerComponent) { this.component = verticalIconsComponent - pluginManagerComponent.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod) ) - } + pluginManagerComponent.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod)) + } } module.exports = VerticalIconsApi diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index 3364da36e9..6977234217 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -1,44 +1,58 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') -const remixLib = require('remix-lib') +// const remixLib = require('remix-lib') -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() +// const styleguide = require('../ui/styles-guide/theme-chooser') +// const styles = styleguide.chooser() const EventEmmitter = require('events') - - // Component - class VerticalIconComponent { - - constructor() { - this.event = new EventEmmitter - } - - addIcon (mod) { - let self = this - this.view.appendChild(yo`
{ self._iconClick(mod.name)}} title=${mod.name}>${mod.name}
`) - } - - removeIcon (item) { - - } - - select (name) { - this.event.emit('showContent', name) - } - - _iconClick (name) { - // called when an icon has been clicked - this.event.emit('showContent', name) - } - - render() { - this.view = yo` -
-
- ` - return this.view - } - } - - module.exports = VerticalIconComponent + +// Component +class VerticalIconComponent { + + constructor () { + this.event = new EventEmmitter() + } + + addIcon (mod) { + let self = this + this.view.appendChild(yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
`) + } + + removeIcon (item) { + + } + + select (name) { + this.event.emit('showContent', name) + } + + _iconClick (name) { + // called when an icon has been clicked + this.event.emit('showContent', name) + } + + render () { + this.view = yo` +
+
+ ` + return this.view + } +} + +module.exports = VerticalIconComponent + +const css = csjs` + .icons { + margin-left: 10px; + margin-top: 15px; + } + .icon { + cursor: pointer; + margin-bottom: 25px; + } + .icon img { + width: 25px; + } +` diff --git a/src/app/editor/SourceHighlighters.js b/src/app/editor/SourceHighlighters.js index e5eaa3d92b..8902235fe5 100644 --- a/src/app/editor/SourceHighlighters.js +++ b/src/app/editor/SourceHighlighters.js @@ -3,33 +3,33 @@ var SourceHighlighter = require('./sourceHighlighter') module.exports = class SourceHighlighters { - constructor () { - this.highlighters = {} - } + constructor () { + this.highlighters = {} + } - profile () { - return { - type: 'sourcehighlighter', - methods: ['highlight', 'discardHighlight'] - } + profile () { + return { + type: 'sourcehighlighter', + methods: ['highlight', 'discardHighlight'] } + } - // TODO what to do with mod? - highlight (mod, lineColumnPos, filePath, hexColor, cb) { - var position - try { - position = JSON.parse(lineColumnPos) - } catch (e) { - return cb(e.message) - } - if (!highlighters[mod]) highlighters[mod] = new SourceHighlighter() - highlighters[mod].currentSourceLocation(null) - highlighters[mod].currentSourceLocationFromfileName(position, filePath, hexColor) - cb() + // TODO what to do with mod? + highlight (mod, lineColumnPos, filePath, hexColor, cb) { + var position + try { + position = JSON.parse(lineColumnPos) + } catch (e) { + return cb(e.message) } + if (!highlighters[mod]) highlighters[mod] = new SourceHighlighter() + highlighters[mod].currentSourceLocation(null) + highlighters[mod].currentSourceLocationFromfileName(position, filePath, hexColor) + cb() + } - discardHighlight (mod, cb) { - if (highlighters[mod]) highlighters[mod].currentSourceLocation(null) - cb() - } -} \ No newline at end of file + discardHighlight (mod, cb) { + if (highlighters[mod]) highlighters[mod].currentSourceLocation(null) + cb() + } +} diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 65b8d19cb2..a32ef613c8 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -2,7 +2,7 @@ var $ = require('jquery') var yo = require('yo-yo') -var EventEmitter = require ('events') +var EventEmitter = require('events') var EventManager = require('../../lib/events') var globalRegistry = require('../../global/registry') var CompilerImport = require('../compiler/compiler-imports') @@ -116,7 +116,7 @@ class FileManager { cb(null, path) } } - + getFile (path, cb) { var provider = this.fileProviderOf(path) if (provider) { diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 6dc8f84467..6a8fda6d07 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -40,7 +40,7 @@ class EditorPanel { } } self._view = {} - + var contextualListener = new ContextualListener({editor: self._components.editor, pluginManager: self._deps.pluginManager}) var contextView = new ContextView({contextualListener, editor: self._components.editor}) diff --git a/src/app/panels/left-icon-panel.js b/src/app/panels/left-icon-panel.js index c68a84235f..e6121dad3a 100644 --- a/src/app/panels/left-icon-panel.js +++ b/src/app/panels/left-icon-panel.js @@ -69,7 +69,6 @@ module.exports = class LeftIconPanel { {type: 'settings', displayName: 'setting', icon: 'fa fa-cog fa-2x'} ] } - swapPlugin (name) { console.log(name) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index f15cb7d2b7..70a5b48adf 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -321,7 +321,6 @@ UniversalDApp.prototype.runTestTx = function (tx, cb) { }) } - /** * This function send a tx without alerting the user (if mainnet or if gas estimation too high). * SHOULD BE TAKEN CAREFULLY! From b4c92b6ab357f9a8e10cd5a68275afaa51ff6bf9 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Wed, 9 Jan 2019 14:07:36 +0100 Subject: [PATCH 008/636] update with buttons - in progress --- src/app.js | 12 +++--- .../components/plugin-manager-component.js | 39 ++++++++++++------- src/app/components/swap-panel-component.js | 1 - 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/app.js b/src/app.js index dd36032dc0..b2ffe72169 100644 --- a/src/app.js +++ b/src/app.js @@ -39,12 +39,12 @@ const PluginManagerComponent = require('./app/components/plugin-manager-componen const PluginManagerApi = require('./app/components/plugin-manager-api') const VerticalIconsComponent = require('./app/components/vertical-icons-component') -// const VerticalIconsApi = require('./app/components/vertical-icons-api') +const VerticalIconsApi = require('./app/components/vertical-icons-api') const SwapPanelComponent = require('./app/components/swap-panel-component') -// const SwapPanelApi = require('./app/components/swap-panel-api') +const SwapPanelApi = require('./app/components/swap-panel-api') -// const AppManager = require('remix-plugin').AppManager +const AppManager = require('remix-plugin').AppManager var styleGuide = require('./app/ui/styles-guide/theme-chooser') var styles = styleGuide.chooser() @@ -437,7 +437,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org - the current API is not optimal. For instance methods of `app` only refers to `executionContext`, wich does not make really sense. */ - // const appManager = new AppManager({modules: [], plugins: []}) + const appManager = new AppManager({modules: [], plugins: []}) const swapPanelComponent = new SwapPanelComponent() const pluginManagerComponent = new PluginManagerComponent( @@ -456,8 +456,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const verticalIconComponent = new VerticalIconsComponent() - // const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, pluginManagerComponent) - // const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, pluginManagerComponent) + const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, pluginManagerComponent) + const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, pluginManagerComponent) const pluginManagerAPI = new PluginManagerApi(pluginManagerComponent) self._view.mainpanel.appendChild(self._components.editorpanel.render()) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 9f2b842639..6502efd8e6 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -33,14 +33,14 @@ class PluginManagerComponent { 'Config': { name: 'Config', target: config }, 'TxListener': { name: 'TxListener', target: txListener }, // internal components. They are mostly views, they don't provide external API for plugins - 'Solidity Compile': { name: 'Solidity Compile', class: 'evm-compiler', Type: CompileTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3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kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' } } this.activated = {} // list all activated modules @@ -66,9 +66,9 @@ class PluginManagerComponent { this.activateInternal('TxListener') this.activateInternal('FilePanel') - this.activateInternal('Solidity Compile') + this.activateInternal('SolidityCompile') this.activateInternal('Run') - this.activateInternal('Plugin Manager') + this.activateInternal('PluginManager') this.activateInternal('Settings') this.activateInternal('Support') } @@ -82,7 +82,9 @@ class PluginManagerComponent {
` for (var mod in this.modulesDefinition) { - if (this.modulesDefinition[mod].icon) pluginManagerDiv.appendChild(this.renderItem(mod)) + if (this.modulesDefinition[mod].icon) { + pluginManagerDiv.appendChild(this.renderItem(mod)) + } } console.log(this.activated) return pluginManagerDiv @@ -90,23 +92,28 @@ class PluginManagerComponent { renderItem (item) { let ctrBtns - if (this.activated.hasOwnProperty(item)) { - ctrBtns = yo` - - ` - } else { - ctrBtns = yo` - - ` + + let action = (event) => { + if (this.activated.hasOwnProperty(item)) { + this.deactivateInternal(item) + } else { + this.activateInternal(item) + } } + + ctrBtns = yo`
+ +
` + this.plugins.push(item) // var self = this - return yo` + this.view = yo`
${this.modulesDefinition[item].name} ${ctrBtns}
` + return this.view } activatePlugin (jsonProfile, api) { @@ -120,6 +127,7 @@ class PluginManagerComponent { deactivateInternal (name) { delete this.activated[name] this.event.emit('removingItem', name) + if (this.view) this.view.querySelector(`#${name} button`).innerHTML = 'activate' } activateInternal (name) { @@ -141,6 +149,7 @@ class PluginManagerComponent { this.data.proxy.register(mod, instance) } this.activated[mod.name] = mod + if (this.view) this.view.querySelector(`#${name} button`).innerHTML = 'deactivate' return instance } diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index 525c2e8667..683e712e7d 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -29,7 +29,6 @@ class SwapPanelComponent { add (moduleName, content) { this.contents[moduleName] = yo`
${content}
` this.view.appendChild(this.contents[moduleName]) - this.showContent(moduleName) } render () { From 33683ac5be75df73a88ba25d306a24706d8d69dc Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 9 Jan 2019 14:44:19 +0100 Subject: [PATCH 009/636] fixing adding removing module --- .../components/plugin-manager-component.js | 20 ++++++++++--------- src/app/components/swap-panel-api.js | 7 +++++++ src/app/components/swap-panel-component.js | 7 ++++++- src/app/components/vertical-icons-api.js | 1 + .../components/vertical-icons-component.js | 7 ++++--- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 6502efd8e6..f4cf2bd18e 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -33,14 +33,14 @@ class PluginManagerComponent { 'Config': { name: 'Config', target: config }, 'TxListener': { name: 'TxListener', target: txListener }, // internal components. They are mostly views, they don't provide external API for plugins - 'SolidityCompile': { name: 'Solidity Compile', class: 'evm-compiler', Type: CompileTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjx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xLjE1Niw3LjA4M2MtMS43MDQsMC40MTgtMy4zMTMsMS4wODMtNC43NzcsMS45NjNMMTAuMTgsNS44NzNsLTQuMjQzLDQuMjQxbDQuMTA3LDUuODc0Yy0wLjg4OCwxLjQ3LTEuNTYzLDMuMDc3LTEuOTkyLDQuNzkyICBMMSwyMS45NTR2Nmw3LjA0NCwxLjI0OWMwLjQyNSwxLjcxMSwxLjEwMSwzLjMxOCwxLjk5Miw0Ljc5bC00LjE2Myw1LjgyM2w0LjI0MSw0LjI0NWw1Ljg4MS00LjExOSAgYzEuNDY4LDAuODgyLDMuMDczLDEuNTUyLDQuNzc3LDEuOTczbDEuMTgsNy4wODdoNmwxLjI2MS03LjEwNWMxLjY5NS0wLjQzLDMuMjk3LTEuMTA1LDQuNzUxLTEuOTlsNS45MjIsNC4xNTVsNC4yNDItNC4yNDUgIGwtNC4yMjctNS44N2MwLjg3NS0xLjQ1NiwxLjUzOS0zLjA0OCwxLjk1OC00LjczOUw0OSwyNy45NTR6IE0yNSwzM2MtNC40MTgsMC04LTMuNTgyLTgtOHMzLjU4Mi04LDgtOHM4LDMuNTgyLDgsOFMyOS40MTgsMzMsMjUsMzMgIHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' } } this.activated = {} // list all activated modules @@ -96,12 +96,14 @@ class PluginManagerComponent { let action = (event) => { if (this.activated.hasOwnProperty(item)) { this.deactivateInternal(item) + event.target.innerHTML = 'activate' } else { this.activateInternal(item) + event.target.innerHTML = 'deactivate' } } - ctrBtns = yo`
+ ctrBtns = yo`
` @@ -125,12 +127,13 @@ class PluginManagerComponent { } deactivateInternal (name) { + if (!this.activated[name]) return + this.event.emit('removingItem', this.activated[name]) delete this.activated[name] - this.event.emit('removingItem', name) - if (this.view) this.view.querySelector(`#${name} button`).innerHTML = 'activate' } activateInternal (name) { + if (this.activated[name]) return const mod = this.modulesDefinition[name] let dep if (mod.dep) dep = this.activateInternal(mod.dep) @@ -148,8 +151,7 @@ class PluginManagerComponent { if (mod.class === 'evm-compiler') { this.data.proxy.register(mod, instance) } - this.activated[mod.name] = mod - if (this.view) this.view.querySelector(`#${name} button`).innerHTML = 'deactivate' + this.activated[mod.name] = mod return instance } diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index 9a37f76075..eb128b17c6 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -9,6 +9,9 @@ class SwapPanelApi { pluginManagerComponent.event.on('requestContainer', (mod, content) => { this.add(mod.name, content) }) + pluginManagerComponent.event.on('removingItem', (mod) => { + this.remove(mod.name) + }) } /* @@ -20,6 +23,10 @@ class SwapPanelApi { return this.component.add(moduleName, content) } + remove (moduleName) { + return this.component.remove(moduleName) + } + reference (modulename, domElement) { this.nodes[modulename] = domElement } diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index 683e712e7d..db6208b844 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -27,10 +27,15 @@ class SwapPanelComponent { } add (moduleName, content) { - this.contents[moduleName] = yo`
${content}
` + this.contents[moduleName] = yo`
${content}
` this.view.appendChild(this.contents[moduleName]) } + remove (moduleName) { + var el = this.view.querySelector(`div#${moduleName}Content`) + el.parentElement.removeChild(el) + } + render () { this.view = yo`
diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index 3c4ba39ef0..a167dab0c0 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -4,6 +4,7 @@ class VerticalIconsApi { constructor (verticalIconsComponent, pluginManagerComponent) { this.component = verticalIconsComponent pluginManagerComponent.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod)) + pluginManagerComponent.event.on('removingItem', (mod) => verticalIconsComponent.removeIcon(mod)) } } module.exports = VerticalIconsApi diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index 6977234217..b2011f2472 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -16,11 +16,12 @@ class VerticalIconComponent { addIcon (mod) { let self = this - this.view.appendChild(yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
`) + this.view.appendChild(yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
`) } - removeIcon (item) { - + removeIcon (mod) { + var el = this.view.querySelector(`#${mod.name}Icon`) + el.parentElement.removeChild(el) } select (name) { From 017a82315815d6ea1fa4003608b748ae7b5a5e1c Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Thu, 3 Jan 2019 14:33:16 +0100 Subject: [PATCH 010/636] with Yann --- src/app.js | 201 +++++++++++++----- src/app/components/plugin-manager-api.js | 26 +++ .../components/plugin-manager-component.js | 62 ++++++ src/app/components/swap-panel-api.js | 26 +++ src/app/components/swap-panel-component.js | 57 +++++ src/app/components/vertical-icons-api.js | 23 ++ .../components/vertical-icons-component.js | 39 ++++ src/app/panels/left-icon-panel.js | 183 ++++++++++++++++ 8 files changed, 559 insertions(+), 58 deletions(-) create mode 100644 src/app/components/plugin-manager-api.js create mode 100644 src/app/components/plugin-manager-component.js create mode 100644 src/app/components/swap-panel-api.js create mode 100644 src/app/components/swap-panel-component.js create mode 100644 src/app/components/vertical-icons-api.js create mode 100644 src/app/components/vertical-icons-component.js create mode 100644 src/app/panels/left-icon-panel.js diff --git a/src/app.js b/src/app.js index 4ebd885dfe..63de8c3af4 100644 --- a/src/app.js +++ b/src/app.js @@ -37,7 +37,17 @@ var toolTip = require('./app/ui/tooltip') var TransactionReceiptResolver = require('./transactionReceiptResolver') const CompilerAbstract = require('./app/compiler/compiler-abstract') -const PluginManager = require('./app/plugin/pluginManager') +// const PluginManager = require('./app/plugin/pluginManager') + +// var IconPanel = require('./app/panels/left-icon-panel') + +const VerticalIconsComponent = require('./app/components/vertical-icons-component') +const VerticalIconsApi = require('./app/components/vertical-icons-api') +// var VerticalIconsProfile = require('./app/panels/vertical-icons-profile') + +const SwapPanelComponent = require('./app/component/swap-panel-component') +const SwapPanelComponent = require('./app/component/swap-panel-api') + const CompileTab = require('./app/tabs/compile-tab') const SettingsTab = require('./app/tabs/settings-tab') const AnalysisTab = require('./app/tabs/analysis-tab') @@ -46,6 +56,8 @@ const SupportTab = require('./app/tabs/support-tab') const TestTab = require('./app/tabs/test-tab') const RunTab = require('./app/tabs/run-tab') +const appManager = require('remix-plugin').appManager + var styleGuide = require('./app/ui/styles-guide/theme-chooser') var styles = styleGuide.chooser() @@ -188,46 +200,53 @@ class App { } } if (direction === 'left') { - self._view.leftpanel.style.width = delta + 'px' - self._view.centerpanel.style.left = delta + 'px' - } - if (direction === 'right') { - self._view.rightpanel.style.width = delta + 'px' - self._view.centerpanel.style.right = delta + 'px' + self._view.swappanel.style.width = delta + 'px' + self._view.mainpanel.style.left = delta + 'px' } + // if (direction === 'right') { + // self._view.mainpanel.style.width = delta + 'px' + // self._view.swappanel.style.right = delta + 'px' + // } } init () { var self = this run.apply(self) } + render () { var self = this if (self._view.el) return self._view.el - self._view.leftpanel = yo` -
- ${''} + // not resizable + self._view.iconpanel = yo` +
+ ${''}
` - self._view.centerpanel = yo` -
+ + // center panel, resizable + self._view.swappanel = yo` +
${''}
` - self._view.rightpanel = yo` -
+ + // handle the editor + terminal + self._view.mainpanel = yo` +
${''}
` + self._view.el = yo`
- ${self._view.leftpanel} - ${self._view.centerpanel} - ${self._view.rightpanel} + ${self._view.iconpanel} + ${self._view.swappanel} + ${self._view.mainpanel}
` // INIT self._adjustLayout('left', self.data._layout.left.offset) - self._adjustLayout('right', self.data._layout.right.offset) + // self._adjustLayout('right', self.data._layout.right.offset) return self._view.el } startdebugging (txHash) { @@ -365,23 +384,113 @@ Please make a backup of your contracts and start using http://remix.ethereum.org var fileManager = self._components.fileManager registry.put({api: fileManager, name: 'filemanager'}) - // ---------------- Plugin Manager ------------------------------- - - let pluginManager = new PluginManager( - self, - self._components.compilersArtefacts, - txlistener, - self._components.fileProviders, - self._components.fileManager, - udapp) - registry.put({api: pluginManager, name: 'pluginmanager'}) - - pluginManager.event.register('sendCompilationResult', (file, source, languageVersion, data) => { - // TODO check whether the tab is configured - let compiler = new CompilerAbstract(languageVersion, data, source) - self._components.compilersArtefacts['__last'] = compiler + // ----------------- app manager ---------------------------- + const VerticalIconsProfile = { + type: 'verticalIcons', + methods: ['addIcon', 'removeIcon'], + } + + const SwapPanelProfile = { + type: 'swapPanel', + methods: ['addView', 'showContent'], + } + + const PluginManagerProfile = { + type: 'pluginManager', + methods: [], + } + + const FileManagerProfile = { + type: 'fileManager', + methods: [], + } + + const SettingsProfile = { + type: 'settings', + methods: [], + } + + const appManager = new appManager() + + const swapPanelComponent = new SwapPanelComponent() + const pluginManagerComponent = new PluginManagerComponent(appManager) + const verticalIconComponent = new VerticalIconsComponent(appManager) + + const swapPanelApi = new SwapPanelApi(swapPanelComponent) + const verticalIconApi = new VerticalsIconApi(verticalIconComponent) + const pluginManagerAPI = new pluginManagerAPI(pluginManagerComponent) + + self._components.filePanel = new FilePanel() + registry.put({api: self._components.filePanel, name: 'filepanel'}) + + var settings = new SettingsTab() + + // All Plugins and Modules are registered in the contructor + // You cannot add module after + appManager.init({ + // Module should be activated by default + modules: [ + { json: VerticalIconsProfile, api: verticalIconApi }, + { json: SwapPanelProfile, api: swapPanelApi }, + { json: PluginManagerProfile, api: pluginManagerApi }, + { json: FileManagerProfile, api: self._components.filePanel }, + { json: SettingsProfile, api: settings } + ], + // Plugins need to be activated + plugins: [], + options: { + bootstrap: 'pluginManager' + } }) + const compileTab = new CompileTab(self._components.registry) + const compileTabProfile = { + type: 'solidityCompile', + methods: [], + } + appManager.addPlugin({json: compileTabProfile, api: compileTab}) + + const testTab = new TestTab(self._components.registry, compileTab) + const testTabProfile = { + type: 'solidityUnitTesting', + methods: [], + } + appManager.addPlugin({json: testTabProfile, api: testTab}) + + const runTab = new RunTab(self._components.registry) + const runTabProfile = { + type: 'runTransaction', + methods: [], + } + appManager.addPlugin({json: runTabProfile, api: runTab}) + + const analysisTab = new AnalysisTab(self._components.registry) + const analysisTabProfile = { + type: 'solidityStaticAnalisys', + methods: [], + } + appManager.addPlugin({json: analysisTabProfile, api: analysisTab}) + + const debuggerTab = new DebuggerTab(self._components.registry) + const debuggerTabProfile = { + type: 'debugger', + methods: [], + } + appManager.addPlugin({json: debuggerTabProfile, api: debuggerTab}) + + const supportTab = new SupportTab(self._components.registry) + const supportTabProfile = { + type: 'support', + methods: [], + } + appManager.addPlugin({json: supportTabProfile, api: supportTab}) + + self._components.iconpanel.appendChild(verticalIconComponent.render()) + self._components.iconpanel.event.register('resize', delta => self._adjustLayout('left', delta)) + + self._components.swappanel.appendChild(swapPanelComponent.render()) + self._components.swappanel.event.register('resize', delta => self._adjustLayout('center', delta)) + self._components.editorpanel.init() self._components.fileManager.init() @@ -409,35 +518,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org self.loadFiles(filesToLoad) } - // ---------------- FilePanel -------------------- - self._components.filePanel = new FilePanel() - self._view.leftpanel.appendChild(self._components.filePanel.render()) - self._components.filePanel.event.register('resize', delta => self._adjustLayout('left', delta)) - registry.put({api: self._components.filePanel, name: 'filepanel'}) - // ----------------- Renderer ----------------- var renderer = new Renderer() registry.put({api: renderer, name: 'renderer'}) - // ---------------- Tabs ------------------------------- - let compileTab = new CompileTab(self._components.registry) - let tabs = { - compile: compileTab, - run: new RunTab(self._components.registry), - settings: new SettingsTab(self._components.registry), - analysis: new AnalysisTab(self._components.registry), - debug: new DebuggerTab(self._components.registry), - support: new SupportTab(self._components.registry), - test: new TestTab(self._components.registry, compileTab) - } - - // ---------------- Righthand-panel -------------------- - self._components.righthandpanel = new RighthandPanel({ tabs, pluginManager }) - self._view.rightpanel.appendChild(self._components.righthandpanel.render()) - self._components.righthandpanel.init() - self._components.righthandpanel.event.register('resize', delta => self._adjustLayout('right', delta)) - - var txLogger = new TxLogger() // eslint-disable-line + var txLogger = new TxLogger() // eslint-disable-line var queryParams = new QueryParams() diff --git a/src/app/components/plugin-manager-api.js b/src/app/components/plugin-manager-api.js new file mode 100644 index 0000000000..3cadd1bdb1 --- /dev/null +++ b/src/app/components/plugin-manager-api.js @@ -0,0 +1,26 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +const EventManager = remixLib.EventManager + +class SwapPanelApi { + constructor (swapPanelComponent) { + this.component = swapPanelComponent + } + + /* + viewTitle: string + content: DOM element + */ + addView(viewTitle, content) { + // add the DOM to the swappanel + this.component.addView(viewTitle, contents) + } +} + + +module.exports = SwapPanelApi diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js new file mode 100644 index 0000000000..59de442953 --- /dev/null +++ b/src/app/components/plugin-manager-component.js @@ -0,0 +1,62 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +const EventManager = remixLib.EventManager + +class PluginManagerComponent { + constructor (appManager) { + this.appManager = appManager + appManager.event.register('pluginLoaded', () => { + // call this.renderItem + }) + } + + render () { + var self = this + // loop over all this.modules and this.plugins + var view = yo` +
+
+ ` + } + + _activate(item) { + this.appManager.activate(item) + } + + _deactivate(item) { + this.appManager.deactivate(item) + } + + renderItem (item) { + var self = this + + var view = yo` +
+ ${item.name} + ${item.url} +
+ ` + } +} + +module.exports = SwapPanelComponent + +const css = csjs` + .plugins { + width : 300px; + } + .plugItIn { + display : none; + } + .plugItIn.active { + display :block; + } + .clearFunds { background-color: lightblue; } +` diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js new file mode 100644 index 0000000000..3cadd1bdb1 --- /dev/null +++ b/src/app/components/swap-panel-api.js @@ -0,0 +1,26 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +const EventManager = remixLib.EventManager + +class SwapPanelApi { + constructor (swapPanelComponent) { + this.component = swapPanelComponent + } + + /* + viewTitle: string + content: DOM element + */ + addView(viewTitle, content) { + // add the DOM to the swappanel + this.component.addView(viewTitle, contents) + } +} + + +module.exports = SwapPanelApi diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js new file mode 100644 index 0000000000..bb6c213e09 --- /dev/null +++ b/src/app/components/swap-panel-component.js @@ -0,0 +1,57 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +const EventManager = remixLib.EventManager + +class SwapPanelComponent { + constructor () { + } + + showContent (moduleName) { + // hiding the current view and display the `moduleName` + } + + addView (title, content) { + // add the DOM to the swappanel + } + + render () { + var self = this + + var view = yo` +
+
+

Plugin 1

+
  • Some Text
+
+
+

Plugin 2

+
  • Some Text
+
+
+

Plugin 3

+
  • Some Text
+
+
+ ` + } +} + +module.exports = SwapPanelComponent + +const css = csjs` + .plugins { + width : 300px; + } + .plugItIn { + display : none; + } + .plugItIn.active { + display :block; + } + .clearFunds { background-color: lightblue; } +` diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js new file mode 100644 index 0000000000..ec4438d734 --- /dev/null +++ b/src/app/components/vertical-icons-api.js @@ -0,0 +1,23 @@ +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + +// API +class VerticalIconsApi { + + constructor(verticalIconsComponent) { + this.component = verticalIconsComponent + } + + addIcon(icon) { + this.component.event.trigger('addIcon', icon) + } + + removeIcon(icon) { + this.component.event.trigger('removeIcon', icon) + } +} +module.exports = VerticalIconsApi diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js new file mode 100644 index 0000000000..57e375272f --- /dev/null +++ b/src/app/components/vertical-icons-component.js @@ -0,0 +1,39 @@ + +var yo = require('yo-yo') +var csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() + + // Component + class VerticalIconComponent { + + constructor(appManager) { + this.appManager = appManager + appManager.event.register('activated', (item) => { + this.addIcon(item) + }) + appManager.event.register('deactivated', (item) => { + this.removeIcon(item) + }) + } + + addIcon (item) { + + } + + removeIcon (item) { + + } + + render() { + yo` +
+

example

+
+ ` + } + } + + module.exports = VerticalIconComponent diff --git a/src/app/panels/left-icon-panel.js b/src/app/panels/left-icon-panel.js new file mode 100644 index 0000000000..10601dc9da --- /dev/null +++ b/src/app/panels/left-icon-panel.js @@ -0,0 +1,183 @@ +const yo = require('yo-yo') +const csjs = require('csjs-inject') +const remixLib = require('remix-lib') + +var globalRegistry = require('../../global/registry') + +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() +// const PluginManager = require('../plugin/pluginManager') +// const TabbedMenu = require('../tabs/tabbed-menu') +// const CompileTab = require('../tabs/compile-tab') +// const SettingsTab = require('../tabs/settings-tab') +// const AnalysisTab = require('../tabs/analysis-tab') +// const DebuggerTab = require('../tabs/debugger-tab') +// const SupportTab = require('../tabs/support-tab') +// const PluginTab = require('../tabs/plugin-tab') +// const TestTab = require('../tabs/test-tab') +// const RunTab = require('../tabs/run-tab') +// const DraggableContent = require('../ui/draggableContent') + +const EventManager = remixLib.EventManager + +// var async = require('async') + +// var tooltip = require('../ui/tooltip') + +// var styleGuide = require('../ui/styles-guide/theme-chooser') + +// var css = require('./styles/file-panel-styles') + +// var canUpload = window.File || window.FileReader || window.FileList || window.Blob +// var ghostbar = yo`
` + +/* + Overview of APIs: + * fileManager: @args fileProviders (browser, shared-folder, swarm, github, etc ...) & config & editor + - listen on browser & localhost file provider (`fileRenamed` & `fileRemoved`) + - update the tabs, switchFile + - trigger `currentFileChanged` + - set the current file in the config + * fileProvider: currently browser, swarm, localhost, github, gist + - link to backend + - provide properties `type`, `readonly` + - provide API `resolveDirectory`, `remove`, `exists`, `rename`, `get`, `set` + - trigger `fileExternallyChanged`, `fileRemoved`, `fileRenamed`, `fileRenamedError`, `fileAdded` + * file-explorer: treeview @args fileProvider + - listen on events triggered by fileProvider + - call fileProvider API +*/ + +module.exports = class LeftIconPanel { + constructor (localRegistry) { + const self = this + self._components = {} + self._components.registry = localRegistry || globalRegistry + + self._components.registry.put({api: this, name: 'lefticonpanel'}) + self.event = new EventManager() + self._view = { + element: null, + tabbedMenu: null, + tabbedMenuViewport: null, + dragbar: null + } + + self.plugins = [ + {type: 'fileManager', displayName: 'File Manger', icon: 'fa fa-files-o fa-2x'}, + {type: 'pluginManager', displayName: 'Plugin Manger', icon: 'fa fa-puzzle-piece fa-2x'}, + {type: 'settings', displayName: 'setting', icon: 'fa fa-cog fa-2x'} + ] + } + + + swapPlugin (name) { + console.log(name) + } + + render () { + const self = this + // if (self._view.element) return self._view.element + // return self._view.element + return yo` +
+
    + ${self.plugins.map(function (pi) { + return yo`
  • + { self.swapPlugin(pi.type) }} style="size: 24px;" class="${pi.icon} ${css.plugin}"> +
  • ` + }) + } +
+
+ ` + } + + init () { + // @TODO: init is for resizable drag bar only and should be refactored in the future + const self = this + const limit = 60 + self._view.dragbar.addEventListener('mousedown', mousedown) + const ghostbar = yo`
` + function mousedown (event) { + event.preventDefault() + if (event.which === 1) { + moveGhostbar(event) + document.body.appendChild(ghostbar) + document.addEventListener('mousemove', moveGhostbar) + document.addEventListener('mouseup', removeGhostbar) + document.addEventListener('keydown', cancelGhostbar) + } + } + function cancelGhostbar (event) { + if (event.keyCode === 27) { + document.body.removeChild(ghostbar) + document.removeEventListener('mousemove', moveGhostbar) + document.removeEventListener('mouseup', removeGhostbar) + document.removeEventListener('keydown', cancelGhostbar) + } + } + function getPosition (event) { + const lhp = window['filepanel'].offsetWidth + const max = document.body.offsetWidth - limit + var newpos = (event.pageX > max) ? max : event.pageX + newpos = (newpos > (lhp + limit)) ? newpos : lhp + limit + return newpos + } + function moveGhostbar (event) { // @NOTE VERTICAL ghostbar + ghostbar.style.left = getPosition(event) + 'px' + } + function removeGhostbar (event) { + document.body.removeChild(ghostbar) + document.removeEventListener('mousemove', moveGhostbar) + document.removeEventListener('mouseup', removeGhostbar) + document.removeEventListener('keydown', cancelGhostbar) + self.event.trigger('resize', [document.body.offsetWidth - getPosition(event)]) + } + } +} + +const css = csjs` + .lefticonpanel { + display : flex; + flex-direction : column; + top : 0; + right : 0; + bottom : 0; + box-sizing : border-box; + overflow : hidden; + height : 100%; + } + .header { + height : 100%; + } + .dragbar { + position : absolute; + width : 0.5em; + top : 3em; + bottom : 0; + cursor : col-resize; + z-index : 999; + border-left : 2px solid ${styles.rightPanel.bar_Dragging}; + } + .ghostbar { + width : 3px; + background-color : ${styles.rightPanel.bar_Ghost}; + opacity : 0.5; + position : absolute; + cursor : col-resize; + z-index : 9999; + top : 0; + bottom : 0; + } + i.plugin { + cursor : pointer; + } + .container ul { + margin-top : 10px; + } + .container ul li { + text-align : center; + margin-top : 10px; + } +` From eccca7da1a2635bb1ac0762910d436e2f99d1e99 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Thu, 3 Jan 2019 15:28:26 +0100 Subject: [PATCH 011/636] slight update of code from our conversation --- src/app.js | 2 +- src/app/components/plugin-manager-component.js | 9 +++++++-- src/app/components/swap-panel-api.js | 7 ++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app.js b/src/app.js index 63de8c3af4..e63d02b2d7 100644 --- a/src/app.js +++ b/src/app.js @@ -448,7 +448,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org type: 'solidityCompile', methods: [], } - appManager.addPlugin({json: compileTabProfile, api: compileTab}) + appManager.addPlugin({json: compileTabProfile, api: new InternalModule(compileTab) }) const testTab = new TestTab(self._components.registry, compileTab) const testTabProfile = { diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 59de442953..85d62a46c1 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -25,11 +25,15 @@ class PluginManagerComponent { } _activate(item) { - this.appManager.activate(item) + this.event.emit('activation', item) } _deactivate(item) { - this.appManager.deactivate(item) + this.event.emit('deactivation', item) + } + + _addPlugin(url){ + this.event.emit('plugin loading', url) } renderItem (item) { @@ -42,6 +46,7 @@ class PluginManagerComponent {
+
- +
` } } -module.exports = SwapPanelComponent +module.exports = PluginManagerComponent const css = csjs` .plugins { diff --git a/src/app/components/plugin-manager-proxy.js b/src/app/components/plugin-manager-proxy.js new file mode 100644 index 0000000000..f4849aa534 --- /dev/null +++ b/src/app/components/plugin-manager-proxy.js @@ -0,0 +1,24 @@ +var yo = require('yo-yo') + +var registry = require('../../global/registry') + +const CompilerAbstract = require('../compiler/compiler-abstract') + +const EventManager = require('remix-lib').EventManager + +class PluginManagerProxy { + + constructor () { + this.event = new EventManager + } + + register (mod, instance) { + instance.event.on('compilationFinished', (file, source, languageVersion, data) => { + registry.get('compilersartefacts').api['__last'] = new CompilerAbstract(languageVersion, data, source) + this.event.trigger('sendCompilationResult', [file, source, languageVersion, data]) + }) + } + +} + +module.exports = PluginManagerProxy diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index b09809c98c..376f016f10 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -5,25 +5,30 @@ const remixLib = require('remix-lib') const styleguide = require('../ui/styles-guide/theme-chooser') const styles = styleguide.chooser() -const EventManager = remixLib.EventManager +const EventEmmitter = require('events') class SwapPanelApi { - constructor (swapPanelComponent, pluginManagerApi) { + constructor (swapPanelComponent, verticalIconsComponent, pluginManagerComponent) { this.component = swapPanelComponent + verticalIconsComponent.event.on('showContent', (moduleName) => { + this.component.showContent(moduleName) + }) + pluginManagerComponent.event.on('internalActivated', (mod, content) => { + this.add(mod.name, content) + }) } /* - viewTitle: string content: DOM element + by appManager */ - addView(viewTitle, content) { + add (moduleName, content) { // add the DOM to the swappanel - this.component.addView(viewTitle, contents) + return this.component.add(moduleName, content) } - activate() { - this.event.emit(activated) - this.pluginManagerApi.activated(this.type) + reference (modulename, domElement) { + this.nodes[modulename] = domElement } } diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index bb6c213e09..c10bfbe715 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -5,39 +5,40 @@ const remixLib = require('remix-lib') const styleguide = require('../ui/styles-guide/theme-chooser') const styles = styleguide.chooser() -const EventManager = remixLib.EventManager - class SwapPanelComponent { constructor () { + // list of contents + this.contents = {} + // name of the current displayed content + this.currentNode } showContent (moduleName) { // hiding the current view and display the `moduleName` + if (this.contents[moduleName]) { + this.contents[moduleName].style.display = 'block' + if (this.currentNode) { + this.contents[this.currentNode].style.display = 'none' + } + this.currentNode = moduleName + return + } + console.log(`${moduleName} not found`) } - addView (title, content) { - // add the DOM to the swappanel - } + + add (moduleName, content) { + this.contents[moduleName] = yo`
${content}
` + this.view.appendChild(this.contents[moduleName]) + this.showContent(moduleName) + } render () { - var self = this - - var view = yo` + this.view = yo`
-
-

Plugin 1

-
  • Some Text
-
-
-

Plugin 2

-
  • Some Text
-
-
-

Plugin 3

-
  • Some Text
-
` + return this.view } } @@ -45,7 +46,6 @@ module.exports = SwapPanelComponent const css = csjs` .plugins { - width : 300px; } .plugItIn { display : none; diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index a11d8a43a3..3cb69883d5 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -8,17 +8,9 @@ const styles = styleguide.chooser() // API class VerticalIconsApi { - constructor(verticalIconsComponent, pluginManagerApi) { - pluginManagerApi.event.on('activate', (module) => verticalIconsComponent.addIcon(module) ) + constructor(verticalIconsComponent, pluginManagerComponent) { this.component = verticalIconsComponent - } - - addIcon(icon) { - this.component.event.trigger('addIcon', icon) - } - - removeIcon(icon) { - this.component.event.trigger('removeIcon', icon) - } + pluginManagerComponent.event.on('internalActivated', (mod, content) => verticalIconsComponent.addIcon(mod) ) + } } module.exports = VerticalIconsApi diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index 57e375272f..3364da36e9 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -5,34 +5,39 @@ const remixLib = require('remix-lib') const styleguide = require('../ui/styles-guide/theme-chooser') const styles = styleguide.chooser() +const EventEmmitter = require('events') // Component class VerticalIconComponent { - constructor(appManager) { - this.appManager = appManager - appManager.event.register('activated', (item) => { - this.addIcon(item) - }) - appManager.event.register('deactivated', (item) => { - this.removeIcon(item) - }) + constructor() { + this.event = new EventEmmitter } - addIcon (item) { - + addIcon (mod) { + let self = this + this.view.appendChild(yo`
{ self._iconClick(mod.name)}} title=${mod.name}>${mod.name}
`) } removeIcon (item) { } + select (name) { + this.event.emit('showContent', name) + } + + _iconClick (name) { + // called when an icon has been clicked + this.event.emit('showContent', name) + } + render() { - yo` -
-

example

+ this.view = yo` +
` + return this.view } } diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 8c4b2ef55d..6906222f01 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -244,12 +244,10 @@ class EditorPanel { function toggleLHP (event) { this.children[0].classList.toggle('fa-angle-double-right') this.children[0].classList.toggle('fa-angle-double-left') - self.event.trigger('resize', ['left']) } function toggleRHP (event) { this.children[0].classList.toggle('fa-angle-double-right') this.children[0].classList.toggle('fa-angle-double-left') - self.event.trigger('resize', ['right']) } function increase () { self._components.editor.editorFontSize(1) } function decrease () { self._components.editor.editorFontSize(-1) } diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index a1586dd56b..49433f1065 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -263,7 +263,6 @@ function filepanel (localRegistry) { document.removeEventListener('mousemove', moveGhostbar) document.removeEventListener('mouseup', removeGhostbar) document.removeEventListener('keydown', cancelGhostbar) - self.event.trigger('resize', [getPosition(event)]) } function createNewFile () { diff --git a/src/app/panels/left-icon-panel.js b/src/app/panels/left-icon-panel.js index 10601dc9da..c68a84235f 100644 --- a/src/app/panels/left-icon-panel.js +++ b/src/app/panels/left-icon-panel.js @@ -132,7 +132,6 @@ module.exports = class LeftIconPanel { document.removeEventListener('mousemove', moveGhostbar) document.removeEventListener('mouseup', removeGhostbar) document.removeEventListener('keydown', cancelGhostbar) - self.event.trigger('resize', [document.body.offsetWidth - getPosition(event)]) } } } diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js deleted file mode 100644 index 0bcb4f9877..0000000000 --- a/src/app/panels/righthand-panel.js +++ /dev/null @@ -1,163 +0,0 @@ -const yo = require('yo-yo') -const csjs = require('csjs-inject') -const EventManager = require('../../lib/events') - -var globalRegistry = require('../../global/registry') - -const styleguide = require('../ui/styles-guide/theme-chooser') -const TabbedMenu = require('../tabs/tabbed-menu') -const PluginTab = require('../tabs/plugin-tab') -const DraggableContent = require('../ui/draggableContent') - -const styles = styleguide.chooser() - -const css = csjs` - .righthandpanel { - display : flex; - flex-direction : column; - top : 0; - right : 0; - bottom : 0; - box-sizing : border-box; - overflow : hidden; - height : 100%; - } - .header { - height : 100%; - } - .dragbar { - position : absolute; - width : 0.5em; - top : 3em; - bottom : 0; - cursor : col-resize; - z-index : 999; - border-left : 2px solid ${styles.rightPanel.bar_Dragging}; - } - .ghostbar { - width : 3px; - background-color : ${styles.rightPanel.bar_Ghost}; - opacity : 0.5; - position : absolute; - cursor : col-resize; - z-index : 9999; - top : 0; - bottom : 0; - } -` - -class RighthandPanel { - constructor ({pluginManager, tabs}, localRegistry) { - const self = this - self._components = {} - self._components.registry = localRegistry || globalRegistry - self._components.registry.put({api: this, name: 'righthandpanel'}) - self.event = new EventManager() - self._view = { - element: null, - tabbedMenu: null, - tabbedMenuViewport: null, - dragbar: null - } - - var tabbedMenu = new TabbedMenu(self._components.registry) - - self._components = { - tabbedMenu: tabbedMenu, - tabs - } - - self._components.tabs.settings.event.register('plugin-loadRequest', json => { - self.loadPlugin(json) - }) - - self.loadPlugin = function (json) { - var modal = new DraggableContent(() => { - pluginManager.unregister(json) - }) - var tab = new PluginTab(json) - var content = tab.render() - document.querySelector('body').appendChild(modal.render(json.title, json.url, content)) - pluginManager.register(json, modal, content) - } - - self._view.dragbar = yo`
` - self._view.element = yo` -
- ${self._view.dragbar} - -
` - - const { compile, run, settings, analysis, debug, support, test } = tabs - self._components.tabbedMenu.addTab('Compile', 'compileView', compile.render()) - self._components.tabbedMenu.addTab('Run', 'runView', run.render()) - self._components.tabbedMenu.addTab('Analysis', 'staticanalysisView', analysis.render()) - self._components.tabbedMenu.addTab('Testing', 'testView', test.render()) - self._components.tabbedMenu.addTab('Debugger', 'debugView', debug.render()) - self._components.tabbedMenu.addTab('Settings', 'settingsView', settings.render()) - self._components.tabbedMenu.addTab('Support', 'supportView', support.render()) - self._components.tabbedMenu.selectTabByTitle('Compile') - } - - render () { - const self = this - if (self._view.element) return self._view.element - return self._view.element - } - - debugger () { - return this._components.tabs.debug.debugger() - } - - focusOn (x) { - if (this._components.tabbedMenu) this._components.tabbedMenu.selectTabByClassName(x) - } - - init () { - // @TODO: init is for resizable drag bar only and should be refactored in the future - const self = this - const limit = 60 - self._view.dragbar.addEventListener('mousedown', mousedown) - const ghostbar = yo`
` - function mousedown (event) { - event.preventDefault() - if (event.which === 1) { - moveGhostbar(event) - document.body.appendChild(ghostbar) - document.addEventListener('mousemove', moveGhostbar) - document.addEventListener('mouseup', removeGhostbar) - document.addEventListener('keydown', cancelGhostbar) - } - } - function cancelGhostbar (event) { - if (event.keyCode === 27) { - document.body.removeChild(ghostbar) - document.removeEventListener('mousemove', moveGhostbar) - document.removeEventListener('mouseup', removeGhostbar) - document.removeEventListener('keydown', cancelGhostbar) - } - } - function getPosition (event) { - const lhp = window['filepanel'].offsetWidth - const max = document.body.offsetWidth - limit - var newpos = (event.pageX > max) ? max : event.pageX - newpos = (newpos > (lhp + limit)) ? newpos : lhp + limit - return newpos - } - function moveGhostbar (event) { // @NOTE VERTICAL ghostbar - ghostbar.style.left = getPosition(event) + 'px' - } - function removeGhostbar (event) { - document.body.removeChild(ghostbar) - document.removeEventListener('mousemove', moveGhostbar) - document.removeEventListener('mouseup', removeGhostbar) - document.removeEventListener('keydown', cancelGhostbar) - self.event.trigger('resize', [document.body.offsetWidth - getPosition(event)]) - } - } -} - -module.exports = RighthandPanel diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index f5b9aa5365..e2fba7c881 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -1,4 +1,5 @@ /* global Worker */ +const EventEmitter = require('events') const async = require('async') const $ = require('jquery') const yo = require('yo-yo') @@ -25,6 +26,7 @@ const styles = styleGuide.chooser() module.exports = class CompileTab { constructor (localRegistry) { const self = this + self.event = new EventEmitter() self._view = { el: null, autoCompile: null, @@ -115,9 +117,11 @@ module.exports = class CompileTab { self._view.compileIcon.setAttribute('title', '') }) self._components.compiler.event.register('compilationFinished', function finish (success, data, source) { + if (success) { + // forwarding the event to the appManager infra + self.event.emit('compilationFinished', null, source, 'Solidity', data) + } if (self._view.compileIcon) { - const compileTab = document.querySelector('.compileView') - compileTab.style.color = styles.colors.black self._view.compileIcon.style.color = styles.colors.black self._view.compileIcon.classList.remove(`${css.spinningIcon}`) self._view.compileIcon.classList.remove(`${css.bouncingIcon}`) @@ -129,7 +133,6 @@ module.exports = class CompileTab { self._view.contractNames.innerHTML = '' if (success) { // TODO consider using compile tab as a proper module instead of just forwarding event - self._deps.pluginManager.receivedDataFrom('sendCompilationResult', 'solidity-compiler', [data.target, source, self.data.selectedVersion, data]) self._view.contractNames.removeAttribute('disabled') self._components.compiler.visitContracts(contract => { self.data.contractsDetails[contract.name] = parseContracts(contract.name, contract.object, self._components.compiler.getSource(contract.file)) @@ -139,22 +142,16 @@ module.exports = class CompileTab { } else { self._view.contractNames.setAttribute('disabled', true) } - // hightlight the tab if error - if (success) document.querySelector('.compileView').style.color = '' // @TODO: compileView tab - else document.querySelector('.compileView').style.color = styles.colors.red // @TODO: compileView tab - // display warning error if any var error = false if (data['error']) { error = true self._deps.renderer.error(data['error'].formattedMessage, self._view.errorContainer, {type: data['error'].severity || 'error'}) if (data['error'].mode === 'panic') { - /* return modalDialogCustom.alert(yo`
The compiler returned with the following internal error:
${data['error'].formattedMessage}.
The compiler might be in a non-sane state, please be careful and do not use further compilation data to deploy to mainnet. It is heavily recommended to use another browser not affected by this issue (Firefox is known to not be affected).

Please join remix gitter channel for more information.
`) - */ } } if (data.errors && data.errors.length) { @@ -185,6 +182,13 @@ module.exports = class CompileTab { } }) } + profile () { + return { + type: 'solidityCompile', + methods: {}, + events: ['compilationFinished'] + } + } addWarning (msg, settings) { const self = this self._deps.renderer.error(msg, self._view.errorContainerHead, settings) diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index b8f38ed79c..525cd33c39 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -205,7 +205,6 @@ module.exports = class SettingsTab { const css = csjs` .settingsTabView { padding: 2%; - display: flex; } .info { ${styles.rightPanel.settingsTab.box_SolidityVersionInfo}; diff --git a/src/app/ui/renderer.js b/src/app/ui/renderer.js index f90e756971..b5b968c72c 100644 --- a/src/app/ui/renderer.js +++ b/src/app/ui/renderer.js @@ -16,7 +16,6 @@ function Renderer (localRegistry) { self._components.registry = localRegistry || globlalRegistry // dependencies self._deps = { - editor: self._components.registry.get('editor').api, fileManager: self._components.registry.get('filemanager').api, config: self._components.registry.get('config').api } @@ -27,13 +26,15 @@ function Renderer (localRegistry) { Renderer.prototype._error = function (file, error) { const self = this + const editor = self._components.registry.get('editor').api if (file === self._deps.config.get('currentFile')) { - self._deps.editor.addAnnotation(error) + editor.addAnnotation(error) } } Renderer.prototype._errorClick = function (errFile, errLine, errCol) { const self = this + const editor = self._components.registry.get('editor').api if (errFile !== self._deps.config.get('currentFile')) { // TODO: refactor with this._components.contextView.jumpTo var provider = self._deps.fileManager.fileProviderOf(errFile) @@ -41,11 +42,11 @@ Renderer.prototype._errorClick = function (errFile, errLine, errCol) { provider.exists(errFile, (error, exist) => { if (error) return console.log(error) self._deps.fileManager.switchFile(errFile) - self._deps.editor.gotoLine(errLine, errCol) + editor.gotoLine(errLine, errCol) }) } } else { - self._deps.editor.gotoLine(errLine, errCol) + editor.gotoLine(errLine, errCol) } } From b1d3ec1a884535ce936a6cfbe1055f47a1d64225 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 7 Jan 2019 15:04:39 +0100 Subject: [PATCH 015/636] add minimal API for plugin --- package.json | 1 + src/app.js | 81 ++++++++++++++++--- .../components/plugin-manager-component.js | 35 +++++--- src/app/components/swap-panel-api.js | 2 +- src/app/components/vertical-icons-api.js | 2 +- src/app/editor/SourceHighlighters.js | 35 ++++++++ src/app/editor/editor.js | 3 + src/app/files/browser-files-tree.js | 7 ++ src/app/files/fileManager.js | 49 +++++++++++ src/app/panels/editor-panel.js | 48 +++++------ src/app/tabs/compile-tab.js | 5 +- src/universal-dapp.js | 36 +++++++++ 12 files changed, 257 insertions(+), 47 deletions(-) create mode 100644 src/app/editor/SourceHighlighters.js diff --git a/package.json b/package.json index c7fbb313fc..3b186abf8d 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "csslint": "^1.0.2", "deep-equal": "^1.0.1", "ethereumjs-util": "^5.1.2", + "events": "^3.0.0", "execr": "^1.0.1", "exorcist": "^0.4.0", "fast-async": "6.3.1", diff --git a/src/app.js b/src/app.js index ba31917b56..61893cf9fa 100644 --- a/src/app.js +++ b/src/app.js @@ -6,6 +6,7 @@ var async = require('async') var request = require('request') var remixLib = require('remix-lib') var EventManager = require('./lib/events') +var EventEmitter = require('events') var registry = require('./global/registry') var UniversalDApp = require('./universal-dapp.js') @@ -203,6 +204,13 @@ class App { var self = this run.apply(self) } + + profile () { + return { + type: 'app', + methods: ['getExecutionContextProvider', 'getProviderEndpoint', 'detectNetWork', 'addProvider', 'removeProvider'] + } + } render () { var self = this @@ -283,6 +291,34 @@ class App { if (callback) callback(error) }) } + + getExecutionContextProvider (cb) { + cb(null, executionContext.getProvider()) + } + + getProviderEndpoint (cb) { + if (executionContext.getProvider() === 'web3') { + cb(null, executionContext.web3().currentProvider.host) + } else { + cb('no endpoint: current provider is either injected or vm') + } + } + + detectNetWork (cb) { + executionContext.detectNetwork((error, network) => { + cb(error, network) + }) + } + + addProvider (name, url, cb) { + executionContext.addProvider({ name, url }) + cb() + } + + removeProvider (name, cb) { + executionContext.removeProvider(name) + cb() + } } module.exports = App @@ -362,33 +398,60 @@ Please make a backup of your contracts and start using http://remix.ethereum.org }) registry.put({api: eventsDecoder, name: 'eventsdecoder'}) + /* + that proxy is used by appManager to broadcast new transaction event + */ + const txListenerModuleProxy = { + event: new EventEmitter(), + profile() { + return { + type: 'txListener', + events: ['newTransaction'] + } + } + } + txlistener.event.register('newTransaction', (tx) => { + txListenerModule.event.emit('newTransaction', tx) + }) + txlistener.startListening() // TODO: There are still a lot of dep between editorpanel and filemanager - // ----------------- editor panel ---------------------- - self._components.editorpanel = new EditorPanel() - registry.put({ api: self._components.editorpanel, name: 'editorpanel' }) - // ----------------- file manager ---------------------------- self._components.fileManager = new FileManager() var fileManager = self._components.fileManager registry.put({api: fileManager, name: 'filemanager'}) + // ----------------- editor panel ---------------------- + self._components.editorpanel = new EditorPanel() + registry.put({ api: self._components.editorpanel, name: 'editorpanel' }) + // ----------------- Renderer ----------------- var renderer = new Renderer() registry.put({api: renderer, name: 'renderer'}) // ----------------- app manager ---------------------------- - const PluginManagerProfile = { - type: 'pluginManager', - methods: [] - } + + /* + TODOs: + - for each activated plugin, + an internal module (associated only with the plugin) should be created for accessing specific part of the UI. detail to be discussed + - the current API is not optimal. For instance methods of `app` only refers to `executionContext`, wich does not make really sense. + */ const appManager = new AppManager({modules: [],plugins : []}) const swapPanelComponent = new SwapPanelComponent() - const pluginManagerComponent = new PluginManagerComponent() + const pluginManagerComponent = new PluginManagerComponent( + { + app: this, + udapp: udapp, + fileManager: fileManager, + sourceHighlighters: registry.get('editor').api.sourceHighlighters, + config: self._components.filesProviders['config'], + txListener: txListenerModuleProxy + }) registry.put({api: pluginManagerComponent.proxy(), name: 'pluginmanager'}) self._components.editorpanel.init() diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 08ede7bc40..1ca95bf82f 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -21,11 +21,20 @@ const EventEmitter = require ('events') class PluginManagerComponent { - constructor () { + constructor ({ app, udapp, fileManager, sourceHighlighters, config, txListener }) { this.event = new EventEmitter() this.modulesDefinition = { - 'FilePanel': { name: 'FilePanel', Type: FilePanel, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwb2x5bGluZSBmaWxsPSJub25lIiBwb2ludHM9IjQ0LDIxIDQ0LDQ5IDYsNDkgICA2LDIxICIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBvbHlsaW5lIGZpbGw9Im5vbmUiIHBvaW50cz0iMTksNDkgMTksMjggMzEsMjggICAzMSw0OSAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjxwb2x5Z29uIHBvaW50cz0iMzUsNSAzNSw4LjAxNiAzNywxMC4wOTQgMzcsNyAzOSw3IDM5LDEyLjIwMyA0MSwxNC4yNjYgNDEsNSAiLz48cG9seWxpbmUgZmlsbD0ibm9uZSIgcG9pbnRzPSIgIDEuMTEsMjUuOTQyIDI1LDEuMDUzIDQ4Ljg5LDI1Ljk0MyAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' }, + // service module. They can be seen as daemon + // they usually don't have UI and only represent the minimal API a plugins can access. + 'App': { name: 'App', target: app }, + 'Udapp': { name: 'Udapp', target: udapp }, + 'FileManager': { name: 'FileManager', target: fileManager }, + 'SourceHighlighters': { name: 'SourceHighlighters', target: sourceHighlighters }, + 'Config': { name: 'Config', target: config }, + 'TxListener': { name: 'TxListener', target: txListener }, + // internal components. They are mostly views, they don't provide external API for plugins 'Solidity Compile': { name: 'Solidity Compile', class: 'evm-compiler', Type: CompileTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVz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{ + this.activateInternal('App') + this.activateInternal('Udapp') + this.activateInternal('FileManager') + this.activateInternal('SourceHighlighters') + this.activateInternal('Config') + this.activateInternal('TxListener') + this.activateInternal('FilePanel') this.activateInternal('Solidity Compile') this.activateInternal('Run') @@ -63,13 +79,12 @@ class PluginManagerComponent { ` } - activatePlugin (name, api) { - let profile = { json: Plugin1Profile, api: pluginManagerApi } + activatePlugin (jsonProfile, api) { + let profile = { json: jsonProfile, api } let plugin = new Plugin(profile, api) this.appManager.addPlugin(plugin) - // Plugin1Profile.location - // mainpanel or swappanel or bottom-bar - // plugin.render() // plugin.create() + this.event.emit('displayableModuleActivated', jsonProfile, plugin.render()) + this.activated[jsonProfile.name] = plugin } activateInternal (name) { @@ -78,12 +93,14 @@ class PluginManagerComponent { if (mod.dep) dep = this.activateInternal(mod.dep) let instance = mod.target if (!instance && mod.Type) instance = new mod.Type(registry, dep) - if (!instance) return console.log('PluginManagerComponent: no Type or instance to add') + if (!instance) return console.log(`PluginManagerComponent: no Type or instance to add: ${JSON.stringify(mod)}`) registry.put({api: instance, name: mod.name.toLocaleLowerCase()}) if (instance.profile && typeof instance.profile === 'function') { this.event.emit('requestActivation', instance.profile(), instance) } - this.event.emit('internalActivated', mod, instance.render()) + if (mod.icon && instance.render && typeof instance.render === 'function') { + this.event.emit('requestContainer', mod, instance.render()) + } // if of type evm-compiler, we forward to the internal components if (mod.class === 'evm-compiler') { this.data.proxy.register(mod, instance) diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index 376f016f10..24cbd40ce5 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -13,7 +13,7 @@ class SwapPanelApi { verticalIconsComponent.event.on('showContent', (moduleName) => { this.component.showContent(moduleName) }) - pluginManagerComponent.event.on('internalActivated', (mod, content) => { + pluginManagerComponent.event.on('requestContainer', (mod, content) => { this.add(mod.name, content) }) } diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index 3cb69883d5..0ddd3c21bc 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -10,7 +10,7 @@ class VerticalIconsApi { constructor(verticalIconsComponent, pluginManagerComponent) { this.component = verticalIconsComponent - pluginManagerComponent.event.on('internalActivated', (mod, content) => verticalIconsComponent.addIcon(mod) ) + pluginManagerComponent.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod) ) } } module.exports = VerticalIconsApi diff --git a/src/app/editor/SourceHighlighters.js b/src/app/editor/SourceHighlighters.js new file mode 100644 index 0000000000..e5eaa3d92b --- /dev/null +++ b/src/app/editor/SourceHighlighters.js @@ -0,0 +1,35 @@ +'use strict' +var SourceHighlighter = require('./sourceHighlighter') + +module.exports = class SourceHighlighters { + + constructor () { + this.highlighters = {} + } + + profile () { + return { + type: 'sourcehighlighter', + methods: ['highlight', 'discardHighlight'] + } + } + + // TODO what to do with mod? + highlight (mod, lineColumnPos, filePath, hexColor, cb) { + var position + try { + position = JSON.parse(lineColumnPos) + } catch (e) { + return cb(e.message) + } + if (!highlighters[mod]) highlighters[mod] = new SourceHighlighter() + highlighters[mod].currentSourceLocation(null) + highlighters[mod].currentSourceLocationFromfileName(position, filePath, hexColor) + cb() + } + + discardHighlight (mod, cb) { + if (highlighters[mod]) highlighters[mod].currentSourceLocation(null) + cb() + } +} \ No newline at end of file diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index e2d27838c4..bdb9734a2a 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -7,6 +7,7 @@ var ace = require('brace') require('brace/theme/tomorrow_night_blue') var globalRegistry = require('../../global/registry') +const SourceHighlighters = require('./SourceHighlighters') var Range = ace.acequire('ace/range').Range require('brace/ext/language_tools') @@ -317,6 +318,8 @@ function Editor (opts = {}, localRegistry) { editor.commands.bindKeys({ 'ctrl-t': null }) editor.setShowPrintMargin(false) editor.resize(true) + + this.sourceHighlighters = new SourceHighlighters() } function editorOnChange (self) { diff --git a/src/app/files/browser-files-tree.js b/src/app/files/browser-files-tree.js index bc434e0561..b527d4cd71 100644 --- a/src/app/files/browser-files-tree.js +++ b/src/app/files/browser-files-tree.js @@ -130,6 +130,13 @@ function FilesTree (name, storage) { if (path[0] === '/') return path.substring(1) return path } + + this.profile = function () { + return { + type: this.type, + methods: ['get', 'set', 'remove'] + } + } } module.exports = FilesTree diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 5361093123..65b8d19cb2 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -2,6 +2,7 @@ var $ = require('jquery') var yo = require('yo-yo') +var EventEmitter = require ('events') var EventManager = require('../../lib/events') var globalRegistry = require('../../global/registry') var CompilerImport = require('../compiler/compiler-imports') @@ -15,6 +16,7 @@ class FileManager { constructor (localRegistry) { this.tabbedFiles = {} this.event = new EventManager() + this.nodeEvent = new EventEmitter() this._components = {} this._components.compilerImport = new CompilerImport() this._components.registry = localRegistry || globalRegistry @@ -42,6 +44,18 @@ class FileManager { self._deps.gistExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) }) self._deps.localhostExplorer.event.register('errored', (event) => { this.removeTabsOf(self._deps.localhostExplorer) }) self._deps.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(self._deps.localhostExplorer) }) + + self.event.register('currentFileChanged', (file, provider) => { + this.nodeEvent.emit('currentFileChanged', file) + }) + } + + profile () { + return { + type: 'fileManager', + methods: ['getFilesFromPath', 'getCurrentFile', 'getFile', 'setFile'], + events: ['currentFileChanged'] + } } fileRenamedEvent (oldName, newName, isFolder) { @@ -94,6 +108,41 @@ class FileManager { return path ? path[1] : null } + getCurrentFile (cb) { + var path = this.currentFile() + if (!path) { + cb('no file selected') + } else { + cb(null, path) + } + } + + getFile (path, cb) { + var provider = this.fileProviderOf(path) + if (provider) { + // TODO add approval to user for external plugin to get the content of the given `path` + provider.get(path, (error, content) => { + cb(error, content) + }) + } else { + cb(path + ' not available') + } + } + + setFile (path, content, cb) { + var provider = this.fileProviderOf(path) + if (provider) { + // TODO add approval to user for external plugin to set the content of the given `path` + provider.set(path, content, (error) => { + if (error) return cb(error) + this.syncEditor(path) + cb() + }) + } else { + cb(path + ' not available') + } + } + removeTabsOf (provider) { for (var tab in this.tabbedFiles) { if (this.fileProviderOf(tab).type === provider.type) { diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 6906222f01..6dc8f84467 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -15,9 +15,11 @@ var css = styles.css class EditorPanel { constructor (localRegistry) { var self = this + self.event = new EventManager() self._components = {} self._components.registry = localRegistry || globalRegistry - self.event = new EventManager() + self._components.editor = new Editor({}) + self._components.registry.put({api: self._components.editor, name: 'editor'}) } init () { var self = this @@ -38,32 +40,26 @@ class EditorPanel { } } self._view = {} - var editor = new Editor({}) - self._components.registry.put({api: editor, name: 'editor'}) - - var contextualListener = new ContextualListener({editor, pluginManager: self._deps.pluginManager}) - var contextView = new ContextView({contextualListener, editor}) + + var contextualListener = new ContextualListener({editor: self._components.editor, pluginManager: self._deps.pluginManager}) + var contextView = new ContextView({contextualListener, editor: self._components.editor}) - self._components = { - editor: editor, - contextualListener: contextualListener, - contextView: contextView, - // TODO list of compilers is always empty; should find a path to add plugin compiler here - terminal: new Terminal({ - udapp: self._deps.udapp, - compilers: {} - }, - { - getPosition: (event) => { - var limitUp = 36 - var limitDown = 20 - var height = window.innerHeight - var newpos = (event.pageY < limitUp) ? limitUp : event.pageY - newpos = (newpos < height - limitDown) ? newpos : height - limitDown - return newpos - } - }) - } + self._components.contextualListener = contextualListener + self._components.contextView = contextView + self._components.terminal = new Terminal({ + udapp: self._deps.udapp, + compilers: {} + }, + { + getPosition: (event) => { + var limitUp = 36 + var limitDown = 20 + var height = window.innerHeight + var newpos = (event.pageY < limitUp) ? limitUp : event.pageY + newpos = (newpos < height - limitDown) ? newpos : height - limitDown + return newpos + } + }) self._components.terminal.event.register('filterChanged', (type, value) => { this.event.trigger('terminalFilterChanged', [type, value]) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index e2fba7c881..262a78a4f1 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -182,10 +182,13 @@ module.exports = class CompileTab { } }) } + getCompilationResult (cb) { + cb(null, self._components.compiler.lastCompilationResult) + } profile () { return { type: 'solidityCompile', - methods: {}, + methods: ['getCompilationResult'], events: ['compilationFinished'] } } diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 3342478c60..207fdbe1d4 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -29,6 +29,13 @@ function UniversalDApp (registry) { executionContext.event.register('contextChanged', this.resetEnvironment.bind(this)) } +UniversalDApp.prototype.profile = function () { + return { + type: 'udapp', + methods: ['runTestTx', 'getAccounts', 'createVMAccount'] + } +} + UniversalDApp.prototype.resetEnvironment = function () { this.accounts = {} if (executionContext.isVM()) { @@ -64,6 +71,7 @@ UniversalDApp.prototype.resetAPI = function (transactionContextAPI) { } UniversalDApp.prototype.createVMAccount = function (privateKey, balance, cb) { + if (executionContext.getProvider() !== 'vm') return cb('plugin API does not allow creating a new account through web3 connection. Only vm mode is allowed') this._addAccount(privateKey, balance) executionContext.vm().stateManager.cache.flush(function () {}) privateKey = Buffer.from(privateKey, 'hex') @@ -216,6 +224,34 @@ UniversalDApp.prototype.getInputs = function (funABI) { return txHelper.inputParametersDeclarationToString(funABI.inputs) } +/** + * This function send a tx only to javascript VM or testnet, will return an error for the mainnet + * SHOULD BE TAKEN CAREFULLY! + * + * @param {Object} tx - transaction. + * @param {Function} callback - callback. + */ +UniversalDApp.prototype.runTestTx = function (tx, cb) { + executionContext.detectNetwork((error, network) => { + if (error) return cb(error) + if (network.name === 'Main' && network.id === '1') { + return cb('It is not allowed to make this action against mainnet') + } + udapp.silentRunTx(tx, (error, result) => { + if (error) return cb(error) + cb(null, { + transactionHash: result.transactionHash, + status: result.result.status, + gasUsed: '0x' + result.result.gasUsed.toString('hex'), + error: result.result.vm.exceptionError, + return: result.result.vm.return ? '0x' + result.result.vm.return.toString('hex') : '0x', + createdAddress: result.result.createdAddress ? '0x' + result.result.createdAddress.toString('hex') : undefined + }) + }) + }) +} + + /** * This function send a tx without alerting the user (if mainnet or if gas estimation too high). * SHOULD BE TAKEN CAREFULLY! From 0b450f6b0b304fa0ba51cbe27e56ab7b9d2c8e28 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Wed, 9 Jan 2019 12:54:21 +0100 Subject: [PATCH 016/636] update with commented out code, errors for discussion and a question --- src/app.js | 34 +++---- src/app/components/plugin-manager-api.js | 24 ++--- .../components/plugin-manager-component.js | 86 +++++++++++------ src/app/components/plugin-manager-proxy.js | 4 +- src/app/components/swap-panel-api.js | 9 +- src/app/components/swap-panel-component.js | 11 +-- src/app/components/vertical-icons-api.js | 13 +-- .../components/vertical-icons-component.js | 92 +++++++++++-------- src/app/editor/SourceHighlighters.js | 50 +++++----- src/app/files/fileManager.js | 4 +- src/app/panels/editor-panel.js | 2 +- src/app/panels/left-icon-panel.js | 1 - src/universal-dapp.js | 1 - 13 files changed, 170 insertions(+), 161 deletions(-) diff --git a/src/app.js b/src/app.js index 61893cf9fa..b8f230dd90 100644 --- a/src/app.js +++ b/src/app.js @@ -39,12 +39,12 @@ const PluginManagerComponent = require('./app/components/plugin-manager-componen const PluginManagerApi = require('./app/components/plugin-manager-api') const VerticalIconsComponent = require('./app/components/vertical-icons-component') -const VerticalIconsApi = require('./app/components/vertical-icons-api') +// const VerticalIconsApi = require('./app/components/vertical-icons-api') const SwapPanelComponent = require('./app/components/swap-panel-component') -const SwapPanelApi = require('./app/components/swap-panel-api') +// const SwapPanelApi = require('./app/components/swap-panel-api') -const AppManager = require('remix-plugin').AppManager +// const AppManager = require('remix-plugin').AppManager var styleGuide = require('./app/ui/styles-guide/theme-chooser') var styles = styleGuide.chooser() @@ -178,7 +178,7 @@ class App { } } _adjustLayout (direction, delta) { - /*var self = this + /* var self = this var layout = self.data._layout[direction] if (layout) { if (delta === undefined) { @@ -211,7 +211,7 @@ class App { methods: ['getExecutionContextProvider', 'getProviderEndpoint', 'detectNetWork', 'addProvider', 'removeProvider'] } } - + render () { var self = this if (self._view.el) return self._view.el @@ -235,7 +235,7 @@ class App { ${''}
` - + self._view.el = yo`
${self._view.iconpanel} @@ -310,12 +310,12 @@ class App { }) } - addProvider (name, url, cb) { + addProvider (name, url, cb) { executionContext.addProvider({ name, url }) cb() } - removeProvider (name, cb) { + removeProvider (name, cb) { executionContext.removeProvider(name) cb() } @@ -403,7 +403,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org */ const txListenerModuleProxy = { event: new EventEmitter(), - profile() { + profile () { return { type: 'txListener', events: ['newTransaction'] @@ -430,21 +430,21 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // ----------------- Renderer ----------------- var renderer = new Renderer() registry.put({api: renderer, name: 'renderer'}) - + // ----------------- app manager ---------------------------- /* TODOs: - for each activated plugin, an internal module (associated only with the plugin) should be created for accessing specific part of the UI. detail to be discussed - - the current API is not optimal. For instance methods of `app` only refers to `executionContext`, wich does not make really sense. + - the current API is not optimal. For instance methods of `app` only refers to `executionContext`, wich does not make really sense. */ - const appManager = new AppManager({modules: [],plugins : []}) + // const appManager = new AppManager({modules: [], plugins: []}) const swapPanelComponent = new SwapPanelComponent() const pluginManagerComponent = new PluginManagerComponent( - { + { app: this, udapp: udapp, fileManager: fileManager, @@ -455,12 +455,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org registry.put({api: pluginManagerComponent.proxy(), name: 'pluginmanager'}) self._components.editorpanel.init() - self._components.fileManager.init() - + self._components.fileManager.init() + const verticalIconComponent = new VerticalIconsComponent() - const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, pluginManagerComponent) - const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, pluginManagerComponent) + // const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, pluginManagerComponent) + // const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, pluginManagerComponent) const pluginManagerAPI = new PluginManagerApi(pluginManagerComponent) self._view.mainpanel.appendChild(self._components.editorpanel.render()) diff --git a/src/app/components/plugin-manager-api.js b/src/app/components/plugin-manager-api.js index 865c0b3ce6..66acb32242 100644 --- a/src/app/components/plugin-manager-api.js +++ b/src/app/components/plugin-manager-api.js @@ -1,31 +1,19 @@ -var yo = require('yo-yo') -var csjs = require('csjs-inject') -const remixLib = require('remix-lib') - -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() +// const remixLib = require('remix-lib') class PluginManagerApi { constructor (pluginManagerComponent) { + this.component = pluginManagerComponent pluginManagerComponent.event.on('activation', (item) => this.event.emit('activation', item)) // listen by appManager pluginManagerComponent.event.on('deactivation', (item) => this.event.emit('deactivation', item)) // listen by appManager } - /* - function called by appManager - */ - addItem (item) { - // add to appManager and then render - this.renderItem(item) - } - init (data) { - for (var m in data.modules) { - this.renderItem(item) + for (var m in data.modules) { + this.renderItem(m) } - for (var m in data.plugins) { - this.renderItem(item) + for (var n in data.plugins) { + this.renderItem(n) } } } diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 1ca95bf82f..9f2b842639 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -12,12 +12,12 @@ const RunTab = require('../tabs/run-tab') var registry = require('../../global/registry') -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() +// const styleguide = require('../ui/styles-guide/theme-chooser') +// const styles = styleguide.chooser() const PluginManagerProxy = require('./plugin-manager-proxy') -const EventEmitter = require ('events') +const EventEmitter = require('events') class PluginManagerComponent { @@ -44,9 +44,13 @@ class PluginManagerComponent { 'Settings': { name: 'Settings', Type: SettingsTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDE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UxLTEuOTlsNS45MjIsNC4xNTVsNC4yNDItNC4yNDUgIGwtNC4yMjctNS44N2MwLjg3NS0xLjQ1NiwxLjUzOS0zLjA0OCwxLjk1OC00LjczOUw0OSwyNy45NTR6IE0yNSwzM2MtNC40MTgsMC04LTMuNTgyLTgtOHMzLjU4Mi04LDgtOHM4LDMuNTgyLDgsOFMyOS40MTgsMzMsMjUsMzMgIHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' } } this.activated = {} // list all activated modules + // this.activated = [] // list all activated modules this.plugins = [] this.data = {} this.data.proxy = new PluginManagerProxy() + + // This load the state from localstorage first then from the second parameter is nothing is found in localstorage + // this.store = Store.fromLocal('***', {}) // Or EntityStore.fromLocal('***', {}, 'id') } proxy () { @@ -70,21 +74,52 @@ class PluginManagerComponent { } render () { - var self = this + // var self = this // loop over all this.modules and this.plugins - return yo` + let pluginManagerDiv = yo`
- list all modules / plugins that can be activated +

Plugin Manager

+
+ ` + for (var mod in this.modulesDefinition) { + if (this.modulesDefinition[mod].icon) pluginManagerDiv.appendChild(this.renderItem(mod)) + } + console.log(this.activated) + return pluginManagerDiv + } + + renderItem (item) { + let ctrBtns + if (this.activated.hasOwnProperty(item)) { + ctrBtns = yo` + + ` + } else { + ctrBtns = yo` + + ` + } + this.plugins.push(item) + // var self = this + return yo` +
+ ${this.modulesDefinition[item].name} + ${ctrBtns}
` } activatePlugin (jsonProfile, api) { - let profile = { json: jsonProfile, api } - let plugin = new Plugin(profile, api) - this.appManager.addPlugin(plugin) - this.event.emit('displayableModuleActivated', jsonProfile, plugin.render()) - this.activated[jsonProfile.name] = plugin + // let profile = { json: jsonProfile, api } + // let plugin = new Plugin(profile, api) + // this.appManager.addPlugin(plugin) + // this.event.emit('displayableModuleActivated', jsonProfile, plugin.render()) + // this.activated[jsonProfile.name] = plugin + } + + deactivateInternal (name) { + delete this.activated[name] + this.event.emit('removingItem', name) } activateInternal (name) { @@ -116,32 +151,23 @@ class PluginManagerComponent { _deactivate (item) { this.event.emit('deactivation', item) } - - renderItem (item) { - this.plugins.push(item) - var self = this - var view = yo` -
- ${item.name} - ${item.url} - - -
- ` - } } module.exports = PluginManagerComponent const css = csjs` - .plugins { + .plugins { width : 300px; } - .plugItIn { - display : none; + .plugin { + border-bottom: 1px black solid; + padding: 10px 20px; + margin-bottom: 20px; + } + .plugItIn.active { + display: block; } - .plugItIn.active { - display :block; + .plugin button { + cursor: pointer; } - .clearFunds { background-color: lightblue; } ` diff --git a/src/app/components/plugin-manager-proxy.js b/src/app/components/plugin-manager-proxy.js index f4849aa534..2aa9508235 100644 --- a/src/app/components/plugin-manager-proxy.js +++ b/src/app/components/plugin-manager-proxy.js @@ -1,5 +1,3 @@ -var yo = require('yo-yo') - var registry = require('../../global/registry') const CompilerAbstract = require('../compiler/compiler-abstract') @@ -9,7 +7,7 @@ const EventManager = require('remix-lib').EventManager class PluginManagerProxy { constructor () { - this.event = new EventManager + this.event = new EventManager() } register (mod, instance) { diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index 24cbd40ce5..9a37f76075 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -1,11 +1,4 @@ -var yo = require('yo-yo') -var csjs = require('csjs-inject') -const remixLib = require('remix-lib') - -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() - -const EventEmmitter = require('events') +// const EventEmmitter = require('events') class SwapPanelApi { constructor (swapPanelComponent, verticalIconsComponent, pluginManagerComponent) { diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index c10bfbe715..525c2e8667 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -1,9 +1,9 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') -const remixLib = require('remix-lib') +// const remixLib = require('remix-lib') -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() +// const styleguide = require('../ui/styles-guide/theme-chooser') +// const styles = styleguide.chooser() class SwapPanelComponent { constructor () { @@ -26,15 +26,14 @@ class SwapPanelComponent { console.log(`${moduleName} not found`) } - add (moduleName, content) { this.contents[moduleName] = yo`
${content}
` this.view.appendChild(this.contents[moduleName]) this.showContent(moduleName) - } + } render () { - this.view = yo` + this.view = yo`
` diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index 0ddd3c21bc..3c4ba39ef0 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -1,16 +1,9 @@ -var yo = require('yo-yo') -var csjs = require('csjs-inject') -const remixLib = require('remix-lib') - -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() - // API class VerticalIconsApi { - constructor(verticalIconsComponent, pluginManagerComponent) { + constructor (verticalIconsComponent, pluginManagerComponent) { this.component = verticalIconsComponent - pluginManagerComponent.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod) ) - } + pluginManagerComponent.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod)) + } } module.exports = VerticalIconsApi diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index 3364da36e9..6977234217 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -1,44 +1,58 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') -const remixLib = require('remix-lib') +// const remixLib = require('remix-lib') -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() +// const styleguide = require('../ui/styles-guide/theme-chooser') +// const styles = styleguide.chooser() const EventEmmitter = require('events') - - // Component - class VerticalIconComponent { - - constructor() { - this.event = new EventEmmitter - } - - addIcon (mod) { - let self = this - this.view.appendChild(yo`
{ self._iconClick(mod.name)}} title=${mod.name}>${mod.name}
`) - } - - removeIcon (item) { - - } - - select (name) { - this.event.emit('showContent', name) - } - - _iconClick (name) { - // called when an icon has been clicked - this.event.emit('showContent', name) - } - - render() { - this.view = yo` -
-
- ` - return this.view - } - } - - module.exports = VerticalIconComponent + +// Component +class VerticalIconComponent { + + constructor () { + this.event = new EventEmmitter() + } + + addIcon (mod) { + let self = this + this.view.appendChild(yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
`) + } + + removeIcon (item) { + + } + + select (name) { + this.event.emit('showContent', name) + } + + _iconClick (name) { + // called when an icon has been clicked + this.event.emit('showContent', name) + } + + render () { + this.view = yo` +
+
+ ` + return this.view + } +} + +module.exports = VerticalIconComponent + +const css = csjs` + .icons { + margin-left: 10px; + margin-top: 15px; + } + .icon { + cursor: pointer; + margin-bottom: 25px; + } + .icon img { + width: 25px; + } +` diff --git a/src/app/editor/SourceHighlighters.js b/src/app/editor/SourceHighlighters.js index e5eaa3d92b..8902235fe5 100644 --- a/src/app/editor/SourceHighlighters.js +++ b/src/app/editor/SourceHighlighters.js @@ -3,33 +3,33 @@ var SourceHighlighter = require('./sourceHighlighter') module.exports = class SourceHighlighters { - constructor () { - this.highlighters = {} - } + constructor () { + this.highlighters = {} + } - profile () { - return { - type: 'sourcehighlighter', - methods: ['highlight', 'discardHighlight'] - } + profile () { + return { + type: 'sourcehighlighter', + methods: ['highlight', 'discardHighlight'] } + } - // TODO what to do with mod? - highlight (mod, lineColumnPos, filePath, hexColor, cb) { - var position - try { - position = JSON.parse(lineColumnPos) - } catch (e) { - return cb(e.message) - } - if (!highlighters[mod]) highlighters[mod] = new SourceHighlighter() - highlighters[mod].currentSourceLocation(null) - highlighters[mod].currentSourceLocationFromfileName(position, filePath, hexColor) - cb() + // TODO what to do with mod? + highlight (mod, lineColumnPos, filePath, hexColor, cb) { + var position + try { + position = JSON.parse(lineColumnPos) + } catch (e) { + return cb(e.message) } + if (!highlighters[mod]) highlighters[mod] = new SourceHighlighter() + highlighters[mod].currentSourceLocation(null) + highlighters[mod].currentSourceLocationFromfileName(position, filePath, hexColor) + cb() + } - discardHighlight (mod, cb) { - if (highlighters[mod]) highlighters[mod].currentSourceLocation(null) - cb() - } -} \ No newline at end of file + discardHighlight (mod, cb) { + if (highlighters[mod]) highlighters[mod].currentSourceLocation(null) + cb() + } +} diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 65b8d19cb2..a32ef613c8 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -2,7 +2,7 @@ var $ = require('jquery') var yo = require('yo-yo') -var EventEmitter = require ('events') +var EventEmitter = require('events') var EventManager = require('../../lib/events') var globalRegistry = require('../../global/registry') var CompilerImport = require('../compiler/compiler-imports') @@ -116,7 +116,7 @@ class FileManager { cb(null, path) } } - + getFile (path, cb) { var provider = this.fileProviderOf(path) if (provider) { diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 6dc8f84467..6a8fda6d07 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -40,7 +40,7 @@ class EditorPanel { } } self._view = {} - + var contextualListener = new ContextualListener({editor: self._components.editor, pluginManager: self._deps.pluginManager}) var contextView = new ContextView({contextualListener, editor: self._components.editor}) diff --git a/src/app/panels/left-icon-panel.js b/src/app/panels/left-icon-panel.js index c68a84235f..e6121dad3a 100644 --- a/src/app/panels/left-icon-panel.js +++ b/src/app/panels/left-icon-panel.js @@ -69,7 +69,6 @@ module.exports = class LeftIconPanel { {type: 'settings', displayName: 'setting', icon: 'fa fa-cog fa-2x'} ] } - swapPlugin (name) { console.log(name) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 207fdbe1d4..94b8f06341 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -251,7 +251,6 @@ UniversalDApp.prototype.runTestTx = function (tx, cb) { }) } - /** * This function send a tx without alerting the user (if mainnet or if gas estimation too high). * SHOULD BE TAKEN CAREFULLY! From a2d65662b1dd055c8319e8639bb0559ec649c266 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Wed, 9 Jan 2019 14:07:36 +0100 Subject: [PATCH 017/636] update with buttons - in progress --- src/app.js | 12 +++--- .../components/plugin-manager-component.js | 39 ++++++++++++------- src/app/components/swap-panel-component.js | 1 - 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/app.js b/src/app.js index b8f230dd90..87379f67a3 100644 --- a/src/app.js +++ b/src/app.js @@ -39,12 +39,12 @@ const PluginManagerComponent = require('./app/components/plugin-manager-componen const PluginManagerApi = require('./app/components/plugin-manager-api') const VerticalIconsComponent = require('./app/components/vertical-icons-component') -// const VerticalIconsApi = require('./app/components/vertical-icons-api') +const VerticalIconsApi = require('./app/components/vertical-icons-api') const SwapPanelComponent = require('./app/components/swap-panel-component') -// const SwapPanelApi = require('./app/components/swap-panel-api') +const SwapPanelApi = require('./app/components/swap-panel-api') -// const AppManager = require('remix-plugin').AppManager +const AppManager = require('remix-plugin').AppManager var styleGuide = require('./app/ui/styles-guide/theme-chooser') var styles = styleGuide.chooser() @@ -440,7 +440,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org - the current API is not optimal. For instance methods of `app` only refers to `executionContext`, wich does not make really sense. */ - // const appManager = new AppManager({modules: [], plugins: []}) + const appManager = new AppManager({modules: [], plugins: []}) const swapPanelComponent = new SwapPanelComponent() const pluginManagerComponent = new PluginManagerComponent( @@ -459,8 +459,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const verticalIconComponent = new VerticalIconsComponent() - // const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, pluginManagerComponent) - // const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, pluginManagerComponent) + const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, pluginManagerComponent) + const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, pluginManagerComponent) const pluginManagerAPI = new PluginManagerApi(pluginManagerComponent) self._view.mainpanel.appendChild(self._components.editorpanel.render()) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 9f2b842639..6502efd8e6 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -33,14 +33,14 @@ class PluginManagerComponent { 'Config': { name: 'Config', target: config }, 'TxListener': { name: 'TxListener', target: txListener }, // internal components. They are mostly views, they don't provide external API for plugins - 'Solidity Compile': { name: 'Solidity Compile', class: 'evm-compiler', Type: CompileTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00NiwxNXYtNCAgYzAtMS4xMDQtMC44OTYtMi0yLTJjMCwwLTI0LjY0OCwwLTI2LDBjLTEuNDY5LDAtMi40ODQtNC00LTRIM0MxLjg5Niw1LDEsNS44OTYsMSw3djR2Mjl2NGMwLDEuMTA0LDAuODk2LDIsMiwyaDM5ICBjMS4xMDQsMCwyLTAuODk2LDItMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ry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ODgyLDMuMDczLDEuNTUyLDQuNzc3LDEuOTczbDEuMTgsNy4wODdoNmwxLjI2MS03LjEwNWMxLjY5NS0wLjQzLDMuMjk3LTEuMTA1LDQuNzUxLTEuOTlsNS45MjIsNC4xNTVsNC4yNDItNC4yNDUgIGwtNC4yMjctNS44N2MwLjg3NS0xLjQ1NiwxLjUzOS0zLjA0OCwxLjk1OC00LjczOUw0OSwyNy45NTR6IE0yNSwzM2MtNC40MTgsMC04LTMuNTgyLTgtOHMzLjU4Mi04LDgtOHM4LDMuNTgyLDgsOFMyOS40MTgsMzMsMjUsMzMgIHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' } } this.activated = {} // list all activated modules @@ -66,9 +66,9 @@ class PluginManagerComponent { this.activateInternal('TxListener') this.activateInternal('FilePanel') - this.activateInternal('Solidity Compile') + this.activateInternal('SolidityCompile') this.activateInternal('Run') - this.activateInternal('Plugin Manager') + this.activateInternal('PluginManager') this.activateInternal('Settings') this.activateInternal('Support') } @@ -82,7 +82,9 @@ class PluginManagerComponent {
` for (var mod in this.modulesDefinition) { - if (this.modulesDefinition[mod].icon) pluginManagerDiv.appendChild(this.renderItem(mod)) + if (this.modulesDefinition[mod].icon) { + pluginManagerDiv.appendChild(this.renderItem(mod)) + } } console.log(this.activated) return pluginManagerDiv @@ -90,23 +92,28 @@ class PluginManagerComponent { renderItem (item) { let ctrBtns - if (this.activated.hasOwnProperty(item)) { - ctrBtns = yo` - - ` - } else { - ctrBtns = yo` - - ` + + let action = (event) => { + if (this.activated.hasOwnProperty(item)) { + this.deactivateInternal(item) + } else { + this.activateInternal(item) + } } + + ctrBtns = yo`
+ +
` + this.plugins.push(item) // var self = this - return yo` + this.view = yo`
${this.modulesDefinition[item].name} ${ctrBtns}
` + return this.view } activatePlugin (jsonProfile, api) { @@ -120,6 +127,7 @@ class PluginManagerComponent { deactivateInternal (name) { delete this.activated[name] this.event.emit('removingItem', name) + if (this.view) this.view.querySelector(`#${name} button`).innerHTML = 'activate' } activateInternal (name) { @@ -141,6 +149,7 @@ class PluginManagerComponent { this.data.proxy.register(mod, instance) } this.activated[mod.name] = mod + if (this.view) this.view.querySelector(`#${name} button`).innerHTML = 'deactivate' return instance } diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index 525c2e8667..683e712e7d 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -29,7 +29,6 @@ class SwapPanelComponent { add (moduleName, content) { this.contents[moduleName] = yo`
${content}
` this.view.appendChild(this.contents[moduleName]) - this.showContent(moduleName) } render () { From 533ada1ddb9cd1aa6f1b01b65f87a1e56caeb0b6 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 9 Jan 2019 14:44:19 +0100 Subject: [PATCH 018/636] fixing adding removing module --- .../components/plugin-manager-component.js | 20 ++++++++++--------- src/app/components/swap-panel-api.js | 7 +++++++ src/app/components/swap-panel-component.js | 7 ++++++- src/app/components/vertical-icons-api.js | 1 + .../components/vertical-icons-component.js | 7 ++++--- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 6502efd8e6..f4cf2bd18e 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -33,14 +33,14 @@ class PluginManagerComponent { 'Config': { name: 'Config', target: config }, 'TxListener': { name: 'TxListener', target: txListener }, // internal components. They are mostly views, they don't provide external API for plugins - 'SolidityCompile': { name: 'Solidity Compile', class: 'evm-compiler', Type: CompileTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My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wMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' } } this.activated = {} // list all activated modules @@ -96,12 +96,14 @@ class PluginManagerComponent { let action = (event) => { if (this.activated.hasOwnProperty(item)) { this.deactivateInternal(item) + event.target.innerHTML = 'activate' } else { this.activateInternal(item) + event.target.innerHTML = 'deactivate' } } - ctrBtns = yo`
+ ctrBtns = yo`
` @@ -125,12 +127,13 @@ class PluginManagerComponent { } deactivateInternal (name) { + if (!this.activated[name]) return + this.event.emit('removingItem', this.activated[name]) delete this.activated[name] - this.event.emit('removingItem', name) - if (this.view) this.view.querySelector(`#${name} button`).innerHTML = 'activate' } activateInternal (name) { + if (this.activated[name]) return const mod = this.modulesDefinition[name] let dep if (mod.dep) dep = this.activateInternal(mod.dep) @@ -148,8 +151,7 @@ class PluginManagerComponent { if (mod.class === 'evm-compiler') { this.data.proxy.register(mod, instance) } - this.activated[mod.name] = mod - if (this.view) this.view.querySelector(`#${name} button`).innerHTML = 'deactivate' + this.activated[mod.name] = mod return instance } diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index 9a37f76075..eb128b17c6 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -9,6 +9,9 @@ class SwapPanelApi { pluginManagerComponent.event.on('requestContainer', (mod, content) => { this.add(mod.name, content) }) + pluginManagerComponent.event.on('removingItem', (mod) => { + this.remove(mod.name) + }) } /* @@ -20,6 +23,10 @@ class SwapPanelApi { return this.component.add(moduleName, content) } + remove (moduleName) { + return this.component.remove(moduleName) + } + reference (modulename, domElement) { this.nodes[modulename] = domElement } diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index 683e712e7d..db6208b844 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -27,10 +27,15 @@ class SwapPanelComponent { } add (moduleName, content) { - this.contents[moduleName] = yo`
${content}
` + this.contents[moduleName] = yo`
${content}
` this.view.appendChild(this.contents[moduleName]) } + remove (moduleName) { + var el = this.view.querySelector(`div#${moduleName}Content`) + el.parentElement.removeChild(el) + } + render () { this.view = yo`
diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index 3c4ba39ef0..a167dab0c0 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -4,6 +4,7 @@ class VerticalIconsApi { constructor (verticalIconsComponent, pluginManagerComponent) { this.component = verticalIconsComponent pluginManagerComponent.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod)) + pluginManagerComponent.event.on('removingItem', (mod) => verticalIconsComponent.removeIcon(mod)) } } module.exports = VerticalIconsApi diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index 6977234217..b2011f2472 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -16,11 +16,12 @@ class VerticalIconComponent { addIcon (mod) { let self = this - this.view.appendChild(yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
`) + this.view.appendChild(yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
`) } - removeIcon (item) { - + removeIcon (mod) { + var el = this.view.querySelector(`#${mod.name}Icon`) + el.parentElement.removeChild(el) } select (name) { From 8e4f05f7159c912d4cf92741758589d97956dc7f Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Fri, 11 Jan 2019 12:24:10 +0100 Subject: [PATCH 019/636] updates to css for plugin manager --- src/app.js | 2 + .../components/plugin-manager-component.js | 53 +++++++++++++------ src/app/components/swap-panel-component.js | 5 +- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/src/app.js b/src/app.js index 87379f67a3..d08ae3fdaf 100644 --- a/src/app.js +++ b/src/app.js @@ -100,6 +100,7 @@ var css = csjs` bottom : 0; overflow : hidden; width : 400px; + height : 100%; } .highlightcode { position:absolute; @@ -208,6 +209,7 @@ class App { profile () { return { type: 'app', + description: 'the app', methods: ['getExecutionContextProvider', 'getProviderEndpoint', 'detectNetWork', 'addProvider', 'removeProvider'] } } diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index f4cf2bd18e..53963013f9 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -12,8 +12,8 @@ const RunTab = require('../tabs/run-tab') var registry = require('../../global/registry') -// const styleguide = require('../ui/styles-guide/theme-chooser') -// const styles = styleguide.chooser() +const styleguide = require('../ui/styles-guide/theme-chooser') +const styles = styleguide.chooser() const PluginManagerProxy = require('./plugin-manager-proxy') @@ -33,15 +33,15 @@ class PluginManagerComponent { 'Config': { name: 'Config', target: config }, 'TxListener': { name: 'TxListener', target: txListener }, // internal components. They are mostly views, they don't provide external API for plugins - 'SolidityCompile': { name: 'SolidityCompile', class: 'evm-compiler', Type: CompileTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00NiwxNXYtNCAg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NzYzLTEuOTgybC0xLjI0NS03LjEwNmgtNiAgbC0xLjE1Niw3LjA4M2MtMS43MDQsMC40MTgtMy4zMTMsMS4wODMtNC43NzcsMS45NjNMMTAuMTgsNS44NzNsLTQuMjQzLDQuMjQxbDQuMTA3LDUuODc0Yy0wLjg4OCwxLjQ3LTEuNTYzLDMuMDc3LTEuOTkyLDQuNzkyICBMMSwyMS45NTR2Nmw3LjA0NCwxLjI0OWMwLjQyNSwxLjcxMSwxLjEwMSwzLjMxOCwxLjk5Miw0Ljc5bC00LjE2Myw1LjgyM2w0LjI0MSw0LjI0NWw1Ljg4MS00LjExOSAgYzEuNDY4LDAuODgyLDMuMDczLDEuNTUyLDQuNzc3LDEuOTczbDEuMTgsNy4wODdoNmwxLjI2MS03LjEwNWMxLjY5NS0wLjQzLDMuMjk3LTEuMTA1LDQuNzUxLTEuOTlsNS45MjIsNC4xNTVsNC4yNDItNC4yNDUgIGwtNC4yMjctNS44N2MwLjg3NS0xLjQ1NiwxLjUzOS0zLjA0OCwxLjk1OC00LjczOUw0OSwyNy45NTR6IE0yNSwzM2MtNC40MTgsMC04LTMuNTgyLTgtOHMzLjU4Mi04LDgtOHM4LDMuNTgyLDgsOFMyOS40MTgsMzMsMjUsMzMgIHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' } + 'SolidityCompile': { name: 'SolidityCompile', description: 'Compile functionality for solidity', class: 'evm-compiler', Type: CompileTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3Z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pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIgeDE9IjEiIHgyPSIxIiB5MT0iMyIgeTI9IjQ5Ii8+PC9zdmc+' }, + 'Run': { name: 'Run', Type: RunTab, description: 'Deploy & run a contract with access to a contracts methods', icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00My43MzQsMjFjLTMuNjMxLDAtMTUuMDkyLDAtMTUuMDkyLDAgIFMxNi4yNSw1LjE4OCwxNi4wNDcsNC45MzhzLTAuNDIyLTAuNTk0LTEuMTI1LTAuNjcyYy0wLjg1OS0wLjA5NS0xLjk2OS0wLjIwMy0yLjMyOC0wLjIzNGMtMC40MDYtMC4wMzUtMC43MTksMC4xNDEtMC40OTYsMC43MzQgIEMxMi4zODgsNS41MzksMTguNzQ4LDIxLDE4Ljc0OCwyMUg2LjAzNGMwLDAtMi40NTgtNC43MjItMi44NzgtNS41MzFDMi45NjUsMTUuMTAxLDIuNTU3LDE1LjAxNCwyLDE1SDEuMjk3ICBjLTAuMTI1LDAtMC4zMTIsMC0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2MtNC40MTgsMC04LTMuNTgyLTgtOHMzLjU4Mi04LDgtOHM4LDMuNTgyLDgsOFMyOS40MTgsMzMsMjUsMzMgIHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' } } this.activated = {} // list all activated modules // this.activated = [] // list all activated modules @@ -111,7 +111,8 @@ class PluginManagerComponent { // var self = this this.view = yo`
- ${this.modulesDefinition[item].name} +

${this.modulesDefinition[item].name}

+ ${this.modulesDefinition[item].description} ${ctrBtns}
` @@ -168,17 +169,37 @@ module.exports = PluginManagerComponent const css = csjs` .plugins { - width : 300px; } - .plugin { - border-bottom: 1px black solid; + .plugins h2 { + font-size: 1em; + border-bottom: 1px ${styles.appProperties.solidBorderBox_BorderColor} solid; + padding: 10px 20px; + font-size: 10px; padding: 10px 20px; - margin-bottom: 20px; + text-transform: uppercase; + font-weight: normal; + background-color: white; + margin-bottom: 0; + } + .plugin { + ${styles.rightPanel.compileTab.box_CompileContainer}; + margin: 0; + margin-bottom: 2%; + border-bottom: 1px ${styles.appProperties.solidBorderBox_BorderColor} solid; + padding: 0px 20px 10px; + } + .plugin h3 { + margin-bottom: 5px; + font-size: 12px; + margin-top: 9px; } + .plugItIn.active { display: block; } .plugin button { + ${styles.rightPanel.settingsTab.button_LoadPlugin}; cursor: pointer; + font-size: 10px; } ` diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index db6208b844..f548d655f6 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -49,12 +49,15 @@ module.exports = SwapPanelComponent const css = csjs` .plugins { + height: : 100%; + overflow-y: auto; + margin-right: 10px; } .plugItIn { display : none; + height : 100%; } .plugItIn.active { display :block; } - .clearFunds { background-color: lightblue; } ` From 4525875e991db8e55fd0ac1bb6d9d88a46c91e27 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 10 Jan 2019 18:07:41 +0100 Subject: [PATCH 020/636] integrate remix-plugin 0.0.4 --- package.json | 2 +- src/app.js | 98 +++++-- src/app/components/plugin-manager-api.js | 21 -- .../components/plugin-manager-component.js | 148 +++-------- src/app/components/swap-panel-api.js | 6 +- src/app/components/vertical-icons-api.js | 6 +- src/app/editor/SourceHighlighters.js | 2 +- src/app/files/browser-files-tree.js | 2 +- src/app/files/fileManager.js | 2 +- src/app/panels/editor-panel.js | 2 +- src/app/panels/file-panel.js | 9 + src/app/tabs/analysis-tab.js | 8 + src/app/tabs/compile-tab.js | 8 +- src/app/tabs/debugger-tab.js | 9 + src/app/tabs/run-tab.js | 12 +- src/app/tabs/settings-tab.js | 8 + src/app/tabs/support-tab.js | 8 + src/app/tabs/test-tab.js | 8 + src/lib/store.js | 250 ++++++++++++++++++ src/remixAppManager.js | 45 ++++ src/universal-dapp.js | 2 +- 21 files changed, 479 insertions(+), 177 deletions(-) delete mode 100644 src/app/components/plugin-manager-api.js create mode 100644 src/lib/store.js create mode 100644 src/remixAppManager.js diff --git a/package.json b/package.json index 3b186abf8d..1975bef152 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "remix-analyzer": "0.3.1", "remix-debug": "0.3.1", "remix-lib": "0.4.1", - "remix-plugin": "0.0.1-alpha.2", + "remix-plugin": "0.0.1-alpha.4", "remix-solidity": "0.3.1", "remix-tests": "0.1.1", "remixd": "0.1.8-alpha.6", diff --git a/src/app.js b/src/app.js index d08ae3fdaf..051330aea5 100644 --- a/src/app.js +++ b/src/app.js @@ -36,7 +36,6 @@ var toolTip = require('./app/ui/tooltip') var TransactionReceiptResolver = require('./transactionReceiptResolver') const PluginManagerComponent = require('./app/components/plugin-manager-component') -const PluginManagerApi = require('./app/components/plugin-manager-api') const VerticalIconsComponent = require('./app/components/vertical-icons-component') const VerticalIconsApi = require('./app/components/vertical-icons-api') @@ -44,7 +43,17 @@ const VerticalIconsApi = require('./app/components/vertical-icons-api') const SwapPanelComponent = require('./app/components/swap-panel-component') const SwapPanelApi = require('./app/components/swap-panel-api') -const AppManager = require('remix-plugin').AppManager +const CompileTab = require('./app/tabs/compile-tab') +const SettingsTab = require('./app/tabs/settings-tab') +const AnalysisTab = require('./app/tabs/analysis-tab') +const DebuggerTab = require('./app/tabs/debugger-tab') +const SupportTab = require('./app/tabs/support-tab') +const TestTab = require('./app/tabs/test-tab') +const RunTab = require('./app/tabs/run-tab') +const FilePanel = require('./app/panels/file-panel') + +import { EntityStore } from './lib/store' +import { RemixAppManager } from './remixAppManager' var styleGuide = require('./app/ui/styles-guide/theme-chooser') var styles = styleGuide.chooser() @@ -208,7 +217,7 @@ class App { profile () { return { - type: 'app', + name: 'App', description: 'the app', methods: ['getExecutionContextProvider', 'getProviderEndpoint', 'detectNetWork', 'addProvider', 'removeProvider'] } @@ -407,7 +416,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org event: new EventEmitter(), profile () { return { - type: 'txListener', + name: 'TxListener', events: ['newTransaction'] } } @@ -442,41 +451,74 @@ Please make a backup of your contracts and start using http://remix.ethereum.org - the current API is not optimal. For instance methods of `app` only refers to `executionContext`, wich does not make really sense. */ - const appManager = new AppManager({modules: [], plugins: []}) + // TODOs those are instanciated before hand. should be instanciated on demand - const swapPanelComponent = new SwapPanelComponent() - const pluginManagerComponent = new PluginManagerComponent( - { - app: this, - udapp: udapp, - fileManager: fileManager, - sourceHighlighters: registry.get('editor').api.sourceHighlighters, - config: self._components.filesProviders['config'], - txListener: txListenerModuleProxy - }) + const pluginManagerComponent = new PluginManagerComponent() registry.put({api: pluginManagerComponent.proxy(), name: 'pluginmanager'}) - self._components.editorpanel.init() - self._components.fileManager.init() + let filePanel = new FilePanel() + registry.put({api: filePanel, name: 'filepanel'}) + + let compileTab = new CompileTab(self._components.registry) + let run = new RunTab(self._components.registry) + let settings = new SettingsTab(self._components.registry) + let analysis = new AnalysisTab(self._components.registry) + let debug = new DebuggerTab(self._components.registry) + let support = new SupportTab(self._components.registry) + let test = new TestTab(self._components.registry, compileTab) + + let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }, 'name') + + const appManager = new RemixAppManager(appStore) + + pluginManagerComponent.setApp(appManager) + pluginManagerComponent.setStore(appStore) + + let sourceHighlighters = registry.get('editor').api.sourceHighlighters + let configProvider = self._components.filesProviders['config'] + appManager.init([ + { profile: this.profile(), api: this }, + { profile: udapp.profile(), api: udapp }, + { profile: fileManager.profile(), api: fileManager }, + { profile: sourceHighlighters.profile(), api: sourceHighlighters }, + { profile: configProvider.profile(), api: configProvider }, + { profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy }, + { profile: compileTab.profile(), api: compileTab }, + { profile: filePanel.profile(), api: filePanel }, + { profile: test.profile(), api: test }, + { profile: support.profile(), api: support }, + { profile: debug.profile(), api: debug }, + { profile: analysis.profile(), api: analysis }, + { profile: settings.profile(), api: settings }, + { profile: run.profile(), api: run }, + { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) + const swapPanelComponent = new SwapPanelComponent() const verticalIconComponent = new VerticalIconsComponent() + const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, appManager) + const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, appManager) - const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, pluginManagerComponent) - const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, pluginManagerComponent) - const pluginManagerAPI = new PluginManagerApi(pluginManagerComponent) - + self._components.editorpanel.init() + self._components.fileManager.init() + self._view.mainpanel.appendChild(self._components.editorpanel.render()) self._view.iconpanel.appendChild(verticalIconComponent.render()) self._view.swappanel.appendChild(swapPanelComponent.render()) - pluginManagerComponent.initDefault() - verticalIconComponent.select('FilePanel') - // appManager.init(pluginManagerAPI) + appManager.doActivate('App') + appManager.doActivate('Udapp') + appManager.doActivate('FileManager') + appManager.doActivate('SourceHighlighters') + appManager.doActivate('config') + appManager.doActivate('TxListener') + appManager.doActivate('FilePanel') + appManager.doActivate('SolidityCompile') + appManager.doActivate('Run') + appManager.doActivate('PluginManager') + appManager.doActivate('Settings') + appManager.doActivate('Support') - pluginManagerAPI.init({ - modules: [], - plugins: [] - }) + verticalIconComponent.select('FilePanel') // The event listener needs to be registered as early as possible, because the // parent will send the message upon the "load" event. diff --git a/src/app/components/plugin-manager-api.js b/src/app/components/plugin-manager-api.js deleted file mode 100644 index 66acb32242..0000000000 --- a/src/app/components/plugin-manager-api.js +++ /dev/null @@ -1,21 +0,0 @@ -// const remixLib = require('remix-lib') - -class PluginManagerApi { - constructor (pluginManagerComponent) { - this.component = pluginManagerComponent - pluginManagerComponent.event.on('activation', (item) => this.event.emit('activation', item)) // listen by appManager - pluginManagerComponent.event.on('deactivation', (item) => this.event.emit('deactivation', item)) // listen by appManager - } - - init (data) { - for (var m in data.modules) { - this.renderItem(m) - } - - for (var n in data.plugins) { - this.renderItem(n) - } - } -} - -module.exports = PluginManagerApi diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 53963013f9..43e90897de 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -14,6 +14,7 @@ var registry = require('../../global/registry') const styleguide = require('../ui/styles-guide/theme-chooser') const styles = styleguide.chooser() +import { EntityStore } from '../../lib/store.js' const PluginManagerProxy = require('./plugin-manager-proxy') @@ -21,147 +22,72 @@ const EventEmitter = require('events') class PluginManagerComponent { - constructor ({ app, udapp, fileManager, sourceHighlighters, config, txListener }) { + constructor () { this.event = new EventEmitter() - this.modulesDefinition = { - // service module. They can be seen as daemon - // they usually don't have UI and only represent the minimal API a plugins can access. - 'App': { name: 'App', target: app }, - 'Udapp': { name: 'Udapp', target: udapp }, - 'FileManager': { name: 'FileManager', target: fileManager }, - 'SourceHighlighters': { name: 'SourceHighlighters', target: sourceHighlighters }, - 'Config': { name: 'Config', target: config }, - 'TxListener': { name: 'TxListener', target: txListener }, - // internal components. They are mostly views, they don't provide external API for plugins - 'SolidityCompile': { name: 'SolidityCompile', description: 'Compile functionality for solidity', class: 'evm-compiler', Type: CompileTab, icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00NiwxNXYtNCAgYzAtMS4xMDQtMC44OTYtMi0yLTJjMCwwLTI0LjY0OCwwLTI2LDBjLTEuNDY5LDAtMi40ODQtNC00LTRIM0MxLjg5Niw1LDEsNS44OTYsMSw3djR2Mjl2NGMwLDEuMTA0LDAuODk2LDIsMiwyaDM5ICBjMS4xMDQsMCwyLTAuODk2LDItMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBhdGggZD0iTTEsNDRsNS0yNyAgYzAtMS4xMDQsMC44OTYtMiwyLTJoMzljMS4xMDQsMCwyLDAuODk2LDIsMmwtNSwyNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+' }, - 'FilePanel': { name: 'FilePanel', Type: FilePanel, description: 'Load files from a variety of sources', icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwb2x5bGluZSBmaWxsPSJub25lIiBwb2ludHM9IjQ0LDIxIDQ0LDQ5IDYsNDkgICA2LDIxICIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBvbHlsaW5lIGZpbGw9Im5vbmUiIHBvaW50cz0iMTksNDkgMTksMjggMzEsMjggICAzMSw0OSAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjxwb2x5Z29uIHBvaW50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OS0wLjA5NS0xLjk2OS0wLjIwMy0yLjMyOC0wLjIzNGMtMC40MDYtMC4wMzUtMC43MTksMC4xNDEtMC40OTYsMC43MzQgIEMxMi4zODgsNS41MzksMTguNzQ4LDIxLDE4Ljc0OCwyMUg2LjAzNGMwLDAtMi40NTgtNC43MjItMi44NzgtNS41MzFDMi45NjUsMTUuMTAxLDIuNTU3LDE1LjAxNCwyLDE1SDEuMjk3ICBjLTAuMTI1LDAtMC4zMTIsMC0wLjI4MSwwLjM0NEMxLjA1OCwxNS44MTEsMywyNSwzLDI1cy0xLjg4OCw5LjE5Ny0xLjk4NCw5LjY1NkMwLjk1MywzNC45NTMsMS4xNzIsMzUsMS4yOTcsMzVIMiAgYzAuOTY2LTAuMDA5LDAuOTU0LTAuMDc5LDEuMTU2LTAuNDY5QzMuNTc2LDMzLjcyMiw2LjAzNCwyOSw2LjAzNCwyOWgxMi43MTRjMCwwLTYuMzYsMTUuNDYxLTYuNjUsMTYuMjM0ICBjLTAuMjIzLDAuNTk0LDAuMDksMC43NywwLjQ5NiwwLjczNGMwLjM1OS0wLjAzMSwxLjQ2OS0wLjEzOSwyLjMyOC0wLjIzNGMwLjcwMy0wLjA3OCwwLjkyMi0wLjQyMiwxLjEyNS0wLjY3MlMyOC42NDMsMjksMjguNjQzLDI5ICBzMTEuNDYxLDAsMTUuMDkyLDBjMy43NjYsMCw1LjI2NC0zLjAzMSw1LjI2NC00UzQ3LjQ4NCwyMSw0My43MzQsMjF6IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+' }, - 'SolidityStaticAnalysis': { name: 'SolidityStaticAnalysis', Type: AnalysisTab, description: 'To see the static analysis',icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuM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DksMi44NzQtMTEuNDk5LTMuNTg4LTEyLjM5N2MtMC42NjUtMS4xNjgtMi4zNjgtMS43NTktNC41ODEtMS43NTkgIGMtOC44NTQsMC4xNjMtOS45MjIsNi42ODYtNy45ODEsMTQuMTU2Yy0wLjM0NSwwLjIxLTAuOTEzLDAuODc4LTAuNzcxLDIuMDY1YzAuMjY2LDIuMjExLDEuMTcsMi43NzEsMS43NDQsMi44MTggIGMwLjIyLDIuMDYyLDEuNTgsNC41MDUsMi4zMTIsNC44ODhjMCwxLjQ3MywwLjA1NSwyLjU5OC0wLjA5MSw0LjIxQzE5LjM2NywzNy4yMzgsNy41NDYsMzUuOTE2LDcsNDVoMzggIEM0NC40NTUsMzUuOTE2LDMyLjY4NSwzNy4yMzgsMzAuOTMzLDMyLjUyOHoiLz48L3N2Zz4=' }, - 'PluginManager': { name: 'PluginManager', target: this, description: 'Mangement of Plugins and Modules', icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9IiAgTTMyLDM1YzAsMCw4LjMxMiwwLDkuMDk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00LjExOSAgYzEuNDY4LDAuODgyLDMuMDczLDEuNTUyLDQuNzc3LDEuOTczbDEuMTgsNy4wODdoNmwxLjI2MS03LjEwNWMxLjY5NS0wLjQzLDMuMjk3LTEuMTA1LDQuNzUxLTEuOTlsNS45MjIsNC4xNTVsNC4yNDItNC4yNDUgIGwtNC4yMjctNS44N2MwLjg3NS0xLjQ1NiwxLjUzOS0zLjA0OCwxLjk1OC00LjczOUw0OSwyNy45NTR6IE0yNSwzM2MtNC40MTgsMC04LTMuNTgyLTgtOHMzLjU4Mi04LDgtOHM4LDMuNTgyLDgsOFMyOS40MTgsMzMsMjUsMzMgIHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' } + this.data = { + proxy: new PluginManagerProxy() + } + this.views = { + root: null, + items: {} } - this.activated = {} // list all activated modules - // this.activated = [] // list all activated modules - this.plugins = [] - this.data = {} - this.data.proxy = new PluginManagerProxy() - - // This load the state from localstorage first then from the second parameter is nothing is found in localstorage - // this.store = Store.fromLocal('***', {}) // Or EntityStore.fromLocal('***', {}, 'id') } - proxy () { - return this.data.proxy + profile () { + return { + name: 'PluginManager', + methods: [], + events: [], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwc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c3Ryb2tlLXdpZHRoPSIyIi8+PGxpbmUgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIiB4MT0iMjUiIHgyPSIyNSIgeTE9IjI2IiB5Mj0iNDUuNjY4Ii8+PC9zdmc+' + } } - initDefault () { - this.activateInternal('App') - this.activateInternal('Udapp') - this.activateInternal('FileManager') - this.activateInternal('SourceHighlighters') - this.activateInternal('Config') - this.activateInternal('TxListener') - - this.activateInternal('FilePanel') - this.activateInternal('SolidityCompile') - this.activateInternal('Run') - this.activateInternal('PluginManager') - this.activateInternal('Settings') - this.activateInternal('Support') + setApp (appManager) { + this.appManager = appManager + } + + setStore (store) { + this.store = store + this.store.event.on('activate', (name) => { this.views.items[name] ? this.views.items[name].querySelector('button').innerHTML = 'deactivate' : null }) + this.store.event.on('deactivate', (name) => { this.views.items[name] ? this.views.items[name].querySelector('button').innerHTML = 'activate' : null }) + } + + proxy () { + return this.data.proxy } render () { - // var self = this - // loop over all this.modules and this.plugins let pluginManagerDiv = yo`

Plugin Manager

` - for (var mod in this.modulesDefinition) { - if (this.modulesDefinition[mod].icon) { - pluginManagerDiv.appendChild(this.renderItem(mod)) - } - } - console.log(this.activated) + var modules = this.store.getAll() + modules.forEach((mod) => { + pluginManagerDiv.appendChild(this.renderItem(mod.profile.name)) + }) return pluginManagerDiv } renderItem (item) { let ctrBtns - let action = (event) => { - if (this.activated.hasOwnProperty(item)) { - this.deactivateInternal(item) - event.target.innerHTML = 'activate' - } else { - this.activateInternal(item) - event.target.innerHTML = 'deactivate' - } - } + let action = () => { this.store.isActive(item) ? this.appManager.doDeactivate(item) : this.appManager.doActivate(item) } ctrBtns = yo`
- +
` + + this.views.items[item] = ctrBtns - this.plugins.push(item) - // var self = this - this.view = yo` + this.views.root = yo`

${this.modulesDefinition[item].name}

${this.modulesDefinition[item].description} ${ctrBtns}
` - return this.view - } - - activatePlugin (jsonProfile, api) { - // let profile = { json: jsonProfile, api } - // let plugin = new Plugin(profile, api) - // this.appManager.addPlugin(plugin) - // this.event.emit('displayableModuleActivated', jsonProfile, plugin.render()) - // this.activated[jsonProfile.name] = plugin - } - - deactivateInternal (name) { - if (!this.activated[name]) return - this.event.emit('removingItem', this.activated[name]) - delete this.activated[name] - } - - activateInternal (name) { - if (this.activated[name]) return - const mod = this.modulesDefinition[name] - let dep - if (mod.dep) dep = this.activateInternal(mod.dep) - let instance = mod.target - if (!instance && mod.Type) instance = new mod.Type(registry, dep) - if (!instance) return console.log(`PluginManagerComponent: no Type or instance to add: ${JSON.stringify(mod)}`) - registry.put({api: instance, name: mod.name.toLocaleLowerCase()}) - if (instance.profile && typeof instance.profile === 'function') { - this.event.emit('requestActivation', instance.profile(), instance) - } - if (mod.icon && instance.render && typeof instance.render === 'function') { - this.event.emit('requestContainer', mod, instance.render()) - } - // if of type evm-compiler, we forward to the internal components - if (mod.class === 'evm-compiler') { - this.data.proxy.register(mod, instance) - } - this.activated[mod.name] = mod - return instance - } - - _activate (item) { - this.event.emit('activation', item) - } - - _deactivate (item) { - this.event.emit('deactivation', item) + return this.views.root } } diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index eb128b17c6..bae2df24aa 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -1,15 +1,15 @@ // const EventEmmitter = require('events') class SwapPanelApi { - constructor (swapPanelComponent, verticalIconsComponent, pluginManagerComponent) { + constructor (swapPanelComponent, verticalIconsComponent, appManager) { this.component = swapPanelComponent verticalIconsComponent.event.on('showContent', (moduleName) => { this.component.showContent(moduleName) }) - pluginManagerComponent.event.on('requestContainer', (mod, content) => { + appManager.event.on('requestContainer', (mod, content) => { this.add(mod.name, content) }) - pluginManagerComponent.event.on('removingItem', (mod) => { + appManager.event.on('removingItem', (mod) => { this.remove(mod.name) }) } diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index a167dab0c0..6710e510c0 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -1,10 +1,10 @@ // API class VerticalIconsApi { - constructor (verticalIconsComponent, pluginManagerComponent) { + constructor (verticalIconsComponent, appManager) { this.component = verticalIconsComponent - pluginManagerComponent.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod)) - pluginManagerComponent.event.on('removingItem', (mod) => verticalIconsComponent.removeIcon(mod)) + appManager.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod)) + appManager.event.on('removingItem', (mod) => verticalIconsComponent.removeIcon(mod)) } } module.exports = VerticalIconsApi diff --git a/src/app/editor/SourceHighlighters.js b/src/app/editor/SourceHighlighters.js index 8902235fe5..7c53ac19d7 100644 --- a/src/app/editor/SourceHighlighters.js +++ b/src/app/editor/SourceHighlighters.js @@ -9,7 +9,7 @@ module.exports = class SourceHighlighters { profile () { return { - type: 'sourcehighlighter', + name: 'SourceHighlighters', methods: ['highlight', 'discardHighlight'] } } diff --git a/src/app/files/browser-files-tree.js b/src/app/files/browser-files-tree.js index b527d4cd71..54678e5110 100644 --- a/src/app/files/browser-files-tree.js +++ b/src/app/files/browser-files-tree.js @@ -133,7 +133,7 @@ function FilesTree (name, storage) { this.profile = function () { return { - type: this.type, + name: this.type, methods: ['get', 'set', 'remove'] } } diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index a32ef613c8..8f8e23d4bf 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -52,7 +52,7 @@ class FileManager { profile () { return { - type: 'fileManager', + name: 'FileManager', methods: ['getFilesFromPath', 'getCurrentFile', 'getFile', 'setFile'], events: ['currentFileChanged'] } diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 6a8fda6d07..87d6b45335 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -16,6 +16,7 @@ class EditorPanel { constructor (localRegistry) { var self = this self.event = new EventManager() + self._view = {} self._components = {} self._components.registry = localRegistry || globalRegistry self._components.editor = new Editor({}) @@ -39,7 +40,6 @@ class EditorPanel { } } } - self._view = {} var contextualListener = new ContextualListener({editor: self._components.editor, pluginManager: self._deps.pluginManager}) var contextView = new ContextView({contextualListener, editor: self._components.editor}) diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index 49433f1065..31296769b6 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -196,6 +196,15 @@ function filepanel (localRegistry) { self.render = function render () { return element } + self.profile = function () { + return { + name: 'FilePanel', + methods: [], + events: [], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwb2x5bGluZSBmaWxsPSJub25lIiBwb2ludHM9IjQ0LDIxIDQ0LDQ5IDYsNDkgICA2LDIxICIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBvbHlsaW5lIGZpbGw9Im5vbmUiIHBvaW50cz0iMTksNDkgMTksMjggMzEsMjggICAzMSw0OSAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjxwb2x5Z29uIHBvaW50cz0iMzUsNSAzNSw4LjAxNiAzNywxMC4wOTQgMzcsNyAzOSw3IDM5LDEyLjIwMyA0MSwxNC4yNjYgNDEsNSAiLz48cG9seWxpbmUgZmlsbD0ibm9uZSIgcG9pbnRzPSIgIDEuMTEsMjUuOTQyIDI1LDEuMDUzIDQ4Ljg5LDI1Ljk0MyAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' + } + } + function uploadFile (event) { // TODO The file explorer is merely a view on the current state of // the files module. Please ask the user here if they want to overwrite diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index f2d3b8d6bd..5635dece63 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -15,6 +15,14 @@ module.exports = class AnalysisTab { self._components.registry = localRegistry || globalRegistry self._deps = {} } + profile () { + return { + name: 'SolidityAnalysis', + methods: [], + events: [], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJ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0aD0iMiIvPjwvc3ZnPg==' + } + } render () { const self = this var staticanalysis = new StaticAnalysis() diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 262a78a4f1..bc16ee6f48 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -56,8 +56,7 @@ module.exports = class CompileTab { renderer: self._components.registry.get('renderer').api, swarmfileProvider: self._components.registry.get('fileproviders/swarm').api, fileManager: self._components.registry.get('filemanager').api, - fileProviders: self._components.registry.get('fileproviders').api, - pluginManager: self._components.registry.get('pluginmanager').api + fileProviders: self._components.registry.get('fileproviders').api } self.data = { hideWarnings: self._deps.config.get('hideWarnings') || false, @@ -187,9 +186,10 @@ module.exports = class CompileTab { } profile () { return { - type: 'solidityCompile', + name: 'SolidityCompile', methods: ['getCompilationResult'], - events: ['compilationFinished'] + events: ['compilationFinished'], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00NiwxNXYtNCAgYzAtMS4xMDQtMC44OTYtMi0yLTJjMCwwLTI0LjY0OCwwLTI2LDBjLTEuNDY5LDAtMi40ODQtNC00LTRIM0MxLjg5Niw1LDEsNS44OTYsMSw3djR2Mjl2NGMwLDEuMTA0LDAuODk2LDIsMiwyaDM5ICBjMS4xMDQsMCwyLTAuODk2LDItMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBhdGggZD0iTTEsNDRsNS0yNyAgYzAtMS4xMDQsMC44OTYtMiwyLTJoMzljMS4xMDQsMCwyLDAuODk2LDIsMmwtNSwyNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+' } } addWarning (msg, settings) { diff --git a/src/app/tabs/debugger-tab.js b/src/app/tabs/debugger-tab.js index 94737cec03..7754bb7808 100644 --- a/src/app/tabs/debugger-tab.js +++ b/src/app/tabs/debugger-tab.js @@ -27,6 +27,15 @@ class DebuggerTab { self._components.registry = localRegistry || globalRegistry } + profile () { + return { + name: 'Debugger', + methods: [], + events: [], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00NiwxNXYtNCAgYzAtMS4xMDQtMC44OTYtMi0yLTJjMCwwLTI0LjY0OCwwLTI2LDBjLTEuNDY5LDAtMi40ODQtNC00LTRIM0MxLjg5Niw1LDEsNS44OTYsMSw3djR2Mjl2NGMwLDEuMTA0LDAuODk2LDIsMiwyaDM5ICBjMS4xMDQsMCwyLTAuODk2LDItMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PHBhdGggZD0iTTEsNDRsNS0yNyAgYzAtMS4xMDQsMC44OTYtMiwyLTJoMzljMS4xMDQsMCwyLDAuODk2LDIsMmwtNSwyNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+' + } + } + render () { const self = this if (self._view.el) return self._view.el diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index d624fc894d..3c6ede3f62 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -178,7 +178,17 @@ function runTab (opts, localRegistry) { ` container.appendChild(el) - return { render () { return container } } + return { + render () { return container }, + profile () { + return { + name: 'Run', + methods: [], + events: [], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICA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TYuNjUsMTYuMjM0ICBjLTAuMjIzLDAuNTk0LDAuMDksMC43NywwLjQ5NiwwLjczNGMwLjM1OS0wLjAzMSwxLjQ2OS0wLjEzOSwyLjMyOC0wLjIzNGMwLjcwMy0wLjA3OCwwLjkyMi0wLjQyMiwxLjEyNS0wLjY3MlMyOC42NDMsMjksMjguNjQzLDI5ICBzMTEuNDYxLDAsMTUuMDkyLDBjMy43NjYsMCw1LjI2NC0zLjAzMSw1LjI2NC00UzQ3LjQ4NCwyMSw0My43MzQsMjF6IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+' + } + } + } } module.exports = runTab diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 525cd33c39..e05b6fd565 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -38,6 +38,14 @@ module.exports = class SettingsTab { self._components.themeStorage = new Storage('style:') self.data.currentTheme = self._components.themeStorage.get('theme') || 'light' } + profile () { + return { + name: 'Settings', + methods: [], + events: [], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d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IvPjwvc3ZnPg==' + } + } render () { const self = this if (self._view.el) return self._view.el diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index ea7367d71a..eabf86866c 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -28,6 +28,14 @@ module.exports = class SupportTab { self.data.gitterIsLoaded = true }) } + profile () { + return { + name: 'Support', + methods: [], + events: [], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik0zMC45MzMsMzIuNTI4Yy0wLjE0Ni0xLjYxMi0wLjA5LTIuNzM3LTAuMDktNC4yMWMwLjczLTAuMzgzLDIuMDM4LTIuODI1LDIuMjU5LTQuODg4YzAuNTc0LTAuMDQ3LDEuNDc5LTAuNjA3LDEuNzQ0LTIuODE4ICBjMC4xNDMtMS4xODctMC40MjUtMS44NTUtMC43NzEtMi4wNjVjMC45MzQtMi44MDksMi44NzQtMTEuNDk5LTMuNTg4LTEyLjM5N2MtMC42NjUtMS4xNjgtMi4zNjgtMS43NTktNC41ODEtMS43NTkgIGMtOC44NTQsMC4xNjMtOS45MjIsNi42ODYtNy45ODEsMTQuMTU2Yy0wLjM0NSwwLjIxLTAuOTEzLDAuODc4LTAuNzcxLDIuMDY1YzAuMjY2LDIuMjExLDEuMTcsMi43NzEsMS43NDQsMi44MTggIGMwLjIyLDIuMDYyLDEuNTgsNC41MDUsMi4zMTIsNC44ODhjMCwxLjQ3MywwLjA1NSwyLjU5OC0wLjA5MSw0LjIxQzE5LjM2NywzNy4yMzgsNy41NDYsMzUuOTE2LDcsNDVoMzggIEM0NC40NTUsMzUuOTE2LDMyLjY4NSwzNy4yMzgsMzAuOTMzLDMyLjUyOHoiLz48L3N2Zz4=' + } + } render () { const self = this if (self._view.el) return self._view.el diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index bb85ba84a2..12edc63358 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -23,6 +23,14 @@ module.exports = class TestTab { self.data = {} self.testList = yo`
` } + profile () { + return { + name: 'Run', + methods: [], + events: [], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00OSw0djI1YzAsMC01LjI3MywzLTEyLDMgIGMtMTEuOTI5LDAtMTUuODY5LTQtMjQtNFMxLDMwLDEsMzBWM2MwLDAsMi4wODUtMiwxMi0yczE0LjA0Nyw2LDI0LDZDNDMuMjgxLDcsNDguMTMsNC40NzEsNDksNHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjxsaW5lIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIgeDE9IjEiIHgyPSIxIiB5MT0iMyIgeTI9IjQ5Ii8+PC9zdmc+' + } + } render () { const self = this var testsOutput = yo`` diff --git a/src/lib/store.js b/src/lib/store.js new file mode 100644 index 0000000000..d0ba59722f --- /dev/null +++ b/src/lib/store.js @@ -0,0 +1,250 @@ +import { EventEmitter } from 'events' + +export class Store { + + /** + * Instanciate the store from `localStorage` first + * @template T + * @param {string} name The name of the store + * @param {T} initialState The initial state used if state is not available in `localStorage` + */ + static fromLocal(name, initialState) { + const fromLocal = localStorage.getItem(name) + const intial = fromLocal ? JSON.parse(fromLocal) : initialState + return new Store(name, intial) + } + + /** + * Create a Store that hold the state of the component + * @template T + * @param {string} name The name of the store + * @param {T} initialState The initial state of the store + */ + constructor(name, initialState) { + this.event = new EventEmitter() + this.name = name + this.state = initialState + } + + /** Listen on event from the store */ + get on() { + return this.event.on; + } + + /** Liste once on event from the store */ + get once() { + return this.event.once; + } + + /** + * Update one field of the state + * @param {Partial} state The part of the state updated + */ + /* + update(state) { + this.state = { ...this.state, ...state } + } + */ + + /** + * Get one field of the state + * @template Key key of `this.state` + * @param {Key} key A key of the state + */ + get(key) { + return this.state.entities[key] + } + + /** Reset the state its initial value */ + reset() { + this.state = this.initialState + } + + /** Dispatch an event with the new state */ + dispatch() { + this.event.emit('newState', this.state) + } +} + +/** + * An entity inside a collection + * @typedef {Object} EntityState + * @property {string[]} ids The list of IDs of the entity in the state + * @property {string[]} actives The list of IDs of the activated entities + * @property {Object} entities A map of ids and entities + */ + + + +export class EntityStore extends Store { + + /** + * Instanciate the store from `localStorage` first + * @param {string} name The name of the store + * @param {EntityState} initialState The initial state used if state is not available in `localStorage` + */ + static fromLocal(name, initialState) { + const fromLocal = localStorage.getItem(name) + const intial = fromLocal ? JSON.parse(fromLocal) : initialState + return new EntityStore(name, intial) + } + + /** + * Create a entity Store that hold a map entity of the same model + * @param {string} name The name of the store + * @param {EntityState} initialState The initial state used if state is not available in `localStorage` + */ + constructor(name, initialState) { + super(name, initialState) + } + + //////////// + // GETTER // + //////////// + + /** Tne entities as a Map */ + get entities() { + return this.state.entities + } + + /** List of all the ids */ + get ids() { + return this.state.ids + } + + /** List of all active ID */ + get actives() { + return this.state.actives + } + + /** Return the length of the entity collection */ + get length() { + return this.state.ids.length + } + + ///////////// + // SETTERS // + ///////////// + + /** + * Add a new entity to the state + * @param {Object} entity + */ + add(id, entity) { + this.state.entities[id] = entity + this.state.ids.push(id) + } + + /** + * Remove an entity from the state + * @param {(string|number)} id The id of the entity to remove + */ + remove(id) { + delete this.state.entities[id] + this.state.ids.splice(this.state.ids.indexOf(id), 1) + this.state.actives.splice(this.state.ids.indexOf(id), 1) + } + + /** + * Update one entity of the state + * @param {(string|number)} id The id of the entity to update + * @param {Object} update The fields to update in the entity + */ + /* + updateOne(id, update) { + this.state.entities[id] = { + ...this.state.entities[id], + ...update + } + } + */ + + /** + * Activate one or several entity from the state + * @param {((string|number))} ids An id or a list of id to activate + */ + activate(id) { + this.state.actives.push(id) + this.event.emit('activate', id) + } + + /** + * Deactivate one or several entity from the state + * @param {(string|number))} ids An id or a list of id to deactivate + */ + deactivate(id) { + this.state.actives.splice(this.state.actives.indexOf(id), 1) + this.event.emit('deactivate', id) + } + + /////////// + // QUERY // + /////////// + + /** + * Get one entity + * @param {(string|number)} id The id of the entity to get + */ + getOne(id) { + return this.state.entities[id] + } + + /** + * Get many entities as an array + * @param {(string|number)[]} ids An array of id of entity to get + */ + getMany(ids) { + return ids.map(id => this.state.entities[id]) + } + + /** Get all the entities as an array */ + getAll() { + return this.state.ids.map(id => this.state.entities[id]) + } + + /** Get all active entities */ + getActives() { + return this.state.actives.map(id => this.state.entities[id]) + } + + //////////////// + // CONDITIONS // + //////////////// + + /** + * Is the entity active + * @param {(string|number)} id The id of the entity to check + */ + isActive(id) { + return this.state.actives.includes(id) + } + + /** + * Is this id inside the store + * @param {(string|number)} id The id of the entity to check + */ + hasEntity(id) { + return this.state.ids.includes(id) + } + + /** + * Is the state empty + * @param {(string|number)} id The id of the entity to check + */ + isEmpty() { + return this.state.ids.length === 0 + } +} + +/** + * Store the state of the stores into LocalStorage + * @param {Store[]} stores The list of stores to store into `localStorage` + */ +function localState(stores) { + stores.forEach(store => { + const name = store.name + store.on('newState', (state) => { + localStorage.setItem(name, JSON.stringify(state)) + }) + }) +} diff --git a/src/remixAppManager.js b/src/remixAppManager.js new file mode 100644 index 0000000000..0c6f27b4d8 --- /dev/null +++ b/src/remixAppManager.js @@ -0,0 +1,45 @@ +import { AppManagerApi } from 'remix-plugin' +import { EventEmitter } from 'events' + +export class RemixAppManager extends AppManagerApi { + + constructor (store) { + super(null) + this.store = store + this.event = new EventEmitter() + } + + doActivate (name) { + this.activateOne(name) + // temp + this.store.activate(name) + // promise ? + const entity = this.getEntity(name) + if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { + this.event.emit('requestContainer', entity.profile, entity.api.render()) + } + } + + doDeactivate (name) { + this.deactivateOne(name) + // temp + this.store.deactivate(name) + // promise ? + const entity = this.getEntity(name) + if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { + this.event.emit('removingItem', entity.profile) + } + } + + setActive (name, isActive) { + isActive ? this.store.activate(name) : this.store.deactivate(name) + } + + getEntity (entityName) { + return this.store.get(entityName) + } + + addEntity (entity) { + this.store.add(entity.profile.name, entity) + } +} \ No newline at end of file diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 2262b576ac..2898d5e8ab 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -31,7 +31,7 @@ function UniversalDApp (registry) { UniversalDApp.prototype.profile = function () { return { - type: 'udapp', + name: 'Udapp', methods: ['runTestTx', 'getAccounts', 'createVMAccount'] } } From 0dabf0f7ebfb01af7dd3202691f264fb36e9cc39 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 11 Jan 2019 14:10:30 +0100 Subject: [PATCH 021/636] quick fix --- .../components/plugin-manager-component.js | 19 ++++++++++--------- src/universal-dapp.js | 7 ------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 43e90897de..cc4be780c7 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -57,37 +57,38 @@ class PluginManagerComponent { } render () { - let pluginManagerDiv = yo` + this.views.root = yo`

Plugin Manager

` var modules = this.store.getAll() modules.forEach((mod) => { - pluginManagerDiv.appendChild(this.renderItem(mod.profile.name)) + this.views.root.appendChild(this.renderItem(mod.profile.name)) }) - return pluginManagerDiv + return this.views.root } renderItem (item) { let ctrBtns + const mod = this.store.getOne(item) + if (!mod) return let action = () => { this.store.isActive(item) ? this.appManager.doDeactivate(item) : this.appManager.doActivate(item) } ctrBtns = yo`
` - this.views.items[item] = ctrBtns - - this.views.root = yo` + this.views.items[item] = yo`
-

${this.modulesDefinition[item].name}

- ${this.modulesDefinition[item].description} +

${mod.profile.name}

+ ${mod.profile.description} ${ctrBtns}
` - return this.views.root + + return this.views.items[item] } } diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 2898d5e8ab..aa6afa5300 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -36,13 +36,6 @@ UniversalDApp.prototype.profile = function () { } } -UniversalDApp.prototype.profile = function () { - return { - type: 'udapp', - methods: ['runTestTx', 'getAccounts', 'createVMAccount'] - } -} - UniversalDApp.prototype.resetEnvironment = function () { this.accounts = {} if (executionContext.isVM()) { From 1a8aa4c352474552524f20d528dac3846a00330c Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 11 Jan 2019 15:12:12 +0100 Subject: [PATCH 022/636] forward compilation finished --- .../components/plugin-manager-component.js | 23 +------------------ src/app/components/plugin-manager-proxy.js | 16 +++++++++---- src/app/tabs/compile-tab.js | 2 +- src/remixAppManager.js | 15 ++++++++++++ 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index cc4be780c7..8a62e5636d 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -1,32 +1,15 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') -const FilePanel = require('../panels/file-panel') -const CompileTab = require('../tabs/compile-tab') -const SettingsTab = require('../tabs/settings-tab') -const AnalysisTab = require('../tabs/analysis-tab') -const DebuggerTab = require('../tabs/debugger-tab') -const SupportTab = require('../tabs/support-tab') -const TestTab = require('../tabs/test-tab') -const RunTab = require('../tabs/run-tab') - -var registry = require('../../global/registry') - const styleguide = require('../ui/styles-guide/theme-chooser') const styles = styleguide.chooser() -import { EntityStore } from '../../lib/store.js' - -const PluginManagerProxy = require('./plugin-manager-proxy') const EventEmitter = require('events') class PluginManagerComponent { constructor () { - this.event = new EventEmitter() - this.data = { - proxy: new PluginManagerProxy() - } + this.event = new EventEmitter() this.views = { root: null, items: {} @@ -52,10 +35,6 @@ class PluginManagerComponent { this.store.event.on('deactivate', (name) => { this.views.items[name] ? this.views.items[name].querySelector('button').innerHTML = 'activate' : null }) } - proxy () { - return this.data.proxy - } - render () { this.views.root = yo`
diff --git a/src/app/components/plugin-manager-proxy.js b/src/app/components/plugin-manager-proxy.js index 2aa9508235..3fc4126279 100644 --- a/src/app/components/plugin-manager-proxy.js +++ b/src/app/components/plugin-manager-proxy.js @@ -10,11 +10,19 @@ class PluginManagerProxy { this.event = new EventManager() } - register (mod, instance) { - instance.event.on('compilationFinished', (file, source, languageVersion, data) => { + register (instance) { + var event = this.event + this._listener = (file, source, languageVersion, data) => { registry.get('compilersartefacts').api['__last'] = new CompilerAbstract(languageVersion, data, source) - this.event.trigger('sendCompilationResult', [file, source, languageVersion, data]) - }) + event.trigger('sendCompilationResult', [file, source, languageVersion, data]) + } + instance.event.on('compilationFinished', this._listener) + } + + unregister (instance) { + if (!this._listener) { + instance.event.on('compilationFinished', this._listener) + } } } diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index bc16ee6f48..d0e9ab39c5 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -118,7 +118,7 @@ module.exports = class CompileTab { self._components.compiler.event.register('compilationFinished', function finish (success, data, source) { if (success) { // forwarding the event to the appManager infra - self.event.emit('compilationFinished', null, source, 'Solidity', data) + self.event.emit('compilationFinished', source.target, source, self.data.selectedVersion, data) } if (self._view.compileIcon) { self._view.compileIcon.style.color = styles.colors.black diff --git a/src/remixAppManager.js b/src/remixAppManager.js index 0c6f27b4d8..b3564aad9d 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -1,5 +1,6 @@ import { AppManagerApi } from 'remix-plugin' import { EventEmitter } from 'events' +import PluginManagerProxy from './app/components/plugin-manager-proxy' export class RemixAppManager extends AppManagerApi { @@ -7,6 +8,14 @@ export class RemixAppManager extends AppManagerApi { super(null) this.store = store this.event = new EventEmitter() + this.data = { + proxy: new PluginManagerProxy() + } + } + + proxy () { + // that's temporary. should be removed when we can have proper notification registration + return this.data.proxy } doActivate (name) { @@ -18,6 +27,9 @@ export class RemixAppManager extends AppManagerApi { if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { this.event.emit('requestContainer', entity.profile, entity.api.render()) } + if (name === 'SolidityCompile') { + this.data.proxy.register(entity.api) + } } doDeactivate (name) { @@ -29,6 +41,9 @@ export class RemixAppManager extends AppManagerApi { if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { this.event.emit('removingItem', entity.profile) } + if (name === 'SolidityCompile') { + this.data.proxy.unregister(entity.api) + } } setActive (name, isActive) { From d5750afeef12b959ec5f5536ec9bf5bc53475b3e Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 11 Jan 2019 15:13:01 +0100 Subject: [PATCH 023/636] fix start debugging --- src/app.js | 6 +----- src/app/execution/txLogger.js | 5 ++--- src/app/tabs/tabbed-menu.js | 3 --- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/app.js b/src/app.js index 051330aea5..c69a538fe8 100644 --- a/src/app.js +++ b/src/app.js @@ -259,11 +259,6 @@ class App { // self._adjustLayout('right', self.data._layout.right.offset) return self._view.el } - startdebugging (txHash) { - const self = this - self.event.trigger('debuggingRequested', []) - self._components.righthandpanel.debugger().debug(txHash) - } loadFromGist (params) { const self = this return self._components.gistHandler.handleLoad(params, function (gistId) { @@ -542,6 +537,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } var txLogger = new TxLogger() // eslint-disable-line + txLogger.event.register('debuggingRequested', (hash) => { debug.debugger().debug(hash) }) var queryParams = new QueryParams() diff --git a/src/app/execution/txLogger.js b/src/app/execution/txLogger.js index a0774b8ab8..24f7212b12 100644 --- a/src/app/execution/txLogger.js +++ b/src/app/execution/txLogger.js @@ -142,8 +142,7 @@ class TxLogger { editorPanel: this._components.registry.get('editorpanel').api, txListener: this._components.registry.get('txlistener').api, eventsDecoder: this._components.registry.get('eventsdecoder').api, - compilersArtefacts: this._components.registry.get('compilersartefacts').api, - app: this._components.registry.get('app').api + compilersArtefacts: this._components.registry.get('compilersartefacts').api } this.logKnownTX = this._deps.editorPanel.registerCommand('knownTransaction', (args, cmds, append) => { @@ -208,7 +207,7 @@ function debug (e, data, self) { if (data.tx.isCall && data.tx.envMode !== 'vm') { modalDialog.alert('Cannot debug this call. Debugging calls is only possible in JavaScript VM mode.') } else { - self._deps.app.startdebugging(data.tx.hash) + self.event.trigger('debuggingRequested', [data.tx.hash]) } } diff --git a/src/app/tabs/tabbed-menu.js b/src/app/tabs/tabbed-menu.js index 52dbf614bb..c6bc01ffbc 100644 --- a/src/app/tabs/tabbed-menu.js +++ b/src/app/tabs/tabbed-menu.js @@ -17,9 +17,6 @@ module.exports = class TabbedMenu { app: self._components.registry.get('app').api } self._view = { el: null, viewport: null, tabs: {}, contents: {} } - self._deps.app.event.register('debuggingRequested', () => { - self.selectTabByTitle('Debugger') - }) } render () { const self = this From 45b566945f73c0b3684445d63ce2e18ee44f44f4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 11 Jan 2019 15:13:12 +0100 Subject: [PATCH 024/636] typo --- src/app.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app.js b/src/app.js index c69a538fe8..013bba80ce 100644 --- a/src/app.js +++ b/src/app.js @@ -417,7 +417,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } } txlistener.event.register('newTransaction', (tx) => { - txListenerModule.event.emit('newTransaction', tx) + txListenerModuleProxy.event.emit('newTransaction', tx) }) txlistener.startListening() @@ -449,7 +449,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // TODOs those are instanciated before hand. should be instanciated on demand const pluginManagerComponent = new PluginManagerComponent() - registry.put({api: pluginManagerComponent.proxy(), name: 'pluginmanager'}) + + let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }, 'name') + + const appManager = new RemixAppManager(appStore) + registry.put({api: appManager.proxy(), name: 'pluginmanager'}) let filePanel = new FilePanel() registry.put({api: filePanel, name: 'filepanel'}) @@ -462,10 +466,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org let support = new SupportTab(self._components.registry) let test = new TestTab(self._components.registry, compileTab) - let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }, 'name') - - const appManager = new RemixAppManager(appStore) - pluginManagerComponent.setApp(appManager) pluginManagerComponent.setStore(appStore) From 9804b7baa4fa1580796c7ba55f7da8918cc53f8c Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 14 Jan 2019 11:39:13 +0100 Subject: [PATCH 025/636] Update remixAppManager.js --- src/remixAppManager.js | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/src/remixAppManager.js b/src/remixAppManager.js index b3564aad9d..98deccb7af 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -18,35 +18,16 @@ export class RemixAppManager extends AppManagerApi { return this.data.proxy } - doActivate (name) { - this.activateOne(name) - // temp - this.store.activate(name) - // promise ? + setActive (name, isActive) { const entity = this.getEntity(name) - if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { - this.event.emit('requestContainer', entity.profile, entity.api.render()) - } - if (name === 'SolidityCompile') { - this.data.proxy.register(entity.api) + if (entity && entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { + isActive ? this.event.emit('requestContainer', entity.profile, entity.api.render()) + : this.event.emit('removingItem', entity.profile) } - } - - doDeactivate (name) { - this.deactivateOne(name) // temp - this.store.deactivate(name) - // promise ? - const entity = this.getEntity(name) - if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { - this.event.emit('removingItem', entity.profile) - } - if (name === 'SolidityCompile') { - this.data.proxy.unregister(entity.api) + if (entity && name === 'SolidityCompiler') { + isActive ? this.data.proxy.register(entity.api) : this.data.proxy.unregister(entity.api) } - } - - setActive (name, isActive) { isActive ? this.store.activate(name) : this.store.deactivate(name) } @@ -57,4 +38,4 @@ export class RemixAppManager extends AppManagerApi { addEntity (entity) { this.store.add(entity.profile.name, entity) } -} \ No newline at end of file +} From 2549b41b9b3d2c7ab9ecec0ba5af04ce3b91c741 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Mon, 14 Jan 2019 16:18:12 +0100 Subject: [PATCH 026/636] update to icons --- src/app/components/plugin-manager-component.js | 10 ++++------ src/app/panels/file-panel.js | 2 +- src/app/tabs/analysis-tab.js | 2 +- src/app/tabs/compile-tab.js | 2 +- src/app/tabs/debugger-tab.js | 2 +- src/app/tabs/run-tab.js | 2 +- src/app/tabs/settings-tab.js | 2 +- src/app/tabs/support-tab.js | 2 +- src/app/tabs/test-tab.js | 2 +- 9 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 8a62e5636d..889f556d33 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -21,7 +21,7 @@ class PluginManagerComponent { name: 'PluginManager', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9IiAgTTMyLDM1YzAsMCw4LjMxMiwwLDkuMDk4LDBDNDUuNDYzLDM1LDQ5LDMxLjQ2Myw0OSwyNy4wOTlzLTMuNTM3LTcuOTAyLTcuOTAyLTcuOTAyYy0wLjAyLDA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kyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNzU1IDQ1M3EzNyAzOCAzNyA5MC41dC0zNyA5MC41bC00MDEgNDAwIDE1MCAxNTAtMTYwIDE2MHEtMTYzIDE2My0zODkuNSAxODYuNXQtNDExLjUtMTAwLjVsLTM2MiAzNjJoLTE4MXYtMTgxbDM2Mi0zNjJxLTEyNC0xODUtMTAwLjUtNDExLjV0MTg2LjUtMzg5LjVsMTYwLTE2MCAxNTAgMTUwIDQwMC00MDFxMzgtMzcgOTEtMzd0OTAgMzcgMzcgOTAuNS0zNyA5MC41bC00MDAgNDAxIDIzNCAyMzQgNDAxLTQwMHEzOC0zNyA5MS0zN3Q5MCAzN3oiLz48L3N2Zz4=' } } @@ -37,7 +37,7 @@ class PluginManagerComponent { render () { this.views.root = yo` -
+

Plugin Manager

` @@ -60,7 +60,7 @@ class PluginManagerComponent {
` this.views.items[item] = yo` -
+

${mod.profile.name}

${mod.profile.description} ${ctrBtns} @@ -74,9 +74,7 @@ class PluginManagerComponent { module.exports = PluginManagerComponent const css = csjs` - .plugins { - } - .plugins h2 { + .plugins_settings h2 { font-size: 1em; border-bottom: 1px ${styles.appProperties.solidBorderBox_BorderColor} solid; padding: 10px 20px; diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index 31296769b6..1f58ac2afc 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -201,7 +201,7 @@ function filepanel (localRegistry) { name: 'FilePanel', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZ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/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNjgtNDAgMTI4LTQwaDQxNnptLTU0NCAyMTNsLTI5OSAyOTloMjk5di0yOTl6bS02NDAtMzg0bC0yOTkgMjk5aDI5OXYtMjk5em0xOTYgNjQ3bDMxNi0zMTZ2LTQxNmgtMzg0djQxNnEwIDQwLTI4IDY4dC02OCAyOGgtNDE2djY0MGg1MTJ2LTI1NnEwLTQwIDIwLTg4dDQ4LTc2em05NTYgODA0di0xMTUyaC0zODR2NDE2cTAgNDAtMjggNjh0LTY4IDI4aC00MTZ2NjQwaDg5NnoiLz48L3N2Zz4=' } } diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index 5635dece63..19ec95f330 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -20,7 +20,7 @@ module.exports = class AnalysisTab { name: 'SolidityAnalysis', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVE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N0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==' + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjA0OCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjA0OCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMDQ4IDE1MzZ2MTI4aC0yMDQ4di0xNTM2aDEyOHYxNDA4aDE5MjB6bS0xMjgtMTI0OHY0MzVxMCAyMS0xOS41IDI5LjV0LTM1LjUtNy41bC0xMjEtMTIxLTYzMyA2MzNxLTEwIDEwLTIzIDEwdC0yMy0xMGwtMjMzLTIzMy00MTYgNDE2LTE5Mi0xOTIgNTg1LTU4NXExMC0xMCAyMy0xMHQyMyAxMGwyMzMgMjMzIDQ2NC00NjQtMTIxLTEyMXEtMTYtMTYtNy41LTM1LjV0MjkuNS0xOS41aDQzNXExNCAwIDIzIDl0OSAyM3oiLz48L3N2Zz4=' } } render () { diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index d0e9ab39c5..ac90e771e8 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -189,7 +189,7 @@ module.exports = class CompileTab { name: 'SolidityCompile', methods: ['getCompilationResult'], events: ['compilationFinished'], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW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TQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzeiIvPjwvc3ZnPg==' } } addWarning (msg, settings) { diff --git a/src/app/tabs/debugger-tab.js b/src/app/tabs/debugger-tab.js index 7754bb7808..d245bbea35 100644 --- a/src/app/tabs/debugger-tab.js +++ b/src/app/tabs/debugger-tab.js @@ -32,7 +32,7 @@ class DebuggerTab { name: 'Debugger', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00NiwxNXYtNCAgYzAtMS4xMDQtMC44OTYtMi0yLTJjMCwwLTI0LjY0OCwwLTI2LDBjLTEuNDY5LDAtMi40ODQtNC00LTRIM0MxLjg5Niw1LDEsNS44OTYsMSw3djR2Mjl2NGMwLDEuMTA0LDAuODk2LDIs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5LTQ1dDE5LTQ1IDQ1LTE5IDQ1IDE5bDE3MyAxNzNoODQ0bDE3My0xNzNxMTktMTkgNDUtMTl0NDUgMTkgMTkgNDUtMTkgNDVsLTE3MyAxNzN2Mjk0aDIyNHEyNiAwIDQ1IDE5dDE5IDQ1em0tNDgwLTU3NmgtNjQwcTAtMTMzIDkzLjUtMjI2LjV0MjI2LjUtOTMuNSAyMjYuNSA5My41IDkzLjUgMjI2LjV6Ii8+PC9zdmc+' } } diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 3c6ede3f62..a816dbbf5c 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -185,7 +185,7 @@ function runTab (opts, localRegistry) { name: 'Run', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00My43MzQsMjFjLTMuNjMxLDAtMTUuMDkyLDAtMTUuMDkyLDAgIFMxNi4yNSw1LjE4OCwxNi4wNDcsNC45MzhzLTAuNDIyLTAuNTk0LTEuMTI1L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NCAyNjBxMTUgMjMgMTAgNDl0LTI3IDQwcS0xNSAxMS0zNiAxMS0zNSAwLTUzLTI5bC0xNzQtMjYwcS05MyA5NS05MyAyMjUgMCAxMzIgOTQgMjI2dDIyNiA5NHoiLz48L3N2Zz4=' } } } diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index e05b6fd565..02a7a92e71 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -43,7 +43,7 @@ module.exports = class SettingsTab { name: 'Settings', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00OSwyNy45NTR2LTZsLTcuMTQxLTEuMTY3ICBjLTAuNDIzLTEuNjkxLTEuMDg3LTMuMjgxLTEuOTYyLTQuNzM3bDQuMTYyLTUuOTMybC00LjI0My00LjI0MWwtNS44NTYsNC4yMWMtMS40Ni0wLjg4NC0zLjA2LTEuNTU4LTQuNzYzLTEuOTgybC0xLjI0NS03LjEwNmgtNiAgbC0xLjE1Niw3LjA4M2M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yLTEwOXYyMjJxMCAxMi04IDIzdC0yMCAxM2wtMTg1IDI4cS0xOSA1NC0zOSA5MSAzNSA1MCAxMDcgMTM4IDEwIDEyIDEwIDI1dC05IDIzcS0yNyAzNy05OSAxMDh0LTk0IDcxcS0xMiAwLTI2LTlsLTEzOC0xMDhxLTQ0IDIzLTkxIDM4LTE2IDEzNi0yOSAxODYtNyAyOC0zNiAyOGgtMjIycS0xNCAwLTI0LjUtOC41dC0xMS41LTIxLjVsLTI4LTE4NHEtNDktMTYtOTAtMzdsLTE0MSAxMDdxLTEwIDktMjUgOS0xNCAwLTI1LTExLTEyNi0xMTQtMTY1LTE2OC03LTEwLTctMjMgMC0xMiA4LTIzIDE1LTIxIDUxLTY2LjV0NTQtNzAuNXEtMjctNTAtNDEtOTlsLTE4My0yN3EtMTMtMi0yMS0xMi41dC04LTIzLjV2LTIyMnEwLTEyIDgtMjN0MTktMTNsMTg2LTI4cTE0LTQ2IDM5LTkyLTQwLTU3LTEwNy0xMzgtMTAtMTItMTAtMjQgMC0xMCA5LTIzIDI2LTM2IDk4LjUtMTA3LjV0OTQuNS03MS41cTEzIDAgMjYgMTBsMTM4IDEwN3E0NC0yMyA5MS0zOCAxNi0xMzYgMjktMTg2IDctMjggMzYtMjhoMjIycTE0IDAgMjQuNSA4LjV0MTEuNSAyMS41bDI4IDE4NHE0OSAxNiA5MCAzN2wxNDItMTA3cTktOSAyNC05IDEzIDAgMjUgMTAgMTI5IDExOSAxNjUgMTcwIDcgOCA3IDIyIDAgMTItOCAyMy0xNSAyMS01MSA2Ni41dC01NCA3MC41cTI2IDUwIDQxIDk4bDE4MyAyOHExMyAyIDIxIDEyLjV0OCAyMy41eiIvPjwvc3ZnPg==' } } render () { diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index eabf86866c..06ef2026e4 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -33,7 +33,7 @@ module.exports = class SupportTab { name: 'Support', methods: [], events: [], - ic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app/tabs/test-tab.js b/src/app/tabs/test-tab.js index 12edc63358..596539d57d 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -28,7 +28,7 @@ module.exports = class TestTab { name: 'Run', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUwIDUwIiBoZWlnaHQ9IjUwcHgiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MCA1MCIgd2lkdGg9IjUwcHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxyZWN0IGZpbGw9Im5vbmUiIGhlaWdodD0iNTAiIHdpZHRoPSI1MCIvPjxwYXRoIGQ9Ik00OSw0djI1YzAsMC01LjI3MywzLTEyLDMgIGMtMTEuOTI5LDAtMTUuODY5LTQtMjQtNFMxLDMwLDEsMzBWM2MwLDAsMi4wODUtMiwxMi0yczE0LjA0Nyw2LDI0LDZDNDMuMjgxLDcsNDguMTMsNC40NzEsNDksNHoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iMiIvPjxsaW5lIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbWl0ZXJs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1Ni0zM3Q1NiAzM3E0IDcgNTYgMTAwdDEwMiAxODQgMTA3IDE5NS41IDkyIDE3NC41IDM1IDgxem0tMTI4MCAwcTAgNzMtNDYuNSAxMzF0LTExNy41IDkxLTE0NC41IDQ5LjUtMTM5LjUgMTYuNS0xMzkuNS0xNi41LTE0NC41LTQ5LjUtMTE3LjUtOTEtNDYuNS0xMzFxMC0xMSAzNS04MXQ5Mi0xNzQuNSAxMDctMTk1LjUgMTAyLTE4NCA1Ni0xMDBxMTgtMzMgNTYtMzN0NTYgMzNxNCA3IDU2IDEwMHQxMDIgMTg0IDEwNyAxOTUuNSA5MiAxNzQuNSAzNSA4MXoiLz48L3N2Zz4=' } } render () { From 4774502da85a2b69cdfa05c5ac9c1619d0803225 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 14 Jan 2019 16:38:31 +0100 Subject: [PATCH 027/636] use remix-plugin 0.0.5 --- package.json | 2 +- src/app.js | 69 +++++++++---------- .../components/plugin-manager-component.js | 2 +- src/lib/store.js | 8 +++ src/remixAppManager.js | 33 ++------- 5 files changed, 50 insertions(+), 64 deletions(-) diff --git a/package.json b/package.json index 1975bef152..01d105cd54 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "remix-analyzer": "0.3.1", "remix-debug": "0.3.1", "remix-lib": "0.4.1", - "remix-plugin": "0.0.1-alpha.4", + "remix-plugin": "0.0.1-alpha.5", "remix-solidity": "0.3.1", "remix-tests": "0.1.1", "remixd": "0.1.8-alpha.6", diff --git a/src/app.js b/src/app.js index 013bba80ce..9372a8403f 100644 --- a/src/app.js +++ b/src/app.js @@ -449,15 +449,15 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // TODOs those are instanciated before hand. should be instanciated on demand const pluginManagerComponent = new PluginManagerComponent() - - let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }, 'name') - + let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }) const appManager = new RemixAppManager(appStore) registry.put({api: appManager.proxy(), name: 'pluginmanager'}) + pluginManagerComponent.setApp(appManager) + pluginManagerComponent.setStore(appStore) + let filePanel = new FilePanel() registry.put({api: filePanel, name: 'filepanel'}) - let compileTab = new CompileTab(self._components.registry) let run = new RunTab(self._components.registry) let settings = new SettingsTab(self._components.registry) @@ -465,28 +465,25 @@ Please make a backup of your contracts and start using http://remix.ethereum.org let debug = new DebuggerTab(self._components.registry) let support = new SupportTab(self._components.registry) let test = new TestTab(self._components.registry, compileTab) - - pluginManagerComponent.setApp(appManager) - pluginManagerComponent.setStore(appStore) - let sourceHighlighters = registry.get('editor').api.sourceHighlighters let configProvider = self._components.filesProviders['config'] - appManager.init([ - { profile: this.profile(), api: this }, - { profile: udapp.profile(), api: udapp }, - { profile: fileManager.profile(), api: fileManager }, - { profile: sourceHighlighters.profile(), api: sourceHighlighters }, - { profile: configProvider.profile(), api: configProvider }, - { profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy }, - { profile: compileTab.profile(), api: compileTab }, - { profile: filePanel.profile(), api: filePanel }, - { profile: test.profile(), api: test }, - { profile: support.profile(), api: support }, - { profile: debug.profile(), api: debug }, - { profile: analysis.profile(), api: analysis }, - { profile: settings.profile(), api: settings }, - { profile: run.profile(), api: run }, - { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) + + appStore.addEntities([ + { profile: this.profile(), api: this }, + { profile: udapp.profile(), api: udapp }, + { profile: fileManager.profile(), api: fileManager }, + { profile: sourceHighlighters.profile(), api: sourceHighlighters }, + { profile: configProvider.profile(), api: configProvider }, + { profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy }, + { profile: compileTab.profile(), api: compileTab }, + { profile: filePanel.profile(), api: filePanel }, + { profile: test.profile(), api: test }, + { profile: support.profile(), api: support }, + { profile: debug.profile(), api: debug }, + { profile: analysis.profile(), api: analysis }, + { profile: settings.profile(), api: settings }, + { profile: run.profile(), api: run }, + { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) const swapPanelComponent = new SwapPanelComponent() const verticalIconComponent = new VerticalIconsComponent() @@ -500,18 +497,18 @@ Please make a backup of your contracts and start using http://remix.ethereum.org self._view.iconpanel.appendChild(verticalIconComponent.render()) self._view.swappanel.appendChild(swapPanelComponent.render()) - appManager.doActivate('App') - appManager.doActivate('Udapp') - appManager.doActivate('FileManager') - appManager.doActivate('SourceHighlighters') - appManager.doActivate('config') - appManager.doActivate('TxListener') - appManager.doActivate('FilePanel') - appManager.doActivate('SolidityCompile') - appManager.doActivate('Run') - appManager.doActivate('PluginManager') - appManager.doActivate('Settings') - appManager.doActivate('Support') + appManager.activateOne('App') + appManager.activateOne('Udapp') + appManager.activateOne('FileManager') + appManager.activateOne('SourceHighlighters') + appManager.activateOne('config') + appManager.activateOne('TxListener') + appManager.activateOne('FilePanel') + appManager.activateOne('SolidityCompile') + appManager.activateOne('Run') + appManager.activateOne('PluginManager') + appManager.activateOne('Settings') + appManager.activateOne('Support') verticalIconComponent.select('FilePanel') diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 8a62e5636d..15382e0229 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -53,7 +53,7 @@ class PluginManagerComponent { const mod = this.store.getOne(item) if (!mod) return - let action = () => { this.store.isActive(item) ? this.appManager.doDeactivate(item) : this.appManager.doActivate(item) } + let action = () => { this.store.isActive(item) ? this.appManager.deactivateOne(item) : this.appManager.activateOne(item) } ctrBtns = yo`
diff --git a/src/lib/store.js b/src/lib/store.js index d0ba59722f..972759c022 100644 --- a/src/lib/store.js +++ b/src/lib/store.js @@ -135,6 +135,14 @@ export class EntityStore extends Store { this.state.ids.push(id) } + /** + * Add entities to the state + * @param {Array} entities + */ + addEntities(entities) { + entities.forEach((entity) => { this.add(entity.profile.name, entity) }) + } + /** * Remove an entity from the state * @param {(string|number)} id The id of the entity to remove diff --git a/src/remixAppManager.js b/src/remixAppManager.js index b3564aad9d..98deccb7af 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -18,35 +18,16 @@ export class RemixAppManager extends AppManagerApi { return this.data.proxy } - doActivate (name) { - this.activateOne(name) - // temp - this.store.activate(name) - // promise ? + setActive (name, isActive) { const entity = this.getEntity(name) - if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { - this.event.emit('requestContainer', entity.profile, entity.api.render()) - } - if (name === 'SolidityCompile') { - this.data.proxy.register(entity.api) + if (entity && entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { + isActive ? this.event.emit('requestContainer', entity.profile, entity.api.render()) + : this.event.emit('removingItem', entity.profile) } - } - - doDeactivate (name) { - this.deactivateOne(name) // temp - this.store.deactivate(name) - // promise ? - const entity = this.getEntity(name) - if (entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { - this.event.emit('removingItem', entity.profile) - } - if (name === 'SolidityCompile') { - this.data.proxy.unregister(entity.api) + if (entity && name === 'SolidityCompiler') { + isActive ? this.data.proxy.register(entity.api) : this.data.proxy.unregister(entity.api) } - } - - setActive (name, isActive) { isActive ? this.store.activate(name) : this.store.deactivate(name) } @@ -57,4 +38,4 @@ export class RemixAppManager extends AppManagerApi { addEntity (entity) { this.store.add(entity.profile.name, entity) } -} \ No newline at end of file +} From 72120cdffa825beea354f1c3ec349d13dd31a424 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 14 Jan 2019 18:53:39 +0100 Subject: [PATCH 028/636] split screen (swap panel / editor panel) --- src/app.js | 52 +++++------- src/app/panels/file-panel.js | 41 +--------- src/app/panels/styles/file-panel-styles.js | 22 +---- src/app/staticanalysis/staticAnalysisView.js | 6 -- src/lib/panels-resize.js | 84 ++++++++++++++++++++ 5 files changed, 105 insertions(+), 100 deletions(-) create mode 100644 src/lib/panels-resize.js diff --git a/src/app.js b/src/app.js index 9372a8403f..449c1fefa1 100644 --- a/src/app.js +++ b/src/app.js @@ -52,6 +52,7 @@ const TestTab = require('./app/tabs/test-tab') const RunTab = require('./app/tabs/run-tab') const FilePanel = require('./app/panels/file-panel') +import PanelsResize from './lib/panels-resize' import { EntityStore } from './lib/store' import { RemixAppManager } from './remixAppManager' @@ -85,9 +86,8 @@ var css = csjs` position : absolute; top : 0; bottom : 0; - left : 450px; overflow : hidden; - width : 800px; + width : 82%; } .iconpanel { background-color : ${styles.leftPanel.backgroundColor_Panel}; @@ -98,18 +98,16 @@ var css = csjs` bottom : 0; left : 0; overflow : hidden; - width : 50px; + width : 2%; } .swappanel { display : flex; flex-direction : column; position : absolute; top : 0; - left : 50px; bottom : 0; overflow : hidden; - width : 400px; - height : 100%; + width : 16%; } .highlightcode { position:absolute; @@ -187,31 +185,13 @@ class App { } } } - _adjustLayout (direction, delta) { - /* var self = this - var layout = self.data._layout[direction] - if (layout) { - if (delta === undefined) { - layout.show = !layout.show - if (layout.show) delta = layout.offset - else delta = 0 - } else { - self._components.config.set(`${direction}-offset`, delta) - layout.offset = delta - } - } - if (direction === 'left') { - self._view.swappanel.style.width = delta + 'px' - self._view.mainpanel.style.left = delta + 'px' - } - if (direction === 'right') { - self._view.mainpanel.style.width = delta + 'px' - self._view.swappanel.style.right = delta + 'px' - } - */ - } + init () { var self = this + self._view.swappanel.style.left = self._view.iconpanel.clientWidth + 'px' + self._view.mainpanel.style.left = (self._view.iconpanel.clientWidth + self._view.swappanel.clientWidth) + 'px' + + let resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': '300' }) run.apply(self) } @@ -253,7 +233,7 @@ class App { ${self._view.swappanel} ${self._view.mainpanel}
- ` + ` // INIT // self._adjustLayout('left', self.data._layout.left.offset) // self._adjustLayout('right', self.data._layout.right.offset) @@ -432,7 +412,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // ----------------- editor panel ---------------------- self._components.editorpanel = new EditorPanel() registry.put({ api: self._components.editorpanel, name: 'editorpanel' }) - + // ----------------- Renderer ----------------- var renderer = new Renderer() registry.put({api: renderer, name: 'renderer'}) @@ -449,6 +429,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // TODOs those are instanciated before hand. should be instanciated on demand const pluginManagerComponent = new PluginManagerComponent() + let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }) const appManager = new RemixAppManager(appStore) registry.put({api: appManager.proxy(), name: 'pluginmanager'}) @@ -486,6 +467,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) const swapPanelComponent = new SwapPanelComponent() + const verticalIconComponent = new VerticalIconsComponent() const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, appManager) const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, appManager) @@ -493,9 +475,13 @@ Please make a backup of your contracts and start using http://remix.ethereum.org self._components.editorpanel.init() self._components.fileManager.init() - self._view.mainpanel.appendChild(self._components.editorpanel.render()) + let mainEl = self._components.editorpanel.render() + self._view.mainpanel.appendChild(mainEl) + self._view.iconpanel.appendChild(verticalIconComponent.render()) - self._view.swappanel.appendChild(swapPanelComponent.render()) + + let swapEl = swapPanelComponent.render() + self._view.swappanel.appendChild(swapEl) appManager.activateOne('App') appManager.activateOne('Udapp') diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index 1f58ac2afc..cb4716b5c8 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -20,9 +20,7 @@ var styles = styleGuide.chooser() var css = require('./styles/file-panel-styles') -var limit = 60 var canUpload = window.File || window.FileReader || window.FileList || window.Blob -var ghostbar = yo`
` /* Overview of APIs: @@ -71,8 +69,7 @@ function filepanel (localRegistry) { self._compilerMetadata.syncContractMetadata() self.compilerMetadata = () => { return self._compilerMetadata } - var dragbar = yo`
` - + function remixdDialog () { return yo`
@@ -128,7 +125,6 @@ function filepanel (localRegistry) {
${httpsExplorer.init()}
- ${dragbar}
` } @@ -239,41 +235,6 @@ function filepanel (localRegistry) { }) } - // ----------------- resizeable ui --------------- - function mousedown (event) { - event.preventDefault() - if (event.which === 1) { - moveGhostbar(event) - document.body.appendChild(ghostbar) - document.addEventListener('mousemove', moveGhostbar) - document.addEventListener('mouseup', removeGhostbar) - document.addEventListener('keydown', cancelGhostbar) - } - } - function cancelGhostbar (event) { - if (event.keyCode === 27) { - document.body.removeChild(ghostbar) - document.removeEventListener('mousemove', moveGhostbar) - document.removeEventListener('mouseup', removeGhostbar) - document.removeEventListener('keydown', cancelGhostbar) - } - } - function getPosition (event) { - var rhp = document.body.offsetWidth - window['righthand-panel'].offsetWidth - var newpos = (event.pageX < limit) ? limit : event.pageX - newpos = (newpos < (rhp - limit)) ? newpos : (rhp - limit) - return newpos - } - function moveGhostbar (event) { // @NOTE VERTICAL ghostbar - ghostbar.style.left = getPosition(event) + 'px' - } - function removeGhostbar (event) { - document.body.removeChild(ghostbar) - document.removeEventListener('mousemove', moveGhostbar) - document.removeEventListener('mouseup', removeGhostbar) - document.removeEventListener('keydown', cancelGhostbar) - } - function createNewFile () { modalDialogCustom.prompt(null, 'File Name', 'Untitled.sol', (input) => { helper.createNonClashingName(input, self._deps.fileProviders['browser'], (error, newName) => { diff --git a/src/app/panels/styles/file-panel-styles.js b/src/app/panels/styles/file-panel-styles.js index 0d50abf89e..ea8c3ddc22 100644 --- a/src/app/panels/styles/file-panel-styles.js +++ b/src/app/panels/styles/file-panel-styles.js @@ -73,27 +73,7 @@ var css = csjs` } .treeviews { overflow-y : auto; - } - .dragbar { - position : absolute; - top : 29px; - width : 0.5em; - right : 0; - bottom : 0; - cursor : col-resize; - z-index : 999; - border-right : 2px solid hsla(215, 81%, 79%, .3); - } - .ghostbar { - width : 3px; - background-color : ${styles.colors.lightBlue}; - opacity : 0.5; - position : absolute; - cursor : col-resize; - z-index : 9999; - top : 0; - bottom : 0; - } + } .dialog { display: flex; flex-direction: column; diff --git a/src/app/staticanalysis/staticAnalysisView.js b/src/app/staticanalysis/staticAnalysisView.js index 8e5abef71a..dec4386d73 100644 --- a/src/app/staticanalysis/staticAnalysisView.js +++ b/src/app/staticanalysis/staticAnalysisView.js @@ -122,12 +122,6 @@ staticAnalysisView.prototype.run = function () { self._deps.renderer.error(msg, warningContainer, {type: 'staticAnalysisWarning', useSpan: true}) }) }) - if (warningContainer.html() === '') { - $('#righthand-panel #menu .staticanalysisView').css('color', '') - warningContainer.html('No warning to report') - } else { - $('#righthand-panel #menu .staticanalysisView').css('color', styles.colors.red) - } self.event.trigger('staticAnaysisWarning', [warningCount]) }) } else { diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js new file mode 100644 index 0000000000..e29057729c --- /dev/null +++ b/src/lib/panels-resize.js @@ -0,0 +1,84 @@ +const yo = require('yo-yo') +const csjs = require('csjs-inject') +const styleGuide = require('../app/ui/styles-guide/theme-chooser') +const styles = styleGuide.chooser() + +const css = csjs` + .dragbar { + position : absolute; + top : 29px; + width : 0.5em; + right : 0; + bottom : 0; + cursor : col-resize; + z-index : 999; + border-right : 2px solid hsla(215, 81%, 79%, .3); + } + .ghostbar { + width : 3px; + background-color : ${styles.colors.lightBlue}; + opacity : 0.5; + position : absolute; + cursor : col-resize; + z-index : 9999; + top : 0; + bottom : 0; + } +` + +export default class PanelsResize { + constructor (idpanel1, idpanel2, opt) { + var panel1 = document.querySelector(idpanel1) + var panel2 = document.querySelector(idpanel2) + + var ghostbar = yo`
` + + let mousedown = (event) => { + event.preventDefault() + if (event.which === 1) { + moveGhostbar(event) + document.body.appendChild(ghostbar) + document.addEventListener('mousemove', moveGhostbar) + document.addEventListener('mouseup', removeGhostbar) + document.addEventListener('keydown', cancelGhostbar) + } + } + + let cancelGhostbar = (event) => { + if (event.keyCode === 27) { + document.body.removeChild(ghostbar) + document.removeEventListener('mousemove', moveGhostbar) + document.removeEventListener('mouseup', removeGhostbar) + document.removeEventListener('keydown', cancelGhostbar) + } + } + + let moveGhostbar = (event) => { // @NOTE VERTICAL ghostbar + let p = processWidth(event) + if (p.panel1Width < opt.minWidth || p.panel2Width < opt.minWidth) return + ghostbar.style.left = event.x + 'px' + } + + let removeGhostbar = (event) => { + document.body.removeChild(ghostbar) + document.removeEventListener('mousemove', moveGhostbar) + document.removeEventListener('mouseup', removeGhostbar) + document.removeEventListener('keydown', cancelGhostbar) + let p = processWidth(event) + if (p.panel1Width < opt.minWidth || p.panel2Width < opt.minWidth) return + panel1.style.width = p.panel1Width + 'px' + panel2.style.left = p.panel2left + 'px' + panel2.style.width = p.panel2Width + 'px' + } + + let processWidth = (event) => { + let panel1Width = event.x - panel1.offsetLeft + let panel2left = panel1.offsetLeft + panel1Width + let panel2Width = panel2.parentElement.clientWidth - panel1.offsetLeft - panel1Width + return { panel1Width, panel2left, panel2Width } + } + + var dragbar = yo`
` + panel1.appendChild(dragbar) + } +} \ No newline at end of file From 25e656fac9322851441054db79bbd43b6512770b Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 15 Jan 2019 10:24:57 +0100 Subject: [PATCH 029/636] panel resize --- src/app.js | 16 +++++----------- src/lib/panels-resize.js | 11 ++++++----- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/app.js b/src/app.js index 449c1fefa1..2d05e40f31 100644 --- a/src/app.js +++ b/src/app.js @@ -191,7 +191,7 @@ class App { self._view.swappanel.style.left = self._view.iconpanel.clientWidth + 'px' self._view.mainpanel.style.left = (self._view.iconpanel.clientWidth + self._view.swappanel.clientWidth) + 'px' - let resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': '300' }) + let resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': 300 }) run.apply(self) } @@ -412,7 +412,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // ----------------- editor panel ---------------------- self._components.editorpanel = new EditorPanel() registry.put({ api: self._components.editorpanel, name: 'editorpanel' }) - + // ----------------- Renderer ----------------- var renderer = new Renderer() registry.put({api: renderer, name: 'renderer'}) @@ -429,7 +429,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // TODOs those are instanciated before hand. should be instanciated on demand const pluginManagerComponent = new PluginManagerComponent() - let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }) const appManager = new RemixAppManager(appStore) registry.put({api: appManager.proxy(), name: 'pluginmanager'}) @@ -467,21 +466,16 @@ Please make a backup of your contracts and start using http://remix.ethereum.org { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) const swapPanelComponent = new SwapPanelComponent() - const verticalIconComponent = new VerticalIconsComponent() const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, appManager) const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, appManager) self._components.editorpanel.init() self._components.fileManager.init() - - let mainEl = self._components.editorpanel.render() - self._view.mainpanel.appendChild(mainEl) - + + self._view.mainpanel.appendChild(self._components.editorpanel.render()) self._view.iconpanel.appendChild(verticalIconComponent.render()) - - let swapEl = swapPanelComponent.render() - self._view.swappanel.appendChild(swapEl) + self._view.swappanel.appendChild(swapPanelComponent.render()) appManager.activateOne('App') appManager.activateOne('Udapp') diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js index e29057729c..7d0b16b045 100644 --- a/src/lib/panels-resize.js +++ b/src/lib/panels-resize.js @@ -54,8 +54,8 @@ export default class PanelsResize { } let moveGhostbar = (event) => { // @NOTE VERTICAL ghostbar - let p = processWidth(event) - if (p.panel1Width < opt.minWidth || p.panel2Width < opt.minWidth) return + let p = processPositiions(event) + if (p.panel1Width <= opt.minWidth || p.panel2Width <= opt.minWidth) return ghostbar.style.left = event.x + 'px' } @@ -64,17 +64,18 @@ export default class PanelsResize { document.removeEventListener('mousemove', moveGhostbar) document.removeEventListener('mouseup', removeGhostbar) document.removeEventListener('keydown', cancelGhostbar) - let p = processWidth(event) - if (p.panel1Width < opt.minWidth || p.panel2Width < opt.minWidth) return + let p = processPositiions(event) panel1.style.width = p.panel1Width + 'px' panel2.style.left = p.panel2left + 'px' panel2.style.width = p.panel2Width + 'px' } - let processWidth = (event) => { + let processPositiions = (event) => { let panel1Width = event.x - panel1.offsetLeft + panel1Width = panel1Width < opt.minWidth ? opt.minWidth : panel1Width let panel2left = panel1.offsetLeft + panel1Width let panel2Width = panel2.parentElement.clientWidth - panel1.offsetLeft - panel1Width + panel2Width = panel2Width < opt.minWidth ? opt.minWidth : panel2Width return { panel1Width, panel2left, panel2Width } } From 69d99133d25a5470101f495fa67d3c816d87b642 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 15 Jan 2019 10:25:05 +0100 Subject: [PATCH 030/636] remove toggle button --- src/app/panels/editor-panel.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 87d6b45335..14c3d04733 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -172,18 +172,12 @@ class EditorPanel { self._view.tabsbar = yo`
- - -
${self._view.tabs} - - -
` @@ -237,14 +231,6 @@ class EditorPanel { rightArrow.classList.add(css.hide) } } - function toggleLHP (event) { - this.children[0].classList.toggle('fa-angle-double-right') - this.children[0].classList.toggle('fa-angle-double-left') - } - function toggleRHP (event) { - this.children[0].classList.toggle('fa-angle-double-right') - this.children[0].classList.toggle('fa-angle-double-left') - } function increase () { self._components.editor.editorFontSize(1) } function decrease () { self._components.editor.editorFontSize(-1) } function scrollLeft (event) { From 8217fd3a254e593d5fa04af0dccc78430ce301e7 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 15 Jan 2019 10:26:36 +0100 Subject: [PATCH 031/636] standard --- src/app.js | 14 +++++++------- src/lib/panels-resize.js | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app.js b/src/app.js index 2d05e40f31..60ab86233c 100644 --- a/src/app.js +++ b/src/app.js @@ -185,13 +185,13 @@ class App { } } } - + init () { var self = this self._view.swappanel.style.left = self._view.iconpanel.clientWidth + 'px' self._view.mainpanel.style.left = (self._view.iconpanel.clientWidth + self._view.swappanel.clientWidth) + 'px' - let resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': 300 }) + let resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': 300 }) // eslint-disable-line run.apply(self) } @@ -233,7 +233,7 @@ class App { ${self._view.swappanel} ${self._view.mainpanel}
- ` + ` // INIT // self._adjustLayout('left', self.data._layout.left.offset) // self._adjustLayout('right', self.data._layout.right.offset) @@ -447,7 +447,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org let test = new TestTab(self._components.registry, compileTab) let sourceHighlighters = registry.get('editor').api.sourceHighlighters let configProvider = self._components.filesProviders['config'] - + appStore.addEntities([ { profile: this.profile(), api: this }, { profile: udapp.profile(), api: udapp }, @@ -467,12 +467,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const swapPanelComponent = new SwapPanelComponent() const verticalIconComponent = new VerticalIconsComponent() - const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, appManager) - const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, appManager) + const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, appManager) // eslint-disable-line + const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, appManager) // eslint-disable-line self._components.editorpanel.init() self._components.fileManager.init() - + self._view.mainpanel.appendChild(self._components.editorpanel.render()) self._view.iconpanel.appendChild(verticalIconComponent.render()) self._view.swappanel.appendChild(swapPanelComponent.render()) diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js index 7d0b16b045..57a0475ce3 100644 --- a/src/lib/panels-resize.js +++ b/src/lib/panels-resize.js @@ -32,7 +32,7 @@ export default class PanelsResize { var panel2 = document.querySelector(idpanel2) var ghostbar = yo`
` - + let mousedown = (event) => { event.preventDefault() if (event.which === 1) { @@ -82,4 +82,4 @@ export default class PanelsResize { var dragbar = yo`
` panel1.appendChild(dragbar) } -} \ No newline at end of file +} From 5fccb7040c44be4bb154be084a61e977b6419970 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Tue, 15 Jan 2019 10:41:40 +0100 Subject: [PATCH 032/636] start separating the active from inactive plugins --- src/app/components/plugin-manager-component.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index b9d14c430a..f9b78015f7 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -41,8 +41,9 @@ class PluginManagerComponent {

Plugin Manager

` - var modules = this.store.getAll() - modules.forEach((mod) => { + + var modulesActive = this.store.getActives() + modulesActive.forEach((mod) => { this.views.root.appendChild(this.renderItem(mod.profile.name)) }) return this.views.root From b1e8f036af6261634aa9097d4998dc5479a0dce2 Mon Sep 17 00:00:00 2001 From: dvdptr Date: Fri, 4 Jan 2019 16:36:38 +0100 Subject: [PATCH 033/636] feat(ui): Add support for a new theme New theme is a clean blank white one, replaces background colors and adds solid black borders. Ref: #1198 --- src/app/ui/styles-guide/styleGuideDavid.js | 800 +++++++++++++++++++++ 1 file changed, 800 insertions(+) create mode 100644 src/app/ui/styles-guide/styleGuideDavid.js diff --git a/src/app/ui/styles-guide/styleGuideDavid.js b/src/app/ui/styles-guide/styleGuideDavid.js new file mode 100644 index 0000000000..849cf8ab94 --- /dev/null +++ b/src/app/ui/styles-guide/styleGuideDavid.js @@ -0,0 +1,800 @@ +// var csjs = require('csjs-inject') + +module.exports = styleGuideDavid + +function styleGuideDavid () { + /* -------------------------------------------------------------------------- + + CSS PROPERTIES + + -------------------------------------------------------------------------- */ + var cssProperties = { + /* ------------------------------------------------------ + COLORS + ------------------------------------------------------ */ + colors: { + // BASIC COLORS (B&W and transparent) + transparent: 'transparent', + white: 'hsl(0, 0%, 100%)', + black: 'hsl(0, 0%, 0%)', + opacityBlack: 'hsla(0, 0%, 0%, .4)', + + // BLUE + blue: 'hsla(229, 75%, 87%, 1)', + lightBlue: 'hsla(229, 75%, 87%, .5)', + backgroundBlue: 'hsla(229, 100%, 97%, 1)', + blueLightTrans: 'hsla(202, 91%, 75%, .4)', + brightBlue: 'hsla(233, 91%, 58%, 1)', + azure: '#dbe9f4', + // GREY + grey: 'hsla(0, 0%, 40%, 1)', + lightGrey: 'hsla(0, 0%, 40%, .5)', + veryLightGrey: 'hsla(0, 0%, 40%, .2)', + // RED + strongRed: 'hsla(0, 100%, 71%, 1)', + red: 'hsla(0, 82%, 82%, 1)', + lightRed: 'hsla(0, 82%, 82%, .5)', + // GREEN + green: 'hsla(141, 75%, 84%, 1)', + lightGreen: 'hsla(141, 75%, 84%, .5)', + greenZing: 'hsla(148, 79%, 47%, 1)', + // PINK + pink: 'hsla(300, 69%, 76%, 1)', + lightPink: 'hsla(300, 69%, 76%, .5)', + // ORANGE + orange: 'hsla(44, 100%, 50%, 1)', + lightOrange: 'hsla(44, 100%, 50%, .5)', + // VIOLET + violet: 'hsla(240, 64%, 68%, 1)', + lightViolet: 'hsla(240, 64%, 68%, .5)' + }, + + /* ------------------------------------------------------ + FONTS + ------------------------------------------------------ */ + fonts: { + font: '14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif' + }, + + /* ------------------------------------------------------ + BORDERS + ------------------------------------------------------ */ + borders: { + primary_borderRadius: '3px', + secondary_borderRadius: '5px' + } + } + + /* -------------------------------------------------------------------------- + + APP PROPERTIES + + -------------------------------------------------------------------------- */ + + var appProperties = { + + /* ------------------------------------------------------ + ACE THEME + ------------------------------------------------------ */ + + aceTheme: '', + + /* ------------------------------------------------------ + BACKGROUND COLORS + ------------------------------------------------------ */ + primary_BackgroundColor: cssProperties.colors.white, + secondary_BackgroundColor: cssProperties.colors.white, + tertiary_BackgroundColor: cssProperties.colors.white, + quaternary_BackgroundColor: cssProperties.colors.white, + fifth_BackgroundColor: cssProperties.colors.white, + seventh_BackgroundColor: cssProperties.colors.white, + dark_BackgroundColor: cssProperties.colors.black, + light_BackgroundColor: cssProperties.colors.white, + debuggingMode_BackgroundColor: cssProperties.colors.veryLightGrey, + highlight_BackgroundColor: cssProperties.colors.veryLightGrey, + /* ------------------------------------------------------ + RESIZING + ******************************************************** */ + ghostBar: cssProperties.colors.blueLightTrans, + draggingBar: cssProperties.colors.blueGreyEve, + + /* ------------------------------------------------------ + TEXT COLORS + ******************************************************** */ + mainText_Color: cssProperties.colors.black, + supportText_Color: cssProperties.colors.grey, + + sub_supportText_Color: cssProperties.colors.black, + specialText_Color: cssProperties.colors.greenZing, + brightText_Color: cssProperties.colors.brightBlue, + oppositeText_Color: cssProperties.colors.black, + additionalText_Color: cssProperties.colors.veryLightGrey, + + errorText_Color: cssProperties.colors.strongRed, + warningText_Color: cssProperties.colors.orange, + infoText_Color: cssProperties.colors.violet, + greyedText_color: cssProperties.colors.veryLightGrey, + /* ------------------------------------------------------ + ICONS + ******************************************************** */ + icon_Color: cssProperties.colors.black, + icon_AltColor: cssProperties.colors.white, + icon_HoverColor: cssProperties.colors.azure, + icon_ConstantColor: cssProperties.colors.black, + + /* ------------------------------------------------------ + MESSAGES + ******************************************************** */ + // Success + success_TextColor: cssProperties.colors.black, + success_BackgroundColor: cssProperties.colors.lightGreen, + success_BorderColor: cssProperties.colors.green, + + // Danger + danger_TextColor: cssProperties.colors.black, + danger_BackgroundColor: cssProperties.colors.lightRed, + danger_BorderColor: cssProperties.colors.red, + + // Warning + warning_TextColor: cssProperties.colors.black, + warning_BackgroundColor: cssProperties.colors.lightOrange, + warning_BorderColor: cssProperties.colors.orange, + + // Tooltip + tooltip_Color: cssProperties.colors.white, + tooltip_BackgroundColor: cssProperties.colors.grey, + tooltip_BorderColor: cssProperties.colors.grey, + + /* ------------------------------------------------------ + DROPDOWN + ******************************************************** */ + dropdown_TextColor: cssProperties.colors.black, + dropdown_BackgroundColor: cssProperties.colors.white, + dropdown_SecondaryBackgroundColor: cssProperties.colors.white, + dropdown_BorderColor: cssProperties.colors.veryLightGrey, + + /* ------------------------------------------------------ + INPUT + ******************************************************** */ + input_TextColor: cssProperties.colors.black, + input_BackgroundColor: cssProperties.colors.white, + input_BorderColor: cssProperties.colors.veryLightGrey, + + /* ------------------------------------------------------ + SOLID BORDER BOX + ******************************************************** */ + solidBorderBox_TextColor: cssProperties.colors.black, + solidBorderBox_BackgroundColor: cssProperties.colors.white, + solidBorderBox_BorderColor: cssProperties.colors.white, + + /* ------------------------------------------------------ + SOLID BOX + ******************************************************** */ + solidBox_TextColor: cssProperties.colors.black, + solidBox_BackgroundColor: cssProperties.colors.white, + + /* ------------------------------------------------------ + BUTTONS + ******************************************************** */ + + /* ................. + PRIMARY + .................. */ + primaryButton_TextColor: cssProperties.colors.black, + primaryButton_BackgroundColor: cssProperties.colors.white, + primaryButton_BorderColor: cssProperties.colors.black, + + /* ................. + SECONDARY + .................. */ + secondaryButton_TextColor: cssProperties.colors.black, + secondaryButton_BackgroundColor: cssProperties.colors.white, + secondaryButton_BorderColor: cssProperties.colors.black, + + /* ................. + Teriary + .................. */ + teriaryButton_TextColor: cssProperties.colors.black, + teriaryButton_BackgroundColor: cssProperties.colors.white, + teriaryButton_BorderColor: cssProperties.colors.black, + /* ................. + + /* ................. + Quaternary + .................. */ + quaternaryButton_TextColor: cssProperties.colors.black, + quaternaryButton_BackgroundColor: cssProperties.colors.white, + quaternaryButton_BorderColor: cssProperties.colors.black, + /* ................. + + /* ................. + Fifth + .................. */ + fifthButton_TextColor: cssProperties.colors.black, + fifthButton_BackgroundColor: cssProperties.colors.white, + fifthButton_BorderColor: cssProperties.colors.black, + /* ................. + + /* ................. + Sixth + .................. */ + sixthButton_TextColor: cssProperties.colors.black, + sixthButton_BackgroundColor: cssProperties.colors.white, + sixthButton_BorderColor: cssProperties.colors.black, + /* ................. + + SUCCESS + .................. */ + successButton_TextColor: cssProperties.colors.white, + successButton_BackgroundColor: cssProperties.colors.green, + successButton_BorderColor: cssProperties.colors.green, + + /* ................. + DANGER + .................. */ + dangerButton_TextColor: cssProperties.colors.white, + dangerButton_BackgroundColor: cssProperties.colors.red, + dangerButton_BorderColor: cssProperties.colors.red, + + /* ................. + WARNING + .................. */ + warningButton_TextColor: cssProperties.colors.white, + warningButton_BackgroundColor: cssProperties.colors.lightOrange, + warningButton_BorderColor: cssProperties.colors.lightOrange, + + /* ................. + INFO + .................. */ + infoButton_TextColor: cssProperties.colors.black, + infoButton_BackgroundColor: cssProperties.colors.white, + infoButton_BorderColor: cssProperties.colors.black, + + /* ................. + SOLIDITY + .................. */ + + // CALL + callButton_TextColor: cssProperties.colors.black, + callButton_BackgroundColor: cssProperties.colors.lightBlue, + callButton_BorderColor: cssProperties.colors.lightBlue, + + // TRANSACTION + transactButton_TextColor: cssProperties.colors.black, + transactButton_BackgroundColor: cssProperties.colors.lightRed, + transactButton_BorderColor: cssProperties.colors.lightRed, + + // CONSTANT + constantButton_TextColor: cssProperties.colors.black, + constantButton_BackgroundColor: cssProperties.colors.lightBlue, + constantButton_BorderColor: cssProperties.colors.lightBlue, + + // PAYABLE TRANSACTION + transactPayableButton_TextColor: cssProperties.colors.black, + transactPayableButton_BackgroundColor: cssProperties.colors.red, + transactPayableButton_BorderColor: cssProperties.colors.red, + + /* ------------------------------------------------------ + UI ELEMENTS + ******************************************************** */ + + uiElements: { + solidBorderBox: (opts = {}) => ` + background-color : ${opts.BackgroundColor}; + border : 1px solid ${opts.BorderColor}; + color : ${opts.Color}; + border-radius : ${cssProperties.borders.primary_borderRadius}; + font-size : 12px; + padding : 10px 15px; + line-height : 20px; + overflow : hidden; + word-break : break-word; + width : 100%; + `, + + solidBox: (opts = {}) => ` + background-color : ${opts.BackgroundColor}; + color : ${opts.Color}; + font-size : 12px; + padding : 10px 15px; + line-height : 20px; + overflow : hidden; + word-break : break-word; + width : 100%; + `, + + dottedBorderBox: (opts = {}) => ` + background-color : ${opts.BackgroundColor}; + border : .2em dotted ${opts.BorderColor}; + color : ${opts.Color}; + border-radius : ${cssProperties.borders.secondary_borderRadius}; + line-height : 20px; + padding : 8px 15px; + margin-bottom : 1em; + overflow : hidden; + word-break : break-word; + `, + + inputField: (opts = {}) => ` + background-color : ${opts.BackgroundColor}; + border : 1px solid ${opts.BorderColor}; + color : ${opts.Color}; + border-radius : ${cssProperties.borders.secondary_borderRadius}; + height : 25px; + width : 250px; + padding : 0 8px; + overflow : hidden; + word-break : normal; + `, + + dropdown: (opts = {}) => ` + background-color : ${opts.BackgroundColor}; + border : 1px solid ${opts.BorderColor}; + color : ${opts.Color}; + font-size : 12px; + font-weight : bold; + padding : 0 8px; + text-decoration : none; + cursor : pointer; + border-radius : 3px; + height : 25px; + width : 100%; + text-align : center; + overflow : hidden; + word-break : normal; + `, + + button: (opts = {}) => ` + margin : 1px; + background-color : ${opts.BackgroundColor}; + border : .3px solid ${opts.BorderColor}; + color : ${opts.Color}; + display : flex; + align-items : center; + justify-content : center; + border-radius : 3px; + cursor : pointer; + min-height : 25px; + max-height : 25px; + width : 70px; + min-width : 70px; + font-size : 12px; + overflow : hidden; + word-break : normal; + ` + } + } + + /* -------------------------------------------------------------------------- + + REMIX PROPERTIES + + -------------------------------------------------------------------------- */ + + var remixProperties = { + /* ------------------------------------------------------ + REMIX GENERAL + /* ------------------------------------------------------ */ + remix: { + modalDialog_BackgroundColor_Primary: appProperties.primary_BackgroundColor, + modalDialog_text_Primary: appProperties.mainText_Color, + modalDialog_text_Secondary: appProperties.supportText_Color, + modalDialog_text_Link: appProperties.brightText_Color, + modalDialog_text_Em: appProperties.specialText_Color, + modalDialog_Header_Footer_BackgroundColor: appProperties.secondary_BackgroundColor, + modalDialog_Header_Footer_Color: appProperties.mainText_Color, + modalDialog_BoxDottedBorder_BackgroundColor: appProperties.solidBorderBox_BackgroundColor, + modalDialog_BoxDottedBorder_BorderColor: appProperties.solidBorderBox_BorderColor, + modalDialog_BoxDottedBorder_Color: appProperties.solidBorderBox_TextColor, + + tooltip_CopyToClipboard_BackgroundColor: appProperties.tooltip_BackgroundColor, + tooltip_CopyToClipboard_Color: appProperties.tooltip_Color, + + icon_Color_CopyToClipboard: appProperties.icon_Color, + icon_HoverColor_CopyToClipboard: appProperties.icon_HoverColor, + + solidBox: appProperties.uiElements.solidBorderBox({ + BackgroundColor: appProperties.solidBox_BackgroundColor, + Color: appProperties.solidBox_TextColor + }) + }, + + /* ------------------------------------------------------ + LEFT PANEL (FILE PANEL) + /* ------------------------------------------------------ */ + leftPanel: { + backgroundColor_Panel: appProperties.primary_BackgroundColor, + backgroundColor_FileExplorer: appProperties.tertiary_BackgroundColor, + + text_Primary: appProperties.mainText_Color, + text_Secondary: appProperties.supportText_Color, + text_Teriary: appProperties.sub_supportText_Color, + + bar_Ghost: appProperties.ghostBar, + bar_Dragging: appProperties.draggingBar, + + icon_Color_Menu: appProperties.icon_Color, + icon_HoverColor_Menu: appProperties.icon_HoverColor, + + icon_Color_TogglePanel: appProperties.icon_Color, + icon_HoverColor_TogglePanel: appProperties.icon_HoverColor + + }, + + /* ------------------------------------------------------ + EDITOR + /* ------------------------------------------------------ */ + editor: { + backgroundColor_Panel: appProperties.primary_BackgroundColor, + backgroundColor_Editor: appProperties.light_BackgroundColor, + backgroundColor_Tabs_Highlights: appProperties.secondary_BackgroundColor, + backgroundColor_Editor_Context_Highlights: appProperties.secondary_BackgroundColor, + backgroundColor_Editor_Context_Error_Highlights: appProperties.error_BackgroundColor, + backgroundColor_DebuggerMode: appProperties.debuggingMode_BackgroundColor, + + text_Primary: appProperties.mainText_Color, + text_Secondary: appProperties.supportText_Color, + text_Teriary: appProperties.sub_supportText_Color, + text_Editor: '', + + icon_Color_Editor: appProperties.icon_Color, + icon_HoverColor_Editor: appProperties.icon_HoverColor + + }, + + /* ------------------------------------------------------ + TERMINAL + /* ------------------------------------------------------ */ + terminal: { + backgroundColor_Menu: appProperties.secondary_BackgroundColor, + backgroundColor_Terminal: appProperties.seventh_BackgroundColor, + backgroundColor_TerminalCLI: appProperties.seventh_BackgroundColor, + backgroundImage_Terminal: "url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItL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OTY5LDI1OC4zODciLz4NCgkJCQkJPC9nPg0KCQkJCTwvZz4NCgkJCQk8ZyBvcGFjaXR5PSIwLjgiPg0KCQkJCQk8Zz4NCgkJCQkJCTxwb2x5Z29uIGZpbGw9IiMwMTAxMDEiIHBvaW50cz0iMjU1Ljk2OSwyNTguMzg3IDI1NS45NjksMzQ0LjUwOCAzNjEuMjY3LDE5Ni4yMTIiLz4NCgkJCQkJPC9nPg0KCQkJCTwvZz4NCgkJCQk8ZyBvcGFjaXR5PSIwLjYiPg0KCQkJCQk8Zz4NCgkJCQkJCTxwb2x5Z29uIGZpbGw9IiMwMTAxMDEiIHBvaW50cz0iMjU1Ljk2OSwxMjYuNzgxIDE1MC43MzMsMTc0LjYxMSAyNTUuOTY5LDIzNi44MTggMzYxLjIwNCwxNzQuNjExIi8+DQoJCQkJCTwvZz4NCgkJCQk8L2c+DQoJCQkJPGcgb3BhY2l0eT0iMC40NSI+DQoJCQkJCTxnPg0KCQkJCQkJPHBvbHlnb24gZmlsbD0iIzAxMDEwMSIgcG9pbnRzPSIxNTAuNzM0LDE3NC42MTIgMjU1Ljk2OSwyMzYuODE4IDI1NS45NjksMTI2Ljc4MiAyNTUuOTY5LDAuMDAxIi8+DQoJCQkJCTwvZz4NCgkJCQk8L2c+DQoJCQkJPGcgb3BhY2l0eT0iMC44Ij4NCgkJCQkJPGc+DQoJCQkJCQk8cG9seWdvbiBmaWxsPSIjMDEwMTAxIiBwb2ludHM9IjI1NS45NjksMCAyNTUuOTY5LDEyNi43ODEgMjU1Ljk2OSwyMzYuODE4IDM2MS4yMDQsMTc0LjYxMSIvPg0KCQkJCQk8L2c+DQoJCQkJPC9nPg0KCQkJPC9nPg0KCQk8L2c+DQoJPC9nPg0KPC9zdmc+DQo=')", + + text_Primary: appProperties.mainText_Color, + text_Secondary: appProperties.supportText_Color, + text_RegularLog: appProperties.mainText_Color, + text_InfoLog: appProperties.supportText_Color, + text_ErrorLog: appProperties.errorText_Color, + text_WarnLog: appProperties.warningText_Color, + text_Title_TransactionLog: appProperties.infoText_Color, + text_Regular_TransactionLog: appProperties.supportText_Color, + text_Button: appProperties.oppositeText_Color, + + icon_Color_Log_Succeed: appProperties.success_BorderColor, + icon_Color_Log_Failed: appProperties.errorText_Color, + icon_BackgroundColor_Log_Call: appProperties.infoText_Color, + icon_Color_Log_Call: appProperties.icon_AltColor, + + icon_Color_TogglePanel: appProperties.icon_Color, + icon_HoverColor_TogglePanel: appProperties.icon_HoverColor, + icon_Color_Menu: appProperties.icon_Color, + icon_HoverColor_Menu: appProperties.icon_HoverColor, + + bar_Ghost: appProperties.ghostBar, + bar_Dragging: appProperties.draggingBar, + + input_Search_MenuBar: appProperties.uiElements.inputField({ + BackgroundColor: appProperties.input_BackgroundColor, + BorderColor: appProperties.input_BorderColor, + Color: appProperties.input_TextColor + }), + + dropdown_Filter_MenuBar: appProperties.uiElements.dropdown({ + BackgroundColor: appProperties.dropdown_BackgroundColor, + BorderColor: appProperties.dropdown_BorderColor, + Color: appProperties.dropdown_TextColor + }), + + button_Log_Debug: appProperties.uiElements.button({ + BackgroundColor: appProperties.quaternaryButton_BackgroundColor, + BorderColor: appProperties.infoButton_BorderColor, + Color: appProperties.infoButton_TextColor + }), + + button_Log_Details: appProperties.uiElements.button({ + BackgroundColor: appProperties.quaternaryButton_BackgroundColor, + BorderColor: appProperties.quaternaryButton_BorderColor, + Color: appProperties.quaternaryButton_TextColor + }) + + }, + + /* ------------------------------------------------------ + RIGHT PANEL + /* ------------------------------------------------------ */ + rightPanel: { + backgroundColor_Panel: appProperties.fifth_BackgroundColor, + backgroundColor_Tab: appProperties.fifth_BackgroundColor, + BackgroundColor_Pre: appProperties.primary_BackgroundColor, + + text_Primary: appProperties.mainText_Color, + text_Secondary: appProperties.supportText_Color, + text_Teriary: appProperties.sub_supportText_Color, + text_link: appProperties.brightText_Color, + + bar_Ghost: appProperties.ghostBar, + bar_Dragging: appProperties.draggingBar, + + icon_Color_TogglePanel: appProperties.icon_Color, + icon_HoverColor_TogglePanel: appProperties.icon_HoverColor, + + message_Warning_BackgroundColor: appProperties.warning_BackgroundColor, + message_Warning_BorderColor: appProperties.warning_BorderColor, + message_Warning_Color: appProperties.warning_TextColor, + + message_Error_BackgroundColor: appProperties.danger_BackgroundColor, + message_Error_BorderColor: appProperties.danger_BorderColor, + message_Error_Color: appProperties.danger_TextColor, + + message_Success_BackgroundColor: appProperties.success_BackgroundColor, + message_Success_BorderColor: appProperties.success_BorderColor, + message_Success_Color: appProperties.success_TextColor, + + /* :::::::::::::: + COMPILE TAB + ::::::::::::::: */ + compileTab: { + button_Compile: appProperties.uiElements.button({ + BackgroundColor: appProperties.primaryButton_BackgroundColor, + BorderColor: appProperties.primaryButton_BorderColor, + Color: appProperties.primaryButton_TextColor + }), + + button_Details: appProperties.uiElements.button({ + BackgroundColor: appProperties.secondaryButton_BackgroundColor, + BorderColor: appProperties.secondaryButton_BorderColor, + Color: appProperties.secondaryButton_TextColor + }), + + button_Publish: appProperties.uiElements.button({ + BackgroundColor: appProperties.secondaryButton_BackgroundColor, + BorderColor: appProperties.secondaryButton_BorderColor, + Color: appProperties.secondaryButton_TextColor + }), + + dropdown_CompileContract: appProperties.uiElements.dropdown({ + BackgroundColor: appProperties.dropdown_BackgroundColor, + BorderColor: appProperties.dropdown_BorderColor, + Color: appProperties.dropdown_TextColor + }), + + box_CompileContainer: appProperties.uiElements.solidBorderBox({ + BackgroundColor: appProperties.quaternary_BackgroundColor, + BorderColor: appProperties.solidBorderBox_BackgroundColor, + Color: appProperties.solidBorderBox_TextColor + }), + + icon_WarnCompilation_Color: appProperties.warning_BackgroundColor + + }, + + /* :::::::::::::: + RUN TAB + ::::::::::::::: */ + runTab: { + + additionalText_Color: appProperties.additionalText_Color, + + box_RunTab: appProperties.uiElements.solidBorderBox({ + BackgroundColor: appProperties.solidBox_BackgroundColor, + Color: appProperties.solidBox_TextColor + }), + + box_Info_RunTab: appProperties.uiElements.dottedBorderBox({ + BackgroundColor: appProperties.solidBorderBox_BackgroundColor, + BorderColor: appProperties.solidBorderBox_BorderColor, + Color: appProperties.solidBorderBox_TextColor + }), + + dropdown_RunTab: appProperties.uiElements.dropdown({ + BackgroundColor: appProperties.dropdown_BackgroundColor, + BorderColor: appProperties.dropdown_BorderColor, + Color: appProperties.dropdown_TextColor + }), + titlebox_RunTab: appProperties.uiElements.dropdown({ + BackgroundColor: appProperties.dropdown_SecondaryBackgroundColor, + BorderColor: appProperties.dropdown_BorderColor, + Color: appProperties.dropdown_TextColor + }), + + input_RunTab: appProperties.uiElements.inputField({ + BackgroundColor: appProperties.input_BackgroundColor, + BorderColor: appProperties.input_BorderColor, + Color: appProperties.input_TextColor + }), + + box_Instance: appProperties.uiElements.solidBox({ + BackgroundColor: appProperties.solidBox_BackgroundColor, + Color: appProperties.solidBox_TextColor + }), + + borderBox_Instance: appProperties.uiElements.solidBorderBox({ + BackgroundColor: appProperties.solidBox_BackgroundColor, + Color: appProperties.solidBox_TextColor, + BorderColor: appProperties.solidBorderBox_BorderColor + }), + + button_atAddress: appProperties.uiElements.button({ + BackgroundColor: appProperties.primaryButton_BackgroundColor, + BorderColor: appProperties.primaryButton_BorderColor, + Color: appProperties.primaryButton_TextColor + }), + button_Create: appProperties.uiElements.button({ + BackgroundColor: appProperties.transactButton_BackgroundColor, + BorderColor: appProperties.transactButton_BorderColor, + Color: appProperties.transactButton_TextColor + }), + button_Constant: appProperties.uiElements.button({ + BackgroundColor: appProperties.constantButton_BackgroundColor, + BorderColor: appProperties.constantButton_BorderColor, + Color: appProperties.constantButton_TextColor + }), + button_Instance_Call: appProperties.uiElements.button({ + BackgroundColor: appProperties.callButton_BackgroundColor, + BorderColor: appProperties.callButton_BorderColor, + Color: appProperties.callButton_TextColor + }), + button_Instance_Transact: appProperties.uiElements.button({ + BackgroundColor: appProperties.transactButton_BackgroundColor, + BorderColor: appProperties.transactButton_BorderColor, + Color: appProperties.transactButton_TextColor + }), + + button_Instance_TransactPayable: appProperties.uiElements.button({ + BackgroundColor: appProperties.transactPayableButton_BackgroundColor, + BorderColor: appProperties.transactPayableButton_BorderColor, + Color: appProperties.transactPayableButton_TextColor + }), + + icon_Color_Instance_CopyToClipboard: appProperties.icon_Color, + icon_AltColor_Instance_CopyToClipboard: appProperties.icon_AltColor, + icon_HoverColor_Instance_CopyToClipboard: appProperties.icon_HoverColor, + + icon_Color: appProperties.icon_Color, + icon_HoverColor: appProperties.icon_HoverColor + + }, + + /* :::::::::::::: + TEST TAB + ::::::::::::::: */ + testTab: { + box_listTests: appProperties.uiElements.solidBorderBox({ + BackgroundColor: appProperties.solidBorderBox_BackgroundColor, + BorderColor: appProperties.solidBorderBox_BackgroundColor, + Color: appProperties.solidBorderBox_TextColor + }), + + button_runTests: appProperties.uiElements.button({ + BackgroundColor: appProperties.primaryButton_BackgroundColor, + BorderColor: appProperties.primaryButton_BorderColor, + Color: appProperties.primaryButton_TextColor + }), + + button_generateTestFile: appProperties.uiElements.button({ + BackgroundColor: appProperties.primaryButton_BackgroundColor, + BorderColor: appProperties.primaryButton_BorderColor, + Color: appProperties.primaryButton_TextColor + }), + + color_testPass: appProperties.success_BackgroundColor, + color_testFail: appProperties.danger_BackgroundColor + }, + + /* :::::::::::::: + SETTINGS TAB + ::::::::::::::: */ + settingsTab: { + box_SolidityVersionInfo: appProperties.uiElements.dottedBorderBox({ + BackgroundColor: appProperties.solidBorderBox_BackgroundColor, + BorderColor: appProperties.solidBorderBox_BorderColor, + Color: appProperties.solidBorderBox_TextColor + }), + + dropdown_SelectCompiler: appProperties.uiElements.dropdown({ + BackgroundColor: appProperties.dropdown_BackgroundColor, + BorderColor: appProperties.dropdown_BorderColor, + Color: appProperties.dropdown_TextColor + }), + + button_LoadPlugin: appProperties.uiElements.button({ + BackgroundColor: appProperties.secondaryButton_BackgroundColor, + BorderColor: appProperties.secondaryButton_BorderColor, + Color: appProperties.secondaryButton_TextColor + }), + button_initPlugin: appProperties.uiElements.button({ + BackgroundColor: appProperties.transactButton_BackgroundColor, + BorderColor: appProperties.transactButton_BorderColor, + Color: appProperties.secondaryButton_TextColor + }) + }, + + /* :::::::::::::: + DEBUGGER TAB + ::::::::::::::: */ + debuggerTab: { + text_Primary: appProperties.mainText_Color, + text_Secondary: appProperties.supportText_Color, + text_BgHighlight: appProperties.highlight_BackgroundColor, + + box_Debugger: appProperties.uiElements.solidBorderBox({ + BackgroundColor: appProperties.solidBorderBox_BackgroundColor, + BorderColor: appProperties.solidBorderBox_BackgroundColor, + Color: appProperties.solidBorderBox_TextColor + }), + + button_Debugger: appProperties.uiElements.button({ + BackgroundColor: appProperties.secondaryButton_BackgroundColor, + BorderColor: appProperties.secondaryButton_BorderColor, + Color: appProperties.secondaryButton_TextColor + }), + + button_Debugger_icon_Color: appProperties.icon_ConstantColor, + button_Debugger_icon_HoverColor: appProperties.icon_HoverColor, + + dropdown_Debugger: appProperties.uiElements.dropdown({ + BackgroundColor: cssProperties.colors.veryLightGrey, + BorderColor: appProperties.dropdown_BorderColor, + Color: appProperties.dropdown_TextColor + }), + + input_Debugger: appProperties.uiElements.inputField({ + BackgroundColor: appProperties.input_BackgroundColor, + BorderColor: appProperties.input_BorderColor, + Color: appProperties.input_TextColor + }), + + debuggerDropdowns_Instructions_Highlight_BackgroundColor: appProperties.secondary_BackgroundColor + + }, + + /* :::::::::::::: + ANALYSIS TAB + ::::::::::::::: */ + analysisTab: { + button_Run_AnalysisTab: appProperties.uiElements.button({ + BackgroundColor: appProperties.primaryButton_BackgroundColor, + BorderColor: appProperties.primaryButton_BorderColor, + Color: appProperties.primaryButton_TextColor + }), + + box_AnalysisContainer: appProperties.uiElements.solidBorderBox({ + BackgroundColor: appProperties.solidBorderBox_BackgroundColor, + BorderColor: appProperties.solidBorderBox_BackgroundColor, + Color: appProperties.solidBorderBox_TextColor + }) + }, + + /* :::::::::::::: + SUPPORT TAB + ::::::::::::::: */ + supportTab: { + box_IframeContainer: appProperties.uiElements.solidBorderBox({ + BackgroundColor: appProperties.solidBorderBox_BackgroundColor, + BorderColor: appProperties.solidBorderBox_BackgroundColor, + Color: appProperties.solidBorderBox_TextColor + }), + + box_SupportInfo: appProperties.uiElements.dottedBorderBox({ + BackgroundColor: appProperties.solidBorderBox_BackgroundColor, + BorderColor: appProperties.solidBorderBox_BorderColor, + Color: appProperties.solidBorderBox_TextColor + }) + + } + + } + } + + return { + colors: cssProperties.colors, + appProperties: appProperties, + borders: cssProperties.borders, + leftPanel: remixProperties.leftPanel, + editor: remixProperties.editor, + terminal: remixProperties.terminal, + rightPanel: remixProperties.rightPanel, + remix: remixProperties.remix + } +} From 7209c588c5385757daea403e98d4740d0c2b0500 Mon Sep 17 00:00:00 2001 From: jeremiG Date: Fri, 4 Jan 2019 11:04:06 -0500 Subject: [PATCH 034/636] fix(ui): Remove rounded borders on button class Inconsistent UX can cause problems and unhappy users Ref: #1198 --- src/app/ui/styles-guide/styleGuideDavid.js | 32 ++++++++++------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/app/ui/styles-guide/styleGuideDavid.js b/src/app/ui/styles-guide/styleGuideDavid.js index 849cf8ab94..f223fad0da 100644 --- a/src/app/ui/styles-guide/styleGuideDavid.js +++ b/src/app/ui/styles-guide/styleGuideDavid.js @@ -60,7 +60,6 @@ function styleGuideDavid () { BORDERS ------------------------------------------------------ */ borders: { - primary_borderRadius: '3px', secondary_borderRadius: '5px' } } @@ -283,7 +282,6 @@ function styleGuideDavid () { background-color : ${opts.BackgroundColor}; border : 1px solid ${opts.BorderColor}; color : ${opts.Color}; - border-radius : ${cssProperties.borders.primary_borderRadius}; font-size : 12px; padding : 10px 15px; line-height : 20px; @@ -345,22 +343,20 @@ function styleGuideDavid () { `, button: (opts = {}) => ` - margin : 1px; - background-color : ${opts.BackgroundColor}; - border : .3px solid ${opts.BorderColor}; - color : ${opts.Color}; - display : flex; - align-items : center; - justify-content : center; - border-radius : 3px; - cursor : pointer; - min-height : 25px; - max-height : 25px; - width : 70px; - min-width : 70px; - font-size : 12px; - overflow : hidden; - word-break : normal; + margin : 1px; + background-color : ${opts.BackgroundColor}; + color : ${opts.Color}; + display : flex; + align-items : center; + justify-content : center; + cursor : pointer; + min-height : 25px; + max-height : 25px; + width : 70px; + min-width : 70px; + font-size : 12px; + overflow : hidden; + word-break : normal; ` } } From c0f72d7c81ca7a1336931f0751e02d10b0e9800f Mon Sep 17 00:00:00 2001 From: dvdptr Date: Fri, 4 Jan 2019 18:02:31 +0100 Subject: [PATCH 035/636] fix(ui): Customize the border styles My commit message body Ref: #1198 --- src/app/panels/left-icon-panel.js | 3 ++- src/app/panels/styles/terminal-styles.js | 2 +- src/app/ui/styles-guide/styleGuideDavid.js | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/panels/left-icon-panel.js b/src/app/panels/left-icon-panel.js index e6121dad3a..ca9143900a 100644 --- a/src/app/panels/left-icon-panel.js +++ b/src/app/panels/left-icon-panel.js @@ -151,10 +151,11 @@ const css = csjs` } .dragbar { position : absolute; - width : 0.5em; + width : 2px; top : 3em; bottom : 0; cursor : col-resize; + background-color : hsla(0, 0%, 40%, .2); z-index : 999; border-left : 2px solid ${styles.rightPanel.bar_Dragging}; } diff --git a/src/app/panels/styles/terminal-styles.js b/src/app/panels/styles/terminal-styles.js index 267648237a..0fd92f2e28 100644 --- a/src/app/panels/styles/terminal-styles.js +++ b/src/app/panels/styles/terminal-styles.js @@ -78,7 +78,7 @@ var css = csjs` line-height : 2ch; padding : 1ch; margin-top : 2ch; - border-top : 0.07ch solid ${styles.colors.veryLightGrey}; + border-top : 2px solid ${styles.colors.veryLightGrey}; color : ${styles.appProperties.mainText_Color}; } .cli { diff --git a/src/app/ui/styles-guide/styleGuideDavid.js b/src/app/ui/styles-guide/styleGuideDavid.js index f223fad0da..d912348b92 100644 --- a/src/app/ui/styles-guide/styleGuideDavid.js +++ b/src/app/ui/styles-guide/styleGuideDavid.js @@ -23,7 +23,6 @@ function styleGuideDavid () { blue: 'hsla(229, 75%, 87%, 1)', lightBlue: 'hsla(229, 75%, 87%, .5)', backgroundBlue: 'hsla(229, 100%, 97%, 1)', - blueLightTrans: 'hsla(202, 91%, 75%, .4)', brightBlue: 'hsla(233, 91%, 58%, 1)', azure: '#dbe9f4', // GREY @@ -94,7 +93,7 @@ function styleGuideDavid () { /* ------------------------------------------------------ RESIZING ******************************************************** */ - ghostBar: cssProperties.colors.blueLightTrans, + ghostBar: cssProperties.colors.veryLightGrey, draggingBar: cssProperties.colors.blueGreyEve, /* ------------------------------------------------------ From 263e5cc4a116ff2c89b1ccf7375460d9e5d9dcae Mon Sep 17 00:00:00 2001 From: jeremiG Date: Sun, 6 Jan 2019 12:28:36 -0500 Subject: [PATCH 036/636] fix(ui): Conditionally apply custom styles Two existing themes retain their styling, though the cssjs now checks whether a few properties are set to custom: true on the current style, if so passes the value, otherwise returns the existing default Ref: #1198 --- src/app/panels/left-icon-panel.js | 12 ++++++++++-- src/app/panels/styles/terminal-styles.js | 5 ++++- src/app/ui/styles-guide/styleGuideDavid.js | 10 +++++++++- src/lib/panels-resize.js | 6 +++++- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/app/panels/left-icon-panel.js b/src/app/panels/left-icon-panel.js index ca9143900a..b81e39e598 100644 --- a/src/app/panels/left-icon-panel.js +++ b/src/app/panels/left-icon-panel.js @@ -151,11 +151,19 @@ const css = csjs` } .dragbar { position : absolute; - width : 2px; + width : ${ + styles.rightPanel.customDragbarWidth + ? styles.rightPanel.dragbarWidth + : '0.5rem' + }; top : 3em; bottom : 0; cursor : col-resize; - background-color : hsla(0, 0%, 40%, .2); + background-color : ${ + styles.rightPanel.customDragbarBackgroundColor + ? styles.rightPanel.dragbarBackgroundColor + : '' + }; z-index : 999; border-left : 2px solid ${styles.rightPanel.bar_Dragging}; } diff --git a/src/app/panels/styles/terminal-styles.js b/src/app/panels/styles/terminal-styles.js index 0fd92f2e28..2f528f2850 100644 --- a/src/app/panels/styles/terminal-styles.js +++ b/src/app/panels/styles/terminal-styles.js @@ -78,7 +78,10 @@ var css = csjs` line-height : 2ch; padding : 1ch; margin-top : 2ch; - border-top : 2px solid ${styles.colors.veryLightGrey}; + border-top : ${styles.terminal.customBlockBorderTop + ? styles.terminal.blockBorderTop + : '0.07ch solid ' + styles.colors.veryLightGrey + }; color : ${styles.appProperties.mainText_Color}; } .cli { diff --git a/src/app/ui/styles-guide/styleGuideDavid.js b/src/app/ui/styles-guide/styleGuideDavid.js index d912348b92..bf0687f8ab 100644 --- a/src/app/ui/styles-guide/styleGuideDavid.js +++ b/src/app/ui/styles-guide/styleGuideDavid.js @@ -94,7 +94,7 @@ function styleGuideDavid () { RESIZING ******************************************************** */ ghostBar: cssProperties.colors.veryLightGrey, - draggingBar: cssProperties.colors.blueGreyEve, + draggingBar: cssProperties.colors.veryLightGrey, /* ------------------------------------------------------ TEXT COLORS @@ -398,6 +398,8 @@ function styleGuideDavid () { LEFT PANEL (FILE PANEL) /* ------------------------------------------------------ */ leftPanel: { + customDragbarBorderRight: true, + dragbarBorderRight: '2px solid ' + cssProperties.colors.veryLightGrey, backgroundColor_Panel: appProperties.primary_BackgroundColor, backgroundColor_FileExplorer: appProperties.tertiary_BackgroundColor, @@ -441,6 +443,8 @@ function styleGuideDavid () { TERMINAL /* ------------------------------------------------------ */ terminal: { + customBlockBorderTop: true, + blockBorderTop: '2px solid ' + cssProperties.colors.veryLightGrey, backgroundColor_Menu: appProperties.secondary_BackgroundColor, backgroundColor_Terminal: appProperties.seventh_BackgroundColor, backgroundColor_TerminalCLI: appProperties.seventh_BackgroundColor, @@ -499,6 +503,10 @@ function styleGuideDavid () { RIGHT PANEL /* ------------------------------------------------------ */ rightPanel: { + customDragbarWidth: true, + customDragbarBackgroundColor: true, + dragbarWidth: '2px', + dragbarBackgroundColor: cssProperties.colors.veryLightGrey, backgroundColor_Panel: appProperties.fifth_BackgroundColor, backgroundColor_Tab: appProperties.fifth_BackgroundColor, BackgroundColor_Pre: appProperties.primary_BackgroundColor, diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js index 57a0475ce3..49d11c4280 100644 --- a/src/lib/panels-resize.js +++ b/src/lib/panels-resize.js @@ -12,7 +12,11 @@ const css = csjs` bottom : 0; cursor : col-resize; z-index : 999; - border-right : 2px solid hsla(215, 81%, 79%, .3); + border-right : ${ + styles.leftPanel.customDragbarBorderRight + ? styles.leftPanel.dragbarBorderRight + : '2px solid hsla(215, 81%, 79%, .3)' + } } .ghostbar { width : 3px; From b89960b22ef25f615e6d619ab4d59a63558f9b76 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 7 Jan 2019 16:41:33 +0100 Subject: [PATCH 037/636] use access token while resolving github content --- src/app/compiler/compiler-imports.js | 6 ++++-- src/app/tabs/compile-tab.js | 7 +++---- src/app/tabs/settings-tab.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/compiler/compiler-imports.js b/src/app/compiler/compiler-imports.js index adb09338eb..386a3c2957 100644 --- a/src/app/compiler/compiler-imports.js +++ b/src/app/compiler/compiler-imports.js @@ -4,14 +4,16 @@ var swarmgw = require('swarmgw')() var request = require('request') module.exports = class CompilerImports { - constructor () { + constructor (githubAccessToken) { + this.githubAccessToken = githubAccessToken || (() => {}) this.previouslyHandled = {} // cache import so we don't make the request at each compilation. } handleGithubCall (root, path, cb) { + var accessToken = this.githubAccessToken() ? '?access_token=' + this.githubAccessToken() : '' return request.get( { - url: 'https://api.github.com/repos/' + root + '/contents/' + path, + url: 'https://api.github.com/repos/' + root + '/contents/' + path + accessToken, json: true }, (err, r, data) => { diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index ac90e771e8..13e4caac77 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -46,9 +46,8 @@ module.exports = class CompileTab { self._components = {} self._components.registry = localRegistry || globalRegistry self._components.queryParams = new QueryParams() - self._components.compilerImport = new CompilerImport() + self._components.compilerImport = new CompilerImport(() => { return self._deps.config.get('settings/gist-access-token') }) self._components.compiler = new Compiler((url, cb) => self.importFileCb(url, cb)) - // dependencies self._deps = { editor: self._components.registry.get('editor').api, @@ -511,8 +510,8 @@ module.exports = class CompileTab { }, (error, content, cleanUrl, type, url) => { if (!error) { - if (self._deps.filesProviders[type]) { - self._deps.filesProviders[type].addReadOnly(cleanUrl, content, url) + if (self._deps.fileProviders[type]) { + self._deps.fileProviders[type].addReadOnly(cleanUrl, content, url) } cb(null, content) } else { diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 02a7a92e71..54eb760d20 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -100,7 +100,7 @@ module.exports = class SettingsTab { self._view.gistToken = yo`
Gist Access Token
-
Manage the access token used to publish to Gist.
+
Manage the access token used to publish to Gist and retrieve Github contents.
Go to github token page (link below) to create a new token and save it in Remix. Make sure this token has only 'create gist' permission.
${self._view.gistToken}
From 7ef215f703e6d3c2ddc458a07523db0483a93a09 Mon Sep 17 00:00:00 2001 From: jeremiG Date: Tue, 8 Jan 2019 09:51:26 -0500 Subject: [PATCH 038/636] fix(ui): Apply local CSS variables to existing themes - Prevent excessively verbose stylesheet --- src/app/panels/left-icon-panel.js | 12 ++---------- src/app/ui/styles-guide/style-guide.js | 5 +++++ src/app/ui/styles-guide/styleGuideDark.js | 5 +++++ src/app/ui/styles-guide/styleGuideDavid.js | 13 +++++-------- src/lib/panels-resize.js | 6 +----- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/app/panels/left-icon-panel.js b/src/app/panels/left-icon-panel.js index b81e39e598..d5dae1dbc3 100644 --- a/src/app/panels/left-icon-panel.js +++ b/src/app/panels/left-icon-panel.js @@ -151,19 +151,11 @@ const css = csjs` } .dragbar { position : absolute; - width : ${ - styles.rightPanel.customDragbarWidth - ? styles.rightPanel.dragbarWidth - : '0.5rem' - }; + width : ${styles.rightPanel.dragbarWidth}; top : 3em; bottom : 0; cursor : col-resize; - background-color : ${ - styles.rightPanel.customDragbarBackgroundColor - ? styles.rightPanel.dragbarBackgroundColor - : '' - }; + background-color : ${styles.rightPanel.dragbarBackgroundColor}; z-index : 999; border-left : 2px solid ${styles.rightPanel.bar_Dragging}; } diff --git a/src/app/ui/styles-guide/style-guide.js b/src/app/ui/styles-guide/style-guide.js index 9c8a1ea8d5..cb07940ff2 100644 --- a/src/app/ui/styles-guide/style-guide.js +++ b/src/app/ui/styles-guide/style-guide.js @@ -411,6 +411,7 @@ function styleGuide () { bar_Ghost: appProperties.ghostBar, bar_Dragging: appProperties.draggingBar, + dragbarBorderRight: '2px solid hsla(215, 81%, 79%, .3)', icon_Color_Menu: appProperties.icon_Color, icon_HoverColor_Menu: appProperties.icon_HoverColor, @@ -460,6 +461,8 @@ function styleGuide () { text_Regular_TransactionLog: appProperties.supportText_Color, text_Button: appProperties.oppositeText_Color, + blockBorderTop: '0.07ch solid ' + cssProperties.colors.veryLightGrey, + icon_Color_Log_Succeed: appProperties.success_BorderColor, icon_Color_Log_Failed: appProperties.errorText_Color, icon_BackgroundColor_Log_Call: appProperties.infoText_Color, @@ -514,6 +517,8 @@ function styleGuide () { bar_Ghost: appProperties.ghostBar, bar_Dragging: appProperties.draggingBar, + dragbarWidth: '0.5rem', + dragbarBackgroundColor: '', icon_Color_TogglePanel: appProperties.icon_Color, icon_HoverColor_TogglePanel: appProperties.icon_HoverColor, diff --git a/src/app/ui/styles-guide/styleGuideDark.js b/src/app/ui/styles-guide/styleGuideDark.js index 663304fb53..aa767ac82a 100644 --- a/src/app/ui/styles-guide/styleGuideDark.js +++ b/src/app/ui/styles-guide/styleGuideDark.js @@ -418,6 +418,7 @@ function styleGuideDark () { bar_Ghost: appProperties.ghostBar, bar_Dragging: appProperties.draggingBar, + dragbarBorderRight: '2px solid hsla(215, 81%, 79%, .3)', icon_Color_Menu: appProperties.icon_Color, icon_HoverColor_Menu: appProperties.icon_HoverColor, @@ -467,6 +468,8 @@ function styleGuideDark () { text_Regular_TransactionLog: appProperties.supportText_Color, text_Button: appProperties.oppositeText_Color, + blockBorderTop: '0.07ch solid ' + cssProperties.colors.veryLightGrey, + icon_Color_TogglePanel: appProperties.icon_Color, icon_HoverColor_TogglePanel: appProperties.icon_HoverColor, icon_Color_Menu: appProperties.icon_Color, @@ -516,6 +519,8 @@ function styleGuideDark () { bar_Ghost: appProperties.ghostBar, bar_Dragging: appProperties.draggingBar, + dragbarWidth: '0.5rem', + dragbarBackgroundColor: '', icon_Color_TogglePanel: appProperties.icon_Color, icon_HoverColor_TogglePanel: appProperties.icon_HoverColor, diff --git a/src/app/ui/styles-guide/styleGuideDavid.js b/src/app/ui/styles-guide/styleGuideDavid.js index bf0687f8ab..a3c626a1aa 100644 --- a/src/app/ui/styles-guide/styleGuideDavid.js +++ b/src/app/ui/styles-guide/styleGuideDavid.js @@ -398,8 +398,6 @@ function styleGuideDavid () { LEFT PANEL (FILE PANEL) /* ------------------------------------------------------ */ leftPanel: { - customDragbarBorderRight: true, - dragbarBorderRight: '2px solid ' + cssProperties.colors.veryLightGrey, backgroundColor_Panel: appProperties.primary_BackgroundColor, backgroundColor_FileExplorer: appProperties.tertiary_BackgroundColor, @@ -409,6 +407,7 @@ function styleGuideDavid () { bar_Ghost: appProperties.ghostBar, bar_Dragging: appProperties.draggingBar, + dragbarBorderRight: '2px solid ' + cssProperties.colors.veryLightGrey, icon_Color_Menu: appProperties.icon_Color, icon_HoverColor_Menu: appProperties.icon_HoverColor, @@ -443,8 +442,6 @@ function styleGuideDavid () { TERMINAL /* ------------------------------------------------------ */ terminal: { - customBlockBorderTop: true, - blockBorderTop: '2px solid ' + cssProperties.colors.veryLightGrey, backgroundColor_Menu: appProperties.secondary_BackgroundColor, backgroundColor_Terminal: appProperties.seventh_BackgroundColor, backgroundColor_TerminalCLI: appProperties.seventh_BackgroundColor, @@ -460,6 +457,8 @@ function styleGuideDavid () { text_Regular_TransactionLog: appProperties.supportText_Color, text_Button: appProperties.oppositeText_Color, + blockBorderTop: '2px solid ' + cssProperties.colors.veryLightGrey, + icon_Color_Log_Succeed: appProperties.success_BorderColor, icon_Color_Log_Failed: appProperties.errorText_Color, icon_BackgroundColor_Log_Call: appProperties.infoText_Color, @@ -503,10 +502,6 @@ function styleGuideDavid () { RIGHT PANEL /* ------------------------------------------------------ */ rightPanel: { - customDragbarWidth: true, - customDragbarBackgroundColor: true, - dragbarWidth: '2px', - dragbarBackgroundColor: cssProperties.colors.veryLightGrey, backgroundColor_Panel: appProperties.fifth_BackgroundColor, backgroundColor_Tab: appProperties.fifth_BackgroundColor, BackgroundColor_Pre: appProperties.primary_BackgroundColor, @@ -518,6 +513,8 @@ function styleGuideDavid () { bar_Ghost: appProperties.ghostBar, bar_Dragging: appProperties.draggingBar, + dragbarWidth: '2px', + dragbarBackgroundColor: cssProperties.colors.veryLightGrey, icon_Color_TogglePanel: appProperties.icon_Color, icon_HoverColor_TogglePanel: appProperties.icon_HoverColor, diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js index 49d11c4280..f87b338bd2 100644 --- a/src/lib/panels-resize.js +++ b/src/lib/panels-resize.js @@ -12,11 +12,7 @@ const css = csjs` bottom : 0; cursor : col-resize; z-index : 999; - border-right : ${ - styles.leftPanel.customDragbarBorderRight - ? styles.leftPanel.dragbarBorderRight - : '2px solid hsla(215, 81%, 79%, .3)' - } + border-right : ${styles.leftPanel.dragbarBorderRight}; } .ghostbar { width : 3px; From 82d6676dca78de476cc7647e6be2eb459fdfed7c Mon Sep 17 00:00:00 2001 From: jeremiG Date: Tue, 8 Jan 2019 17:39:16 -0500 Subject: [PATCH 039/636] fix(ui): New theme now follows maintainer recommendations - Existing themes aren't broken - New theme provides good color scheme - Buttons are visible and clearly defined --- src/app/panels/styles/terminal-styles.js | 5 +- src/app/tabs/styles/run-tab-styles.js | 4 +- src/app/ui/styles-guide/styleGuideDavid.js | 93 +++++++++++++++++----- 3 files changed, 77 insertions(+), 25 deletions(-) diff --git a/src/app/panels/styles/terminal-styles.js b/src/app/panels/styles/terminal-styles.js index 2f528f2850..af47663e08 100644 --- a/src/app/panels/styles/terminal-styles.js +++ b/src/app/panels/styles/terminal-styles.js @@ -78,10 +78,7 @@ var css = csjs` line-height : 2ch; padding : 1ch; margin-top : 2ch; - border-top : ${styles.terminal.customBlockBorderTop - ? styles.terminal.blockBorderTop - : '0.07ch solid ' + styles.colors.veryLightGrey - }; + border-top : ${styles.terminal.blockBorderTop}; color : ${styles.appProperties.mainText_Color}; } .cli { diff --git a/src/app/tabs/styles/run-tab-styles.js b/src/app/tabs/styles/run-tab-styles.js index b92881d690..afabea3c47 100644 --- a/src/app/tabs/styles/run-tab-styles.js +++ b/src/app/tabs/styles/run-tab-styles.js @@ -130,15 +130,15 @@ var css = csjs` ${styles.rightPanel.runTab.button_transaction} } .atAddress { - ${styles.rightPanel.runTab.button_atAddress} + margin: 0; min-width: 100px; width: 100px; font-size: 10px; - margin: 0; word-break: inherit; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; + ${styles.rightPanel.runTab.button_atAddress} } .atAddressSect { margin-top: 6px; diff --git a/src/app/ui/styles-guide/styleGuideDavid.js b/src/app/ui/styles-guide/styleGuideDavid.js index a3c626a1aa..70cbe02863 100644 --- a/src/app/ui/styles-guide/styleGuideDavid.js +++ b/src/app/ui/styles-guide/styleGuideDavid.js @@ -16,7 +16,7 @@ function styleGuideDavid () { // BASIC COLORS (B&W and transparent) transparent: 'transparent', white: 'hsl(0, 0%, 100%)', - black: 'hsl(0, 0%, 0%)', + black: 'black', opacityBlack: 'hsla(0, 0%, 0%, .4)', // BLUE @@ -59,6 +59,7 @@ function styleGuideDavid () { BORDERS ------------------------------------------------------ */ borders: { + primary_borderRadius: '3px', secondary_borderRadius: '5px' } } @@ -81,10 +82,10 @@ function styleGuideDavid () { BACKGROUND COLORS ------------------------------------------------------ */ primary_BackgroundColor: cssProperties.colors.white, - secondary_BackgroundColor: cssProperties.colors.white, + secondary_BackgroundColor: cssProperties.colors.veryLightGrey, tertiary_BackgroundColor: cssProperties.colors.white, quaternary_BackgroundColor: cssProperties.colors.white, - fifth_BackgroundColor: cssProperties.colors.white, + fifth_BackgroundColor: cssProperties.colors.lightGrey, seventh_BackgroundColor: cssProperties.colors.white, dark_BackgroundColor: cssProperties.colors.black, light_BackgroundColor: cssProperties.colors.white, @@ -181,6 +182,7 @@ function styleGuideDavid () { primaryButton_TextColor: cssProperties.colors.black, primaryButton_BackgroundColor: cssProperties.colors.white, primaryButton_BorderColor: cssProperties.colors.black, + primaryButton_BorderWidth: '2px', /* ................. SECONDARY @@ -281,6 +283,7 @@ function styleGuideDavid () { background-color : ${opts.BackgroundColor}; border : 1px solid ${opts.BorderColor}; color : ${opts.Color}; + border-radius : ${cssProperties.borders.primary_borderRadius} font-size : 12px; padding : 10px 15px; line-height : 20px; @@ -356,6 +359,10 @@ function styleGuideDavid () { font-size : 12px; overflow : hidden; word-break : normal; + border-radius : ${opts.BorderRadius}; + border-width : ${opts.BorderWidth}; + border-color : ${opts.BorderColor}; + border-style : ${opts.BorderStyle}; ` } } @@ -538,25 +545,37 @@ function styleGuideDavid () { button_Compile: appProperties.uiElements.button({ BackgroundColor: appProperties.primaryButton_BackgroundColor, BorderColor: appProperties.primaryButton_BorderColor, - Color: appProperties.primaryButton_TextColor + Color: appProperties.primaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_Details: appProperties.uiElements.button({ BackgroundColor: appProperties.secondaryButton_BackgroundColor, BorderColor: appProperties.secondaryButton_BorderColor, - Color: appProperties.secondaryButton_TextColor + Color: appProperties.secondaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_Publish: appProperties.uiElements.button({ BackgroundColor: appProperties.secondaryButton_BackgroundColor, BorderColor: appProperties.secondaryButton_BorderColor, - Color: appProperties.secondaryButton_TextColor + Color: appProperties.secondaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), dropdown_CompileContract: appProperties.uiElements.dropdown({ BackgroundColor: appProperties.dropdown_BackgroundColor, BorderColor: appProperties.dropdown_BorderColor, - Color: appProperties.dropdown_TextColor + Color: appProperties.dropdown_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), box_CompileContainer: appProperties.uiElements.solidBorderBox({ @@ -618,33 +637,51 @@ function styleGuideDavid () { button_atAddress: appProperties.uiElements.button({ BackgroundColor: appProperties.primaryButton_BackgroundColor, BorderColor: appProperties.primaryButton_BorderColor, - Color: appProperties.primaryButton_TextColor + Color: appProperties.primaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_Create: appProperties.uiElements.button({ BackgroundColor: appProperties.transactButton_BackgroundColor, BorderColor: appProperties.transactButton_BorderColor, - Color: appProperties.transactButton_TextColor + Color: appProperties.transactButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_Constant: appProperties.uiElements.button({ BackgroundColor: appProperties.constantButton_BackgroundColor, BorderColor: appProperties.constantButton_BorderColor, - Color: appProperties.constantButton_TextColor + Color: appProperties.constantButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_Instance_Call: appProperties.uiElements.button({ BackgroundColor: appProperties.callButton_BackgroundColor, BorderColor: appProperties.callButton_BorderColor, - Color: appProperties.callButton_TextColor + Color: appProperties.callButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_Instance_Transact: appProperties.uiElements.button({ BackgroundColor: appProperties.transactButton_BackgroundColor, BorderColor: appProperties.transactButton_BorderColor, - Color: appProperties.transactButton_TextColor + Color: appProperties.transactButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_Instance_TransactPayable: appProperties.uiElements.button({ BackgroundColor: appProperties.transactPayableButton_BackgroundColor, BorderColor: appProperties.transactPayableButton_BorderColor, - Color: appProperties.transactPayableButton_TextColor + Color: appProperties.transactPayableButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), icon_Color_Instance_CopyToClipboard: appProperties.icon_Color, @@ -669,13 +706,19 @@ function styleGuideDavid () { button_runTests: appProperties.uiElements.button({ BackgroundColor: appProperties.primaryButton_BackgroundColor, BorderColor: appProperties.primaryButton_BorderColor, - Color: appProperties.primaryButton_TextColor + Color: appProperties.primaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_generateTestFile: appProperties.uiElements.button({ BackgroundColor: appProperties.primaryButton_BackgroundColor, BorderColor: appProperties.primaryButton_BorderColor, - Color: appProperties.primaryButton_TextColor + Color: appProperties.primaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), color_testPass: appProperties.success_BackgroundColor, @@ -701,12 +744,18 @@ function styleGuideDavid () { button_LoadPlugin: appProperties.uiElements.button({ BackgroundColor: appProperties.secondaryButton_BackgroundColor, BorderColor: appProperties.secondaryButton_BorderColor, - Color: appProperties.secondaryButton_TextColor + Color: appProperties.secondaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_initPlugin: appProperties.uiElements.button({ BackgroundColor: appProperties.transactButton_BackgroundColor, BorderColor: appProperties.transactButton_BorderColor, - Color: appProperties.secondaryButton_TextColor + Color: appProperties.secondaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }) }, @@ -727,7 +776,10 @@ function styleGuideDavid () { button_Debugger: appProperties.uiElements.button({ BackgroundColor: appProperties.secondaryButton_BackgroundColor, BorderColor: appProperties.secondaryButton_BorderColor, - Color: appProperties.secondaryButton_TextColor + Color: appProperties.secondaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), button_Debugger_icon_Color: appProperties.icon_ConstantColor, @@ -756,7 +808,10 @@ function styleGuideDavid () { button_Run_AnalysisTab: appProperties.uiElements.button({ BackgroundColor: appProperties.primaryButton_BackgroundColor, BorderColor: appProperties.primaryButton_BorderColor, - Color: appProperties.primaryButton_TextColor + Color: appProperties.primaryButton_TextColor, + BorderWidth: appProperties.primaryButton_BorderWidth, + BorderRadius: cssProperties.borders.primary_borderRadius, + BorderStyle: 'solid' }), box_AnalysisContainer: appProperties.uiElements.solidBorderBox({ From 49d4146238276cf0d8d7ab27b72ada0a5429c280 Mon Sep 17 00:00:00 2001 From: dvdptr Date: Thu, 10 Jan 2019 09:24:31 +0100 Subject: [PATCH 040/636] fix(ui): Change background color to white, black button borders - @yann300 asked for more visible buttons, provided black border Refs: #1657 --- src/app/ui/styles-guide/styleGuideDavid.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/ui/styles-guide/styleGuideDavid.js b/src/app/ui/styles-guide/styleGuideDavid.js index 70cbe02863..24fdc5c0d9 100644 --- a/src/app/ui/styles-guide/styleGuideDavid.js +++ b/src/app/ui/styles-guide/styleGuideDavid.js @@ -59,7 +59,6 @@ function styleGuideDavid () { BORDERS ------------------------------------------------------ */ borders: { - primary_borderRadius: '3px', secondary_borderRadius: '5px' } } @@ -82,10 +81,10 @@ function styleGuideDavid () { BACKGROUND COLORS ------------------------------------------------------ */ primary_BackgroundColor: cssProperties.colors.white, - secondary_BackgroundColor: cssProperties.colors.veryLightGrey, + secondary_BackgroundColor: cssProperties.colors.white, tertiary_BackgroundColor: cssProperties.colors.white, quaternary_BackgroundColor: cssProperties.colors.white, - fifth_BackgroundColor: cssProperties.colors.lightGrey, + fifth_BackgroundColor: cssProperties.colors.white, seventh_BackgroundColor: cssProperties.colors.white, dark_BackgroundColor: cssProperties.colors.black, light_BackgroundColor: cssProperties.colors.white, @@ -118,7 +117,7 @@ function styleGuideDavid () { ******************************************************** */ icon_Color: cssProperties.colors.black, icon_AltColor: cssProperties.colors.white, - icon_HoverColor: cssProperties.colors.azure, + icon_HoverColor: cssProperties.colors.grey, icon_ConstantColor: cssProperties.colors.black, /* ------------------------------------------------------ @@ -182,7 +181,7 @@ function styleGuideDavid () { primaryButton_TextColor: cssProperties.colors.black, primaryButton_BackgroundColor: cssProperties.colors.white, primaryButton_BorderColor: cssProperties.colors.black, - primaryButton_BorderWidth: '2px', + primaryButton_BorderWidth: '1px', /* ................. SECONDARY @@ -348,6 +347,7 @@ function styleGuideDavid () { margin : 1px; background-color : ${opts.BackgroundColor}; color : ${opts.Color}; + border : 1px solid; display : flex; align-items : center; justify-content : center; From a613c829c9da20d61b5d2a525fd9529faa886991 Mon Sep 17 00:00:00 2001 From: jeremiG Date: Thu, 10 Jan 2019 05:40:21 -0500 Subject: [PATCH 041/636] Works well with incognito browser! --- src/app/tabs/settings-tab.js | 11 ++++++++++- .../{styleGuideDavid.js => styleGuideClean.js} | 4 ++-- src/app/ui/styles-guide/theme-chooser.js | 5 +++++ 3 files changed, 17 insertions(+), 3 deletions(-) rename src/app/ui/styles-guide/{styleGuideDavid.js => styleGuideClean.js} (99%) diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 54eb760d20..5d9ab1875e 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -26,7 +26,7 @@ module.exports = class SettingsTab { el: null, optionVM: null, personal: null, warnPersonalMode: null, generateContractMetadata: null, pluginInput: null, versionSelector: null, version: null, - theme: { dark: null, light: null }, + theme: { dark: null, light: null, clean: null }, plugins: {}, config: { general: null, themes: null, @@ -74,6 +74,7 @@ module.exports = class SettingsTab { self._view.theme.light = yo`` self._view.theme.dark = yo`` + self._view.theme.clean = yo`` self._view.theme[self.data.currentTheme].setAttribute('checked', 'checked') self._view.config.general = yo` @@ -120,6 +121,10 @@ module.exports = class SettingsTab { ${self._view.theme.dark}
+
+ ${self._view.theme.clean} + +
` self._view.config.plugins = yo`
` self._view.config.plugin = yo` @@ -203,6 +208,10 @@ module.exports = class SettingsTab { styleGuide.switchTheme('light') window.location.reload() } + function onswitch2cleanTheme (event) { + styleGuide.switchTheme('clean') + window.location.reload() + } function onchangePersonal (event) { self._deps.config.set('settings/personal-mode', !self._deps.config.get('settings/personal-mode')) } diff --git a/src/app/ui/styles-guide/styleGuideDavid.js b/src/app/ui/styles-guide/styleGuideClean.js similarity index 99% rename from src/app/ui/styles-guide/styleGuideDavid.js rename to src/app/ui/styles-guide/styleGuideClean.js index 24fdc5c0d9..19ab6ca254 100644 --- a/src/app/ui/styles-guide/styleGuideDavid.js +++ b/src/app/ui/styles-guide/styleGuideClean.js @@ -1,8 +1,8 @@ // var csjs = require('csjs-inject') -module.exports = styleGuideDavid +module.exports = styleGuideClean -function styleGuideDavid () { +function styleGuideClean () { /* -------------------------------------------------------------------------- CSS PROPERTIES diff --git a/src/app/ui/styles-guide/theme-chooser.js b/src/app/ui/styles-guide/theme-chooser.js index abcb32ade6..fb0e999406 100644 --- a/src/app/ui/styles-guide/theme-chooser.js +++ b/src/app/ui/styles-guide/theme-chooser.js @@ -1,5 +1,6 @@ var styleGuideLight = require('./style-guide') var styleGuideDark = require('./styleGuideDark') +var styleGuideClean = require('./styleGuideClean') var Storage = require('remix-lib').Storage module.exports = { @@ -8,6 +9,8 @@ module.exports = { if (themeStorage.exists('theme')) { if (themeStorage.get('theme') === 'dark') { return styleGuideDark() + } else if (themeStorage.get('theme') === 'clean') { + return styleGuideClean() } else { return styleGuideLight() } @@ -23,6 +26,8 @@ module.exports = { return styleGuideDark() } else if (theme === 'light') { return styleGuideLight() + } else if (theme === 'clean') { + return styleGuideClean() } else { return styleGuideLight() } From afe66ded684f0518ea1e30dba65cd212e90a6d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rocky=20K=C3=BCppers?= Date: Tue, 15 Jan 2019 11:20:44 +0100 Subject: [PATCH 042/636] Fix for File Explorer --- src/app/files/file-explorer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index d0c23595e6..096b5a59c1 100644 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -132,6 +132,7 @@ function fileExplorer (localRegistry, files) { }) self.treeView.event.register('nodeRightClick', function (key, data, label, event) { + if (key == self.files.type) return MENU_HANDLE && MENU_HANDLE.hide(null, true) MENU_HANDLE = contextMenu(event, { 'Rename': () => { @@ -147,6 +148,7 @@ function fileExplorer (localRegistry, files) { }) self.treeView.event.register('leafRightClick', function (key, data, label, event) { + if (key == self.files.type) return MENU_HANDLE && MENU_HANDLE.hide(null, true) MENU_HANDLE = contextMenu(event, { 'Rename': () => { From 4fd0f7103b25865a4b16e1931b41e40d50d1b21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rocky=20K=C3=BCppers?= Date: Tue, 15 Jan 2019 11:25:07 +0100 Subject: [PATCH 043/636] Fix Equality Test --- src/app/files/file-explorer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index 096b5a59c1..b1d90ea71a 100644 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -132,7 +132,7 @@ function fileExplorer (localRegistry, files) { }) self.treeView.event.register('nodeRightClick', function (key, data, label, event) { - if (key == self.files.type) return + if (key === self.files.type) return MENU_HANDLE && MENU_HANDLE.hide(null, true) MENU_HANDLE = contextMenu(event, { 'Rename': () => { @@ -148,7 +148,7 @@ function fileExplorer (localRegistry, files) { }) self.treeView.event.register('leafRightClick', function (key, data, label, event) { - if (key == self.files.type) return + if (key === self.files.type) return MENU_HANDLE && MENU_HANDLE.hide(null, true) MENU_HANDLE = contextMenu(event, { 'Rename': () => { From 3ab3f4bae8692794ae946ae3ab26da0282014b2e Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Tue, 15 Jan 2019 12:42:35 +0100 Subject: [PATCH 044/636] inactive / active mods almost getting ordered --- .../components/plugin-manager-component.js | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index f9b78015f7..591945f69c 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -36,16 +36,39 @@ class PluginManagerComponent { } render () { + this.views.activeMods = yo` +
+

Active Modules

+
+ ` + this.views.inactiveMods = yo` +
+

Inactive Modules

+
+ ` this.views.root = yo`
-

Plugin Manager

+

Plugin Manager

+ ${this.views.activeMods} + ${this.views.inactiveMods}
` - +// loop through actives - to put them through in 1 chunk var modulesActive = this.store.getActives() modulesActive.forEach((mod) => { - this.views.root.appendChild(this.renderItem(mod.profile.name)) + this.views.activeMods.appendChild(this.renderItem(mod.profile.name)) }) + + // loop through all - if 1 is an active forget it + // or update the store.js + // actives get put into store where + var modulesAll = this.store.getAll() + modulesAll.forEach((mod) => { + if ( !(modulesActive.includes(mod)) ) { + this.views.inactiveMods.appendChild(this.renderItem(mod.profile.name)) + } + }) + return this.views.root } From ee0aa3cc8668384cfaf3e3c0f7c05bebd8bc2790 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Tue, 15 Jan 2019 23:40:52 +0100 Subject: [PATCH 045/636] de/activate plugins list work --- .../components/plugin-manager-component.js | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 591945f69c..149720b755 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -37,12 +37,12 @@ class PluginManagerComponent { render () { this.views.activeMods = yo` -
+
` this.views.items[item] = yo` -
+

${mod.profile.name}

${mod.profile.description} ${ctrBtns} @@ -93,6 +105,12 @@ class PluginManagerComponent { return this.views.items[item] } + + reRender (item) { + document.getElementById('pluginManager').innerHTML = '' + let piMan = this.render() + document.getElementById('pluginManager').appendChild(piMan) + } } module.exports = PluginManagerComponent @@ -130,4 +148,9 @@ const css = csjs` cursor: pointer; font-size: 10px; } + .activePlugins { + } + + .inactivePlugins { + } ` From d0a2e47c3419264608f23eebf87014f316299e33 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Wed, 16 Jan 2019 13:09:42 +0100 Subject: [PATCH 046/636] adding the 50px on the icon panel --- src/app.js | 2 +- src/app/components/plugin-manager-component.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app.js b/src/app.js index 60ab86233c..e0f0e6e5d6 100644 --- a/src/app.js +++ b/src/app.js @@ -98,7 +98,7 @@ var css = csjs` bottom : 0; left : 0; overflow : hidden; - width : 2%; + width : 50px; } .swappanel { display : flex; diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 149720b755..bdd283ffef 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -49,6 +49,7 @@ class PluginManagerComponent { this.views.root = yo`

Plugin Manager

+ ${this.views.activeMods} ${this.views.inactiveMods}
@@ -140,9 +141,6 @@ const css = csjs` margin-top: 9px; } - .plugItIn.active { - display: block; - } .plugin button { ${styles.rightPanel.settingsTab.button_LoadPlugin}; cursor: pointer; @@ -153,4 +151,7 @@ const css = csjs` .inactivePlugins { } + .plugins_settings input { + margin: 10px; + } ` From 2508db6ef27baf76a79831d733386451ee36876a Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 14:12:02 +0100 Subject: [PATCH 047/636] resizing window --- src/app.js | 6 ++---- src/app/components/swap-panel-component.js | 5 ++--- src/lib/panels-resize.js | 25 ++++++++++++++++++---- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/app.js b/src/app.js index e0f0e6e5d6..3cc729c45b 100644 --- a/src/app.js +++ b/src/app.js @@ -87,7 +87,6 @@ var css = csjs` top : 0; bottom : 0; overflow : hidden; - width : 82%; } .iconpanel { background-color : ${styles.leftPanel.backgroundColor_Panel}; @@ -106,8 +105,7 @@ var css = csjs` position : absolute; top : 0; bottom : 0; - overflow : hidden; - width : 16%; + overflow : hidden } .highlightcode { position:absolute; @@ -191,7 +189,7 @@ class App { self._view.swappanel.style.left = self._view.iconpanel.clientWidth + 'px' self._view.mainpanel.style.left = (self._view.iconpanel.clientWidth + self._view.swappanel.clientWidth) + 'px' - let resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': 300 }) // eslint-disable-line + let resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': 400, x: 450 }) // eslint-disable-line run.apply(self) } diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index f548d655f6..49f3ddfd6f 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -50,14 +50,13 @@ module.exports = SwapPanelComponent const css = csjs` .plugins { height: : 100%; - overflow-y: auto; - margin-right: 10px; + overflow-y : auto; } .plugItIn { display : none; height : 100%; } .plugItIn.active { - display :block; + display : block; } ` diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js index f87b338bd2..a7ba360877 100644 --- a/src/lib/panels-resize.js +++ b/src/lib/panels-resize.js @@ -26,6 +26,13 @@ const css = csjs` } ` +/* +* opt: +* minWidth : minimn width for panels +* x : position of gutter at load +* +* +*/ export default class PanelsResize { constructor (idpanel1, idpanel2, opt) { var panel1 = document.querySelector(idpanel1) @@ -59,15 +66,19 @@ export default class PanelsResize { ghostbar.style.left = event.x + 'px' } + let setPosition = (event) => { + let p = processPositiions(event) + panel1.style.width = p.panel1Width + 'px' + panel2.style.left = p.panel2left + 'px' + panel2.style.width = p.panel2Width + 'px' + } + let removeGhostbar = (event) => { document.body.removeChild(ghostbar) document.removeEventListener('mousemove', moveGhostbar) document.removeEventListener('mouseup', removeGhostbar) document.removeEventListener('keydown', cancelGhostbar) - let p = processPositiions(event) - panel1.style.width = p.panel1Width + 'px' - panel2.style.left = p.panel2left + 'px' - panel2.style.width = p.panel2Width + 'px' + setPosition(event) } let processPositiions = (event) => { @@ -79,7 +90,13 @@ export default class PanelsResize { return { panel1Width, panel2left, panel2Width } } + window.addEventListener('resize', function (event){ + setPosition({ x: panel1.offsetLeft + panel1.clientWidth }) + }) + var dragbar = yo`
` panel1.appendChild(dragbar) + + setPosition(opt) } } From 8d536e0b85a4cd9dc82a65db08b033b81091c0d0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 14:12:11 +0100 Subject: [PATCH 048/636] standard --- src/app/tabs/run-tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index a816dbbf5c..1a023a6dc2 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -178,7 +178,7 @@ function runTab (opts, localRegistry) { ` container.appendChild(el) - return { + return { render () { return container }, profile () { return { @@ -187,7 +187,7 @@ function runTab (opts, localRegistry) { events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjMwNCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjMwNCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMzAxIDEwMzZxMTIgMTAzLTIyIDE5OC41dC05OSAxNjMuNS0xNTguNSAxMDYtMT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iA5NHoiLz48L3N2Zz4=' } - } + } } } From f156e6bb1a34ee45ea102798ba7f1e1726b20664 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 14:50:47 +0100 Subject: [PATCH 049/636] remove uneeded --- src/app.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/app.js b/src/app.js index 3cc729c45b..f017e3cf52 100644 --- a/src/app.js +++ b/src/app.js @@ -169,19 +169,6 @@ class App { registry.put({api: self._components.filesProviders, name: 'fileproviders'}) self._view = {} - - self.data = { - _layout: { - right: { - offset: 400, - show: true - }, // @TODO: adapt sizes proportionally to browser window size - left: { - offset: 200, - show: true - } - } - } } init () { @@ -232,9 +219,6 @@ class App { ${self._view.mainpanel}
` - // INIT - // self._adjustLayout('left', self.data._layout.left.offset) - // self._adjustLayout('right', self.data._layout.right.offset) return self._view.el } loadFromGist (params) { From a76cb8e1fbaa4a5c2023e4aec814edbd36538757 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 14:53:14 +0100 Subject: [PATCH 050/636] toggle swap panel --- src/app.js | 15 +++++++++------ src/app/components/swap-panel-api.js | 10 +++++++++- src/lib/panels-resize.js | 27 ++++++++++++++++++++++++--- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/src/app.js b/src/app.js index f017e3cf52..e5e2feba06 100644 --- a/src/app.js +++ b/src/app.js @@ -104,8 +104,9 @@ var css = csjs` flex-direction : column; position : absolute; top : 0; + left : 50px; bottom : 0; - overflow : hidden + overflow : hidden; } .highlightcode { position:absolute; @@ -173,10 +174,7 @@ class App { init () { var self = this - self._view.swappanel.style.left = self._view.iconpanel.clientWidth + 'px' - self._view.mainpanel.style.left = (self._view.iconpanel.clientWidth + self._view.swappanel.clientWidth) + 'px' - - let resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': 400, x: 450 }) // eslint-disable-line + self._components.resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': 400, x: 450 }) run.apply(self) } @@ -450,7 +448,12 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const swapPanelComponent = new SwapPanelComponent() const verticalIconComponent = new VerticalIconsComponent() const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, appManager) // eslint-disable-line - const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, appManager) // eslint-disable-line + const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, appManager) // eslint-disable-line + + swapPanelApi.event.on('toggle', () => { + this._components.resizeFeature.panel1.clientWidth !== 0 ? this._components.resizeFeature.minimize() : this._components.resizeFeature.maximise() + }) + swapPanelApi.event.on('showing', () => { this._components.resizeFeature.maximise() }) self._components.editorpanel.init() self._components.fileManager.init() diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index bae2df24aa..873ecea242 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -1,10 +1,18 @@ -// const EventEmmitter = require('events') +import EventEmmitter from 'events' class SwapPanelApi { constructor (swapPanelComponent, verticalIconsComponent, appManager) { + this.event = new EventEmmitter() this.component = swapPanelComponent + this.currentContent verticalIconsComponent.event.on('showContent', (moduleName) => { + if (this.currentContent === moduleName) { + this.event.emit('toggle') + return + } + this.event.emit('showing', moduleName) this.component.showContent(moduleName) + this.currentContent = moduleName }) appManager.event.on('requestContainer', (mod, content) => { this.add(mod.name, content) diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js index a7ba360877..57c0bf244b 100644 --- a/src/lib/panels-resize.js +++ b/src/lib/panels-resize.js @@ -37,6 +37,9 @@ export default class PanelsResize { constructor (idpanel1, idpanel2, opt) { var panel1 = document.querySelector(idpanel1) var panel2 = document.querySelector(idpanel2) + this.panel1 = panel1 + this.panel2 = panel2 + this.opt = opt var ghostbar = yo`
` @@ -61,13 +64,13 @@ export default class PanelsResize { } let moveGhostbar = (event) => { // @NOTE VERTICAL ghostbar - let p = processPositiions(event) + let p = processPositions(event) if (p.panel1Width <= opt.minWidth || p.panel2Width <= opt.minWidth) return ghostbar.style.left = event.x + 'px' } let setPosition = (event) => { - let p = processPositiions(event) + let p = processPositions(event) panel1.style.width = p.panel1Width + 'px' panel2.style.left = p.panel2left + 'px' panel2.style.width = p.panel2Width + 'px' @@ -81,7 +84,7 @@ export default class PanelsResize { setPosition(event) } - let processPositiions = (event) => { + let processPositions = (event) => { let panel1Width = event.x - panel1.offsetLeft panel1Width = panel1Width < opt.minWidth ? opt.minWidth : panel1Width let panel2left = panel1.offsetLeft + panel1Width @@ -98,5 +101,23 @@ export default class PanelsResize { panel1.appendChild(dragbar) setPosition(opt) + } + + minimize () { + let panel1Width = 0 + let panel2left = this.panel1.offsetLeft + panel1Width + let panel2Width = this.panel2.parentElement.clientWidth - this.panel1.offsetLeft - panel1Width + this.panel1.style.width = panel1Width + 'px' + this.panel2.style.left = panel2left + 'px' + this.panel2.style.width = panel2Width + 'px' + } + + maximise () { + let panel1Width = this.opt.minWidth + let panel2left = this.panel1.offsetLeft + panel1Width + let panel2Width = this.panel2.parentElement.clientWidth - this.panel1.offsetLeft - panel1Width + this.panel1.style.width = panel1Width + 'px' + this.panel2.style.left = panel2left + 'px' + this.panel2.style.width = panel2Width + 'px' } } From 35a827f2265586378664560b1d9ca221239e2242 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 15:17:35 +0100 Subject: [PATCH 051/636] fix resizing --- src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index e5e2feba06..c02555ee15 100644 --- a/src/app.js +++ b/src/app.js @@ -453,7 +453,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org swapPanelApi.event.on('toggle', () => { this._components.resizeFeature.panel1.clientWidth !== 0 ? this._components.resizeFeature.minimize() : this._components.resizeFeature.maximise() }) - swapPanelApi.event.on('showing', () => { this._components.resizeFeature.maximise() }) + swapPanelApi.event.on('showing', () => { this._components.resizeFeature.panel1.clientWidth === 0 ? this._components.resizeFeature.maximise() : '' }) self._components.editorpanel.init() self._components.fileManager.init() From 9254fa4bb1a81a01430841b4b79936a78f1dd0b6 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 15:22:18 +0100 Subject: [PATCH 052/636] typo --- src/remixAppManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remixAppManager.js b/src/remixAppManager.js index 98deccb7af..7b3814cb9b 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -25,7 +25,7 @@ export class RemixAppManager extends AppManagerApi { : this.event.emit('removingItem', entity.profile) } // temp - if (entity && name === 'SolidityCompiler') { + if (entity && name === 'SolidityCompile') { isActive ? this.data.proxy.register(entity.api) : this.data.proxy.unregister(entity.api) } isActive ? this.store.activate(name) : this.store.deactivate(name) From 25614ec1ed3dec4cd2e833d7a146e544f64063ec Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 15:28:11 +0100 Subject: [PATCH 053/636] fix test tab --- src/app/tabs/test-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index 596539d57d..bc222136a0 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -25,7 +25,7 @@ module.exports = class TestTab { } profile () { return { - name: 'Run', + name: 'Solidity Unit Testing', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjMwNCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjMwNCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNzI4IDQ0OGwtMzg0IDcwNGg3Njh6bS0xMjgwIDBsLTM4NCA3MDRoNzY4em04MjEtMTkycS0xNCA0MC00NS41IDcxLjV0LTcxLjUgNDUuNXYxM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ep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 16:39:51 +0100 Subject: [PATCH 054/636] fix updating view --- .../components/plugin-manager-component.js | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index bdd283ffef..66259820c4 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -31,8 +31,8 @@ class PluginManagerComponent { setStore (store) { this.store = store - this.store.event.on('activate', (name) => { this.views.items[name] ? this.views.items[name].querySelector('button').innerHTML = 'deactivate' : null }) - this.store.event.on('deactivate', (name) => { this.views.items[name] ? this.views.items[name].querySelector('button').innerHTML = 'activate' : null }) + this.store.event.on('activate', (name) => { this.reRender() }) + this.store.event.on('deactivate', (name) => { this.reRender() }) } render () { @@ -46,7 +46,7 @@ class PluginManagerComponent {

Inactive Modules

` - this.views.root = yo` + var rootView = yo`

Plugin Manager

@@ -69,12 +69,14 @@ class PluginManagerComponent { var modulesAll = this.store.getAll() modulesAll.sort() modulesAll.forEach((mod) => { - if ( !(modulesActive.includes(mod)) ) { + if (!modulesActive.includes(mod)) { this.views.inactiveMods.appendChild(this.renderItem(mod.profile.name)) } }) - - return this.views.root + if (!this.views.root) { + this.views.root = rootView + } + return rootView } renderItem (item) { @@ -82,13 +84,11 @@ class PluginManagerComponent { const mod = this.store.getOne(item) if (!mod) return - let action = async() => { + let action = () => { if (this.store.isActive(item)) { - await this.appManager.deactivateOne(item) - this.reRender() + this.appManager.deactivateOne(item) } else { - await this.appManager.activateOne(item) - this.reRender() + this.appManager.activateOne(item) } } @@ -103,14 +103,13 @@ class PluginManagerComponent { ${ctrBtns}
` - return this.views.items[item] } - reRender (item) { - document.getElementById('pluginManager').innerHTML = '' - let piMan = this.render() - document.getElementById('pluginManager').appendChild(piMan) + reRender () { + if (this.views.root) { + yo.update(this.views.root, this.render()) + } } } From 887051bd8b3e39e7aee70f69b36111b358eb1f4c Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 17:43:19 +0100 Subject: [PATCH 055/636] add plugin ethdoc --- package.json | 2 +- src/app.js | 12 +++--- src/app/components/swap-panel-api.js | 21 +++------- src/app/components/vertical-icons-api.js | 12 ++++-- src/remixAppManager.js | 51 ++++++++++++++++++++++-- 5 files changed, 69 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 01d105cd54..612b96d0e3 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "remix-analyzer": "0.3.1", "remix-debug": "0.3.1", "remix-lib": "0.4.1", - "remix-plugin": "0.0.1-alpha.5", + "remix-plugin": "0.0.1-alpha.6", "remix-solidity": "0.3.1", "remix-tests": "0.1.1", "remixd": "0.1.8-alpha.6", diff --git a/src/app.js b/src/app.js index c02555ee15..b2c13c71cc 100644 --- a/src/app.js +++ b/src/app.js @@ -409,8 +409,13 @@ Please make a backup of your contracts and start using http://remix.ethereum.org // TODOs those are instanciated before hand. should be instanciated on demand const pluginManagerComponent = new PluginManagerComponent() + const swapPanelComponent = new SwapPanelComponent() + const verticalIconComponent = new VerticalIconsComponent() + const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent) // eslint-disable-line + const verticalIconsApi = new VerticalIconsApi(verticalIconComponent) // eslint-disable-line + let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }) - const appManager = new RemixAppManager(appStore) + const appManager = new RemixAppManager(appStore, swapPanelApi, verticalIconsApi) registry.put({api: appManager.proxy(), name: 'pluginmanager'}) pluginManagerComponent.setApp(appManager) @@ -445,10 +450,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org { profile: run.profile(), api: run }, { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) - const swapPanelComponent = new SwapPanelComponent() - const verticalIconComponent = new VerticalIconsComponent() - const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent, appManager) // eslint-disable-line - const verticalIconsApi = new VerticalIconsApi(verticalIconComponent, appManager) // eslint-disable-line + appStore.addEntities(appManager.plugins()) swapPanelApi.event.on('toggle', () => { this._components.resizeFeature.panel1.clientWidth !== 0 ? this._components.resizeFeature.minimize() : this._components.resizeFeature.maximise() diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index 873ecea242..939f8a51d9 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -1,7 +1,7 @@ import EventEmmitter from 'events' class SwapPanelApi { - constructor (swapPanelComponent, verticalIconsComponent, appManager) { + constructor (swapPanelComponent, verticalIconsComponent) { this.event = new EventEmmitter() this.component = swapPanelComponent this.currentContent @@ -14,29 +14,18 @@ class SwapPanelApi { this.component.showContent(moduleName) this.currentContent = moduleName }) - appManager.event.on('requestContainer', (mod, content) => { - this.add(mod.name, content) - }) - appManager.event.on('removingItem', (mod) => { - this.remove(mod.name) - }) } /* content: DOM element by appManager */ - add (moduleName, content) { - // add the DOM to the swappanel - return this.component.add(moduleName, content) - } - - remove (moduleName) { - return this.component.remove(moduleName) + add (profile, content) { + return this.component.add(profile.name, content) } - reference (modulename, domElement) { - this.nodes[modulename] = domElement + remove (profile) { + return this.component.remove(profile.name) } } diff --git a/src/app/components/vertical-icons-api.js b/src/app/components/vertical-icons-api.js index 6710e510c0..e97614b9a1 100644 --- a/src/app/components/vertical-icons-api.js +++ b/src/app/components/vertical-icons-api.js @@ -1,10 +1,16 @@ // API class VerticalIconsApi { - constructor (verticalIconsComponent, appManager) { + constructor (verticalIconsComponent) { this.component = verticalIconsComponent - appManager.event.on('requestContainer', (mod, content) => verticalIconsComponent.addIcon(mod)) - appManager.event.on('removingItem', (mod) => verticalIconsComponent.removeIcon(mod)) + } + + addIcon (mod) { + this.component.addIcon(mod) + } + + removeIcon (mod) { + this.component.removeIcon(mod) } } module.exports = VerticalIconsApi diff --git a/src/remixAppManager.js b/src/remixAppManager.js index 7b3814cb9b..e6c375009e 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -1,12 +1,15 @@ -import { AppManagerApi } from 'remix-plugin' +import { AppManagerApi, Plugin } from 'remix-plugin' import { EventEmitter } from 'events' import PluginManagerProxy from './app/components/plugin-manager-proxy' export class RemixAppManager extends AppManagerApi { - constructor (store) { + constructor (store, swapPanelApi, verticalIconsApi) { super(null) this.store = store + this.verticalIconsApi = verticalIconsApi + this.swapPanelApi = swapPanelApi + this.hiddenNodes = {} this.event = new EventEmitter() this.data = { proxy: new PluginManagerProxy() @@ -21,9 +24,14 @@ export class RemixAppManager extends AppManagerApi { setActive (name, isActive) { const entity = this.getEntity(name) if (entity && entity.profile.icon && entity.api.render && typeof entity.api.render === 'function') { - isActive ? this.event.emit('requestContainer', entity.profile, entity.api.render()) - : this.event.emit('removingItem', entity.profile) + // here we have an internal module (it does not need to be rendered necessarily - "rendered" means pushed to the DOM) + // if it contains `render` function, we push the view to `resolveLocation` + isActive ? this.resolveLocation(entity.profile, entity.api.render()) + : this.removeComponent(entity.profile) } + // at this point, if it's an iframe plugin, it should have already been rendered (to the DOM) + // either using `location` in json profile or using the optionnal api in the `Plugin` class + // temp if (entity && name === 'SolidityCompile') { isActive ? this.data.proxy.register(entity.api) : this.data.proxy.unregister(entity.api) @@ -37,5 +45,40 @@ export class RemixAppManager extends AppManagerApi { addEntity (entity) { this.store.add(entity.profile.name, entity) + } + + resolveLocation (profile, domEl) { + // if there's an icon, we add to the swap panel + // if not we suppose it just need to be put to DOM (that would be) + if (profile.icon) { + this.swapPanelApi.add(profile, domEl) + this.verticalIconsApi.addIcon(profile) + return + } + this.hiddenNodes[profile.name] = domEl + document.body.appendChild(domEl) + } + + removeComponent (profile) { + if (profile.icon) { + this.swapPanelApi.remove(profile) + this.verticalIconsApi.removeIcon(profile) + return + } + let hiddenNode = this.hiddenNodes[profile.name] + if (hiddenNode) document.body.removeChild(hiddenNode) + } + + plugins () { + let ethDoc = { + name: 'ethdoc', + events: ['newDoc'], + methods: ['getdoc'], + notifications: { + 'solCompiler': ['getCompilationFinished'] + }, + url: 'https://ipfs.io/ipfs/Qmdu56TjQLMQmwitM6GRZXwvTWh8LBoNCWmoZbSzykPycJ/' + } + return [{ profile: ethDoc, api: new Plugin(ethDoc, { resolveLocaton: (iframe) => { return this.resolveLocation(ethDoc, iframe) } }) }] } } From 4837c8be98c61fe4f1b31a9ac40b10b0f23ade98 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 18:04:15 +0100 Subject: [PATCH 056/636] remix-plugin alpha.6 --- src/app.js | 64 ++++++++----------- .../components/plugin-manager-component.js | 2 + src/lib/store.js | 1 + 3 files changed, 31 insertions(+), 36 deletions(-) diff --git a/src/app.js b/src/app.js index b2c13c71cc..e9ddc6ef8f 100644 --- a/src/app.js +++ b/src/app.js @@ -413,7 +413,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const verticalIconComponent = new VerticalIconsComponent() const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent) // eslint-disable-line const verticalIconsApi = new VerticalIconsApi(verticalIconComponent) // eslint-disable-line - + let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }) const appManager = new RemixAppManager(appStore, swapPanelApi, verticalIconsApi) registry.put({api: appManager.proxy(), name: 'pluginmanager'}) @@ -421,6 +421,13 @@ Please make a backup of your contracts and start using http://remix.ethereum.org pluginManagerComponent.setApp(appManager) pluginManagerComponent.setStore(appStore) + self._components.editorpanel.init() + self._components.fileManager.init() + + self._view.mainpanel.appendChild(self._components.editorpanel.render()) + self._view.iconpanel.appendChild(verticalIconComponent.render()) + self._view.swappanel.appendChild(swapPanelComponent.render()) + let filePanel = new FilePanel() registry.put({api: filePanel, name: 'filepanel'}) let compileTab = new CompileTab(self._components.registry) @@ -433,49 +440,34 @@ Please make a backup of your contracts and start using http://remix.ethereum.org let sourceHighlighters = registry.get('editor').api.sourceHighlighters let configProvider = self._components.filesProviders['config'] - appStore.addEntities([ - { profile: this.profile(), api: this }, - { profile: udapp.profile(), api: udapp }, - { profile: fileManager.profile(), api: fileManager }, - { profile: sourceHighlighters.profile(), api: sourceHighlighters }, - { profile: configProvider.profile(), api: configProvider }, - { profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy }, - { profile: compileTab.profile(), api: compileTab }, - { profile: filePanel.profile(), api: filePanel }, - { profile: test.profile(), api: test }, - { profile: support.profile(), api: support }, - { profile: debug.profile(), api: debug }, - { profile: analysis.profile(), api: analysis }, - { profile: settings.profile(), api: settings }, - { profile: run.profile(), api: run }, - { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) - - appStore.addEntities(appManager.plugins()) + appManager.init([ + { profile: this.profile(), api: this }, + { profile: udapp.profile(), api: udapp }, + { profile: fileManager.profile(), api: fileManager }, + { profile: sourceHighlighters.profile(), api: sourceHighlighters }, + { profile: configProvider.profile(), api: configProvider }, + { profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy }, + { profile: compileTab.profile(), api: compileTab }, + { profile: filePanel.profile(), api: filePanel }, + { profile: support.profile(), api: support }, + { profile: settings.profile(), api: settings }, + { profile: run.profile(), api: run }, + { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) + + appManager.registerMany([ + { profile: debug.profile(), api: debug }, + { profile: analysis.profile(), api: analysis }, + { profile: test.profile(), api: test } + ]) + appManager.registerMany(appManager.plugins()) swapPanelApi.event.on('toggle', () => { this._components.resizeFeature.panel1.clientWidth !== 0 ? this._components.resizeFeature.minimize() : this._components.resizeFeature.maximise() }) swapPanelApi.event.on('showing', () => { this._components.resizeFeature.panel1.clientWidth === 0 ? this._components.resizeFeature.maximise() : '' }) - self._components.editorpanel.init() - self._components.fileManager.init() - self._view.mainpanel.appendChild(self._components.editorpanel.render()) - self._view.iconpanel.appendChild(verticalIconComponent.render()) - self._view.swappanel.appendChild(swapPanelComponent.render()) - appManager.activateOne('App') - appManager.activateOne('Udapp') - appManager.activateOne('FileManager') - appManager.activateOne('SourceHighlighters') - appManager.activateOne('config') - appManager.activateOne('TxListener') - appManager.activateOne('FilePanel') - appManager.activateOne('SolidityCompile') - appManager.activateOne('Run') - appManager.activateOne('PluginManager') - appManager.activateOne('Settings') - appManager.activateOne('Support') verticalIconComponent.select('FilePanel') diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 66259820c4..177625cb22 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -33,6 +33,8 @@ class PluginManagerComponent { this.store = store this.store.event.on('activate', (name) => { this.reRender() }) this.store.event.on('deactivate', (name) => { this.reRender() }) + this.store.event.on('add', (name) => { this.reRender() }) + this.store.event.on('remove', (name) => { this.reRender() }) } render () { diff --git a/src/lib/store.js b/src/lib/store.js index 972759c022..f5e527f671 100644 --- a/src/lib/store.js +++ b/src/lib/store.js @@ -133,6 +133,7 @@ export class EntityStore extends Store { add(id, entity) { this.state.entities[id] = entity this.state.ids.push(id) + this.event.emit('add', id, entity) } /** From 658a6ffdc8a12c830d5b88258f7bdb4180dc17c9 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 18:20:49 +0100 Subject: [PATCH 057/636] add description to module / plugin --- src/app.js | 9 +++------ src/app/components/plugin-manager-component.js | 9 +++++---- src/app/editor/SourceHighlighters.js | 5 +++-- src/app/files/browser-files-tree.js | 3 ++- src/app/files/fileManager.js | 5 +++-- src/app/panels/file-panel.js | 7 ++++--- src/app/tabs/compile-tab.js | 5 +++-- src/app/tabs/run-tab.js | 5 +++-- 8 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/app.js b/src/app.js index e9ddc6ef8f..ca13451448 100644 --- a/src/app.js +++ b/src/app.js @@ -180,8 +180,8 @@ class App { profile () { return { - name: 'App', - description: 'the app', + name: 'app', + description: 'provides information about current context (network).', methods: ['getExecutionContextProvider', 'getProviderEndpoint', 'detectNetWork', 'addProvider', 'removeProvider'] } } @@ -462,13 +462,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org appManager.registerMany(appManager.plugins()) swapPanelApi.event.on('toggle', () => { - this._components.resizeFeature.panel1.clientWidth !== 0 ? this._components.resizeFeature.minimize() : this._components.resizeFeature.maximise() + this._components.resizeFeature.panel1.clientWidth !== 0 ? this._components.resizeFeature.minimize() : this._components.resizeFeature.maximise() }) swapPanelApi.event.on('showing', () => { this._components.resizeFeature.panel1.clientWidth === 0 ? this._components.resizeFeature.maximise() : '' }) - - - verticalIconComponent.select('FilePanel') // The event listener needs to be registered as early as possible, because the diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 177625cb22..f6569da465 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -18,10 +18,11 @@ class PluginManagerComponent { profile () { return { - name: 'PluginManager', + name: 'plugin manager', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNzU1IDQ1M3EzNyAzOCAzNyA5MC41dC0zNyA5MC41bC00MDEgNDAwIDE1MCAxNTAtMTYwIDE2MHEtMTYzIDE2My0zODkuNSAxODYuNXQtNDExLjUtMTAwLjVsLTM2MiAzNjJoLTE4MXYtMTgxbDM2Mi0zNjJxLTEyNC0xODUtMTAwLjUtNDExLjV0MTg2LjUtMzg5LjVsMTYwLTE2MCAxNTAgMTUwIDQwMC00MDFxMzgtMzcgOTEtMzd0OTAgMzcgMzcgOTAuNS0zNyA5MC41bC00MDAgNDAxIDIzNCAyMzQgNDAxLTQwMHEzOC0zNyA5MS0zN3Q5MCAzN3oiLz48L3N2Zz4=' + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNzU1IDQ1M3EzNyAzOCAzNyA5MC41dC0zNyA5MC41bC00MDEgNDAwIDE1MCAxNTAtMTYwIDE2MHEtMTYzIDE2My0zODkuNSAxODYuNXQtNDExLjUtMTAwLjVsLTM2MiAzNjJoLTE4MXYtMTgxbDM2Mi0zNjJxLTEyNC0xODUtMTAwLjUtNDExLjV0MTg2LjUtMzg5LjVsMTYwLTE2MCAxNTAgMTUwIDQwMC00MDFxMzgtMzcgOTEtMzd0OTAgMzcgMzcgOTAuNS0zNyA5MC41bC00MDAgNDAxIDIzNCAyMzQgNDAxLTQwMHEzOC0zNyA5MS0zN3Q5MCAzN3oiLz48L3N2Zz4=', + description: 'allows starting / stopping services and plugins' } } @@ -58,7 +59,7 @@ class PluginManagerComponent { ` var modulesActive = this.store.getActives() - modulesActive.sort(function(a, b) { + modulesActive.sort(function (a, b) { var textA = a.profile.name.toUpperCase(); var textB = b.profile.name.toUpperCase(); return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; @@ -86,7 +87,7 @@ class PluginManagerComponent { const mod = this.store.getOne(item) if (!mod) return - let action = () => { + let action = () => { if (this.store.isActive(item)) { this.appManager.deactivateOne(item) } else { diff --git a/src/app/editor/SourceHighlighters.js b/src/app/editor/SourceHighlighters.js index 7c53ac19d7..fe05946ded 100644 --- a/src/app/editor/SourceHighlighters.js +++ b/src/app/editor/SourceHighlighters.js @@ -9,8 +9,9 @@ module.exports = class SourceHighlighters { profile () { return { - name: 'SourceHighlighters', - methods: ['highlight', 'discardHighlight'] + name: 'source highlighters', + methods: ['highlight', 'discardHighlight'], + description: 'allows plugins to use highlight feature of the code editor' } } diff --git a/src/app/files/browser-files-tree.js b/src/app/files/browser-files-tree.js index 54678e5110..431f06f9c9 100644 --- a/src/app/files/browser-files-tree.js +++ b/src/app/files/browser-files-tree.js @@ -134,7 +134,8 @@ function FilesTree (name, storage) { this.profile = function () { return { name: this.type, - methods: ['get', 'set', 'remove'] + methods: ['get', 'set', 'remove'], + description: 'allows using the config explorer without need of additionnal permission.' } } } diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 8f8e23d4bf..27af965ea0 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -52,9 +52,10 @@ class FileManager { profile () { return { - name: 'FileManager', + name: 'file manager', methods: ['getFilesFromPath', 'getCurrentFile', 'getFile', 'setFile'], - events: ['currentFileChanged'] + events: ['currentFileChanged'], + description: 'allow accessing / updating any files. Plugins need permissions to access this entire API or part of this API' } } diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index cb4716b5c8..08b182ecb0 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -69,7 +69,7 @@ function filepanel (localRegistry) { self._compilerMetadata.syncContractMetadata() self.compilerMetadata = () => { return self._compilerMetadata } - + function remixdDialog () { return yo`
@@ -194,10 +194,11 @@ function filepanel (localRegistry) { self.profile = function () { return { - name: 'FilePanel', + name: 'file panel', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNj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src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 13e4caac77..061d780768 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -185,10 +185,11 @@ module.exports = class CompileTab { } profile () { return { - name: 'SolidityCompile', + name: 'Solidity', methods: ['getCompilationResult'], events: ['compilationFinished'], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNDcyIDBxMjYgMCA0NSAxOXQxOSA0NXYxNjY0cTAgMjYtMTkgNDV0LTQ1IDE5aC0xMjgwcS0yNiAwLTQ1LTE5dC0xOS00NXYtMTY2NHEwLTI2IDE5LTQ1dDQ1LTE5aDEyODB6bS04MzIgMjg4djY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzdi02NHEwLTE0LTktMjN0LTIzLTloLTY0cS0xNCAwLTIzIDl0LTkgMjN6bTAgMjU2djY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzdi02NHEwLTE0LTktMjN0LTIzLTloLTY0cS0xNCAwLTIzIDl0LTkgMjN6bTAgMjU2djY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzdi02NHEwLTE0LTktMjN0LTIzLTloLTY0cS0xNCAwLTIzIDl0LTkgMjN6bTAgMjU2djY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzdi02NHEwLTE0LTktMjN0LTIzLTloLTY0cS0xNCAwLTIzIDl0LTkgMjN6bS0xMjggMzIwdi02NHEwLTE0LTktMjN0LTIzLTloLTY0cS0xNCAwLTIzIDl0LTkgMjN2NjRxMCAxNCA5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Y0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0yNTYgMTAyNHYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzeiIvPjwvc3ZnPg==', + description: 'compile solidity source code' } } addWarning (msg, settings) { diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 1a023a6dc2..90e64b1ad6 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -182,10 +182,11 @@ function runTab (opts, localRegistry) { render () { return container }, profile () { return { - name: 'Run', + name: 'Run Transactions', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjMwNCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjMwNCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMzAxIDEwMzZxMTIgMTAzLTIyIDE5OC41dC05OSAxNjMuNS0xNTguNSAxMDYtMTk2LjUgMzFxLTE2MS0xMS0yNzkuNS0xMjV0LTEzNC41LTI3NHEtMTItMTExIDI3LjUtMjEwLjV0MTE4LjUtMTcwLjVsLTcxLTEwN3EtOTYgODAtMTUxIDE5NHQtNTUgMjQ0cTAgMjctMTguNSA0Ni41dC00NS41IDE5LjVoLTMyNXEtMjMgMTY0LTE0OSAyNzR0LTI5NCAxMTBxLTE4NSAwLTMxNi41LTEzMS41dC0xMzEuNS0zMTYuNSAxMzEuNS0zMTYuNSAzMTYuNS0xMzEuNXE3NiAwIDE1MiAyN2wyNC00NXEtMTIzLTExMC0zMDQtMTEwaC02NHEtMjYgMC00NS0xOXQtMTktNDUgMTktNDUgNDUtMTloMTI4cTc4IDAgMTQ1IDEzLjV0MTE2LjUgMzguNSA3MS41IDM5LjUgNTEgMzYuNWg2MjdsLTg1LTEyOGgtMjIycS0zMCAwLTQ5LTIyLjV0LTE0LTUyLjVxNC0yMyAyMy0zOHQ0My0xNWgyNTNxMzMgMCA1MyAyOGw3MCAxMDUgMTE0LTExNHExOS0xOSA0Ni0xOWgxMDFxMjYgMCA0NSAxOXQxOSA0NXYxMjhxMCAyNi0xOSA0NXQtNDUgMTloLTE3OWwxMTUgMTcycTEzMS02MyAyNzUtMzYgMTQzIDI2IDI0NCAxMzQuNXQxMTggMjUzLjV6bS0xODU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41IDM5LjUgNTEgMzYuNWg2MjdsLTg1LTEyOGgtMjIycS0zMCAwLTQ5LTIyLjV0LTE0LTUyLjVxNC0yMyAyMy0zOHQ0My0xNWgyNTNxMzMgMCA1MyAyOGw3MCAxMDUgMTE0LTExNHExOS0xOSA0Ni0xOWgxMDFxMjYgMCA0NSAxOXQxOSA0NXYxMjhxMCAyNi0xOSA0NXQtNDUgMTloLTE3OWwxMTUgMTcycTEzMS02MyAyNzUtMzYgMTQzIDI2IDI0NCAxMzQuNXQxMTggMjUzLjV6bS0xODUzIDM3MnExMTUgMCAyMDMtNzIuNXQxMTEtMTgzLjVoLTMxNHEtMzUgMC01NS0zMS0xOC0zMi0xLTYzbDE0Ny0yNzdxLTQ3LTEzLTkxLTEzLTEzMiAwLTIyNiA5NHQtOTQgMjI2IDk0IDIyNiAyMjYgOTR6bTE0MDggMHExMzIgMCAyMjYtOTR0OTQtMjI2LTk0LTIyNi0yMjYtOTRxLTYwIDAtMTIxIDI0bDE3NCAyNjBxMTUgMjMgMTAgNDl0LTI3IDQwcS0xNSAxMS0zNiAxMS0zNSAwLTUzLTI5bC0xNzQtMjYwcS05MyA5NS05MyAyMjUgMCAxMzIgOTQgMjI2dDIyNiA5NHoiLz48L3N2Zz4=', + description: 'Execute and save transactions' } } } From c5aafbfacb8e3ef6f6d41de45de523d68352efd3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jan 2019 18:21:05 +0100 Subject: [PATCH 058/636] missing "this" for reference --- src/app/editor/SourceHighlighters.js | 8 ++++---- src/app/tabs/compile-tab.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/editor/SourceHighlighters.js b/src/app/editor/SourceHighlighters.js index fe05946ded..3764cff916 100644 --- a/src/app/editor/SourceHighlighters.js +++ b/src/app/editor/SourceHighlighters.js @@ -23,14 +23,14 @@ module.exports = class SourceHighlighters { } catch (e) { return cb(e.message) } - if (!highlighters[mod]) highlighters[mod] = new SourceHighlighter() - highlighters[mod].currentSourceLocation(null) - highlighters[mod].currentSourceLocationFromfileName(position, filePath, hexColor) + if (!this.highlighters[mod]) this.highlighters[mod] = new SourceHighlighter() + this.highlighters[mod].currentSourceLocation(null) + this.highlighters[mod].currentSourceLocationFromfileName(position, filePath, hexColor) cb() } discardHighlight (mod, cb) { - if (highlighters[mod]) highlighters[mod].currentSourceLocation(null) + if (this.highlighters[mod]) this.highlighters[mod].currentSourceLocation(null) cb() } } diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 061d780768..c265f7d03f 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -181,7 +181,7 @@ module.exports = class CompileTab { }) } getCompilationResult (cb) { - cb(null, self._components.compiler.lastCompilationResult) + cb(null, this._components.compiler.lastCompilationResult) } profile () { return { From 1022b91a3916d492cb412d49c555269f336a5c2c Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jan 2019 09:52:28 +0100 Subject: [PATCH 059/636] fix adding / removing content --- src/app/components/swap-panel-component.js | 6 +++--- src/app/components/vertical-icons-component.js | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index 49f3ddfd6f..d17a11665c 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -27,13 +27,13 @@ class SwapPanelComponent { } add (moduleName, content) { - this.contents[moduleName] = yo`
${content}
` + this.contents[moduleName] = yo`
${content}
` this.view.appendChild(this.contents[moduleName]) } remove (moduleName) { - var el = this.view.querySelector(`div#${moduleName}Content`) - el.parentElement.removeChild(el) + let el = this.contents[moduleName] + if (el) el.parentElement.removeChild(el) } render () { diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index b2011f2472..82afd2ac72 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -12,16 +12,18 @@ class VerticalIconComponent { constructor () { this.event = new EventEmmitter() + this.icons = {} } addIcon (mod) { let self = this - this.view.appendChild(yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
`) + this.icons[mod.name] = yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
` + this.view.appendChild(this.icons[mod.name]) } removeIcon (mod) { - var el = this.view.querySelector(`#${mod.name}Icon`) - el.parentElement.removeChild(el) + let el = this.icons[mod.name] + if (el) el.parentElement.removeChild(el) } select (name) { From da2b4f0d7ddc143b67819ada8379fa91d055d0a4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jan 2019 09:52:40 +0100 Subject: [PATCH 060/636] add description / change name --- src/app.js | 7 ++++--- src/app/components/plugin-manager-component.js | 2 +- src/app/editor/SourceHighlighters.js | 2 +- src/app/files/browser-files-tree.js | 2 +- src/app/files/fileManager.js | 2 +- src/app/panels/file-panel.js | 4 ++-- src/app/tabs/analysis-tab.js | 7 ++++--- src/app/tabs/compile-tab.js | 4 ++-- src/app/tabs/debugger-tab.js | 5 +++-- src/app/tabs/run-tab.js | 4 ++-- src/app/tabs/settings-tab.js | 7 ++++--- src/app/tabs/support-tab.js | 5 +++-- src/app/tabs/test-tab.js | 7 ++++--- src/remixAppManager.js | 5 +++-- src/universal-dapp.js | 5 +++-- 15 files changed, 38 insertions(+), 30 deletions(-) diff --git a/src/app.js b/src/app.js index ca13451448..5566c76fdc 100644 --- a/src/app.js +++ b/src/app.js @@ -181,7 +181,7 @@ class App { profile () { return { name: 'app', - description: 'provides information about current context (network).', + description: 'service - provides information about current context (network).', methods: ['getExecutionContextProvider', 'getProviderEndpoint', 'detectNetWork', 'addProvider', 'removeProvider'] } } @@ -371,8 +371,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org event: new EventEmitter(), profile () { return { - name: 'TxListener', - events: ['newTransaction'] + name: 'transaction listener', + events: ['newTransaction'], + description: 'service - notify new transactions' } } } diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index f6569da465..0b24721659 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -22,7 +22,7 @@ class PluginManagerComponent { methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNzU1IDQ1M3EzNyAzOCAzNyA5MC41dC0zNyA5MC41bC00MDEgNDAwIDE1MCAxNTAtMTYwIDE2MHEtMTYzIDE2My0zODkuNSAxODYuNXQtNDExLjUtMTAwLjVsLTM2MiAzNjJoLTE4MXYtMTgxbDM2Mi0zNjJxLTEyNC0xODUtMTAwLjUtNDExLjV0MTg2LjUtMzg5LjVsMTYwLTE2MCAxNTAgMTUwIDQwMC00MDFxMzgtMzcgOTEtMzd0OTAgMzcgMzcgOTAuNS0zNyA5MC41bC00MDAgNDAxIDIzNCAyMzQgNDAxLTQwMHEzOC0zNyA5MS0zN3Q5MCAzN3oiLz48L3N2Zz4=', - description: 'allows starting / stopping services and plugins' + description: 'start/stop services, modules and plugins' } } diff --git a/src/app/editor/SourceHighlighters.js b/src/app/editor/SourceHighlighters.js index 3764cff916..d484f04689 100644 --- a/src/app/editor/SourceHighlighters.js +++ b/src/app/editor/SourceHighlighters.js @@ -11,7 +11,7 @@ module.exports = class SourceHighlighters { return { name: 'source highlighters', methods: ['highlight', 'discardHighlight'], - description: 'allows plugins to use highlight feature of the code editor' + description: 'service - highlight source code' } } diff --git a/src/app/files/browser-files-tree.js b/src/app/files/browser-files-tree.js index 431f06f9c9..4482155201 100644 --- a/src/app/files/browser-files-tree.js +++ b/src/app/files/browser-files-tree.js @@ -135,7 +135,7 @@ function FilesTree (name, storage) { return { name: this.type, methods: ['get', 'set', 'remove'], - description: 'allows using the config explorer without need of additionnal permission.' + description: 'service - read/write file to the `config` explorer without need of additionnal permission.' } } } diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 27af965ea0..0d4a1809c0 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -55,7 +55,7 @@ class FileManager { name: 'file manager', methods: ['getFilesFromPath', 'getCurrentFile', 'getFile', 'setFile'], events: ['currentFileChanged'], - description: 'allow accessing / updating any files. Plugins need permissions to access this entire API or part of this API' + description: 'service - read/write to any files or folders, require giving permissions' } } diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index 08b182ecb0..21d560165a 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -194,11 +194,11 @@ function filepanel (localRegistry) { self.profile = function () { return { - name: 'file panel', + name: 'file explorers', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNjgtNDAgMTI4LTQwaDQxNnptLTU0NCAyMTNsLTI5OSAyOTloMjk5di0yOTl6bS02NDAtMzg0bC0yOTkgMjk5aDI5OXYtMjk5em0xOTYgNjQ3bDMxNi0zMTZ2LTQxNmgtMzg0djQxNnEwIDQwLTI4IDY4dC02OCAyOGgtNDE2djY0MGg1MTJ2LTI1NnEwLTQwIDIwLTg4dDQ4LTc2em05NTYgODA0di0xMTUyaC0zODR2NDE2cTAgNDAtMjggNjh0LTY4IDI4aC00MTZ2NjQwaDg5NnoiLz48L3N2Zz4=', - description: 'register the file explorers panel' + description: ' - ' } } diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index 19ec95f330..a5cd12ddd4 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -17,12 +17,13 @@ module.exports = class AnalysisTab { } profile () { return { - name: 'SolidityAnalysis', + name: 'solidity static analysis', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjA0OCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjA0OCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMDQ4IDE1MzZ2MTI4aC0yMDQ4di0xNTM2aDEyOHYxNDA4aDE5MjB6bS0xMjgtMTI0OHY0MzVxMCAyMS0xOS41IDI5LjV0LTM1LjUtNy41bC0xMjEtMTIxLTYzMyA2MzNxLTEwIDEwLTIzIDEwdC0yMy0xMGwtMjMzLTIzMy00MTYgNDE2LTE5Mi0xOTIgNTg1LTU4NXExMC0xMCAyMy0xMHQyMyAxMGwyMzMgMjMzIDQ2NC00NjQtMTIxLTEyMXEtMTYtMTYtNy41LTM1LjV0MjkuNS0xOS41aDQzNXExNCAwIDIzIDl0OSAyM3oiLz48L3N2Zz4=' + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjA0OCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjA0OCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMDQ4IDE1MzZ2MTI4aC0yMDQ4di0xNTM2aDEyOHYxNDA4aDE5MjB6bS0xMjgtMTI0OHY0MzVxMCAyMS0xOS41IDI5LjV0LTM1LjUtNy41bC0xMjEtMTIxLTYzMyA2MzNxLTEwIDEwLTIzIDEwdC0yMy0xMGwtMjMzLTIzMy00MTYgNDE2LTE5Mi0xOTIgNTg1LTU4NXExMC0xMCAyMy0xMHQyMyAxMGwyMzMgMjMzIDQ2NC00NjQtMTIxLTEyMXEtMTYtMTYtNy41LTM1LjV0MjkuNS0xOS41aDQzNXExNCAwIDIzIDl0OSAyM3oiLz48L3N2Zz4=', + description: ' - ' } - } + } render () { const self = this var staticanalysis = new StaticAnalysis() diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index c265f7d03f..c96e4d037b 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -185,11 +185,11 @@ module.exports = class CompileTab { } profile () { return { - name: 'Solidity', + name: 'solidity', methods: ['getCompilationResult'], events: ['compilationFinished'], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNDcyIDBxMjYgMCA0NSAxOXQxOSA0NXYxNjY0cTAgMjYtMTkgNDV0LTQ1IDE5aC0xMjgwcS0yNiAwLTQ1LTE5dC0xOS00NXYtMTY2NHEwLTI2IDE5LTQ1dDQ1LTE5aDEyODB6bS04MzIgMjg4djY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzdi02NHEwLTE0LTktMjN0LTIzLTloLTY0cS0xNCAwLTIzIDl0LTkgMjN6bTAgM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IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0yNTYgMTAyNHYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzem0wLTI1NnYtNjRxMC0xNC05LTIzdC0yMy05aC02NHEtMTQgMC0yMyA5dC05IDIzdjY0cTAgMTQgOSAyM3QyMyA5aDY0cTE0IDAgMjMtOXQ5LTIzeiIvPjwvc3ZnPg==', - description: 'compile solidity source code' + description: 'compile solidity contracts' } } addWarning (msg, settings) { diff --git a/src/app/tabs/debugger-tab.js b/src/app/tabs/debugger-tab.js index d245bbea35..09bc3e1c97 100644 --- a/src/app/tabs/debugger-tab.js +++ b/src/app/tabs/debugger-tab.js @@ -29,10 +29,11 @@ class DebuggerTab { profile () { return { - name: 'Debugger', + name: 'debugger', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDk2MHEwIDI2LTE5IDQ1dC00NSAxOWgtMjI0cTAgMTcxLTY3IDI5MGwyMDggMjA5cTE5IDE5IDE5IDQ1dC0xOSA0NXEtMTggMTktNDUgMTl0LTQ1LTE5bC0xOTgtMTk3cS01IDUtMTUgMTN0LTQyIDI4LjUtNjUgMzYuNS04MiAyOS05NyAxM3YtODk2aC0xMjh2ODk2cS01MSAwLTEwMS41LTEzLjV0LTg3LTMzLTY2LTM5LTQzLjUtMzIuNWwtMTUtMTQtMTgzIDIwN3EtMjAgMjEtNDggMjEtMjQgMC00My0xNi0xOS0xOC0yMC41LTQ0LjV0MTUuNS00Ni41bDIwMi0yMjdxLTU4LTExNC01OC0yNzRoLTIyNHEtMjYgMC00NS0xOXQtMTktNDUgMTktNDUgNDUtMTloMjI0di0yOTRsLTE3My0xNzNxLTE5LTE5LTE5LTQ1dDE5LTQ1IDQ1LTE5IDQ1IDE5bDE3MyAxNzNoODQ0bDE3My0xNzNxMTktMTkgNDUtMTl0NDUgMTkgMTkgNDUtMTkgNDVsLTE3MyAxNzN2Mjk0aDIyNHEyNiAwIDQ1IDE5dDE5IDQ1em0tNDgwLTU3NmgtNjQwcTAtMTMzIDkzLjUtMjI2LjV0MjI2LjUtOTMuNSAyMjYuNSA5My41IDkzLjUgMjI2LjV6Ii8+PC9zdmc+' + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDk2MHEwIDI2LTE5IDQ1dC00NSAxOWgtMjI0cTAgMTcxLTY3IDI5MGwyMDggMjA5cTE5IDE5IDE5IDQ1dC0xOSA0NXEtMTggMTktNDUgMTl0LTQ1LTE5bC0xOTgtMTk3cS01IDUtMTUgMTN0LTQyIDI4LjUtNjUgMzYuNS04MiAyOS05NyAxM3YtODk2aC0xMjh2ODk2cS01MSAwLTEwMS41LTEzLjV0LTg3LTMzLTY2LTM5LTQzLjUtMzIuNWwtMTUtMTQtMTgzIDIwN3EtMjAgMjEtNDggMjEtMjQgMC00My0xNi0xOS0xOC0yMC41LTQ0LjV0MTUuNS00Ni41bDIwMi0yMjdxLTU4LTExNC01OC0yNzRoLTIyNHEtMjYgMC00NS0xOXQtMTktNDUgMTktNDUgNDUtMTloMjI0di0yOTRsLTE3My0xNzNxLTE5LTE5LTE5LTQ1dDE5LTQ1IDQ1LTE5IDQ1IDE5bDE3MyAxNzNoODQ0bDE3My0xNzNxMTktMTkgNDUtMTl0NDUgMTkgMTkgNDUtMTkgNDVsLTE3MyAxNzN2Mjk0aDIyNHEyNiAwIDQ1IDE5dDE5IDQ1em0tNDgwLTU3NmgtNjQwcTAtMTMzIDkzLjUtMjI2LjV0MjI2LjUtOTMuNSAyMjYuNSA5My41IDkzLjUgMjI2LjV6Ii8+PC9zdmc+', + description: 'debug transactions' } } diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 90e64b1ad6..474b872116 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -182,11 +182,11 @@ function runTab (opts, localRegistry) { render () { return container }, profile () { return { - name: 'Run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zMS0xOC0zMi0xLTYzbDE0Ny0yNzdxLTQ3LTEzLTkxLTEzLTEzMiAwLTIyNiA5NHQtOTQgMjI2IDk0IDIyNiAyMjYgOTR6bTE0MDggMHExMzIgMCAyMjYtOTR0OTQtMjI2LTk0LTIyNi0yMjYtOTRxLTYwIDAtMTIxIDI0bDE3NCAyNjBxMTUgMjMgMTAgNDl0LTI3IDQwcS0xNSAxMS0zNiAxMS0zNSAwLTUzLTI5bC0xNzQtMjYwcS05MyA5NS05MyAyMjUgMCAxMzIgOTQgMjI2dDIyNiA5NHoiLz48L3N2Zz4=', - description: 'Execute and save transactions' + description: 'execute and save transactions' } } } diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 5d9ab1875e..7b02a5c803 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -40,12 +40,13 @@ module.exports = class SettingsTab { } profile () { return { - name: 'Settings', + name: 'settings', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMTUyIDg5NnEwLTEwNi03NS0xODF0LTE4MS03NS0xODEgNzUtNzUgMTgxIDc1IDE4MSAxODEgNzUgMTgxLTc1IDc1LTE4MXptNTEyLTEwOXYyMjJxMCAxMi04IDIzdC0yMCAxM2wtMTg1IDI4cS0xOSA1NC0zOSA5MSAzNSA1MCAxMDcgMTM4IDEwIDEyIDEwIDI1dC05IDIzcS0yNyAzNy05OSAxMDh0LTk0IDcxcS0xMiAwLTI2LTlsLTEzOC0xMDhxLTQ0IDIzLTkxIDM4LTE2IDEzNi0yOSAxODYtNyAyOC0zNiAyOGgtMjIycS0xNCAwLTI0LjUtOC41d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IDEwIDEyIDEwIDI1dC05IDIzcS0yNyAzNy05OSAxMDh0LTk0IDcxcS0xMiAwLTI2LTlsLTEzOC0xMDhxLTQ0IDIzLTkxIDM4LTE2IDEzNi0yOSAxODYtNyAyOC0zNiAyOGgtMjIycS0xNCAwLTI0LjUtOC41dC0xMS41LTIxLjVsLTI4LTE4NHEtNDktMTYtOTAtMzdsLTE0MSAxMDdxLTEwIDktMjUgOS0xNCAwLTI1LTExLTEyNi0xMTQtMTY1LTE2OC03LTEwLTctMjMgMC0xMiA4LTIzIDE1LTIxIDUxLTY2LjV0NTQtNzAuNXEtMjctNTAtNDEtOTlsLTE4My0yN3EtMTMtMi0yMS0xMi41dC04LTIzLjV2LTIyMnEwLTEyIDgtMjN0MTktMTNsMTg2LTI4cTE0LTQ2IDM5LTkyLTQwLTU3LTEwNy0xMzgtMTAtMTItMTAtMjQgMC0xMCA5LTIzIDI2LTM2IDk4LjUtMTA3LjV0OTQuNS03MS41cTEzIDAgMjYgMTBsMTM4IDEwN3E0NC0yMyA5MS0zOCAxNi0xMzYgMjktMTg2IDctMjggMzYtMjhoMjIycTE0IDAgMjQuNSA4LjV0MTEuNSAyMS41bDI4IDE4NHE0OSAxNiA5MCAzN2wxNDItMTA3cTktOSAyNC05IDEzIDAgMjUgMTAgMTI5IDExOSAxNjUgMTcwIDcgOCA3IDIyIDAgMTItOCAyMy0xNSAyMS01MSA2Ni41dC01NCA3MC41cTI2IDUwIDQxIDk4bDE4MyAyOHExMyAyIDIxIDEyLjV0OCAyMy41eiIvPjwvc3ZnPg==', + description: ' - ' } - } + } render () { const self = this if (self._view.el) return self._view.el diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index 06ef2026e4..a112259e43 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -33,9 +33,10 @@ module.exports = class SupportTab { name: 'Support', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGlu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DQgMTkycTAtMjYtMTktNDV0LTQ1LTE5LTQ1IDE5LTE5IDQ1IDE5IDQ1IDQ1IDE5IDQ1LTE5IDE5LTQ1em04OTYtMzJ2MzIwcTAgMTYtMTIgMjUtOCA3LTIwIDctNCAwLTctMWwtNDQ4LTk2cS0xMS0yLTE4LTExdC03LTIwaC0yNTZ2MTAycTExMSAyMyAxODMuNSAxMTF0NzIuNSAyMDN2ODAwcTAgMjYtMTkgNDV0LTQ1IDE5aC01MTJxLTI2IDAtNDUtMTl0LTE5LTQ1di04MDBxMC0xMDYgNjIuNS0xOTAuNXQxNjEuNS0xMTQuNXYtMTExaC0zMnEtNTkgMC0xMTUgMjMuNXQtOTEuNSA1My02NiA2Ni41LTQwLjUgNTMuNS0xNCAyNC41cS0xNyAzNS01NyAzNS0xNiAwLTI5LTctMjMtMTItMzEuNS0zN3QzLjUtNDlxNS0xMCAxNC41LTI2dDM3LjUtNTMuNSA2MC41LTcwIDg1LTY3IDEwOC41LTUyLjVxLTI1LTQyLTI1LTg2IDAtNjYgNDctMTEzdDExMy00NyAxMTMgNDcgNDcgMTEzcTAgMzMtMTQgNjRoMzAycTAtMTEgNy0yMHQxOC0xMWw0NDgtOTZxMy0xIDctMSAxMiAwIDIwIDcgMTIgOSAxMiAyNXoiLz48L3N2Zz4=', + description: 'help center' } - } + } render () { const self = this if (self._view.el) return self._view.el diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index bc222136a0..c4bd9b3d1c 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -25,12 +25,13 @@ module.exports = class TestTab { } profile () { return { - name: 'Solidity Unit Testing', + name: 'solidity unit testing', methods: [], events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjMwNCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjMwNCAxNzkyIiB4bWxucz0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uNSAxMDItMTg0IDU2LTEwMHExOC0zMyA1Ni0zM3Q1NiAzM3E0IDcgNTYgMTAwdDEwMiAxODQgMTA3IDE5NS41IDkyIDE3NC41IDM1IDgxem0tMTI4MCAwcTAgNzMtNDYuNSAxMzF0LTExNy41IDkxLTE0NC41IDQ5LjUtMTM5LjUgMTYuNS0xMzkuNS0xNi41LTE0NC41LTQ5LjUtMTE3LjUtOTEtNDYuNS0xMzFxMC0xMSAzNS04MXQ5Mi0xNzQuNSAxMDctMTk1LjUgMTAyLTE4NCA1Ni0xMDBxMTgtMzMgNTYtMzN0NTYgMzNxNCA3IDU2IDEwMHQxMDIgMTg0IDEwNyAxOTUuNSA5MiAxNzQuNSAzNSA4MXoiLz48L3N2Zz4=', + description: ' - ' } - } + } render () { const self = this var testsOutput = yo`` diff --git a/src/remixAppManager.js b/src/remixAppManager.js index e6c375009e..76205e946d 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -71,13 +71,14 @@ export class RemixAppManager extends AppManagerApi { plugins () { let ethDoc = { - name: 'ethdoc', + name: 'eth doc', events: ['newDoc'], methods: ['getdoc'], notifications: { 'solCompiler': ['getCompilationFinished'] }, - url: 'https://ipfs.io/ipfs/Qmdu56TjQLMQmwitM6GRZXwvTWh8LBoNCWmoZbSzykPycJ/' + url: 'https://ipfs.io/ipfs/Qmdu56TjQLMQmwitM6GRZXwvTWh8LBoNCWmoZbSzykPycJ/', + description: 'generate solidity documentation' } return [{ profile: ethDoc, api: new Plugin(ethDoc, { resolveLocaton: (iframe) => { return this.resolveLocation(ethDoc, iframe) } }) }] } diff --git a/src/universal-dapp.js b/src/universal-dapp.js index aa6afa5300..16b2e334a0 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -31,8 +31,9 @@ function UniversalDApp (registry) { UniversalDApp.prototype.profile = function () { return { - name: 'Udapp', - methods: ['runTestTx', 'getAccounts', 'createVMAccount'] + name: 'universal dapp', + methods: ['runTestTx', 'getAccounts', 'createVMAccount'], + description: 'service - run transaction and access account' } } From 3397572dbdb7ed759222f2c811acc2fc7a913793 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jan 2019 09:54:18 +0100 Subject: [PATCH 061/636] fix missing reference --- src/universal-dapp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 16b2e334a0..2ef132514c 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -238,7 +238,7 @@ UniversalDApp.prototype.runTestTx = function (tx, cb) { if (network.name === 'Main' && network.id === '1') { return cb('It is not allowed to make this action against mainnet') } - udapp.silentRunTx(tx, (error, result) => { + this.silentRunTx(tx, (error, result) => { if (error) return cb(error) cb(null, { transactionHash: result.transactionHash, From 2ba81c0959a5be50663a63b37cb184e154648a57 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jan 2019 09:54:26 +0100 Subject: [PATCH 062/636] standard --- src/app.js | 4 ++-- src/app/components/plugin-manager-component.js | 8 ++++---- src/app/components/vertical-icons-component.js | 2 +- src/app/tabs/debugger-tab.js | 2 +- src/remixAppManager.js | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app.js b/src/app.js index 5566c76fdc..4443ad9743 100644 --- a/src/app.js +++ b/src/app.js @@ -414,7 +414,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const verticalIconComponent = new VerticalIconsComponent() const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconComponent) // eslint-disable-line const verticalIconsApi = new VerticalIconsApi(verticalIconComponent) // eslint-disable-line - + let appStore = new EntityStore('module', { actives: [], ids: [], entities: {} }) const appManager = new RemixAppManager(appStore, swapPanelApi, verticalIconsApi) registry.put({api: appManager.proxy(), name: 'pluginmanager'}) @@ -456,7 +456,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) appManager.registerMany([ - { profile: debug.profile(), api: debug }, + { profile: debug.profile(), api: debug }, { profile: analysis.profile(), api: analysis }, { profile: test.profile(), api: test } ]) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 0b24721659..de7c79b0bc 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -9,7 +9,7 @@ const EventEmitter = require('events') class PluginManagerComponent { constructor () { - this.event = new EventEmitter() + this.event = new EventEmitter() this.views = { root: null, items: {} @@ -60,9 +60,9 @@ class PluginManagerComponent { var modulesActive = this.store.getActives() modulesActive.sort(function (a, b) { - var textA = a.profile.name.toUpperCase(); - var textB = b.profile.name.toUpperCase(); - return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + var textA = a.profile.name.toUpperCase() + var textB = b.profile.name.toUpperCase() + return (textA < textB) ? -1 : (textA > textB) ? 1 : 0 }) modulesActive.forEach((mod) => { diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index 82afd2ac72..33e8b0d437 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -17,7 +17,7 @@ class VerticalIconComponent { addIcon (mod) { let self = this - this.icons[mod.name] = yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
` + this.icons[mod.name] = yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
` this.view.appendChild(this.icons[mod.name]) } diff --git a/src/app/tabs/debugger-tab.js b/src/app/tabs/debugger-tab.js index 09bc3e1c97..3bf234f83c 100644 --- a/src/app/tabs/debugger-tab.js +++ b/src/app/tabs/debugger-tab.js @@ -35,7 +35,7 @@ class DebuggerTab { icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDk2MHEwIDI2LTE5IDQ1dC00NSAxOWgtMjI0cTAgMTcxLTY3IDI5MGwyMDggMjA5cTE5IDE5IDE5IDQ1dC0xOSA0NXEtMTggMTktNDUgMTl0LTQ1LTE5bC0xOTgtMTk3cS01IDUtMTUgMTN0LTQyIDI4LjUtNjUgMzYuNS04MiAyOS05NyAxM3YtODk2aC0xMjh2ODk2cS01MSAwLTEwMS41LTEzLjV0LTg3LTMzLTY2LTM5LTQzLjUtMzIuNWwtMTUtMTQtMTgzIDIwN3EtMjAgMjEtNDggMjEtMjQgMC00My0xNi0xOS0xOC0yMC41LTQ0LjV0MTUuNS00Ni41bDIwMi0yMjdxLTU4LTExNC01OC0yNzRoLTIyNHEtMjYgMC00NS0xOXQtMTktNDUgMTktNDUgNDUtMTloMjI0di0yOTRsLTE3My0xNzNxLTE5LTE5LTE5LTQ1dDE5LTQ1IDQ1LTE5IDQ1IDE5bDE3MyAxNzNoODQ0bDE3My0xNzNxMTktMTkgNDUtMTl0NDUgMTkgMTkgNDUtMTkgNDVsLTE3MyAxNzN2Mjk0aDIyNHEyNiAwIDQ1IDE5dDE5IDQ1em0tNDgwLTU3NmgtNjQwcTAtMTMzIDkzLjUtMjI2LjV0MjI2LjUtOTMuNSAyMjYuNSA5My41IDkzLjUgMjI2LjV6Ii8+PC9zdmc+', description: 'debug transactions' } - } + } render () { const self = this diff --git a/src/remixAppManager.js b/src/remixAppManager.js index 76205e946d..b58bd212b3 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -31,7 +31,7 @@ export class RemixAppManager extends AppManagerApi { } // at this point, if it's an iframe plugin, it should have already been rendered (to the DOM) // either using `location` in json profile or using the optionnal api in the `Plugin` class - + // temp if (entity && name === 'SolidityCompile') { isActive ? this.data.proxy.register(entity.api) : this.data.proxy.unregister(entity.api) @@ -45,7 +45,7 @@ export class RemixAppManager extends AppManagerApi { addEntity (entity) { this.store.add(entity.profile.name, entity) - } + } resolveLocation (profile, domEl) { // if there's an icon, we add to the swap panel @@ -53,7 +53,7 @@ export class RemixAppManager extends AppManagerApi { if (profile.icon) { this.swapPanelApi.add(profile, domEl) this.verticalIconsApi.addIcon(profile) - return + return } this.hiddenNodes[profile.name] = domEl document.body.appendChild(domEl) From 83d66768b40f833086fc4ae7065708a608dd2d1e Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jan 2019 10:04:49 +0100 Subject: [PATCH 063/636] typo --- src/app/tabs/support-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index a112259e43..d36580f1be 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -30,7 +30,7 @@ module.exports = class SupportTab { } profile () { return { - name: 'Support', + name: 'support', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03MDQgMTkycTAtMjYtMTktNDV0LTQ1LTE5LTQ1IDE5LTE5IDQ1IDE5IDQ1IDQ1IDE5IDQ1LTE5IDE5LTQ1em04OTYtMzJ2MzIwcTAgMTYtMTIgMjUtOCA3LTIwIDctNCAwLTctMWwtNDQ4LTk2cS0xMS0yLTE4LTExdC03LTIwaC0yNTZ2MTAycTExMSAyMyAxODMuNSAxMTF0NzIuNSAyMDN2ODAwcTAgMjYtMTkgNDV0LTQ1IDE5aC01MTJxLTI2IDAtNDUtMTl0LTE5LTQ1di04MDBxMC0xMDYgNjIuNS0xOTAuNXQxNjEuNS0xMTQuNXYtMTExaC0zMnEtNTkgMC0xMTUgMjMuNXQtOTEuNSA1My02NiA2Ni41LTQwLjUgNTMuNS0xNCAyNC41cS0xNyAzNS01NyAzNS0xNiAwLTI5LTctMjMtMTItMzEuNS0zN3QzLjUtNDlxNS0xMCAxNC41LTI2dDM3LjUtNTMuNSA2MC41LTcwIDg1LTY3IDEwOC41LTUyLjVxLTI1LTQyLTI1LTg2IDAtNjYgNDctMTEzdDExMy00NyAxMTMgNDcgNDcgMTEzcTAgMzMtMTQgNjRoMzAycTAtMTEgNy0yMHQxOC0xMWw0NDgtOTZxMy0xIDctMSAxMiAwIDIwIDcgMTIgOSAxMiAyNXoiLz48L3N2Zz4=', From 5b9221a77e7ea21252a8f1dfb766ca783baef859 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jan 2019 10:47:48 +0100 Subject: [PATCH 064/636] fix selecting default panel --- src/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.js b/src/app.js index 4443ad9743..a178155d95 100644 --- a/src/app.js +++ b/src/app.js @@ -467,7 +467,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org }) swapPanelApi.event.on('showing', () => { this._components.resizeFeature.panel1.clientWidth === 0 ? this._components.resizeFeature.maximise() : '' }) - verticalIconComponent.select('FilePanel') + verticalIconComponent.select('file explorers') // The event listener needs to be registered as early as possible, because the // parent will send the message upon the "load" event. From 7767f5644ddec2a007d93129e526850670da4f0c Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jan 2019 10:48:10 +0100 Subject: [PATCH 065/636] don't activate solidity and run by default --- src/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.js b/src/app.js index a178155d95..6fb4a4b4cf 100644 --- a/src/app.js +++ b/src/app.js @@ -448,14 +448,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org { profile: sourceHighlighters.profile(), api: sourceHighlighters }, { profile: configProvider.profile(), api: configProvider }, { profile: txListenerModuleProxy.profile(), api: txListenerModuleProxy }, - { profile: compileTab.profile(), api: compileTab }, { profile: filePanel.profile(), api: filePanel }, { profile: support.profile(), api: support }, { profile: settings.profile(), api: settings }, - { profile: run.profile(), api: run }, { profile: pluginManagerComponent.profile(), api: pluginManagerComponent }]) appManager.registerMany([ + { profile: compileTab.profile(), api: compileTab }, + { profile: run.profile(), api: run }, { profile: debug.profile(), api: debug }, { profile: analysis.profile(), api: analysis }, { profile: test.profile(), api: test } From 43c8ab528943c0cc9e135c8ea3f32cc7b3b8756b Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jan 2019 10:48:28 +0100 Subject: [PATCH 066/636] remix-plugjn alpha.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 612b96d0e3..efa0d1924c 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "remix-analyzer": "0.3.1", "remix-debug": "0.3.1", "remix-lib": "0.4.1", - "remix-plugin": "0.0.1-alpha.6", + "remix-plugin": "0.0.1-alpha.7", "remix-solidity": "0.3.1", "remix-tests": "0.1.1", "remixd": "0.1.8-alpha.6", From f1b7def9916bd94d8a6a1b1602db6433101ce6ad Mon Sep 17 00:00:00 2001 From: LeviBarnes Date: Thu, 17 Jan 2019 01:05:38 -0800 Subject: [PATCH 067/636] Record timestamps of contracts passed as arguments --- src/app/tabs/runTab/model/recorder.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/tabs/runTab/model/recorder.js b/src/app/tabs/runTab/model/recorder.js index 747aab6e5a..2f8a7a67e4 100644 --- a/src/app/tabs/runTab/model/recorder.js +++ b/src/app/tabs/runTab/model/recorder.js @@ -54,6 +54,11 @@ class Recorder { record.name = payLoad.funAbi.name record.inputs = txHelper.serializeInputs(payLoad.funAbi) record.type = payLoad.funAbi.type + for (var p in record.parameters) { + var thisarg = record.parameters[p] + var thistimestamp = this.data._createdContracts[thisarg] + if (thistimestamp) record.parameters[p] = `created{${thistimestamp}}` + } this.udapp.getAccounts((error, accounts) => { if (error) return console.log(error) From ba9f2772b41bbbb3b43a9bab6bfef4ac2c5488ea Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 14 Jan 2019 18:48:00 -0500 Subject: [PATCH 068/636] move tabbed menu styles --- src/app/tabs/styles/tabbed-menu-styles.js | 42 ++++++++++++++++++++++ src/app/tabs/tabbed-menu.js | 43 ++--------------------- 2 files changed, 45 insertions(+), 40 deletions(-) create mode 100644 src/app/tabs/styles/tabbed-menu-styles.js diff --git a/src/app/tabs/styles/tabbed-menu-styles.js b/src/app/tabs/styles/tabbed-menu-styles.js new file mode 100644 index 0000000000..f0adb87f55 --- /dev/null +++ b/src/app/tabs/styles/tabbed-menu-styles.js @@ -0,0 +1,42 @@ +const csjs = require('csjs-inject') +const styles = require('../../ui/styles-guide/theme-chooser').chooser() + +const css = csjs` + .menu { + display: flex; + background-color: ${styles.rightPanel.BackgroundColor_Pre}; + list-style: none; + margin: 0; + padding: 0; + } + .active { + background-color: ${styles.rightPanel.backgroundColor_Tab}; + color: ${styles.appProperties.mainText_Color} + } + .options { + float: left; + padding-top: 0.7em; + min-width: 60px; + font-size: 0.9em; + cursor: pointer; + font-size: 1em; + text-align: center; + } + .optionViews { + background-color: ${styles.rightPanel.backgroundColor_Tab}; + overflow: scroll; + height: 100%; + } + .optionViews > div { + display: none; + } + .optionViews .pre { + word-wrap: break-word; + background-color: ${styles.rightPanel.BackgroundColor_Pre}; + border-radius: 3px; + display: inline-block; + padding: 0 0.6em; + } +` + +module.exports = css diff --git a/src/app/tabs/tabbed-menu.js b/src/app/tabs/tabbed-menu.js index c6bc01ffbc..dbbb798b73 100644 --- a/src/app/tabs/tabbed-menu.js +++ b/src/app/tabs/tabbed-menu.js @@ -1,13 +1,12 @@ var yo = require('yo-yo') -var csjs = require('csjs-inject') +var css = require('./styles/tabbed-menu-styles') var globalRegistry = require('../../global/registry') var helper = require('../../lib/helper') -var styles = require('../ui/styles-guide/theme-chooser').chooser() var EventManager = require('../../lib/events') -module.exports = class TabbedMenu { +class TabbedMenu { constructor (localRegistry) { const self = this self.event = new EventManager() @@ -88,40 +87,4 @@ module.exports = class TabbedMenu { } } -const css = csjs` - .menu { - display: flex; - background-color: ${styles.rightPanel.BackgroundColor_Pre}; - list-style: none; - margin: 0; - padding: 0; - } - .active { - background-color: ${styles.rightPanel.backgroundColor_Tab}; - color: ${styles.appProperties.mainText_Color} - } - .options { - float: left; - padding-top: 0.7em; - min-width: 60px; - font-size: 0.9em; - cursor: pointer; - font-size: 1em; - text-align: center; - } - .optionViews { - background-color: ${styles.rightPanel.backgroundColor_Tab}; - overflow: scroll; - height: 100%; - } - .optionViews > div { - display: none; - } - .optionViews .pre { - word-wrap: break-word; - background-color: ${styles.rightPanel.BackgroundColor_Pre}; - border-radius: 3px; - display: inline-block; - padding: 0 0.6em; - } -` +module.exports = TabbedMenu From d5696f2424516e98412deeeffd05f00fac5f8476 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 Jan 2019 16:10:12 -0500 Subject: [PATCH 069/636] trigger newScenario event and move out dependency --- src/app/tabs/run-tab.js | 9 ++++++++- src/app/tabs/runTab/recorder.js | 13 ++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 474b872116..6aeb3ec864 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -93,7 +93,14 @@ function runTab (opts, localRegistry) { executionContext.event.register('contextChanged', recorder.clearAll.bind(recorder)) self.event.register('clearInstance', recorder.clearAll.bind(recorder)) - var recorderInterface = new RecorderUI(recorder, self) + var recorderInterface = new RecorderUI(recorder, self._deps.logCallback) + + recorderInterface.event.register('newScenario', (abi, address, contractName) => { + var noInstancesText = this._view.noInstancesText + if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } + this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstanceFromABI(abi, address, contractName)) + }) + recorderInterface.render() self._view.collapsedView = yo` diff --git a/src/app/tabs/runTab/recorder.js b/src/app/tabs/runTab/recorder.js index c14f221efc..4621189388 100644 --- a/src/app/tabs/runTab/recorder.js +++ b/src/app/tabs/runTab/recorder.js @@ -1,4 +1,6 @@ var yo = require('yo-yo') +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager var csjs = require('csjs-inject') var css = require('../styles/run-tab-styles') @@ -8,10 +10,10 @@ var confirmDialog = require('../../execution/confirmDialog') class RecorderUI { - constructor (recorder, parentSelf) { + constructor (recorder, logCallBack) { this.recorder = recorder - this.parentSelf = parentSelf - this.logCallBack = this.parentSelf._deps.logCallback + this.logCallBack = logCallBack + this.event = new EventManager() } render () { @@ -67,10 +69,7 @@ class RecorderUI { return modalDialogCustom.alert(error) } - var noInstancesText = this.parentSelf._view.noInstancesText - if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } - - this.parentSelf._view.instanceContainer.appendChild(this.parentSelf._deps.udappUI.renderInstanceFromABI(abi, address, contractName)) + this.event.trigger('newScenario', [abi, address, contractName]) }) } From 563e07ae1659d5bd17bb2f13cc9b759eab651987 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 Jan 2019 16:52:50 -0500 Subject: [PATCH 070/636] mode RunTab to a class --- src/app/tabs/run-tab.js | 355 ++++++++++++++++++++-------------------- 1 file changed, 180 insertions(+), 175 deletions(-) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 6aeb3ec864..f58e6d18c6 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -1,7 +1,7 @@ var $ = require('jquery') var yo = require('yo-yo') var EventManager = require('../../lib/events') -var globlalRegistry = require('../../global/registry') +var globalRegistry = require('../../global/registry') var executionContext = require('../../execution-context') var Card = require('../ui/card') var css = require('./styles/run-tab-styles') @@ -15,188 +15,193 @@ var ContractDropdownUI = require('./runTab/contractDropdown.js') var Recorder = require('./runTab/model/recorder.js') var RecorderUI = require('./runTab/recorder.js') -function runTab (opts, localRegistry) { - var self = this - self.event = new EventManager() - self._view = {} - self.data = { - count: 0, - text: `All transactions (deployed contracts and function executions) in this environment can be saved and replayed in - another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.` - } - self._components = {} - self._components.registry = localRegistry || globlalRegistry - self._components.transactionContextAPI = { - getAddress: (cb) => { - cb(null, $('#txorigin').val()) - }, - getValue: (cb) => { - try { - var number = document.querySelector('#value').value - var select = document.getElementById('unit') - var index = select.selectedIndex - var selectedUnit = select.querySelectorAll('option')[index].dataset.unit - var unit = 'ether' // default - if (['ether', 'finney', 'gwei', 'wei'].indexOf(selectedUnit) >= 0) { - unit = selectedUnit +class RunTab { + + constructor (opts, localRegistry) { + var self = this + self.event = new EventManager() + self._view = {} + self.data = { + count: 0, + text: `All transactions (deployed contracts and function executions) in this environment can be saved and replayed in + another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.` + } + self._components = {} + self._components.registry = localRegistry || globalRegistry + self._components.transactionContextAPI = { + getAddress: (cb) => { + cb(null, $('#txorigin').val()) + }, + getValue: (cb) => { + try { + var number = document.querySelector('#value').value + var select = document.getElementById('unit') + var index = select.selectedIndex + var selectedUnit = select.querySelectorAll('option')[index].dataset.unit + var unit = 'ether' // default + if (['ether', 'finney', 'gwei', 'wei'].indexOf(selectedUnit) >= 0) { + unit = selectedUnit + } + cb(null, executionContext.web3().toWei(number, unit)) + } catch (e) { + cb(e) } - cb(null, executionContext.web3().toWei(number, unit)) - } catch (e) { - cb(e) + }, + getGasLimit: (cb) => { + cb(null, $('#gasLimit').val()) } - }, - getGasLimit: (cb) => { - cb(null, $('#gasLimit').val()) } - } - // dependencies - self._deps = { - udapp: self._components.registry.get('udapp').api, - udappUI: self._components.registry.get('udappUI').api, - config: self._components.registry.get('config').api, - fileManager: self._components.registry.get('filemanager').api, - editor: self._components.registry.get('editor').api, - logCallback: self._components.registry.get('logCallback').api, - filePanel: self._components.registry.get('filepanel').api, - pluginManager: self._components.registry.get('pluginmanager').api, - compilersArtefacts: self._components.registry.get('compilersartefacts').api - } - self._deps.udapp.resetAPI(self._components.transactionContextAPI) - self._view.recorderCount = yo`0` - self._view.instanceContainer = yo`
` - self._view.clearInstanceElement = yo` - self.event.trigger('clearInstance', [])} - title="Clear instances list and reset recorder" aria-hidden="true"> - ` - self._view.instanceContainerTitle = yo` -
- Deployed Contracts - ${self._view.clearInstanceElement} -
` - self._view.noInstancesText = yo` -
- Currently you have no contract instances to interact with. -
` - - var container = yo`
` - - var recorder = new Recorder(self._deps.udapp, self._deps.fileManager, self._deps.config) - recorder.event.register('newTxRecorded', (count) => { - this.data.count = count - this._view.recorderCount.innerText = count - }) - recorder.event.register('cleared', () => { - this.data.count = 0 - this._view.recorderCount.innerText = 0 - }) - executionContext.event.register('contextChanged', recorder.clearAll.bind(recorder)) - self.event.register('clearInstance', recorder.clearAll.bind(recorder)) - - var recorderInterface = new RecorderUI(recorder, self._deps.logCallback) - - recorderInterface.event.register('newScenario', (abi, address, contractName) => { - var noInstancesText = this._view.noInstancesText - if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } - this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstanceFromABI(abi, address, contractName)) - }) - - recorderInterface.render() - - self._view.collapsedView = yo` -
-
${self._view.recorderCount}
-
` - - self._view.expandedView = yo` -
-
- ${self.data.text} -
-
- ${recorderInterface.recordButton} - ${recorderInterface.runButton} + // dependencies + self._deps = { + udapp: self._components.registry.get('udapp').api, + udappUI: self._components.registry.get('udappUI').api, + config: self._components.registry.get('config').api, + fileManager: self._components.registry.get('filemanager').api, + editor: self._components.registry.get('editor').api, + logCallback: self._components.registry.get('logCallback').api, + filePanel: self._components.registry.get('filepanel').api, + pluginManager: self._components.registry.get('pluginmanager').api, + compilersArtefacts: self._components.registry.get('compilersartefacts').api + } + self._deps.udapp.resetAPI(self._components.transactionContextAPI) + self._view.recorderCount = yo`0` + self._view.instanceContainer = yo`
` + self._view.clearInstanceElement = yo` + self.event.trigger('clearInstance', [])} + title="Clear instances list and reset recorder" aria-hidden="true"> + ` + self._view.instanceContainerTitle = yo` +
+ Deployed Contracts + ${self._view.clearInstanceElement} +
` + self._view.noInstancesText = yo` +
+ Currently you have no contract instances to interact with. +
` + + var container = yo`
` + + var recorder = new Recorder(self._deps.udapp, self._deps.fileManager, self._deps.config) + recorder.event.register('newTxRecorded', (count) => { + this.data.count = count + this._view.recorderCount.innerText = count + }) + recorder.event.register('cleared', () => { + this.data.count = 0 + this._view.recorderCount.innerText = 0 + }) + executionContext.event.register('contextChanged', recorder.clearAll.bind(recorder)) + self.event.register('clearInstance', recorder.clearAll.bind(recorder)) + + var recorderInterface = new RecorderUI(recorder, self._deps.logCallback) + + recorderInterface.event.register('newScenario', (abi, address, contractName) => { + var noInstancesText = this._view.noInstancesText + if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } + this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstanceFromABI(abi, address, contractName)) + }) + + recorderInterface.render() + + self._view.collapsedView = yo` +
+
${self._view.recorderCount}
+
` + + self._view.expandedView = yo` +
+
+ ${self.data.text}
-
-
` - - self.recorderOpts = { - title: 'Transactions recorded:', - collapsedView: self._view.collapsedView - } +
+ ${recorderInterface.recordButton} + ${recorderInterface.runButton} +
+
+
` - var recorderCard = new Card({}, {}, self.recorderOpts) - recorderCard.event.register('expandCollapseCard', (arrow, body, status) => { - body.innerHTML = '' - status.innerHTML = '' - if (arrow === 'down') { - status.appendChild(self._view.collapsedView) - body.appendChild(self._view.expandedView) - } else if (arrow === 'up') { - status.appendChild(self._view.collapsedView) + self.recorderOpts = { + title: 'Transactions recorded:', + collapsedView: self._view.collapsedView } - }) - - var settings = new Settings(self._deps.udapp) - var settingsUI = new SettingsUI(settings) - - self.event.register('clearInstance', () => { - this._view.instanceContainer.innerHTML = '' // clear the instances list - this._view.instanceContainer.appendChild(self._view.instanceContainerTitle) - this._view.instanceContainer.appendChild(self._view.noInstancesText) - }) - settingsUI.event.register('clearInstance', () => { - this.event.trigger('clearInstance', []) - }) - - var dropdownLogic = new DropdownLogic( - this._deps.fileManager, - this._deps.pluginManager, - this._deps.compilersArtefacts, - this._deps.compiler, - this._deps.config, - this._deps.editor, - this._deps.udapp, - this._deps.filePanel - ) - var contractDropdownUI = new ContractDropdownUI(dropdownLogic, this._deps.logCallback) - - contractDropdownUI.event.register('clearInstance', () => { - var noInstancesText = this._view.noInstancesText - if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } - }) - contractDropdownUI.event.register('newContractABIAdded', (abi, address) => { - this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstanceFromABI(abi, address, address)) - }) - contractDropdownUI.event.register('newContractInstanceAdded', (contractObject, address, value) => { - this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstance(contractObject, address, value)) - }) - - this._view.instanceContainer.appendChild(this._view.instanceContainerTitle) - this._view.instanceContainer.appendChild(this._view.noInstancesText) - - var el = yo` -
- ${settingsUI.render()} - ${contractDropdownUI.render()} - ${recorderCard.render()} - ${self._view.instanceContainer} -
- ` - container.appendChild(el) - - return { - render () { return container }, - profile () { - return { - name: 'run transactions', - methods: [], - events: [], - icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjMwNCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjMwNCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMzAxIDEwMzZxMTIgMTAzLTIyIDE5OC41dC05OSAxNjMuNS0xNTguNSAxMDYtMTk2LjUgMzFxLTE2MS0xMS0yNzkuNS0xMjV0LTEzNC41LTI3NHEtMTItMTExIDI3LjUtMjEwLjV0MTE4LjUtMTcwLjVsLTcxLTEwN3EtOTYgODAtMTUxIDE5NHQtNTUgMjQ0cTAgMjctMTguNSA0Ni41dC00NS41IDE5LjVoLTMyNXEtMjMgMTY0LTE0OSAyNzR0LTI5NCAxMTBxLTE4NSAwLTMxNi41LTEzMS41dC0xMzEuNS0zMTYuNSAxMzEuNS0zMTYuNSAzMTYuNS0xMzEuNXE3NiAwIDE1MiAyN2wyNC00NXEtMTIzLTExMC0zMDQtMTEwaC02NHEtMjYgMC00NS0xOXQtMTktNDUgMTktNDUgNDUtMTloMTI4cTc4IDAgMTQ1IDEzLjV0MTE2LjUgMzguNSA3MS41IDM5LjUgNTEgMzYuNWg2MjdsLTg1LTEyOGgtMjIycS0zMCAwLTQ5LTIyLjV0LTE0LTUyLjVxNC0yMyAyMy0zOHQ0My0xNWgyNTNxMzMgMCA1MyAyOGw3MCAxMDUgMTE0LTExNHExOS0xOSA0Ni0xOWgxMDFxMjYgMCA0NSAxOXQxOSA0NXYxMjhxMCAyNi0xOSA0NXQtNDUgMTloLTE3OWwxMTUgMTcycTEzMS02MyAyNzUtMzYgMTQzIDI2IDI0NCAxMzQuNXQxMTggMjUzLjV6bS0xODUzIDM3MnExMTUgMCAyMDMtNzIuNXQxMTEtMTgzLjVoLTMxNHEtMzUgMC01NS0zMS0xOC0zMi0xLTYzbDE0Ny0yNzdxLTQ3LTEzLTkxLTEzLTEzMiAwLTIyNiA5NHQtOTQgMjI2IDk0IDIyNiAyMjYgOTR6bTE0MDggMHExMzIgMCAyMjYtOTR0OTQtMjI2LTk0LTIyNi0yMjYtOTRxLTYwIDAtMTIxIDI0bDE3NCAyNjBxMTUgMjMgMTAgNDl0LTI3IDQwcS0xNSAxMS0zNiAxMS0zNSAwLTUzLTI5bC0xNzQtMjYwcS05MyA5NS05MyAyMjUgMCAxMzIgOTQgMjI2dDIyNiA5NHoiLz48L3N2Zz4=', - description: 'execute and save transactions' + + var recorderCard = new Card({}, {}, self.recorderOpts) + recorderCard.event.register('expandCollapseCard', (arrow, body, status) => { + body.innerHTML = '' + status.innerHTML = '' + if (arrow === 'down') { + status.appendChild(self._view.collapsedView) + body.appendChild(self._view.expandedView) + } else if (arrow === 'up') { + status.appendChild(self._view.collapsedView) } + }) + + var settings = new Settings(self._deps.udapp) + var settingsUI = new SettingsUI(settings) + + self.event.register('clearInstance', () => { + this._view.instanceContainer.innerHTML = '' // clear the instances list + this._view.instanceContainer.appendChild(self._view.instanceContainerTitle) + this._view.instanceContainer.appendChild(self._view.noInstancesText) + }) + settingsUI.event.register('clearInstance', () => { + this.event.trigger('clearInstance', []) + }) + + var dropdownLogic = new DropdownLogic( + this._deps.fileManager, + this._deps.pluginManager, + this._deps.compilersArtefacts, + this._deps.compiler, + this._deps.config, + this._deps.editor, + this._deps.udapp, + this._deps.filePanel + ) + var contractDropdownUI = new ContractDropdownUI(dropdownLogic, this._deps.logCallback) + + contractDropdownUI.event.register('clearInstance', () => { + var noInstancesText = this._view.noInstancesText + if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } + }) + contractDropdownUI.event.register('newContractABIAdded', (abi, address) => { + this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstanceFromABI(abi, address, address)) + }) + contractDropdownUI.event.register('newContractInstanceAdded', (contractObject, address, value) => { + this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstance(contractObject, address, value)) + }) + + this._view.instanceContainer.appendChild(this._view.instanceContainerTitle) + this._view.instanceContainer.appendChild(this._view.noInstancesText) + + var el = yo` +
+ ${settingsUI.render()} + ${contractDropdownUI.render()} + ${recorderCard.render()} + ${self._view.instanceContainer} +
+ ` + container.appendChild(el) + this.container = container + } + + render () { + return this.container + } + + profile () { + return { + name: 'run transactions', + methods: [], + events: [], + icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjMwNCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjMwNCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMzAxIDEwMzZxMTIgMTAzLTIyIDE5OC41dC05OSAxNjMuNS0x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OTQgMjI2dDIyNiA5NHoiLz48L3N2Zz4=', + description: 'execute and save transactions' } } } -module.exports = runTab +module.exports = RunTab From 5bf2281a6c83fe23520f53962b722ce4f217a450 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 Jan 2019 17:02:06 -0500 Subject: [PATCH 071/636] remove unused params --- src/app/tabs/run-tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index f58e6d18c6..6c04698122 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -17,7 +17,7 @@ var RecorderUI = require('./runTab/recorder.js') class RunTab { - constructor (opts, localRegistry) { + constructor () { var self = this self.event = new EventManager() self._view = {} @@ -27,7 +27,7 @@ class RunTab { another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.` } self._components = {} - self._components.registry = localRegistry || globalRegistry + self._components.registry = globalRegistry self._components.transactionContextAPI = { getAddress: (cb) => { cb(null, $('#txorigin').val()) From b5296d11647da1f4c5070ca78ae9e5bb32e024b0 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 Jan 2019 17:50:02 -0500 Subject: [PATCH 072/636] remove _deps --- src/app.js | 13 +++++++-- src/app/tabs/run-tab.js | 62 ++++++++++++----------------------------- 2 files changed, 29 insertions(+), 46 deletions(-) diff --git a/src/app.js b/src/app.js index 6fb4a4b4cf..e766ee5de9 100644 --- a/src/app.js +++ b/src/app.js @@ -7,7 +7,6 @@ var request = require('request') var remixLib = require('remix-lib') var EventManager = require('./lib/events') var EventEmitter = require('events') - var registry = require('./global/registry') var UniversalDApp = require('./universal-dapp.js') var UniversalDAppUI = require('./universal-dapp-ui.js') @@ -432,7 +431,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org let filePanel = new FilePanel() registry.put({api: filePanel, name: 'filepanel'}) let compileTab = new CompileTab(self._components.registry) - let run = new RunTab(self._components.registry) + let run = new RunTab( + registry.get('udapp').api, + registry.get('udappUI').api, + registry.get('config').api, + registry.get('filemanager').api, + registry.get('editor').api, + registry.get('logCallback').api, + registry.get('filepanel').api, + registry.get('pluginmanager').api, + registry.get('compilersartefacts').api + ) let settings = new SettingsTab(self._components.registry) let analysis = new AnalysisTab(self._components.registry) let debug = new DebuggerTab(self._components.registry) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 6c04698122..a53a3b88ae 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -17,18 +17,14 @@ var RecorderUI = require('./runTab/recorder.js') class RunTab { - constructor () { + constructor (udapp, udappUI, config, fileManager, editor, logCallback, filePanel, pluginManager, compilersArtefacts) { var self = this - self.event = new EventManager() - self._view = {} - self.data = { - count: 0, - text: `All transactions (deployed contracts and function executions) in this environment can be saved and replayed in - another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.` - } - self._components = {} - self._components.registry = globalRegistry - self._components.transactionContextAPI = { + this.event = new EventManager() + + this._view = {} + this.registry = globalRegistry + + this.transactionContextAPI = { getAddress: (cb) => { cb(null, $('#txorigin').val()) }, @@ -51,19 +47,7 @@ class RunTab { cb(null, $('#gasLimit').val()) } } - // dependencies - self._deps = { - udapp: self._components.registry.get('udapp').api, - udappUI: self._components.registry.get('udappUI').api, - config: self._components.registry.get('config').api, - fileManager: self._components.registry.get('filemanager').api, - editor: self._components.registry.get('editor').api, - logCallback: self._components.registry.get('logCallback').api, - filePanel: self._components.registry.get('filepanel').api, - pluginManager: self._components.registry.get('pluginmanager').api, - compilersArtefacts: self._components.registry.get('compilersartefacts').api - } - self._deps.udapp.resetAPI(self._components.transactionContextAPI) + udapp.resetAPI(this.transactionContextAPI) self._view.recorderCount = yo`0` self._view.instanceContainer = yo`
` self._view.clearInstanceElement = yo` @@ -83,24 +67,22 @@ class RunTab { var container = yo`
` - var recorder = new Recorder(self._deps.udapp, self._deps.fileManager, self._deps.config) + var recorder = new Recorder(udapp, fileManager, config) recorder.event.register('newTxRecorded', (count) => { - this.data.count = count this._view.recorderCount.innerText = count }) recorder.event.register('cleared', () => { - this.data.count = 0 this._view.recorderCount.innerText = 0 }) executionContext.event.register('contextChanged', recorder.clearAll.bind(recorder)) self.event.register('clearInstance', recorder.clearAll.bind(recorder)) - var recorderInterface = new RecorderUI(recorder, self._deps.logCallback) + var recorderInterface = new RecorderUI(recorder, logCallback) recorderInterface.event.register('newScenario', (abi, address, contractName) => { var noInstancesText = this._view.noInstancesText if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } - this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstanceFromABI(abi, address, contractName)) + this._view.instanceContainer.appendChild(udappUI.renderInstanceFromABI(abi, address, contractName)) }) recorderInterface.render() @@ -113,7 +95,8 @@ class RunTab { self._view.expandedView = yo`
- ${self.data.text} + All transactions (deployed contracts and function executions) in this environment can be saved and replayed in + another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.
${recorderInterface.recordButton} @@ -139,7 +122,7 @@ class RunTab { } }) - var settings = new Settings(self._deps.udapp) + var settings = new Settings(udapp) var settingsUI = new SettingsUI(settings) self.event.register('clearInstance', () => { @@ -151,27 +134,18 @@ class RunTab { this.event.trigger('clearInstance', []) }) - var dropdownLogic = new DropdownLogic( - this._deps.fileManager, - this._deps.pluginManager, - this._deps.compilersArtefacts, - this._deps.compiler, - this._deps.config, - this._deps.editor, - this._deps.udapp, - this._deps.filePanel - ) - var contractDropdownUI = new ContractDropdownUI(dropdownLogic, this._deps.logCallback) + var dropdownLogic = new DropdownLogic(fileManager, pluginManager, compilersArtefacts, null, config, editor, udapp, filePanel) + var contractDropdownUI = new ContractDropdownUI(dropdownLogic, logCallback) contractDropdownUI.event.register('clearInstance', () => { var noInstancesText = this._view.noInstancesText if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } }) contractDropdownUI.event.register('newContractABIAdded', (abi, address) => { - this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstanceFromABI(abi, address, address)) + this._view.instanceContainer.appendChild(udappUI.renderInstanceFromABI(abi, address, address)) }) contractDropdownUI.event.register('newContractInstanceAdded', (contractObject, address, value) => { - this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstance(contractObject, address, value)) + this._view.instanceContainer.appendChild(udappUI.renderInstance(contractObject, address, value)) }) this._view.instanceContainer.appendChild(this._view.instanceContainerTitle) From 96d6e137a6cc5618e91e2fb2a7bce1f2f28c573c Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 Jan 2019 17:59:22 -0500 Subject: [PATCH 073/636] move resetAPI call --- src/app.js | 26 ++++++++++++++++++++++ src/app/tabs/run-tab.js | 25 --------------------- src/app/tabs/runTab/model/dropdownlogic.js | 1 + 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/app.js b/src/app.js index e766ee5de9..3c4239b46b 100644 --- a/src/app.js +++ b/src/app.js @@ -1,5 +1,6 @@ 'use strict' +var $ = require('jquery') var csjs = require('csjs-inject') var yo = require('yo-yo') var async = require('async') @@ -502,6 +503,31 @@ Please make a backup of your contracts and start using http://remix.ethereum.org var txLogger = new TxLogger() // eslint-disable-line txLogger.event.register('debuggingRequested', (hash) => { debug.debugger().debug(hash) }) + let transactionContextAPI = { + getAddress: (cb) => { + cb(null, $('#txorigin').val()) + }, + getValue: (cb) => { + try { + var number = document.querySelector('#value').value + var select = document.getElementById('unit') + var index = select.selectedIndex + var selectedUnit = select.querySelectorAll('option')[index].dataset.unit + var unit = 'ether' // default + if (['ether', 'finney', 'gwei', 'wei'].indexOf(selectedUnit) >= 0) { + unit = selectedUnit + } + cb(null, executionContext.web3().toWei(number, unit)) + } catch (e) { + cb(e) + } + }, + getGasLimit: (cb) => { + cb(null, $('#gasLimit').val()) + } + } + udapp.resetAPI(transactionContextAPI) + var queryParams = new QueryParams() var loadingFromGist = self.loadFromGist(queryParams.get()) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index a53a3b88ae..b47df1ba66 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -1,4 +1,3 @@ -var $ = require('jquery') var yo = require('yo-yo') var EventManager = require('../../lib/events') var globalRegistry = require('../../global/registry') @@ -24,30 +23,6 @@ class RunTab { this._view = {} this.registry = globalRegistry - this.transactionContextAPI = { - getAddress: (cb) => { - cb(null, $('#txorigin').val()) - }, - getValue: (cb) => { - try { - var number = document.querySelector('#value').value - var select = document.getElementById('unit') - var index = select.selectedIndex - var selectedUnit = select.querySelectorAll('option')[index].dataset.unit - var unit = 'ether' // default - if (['ether', 'finney', 'gwei', 'wei'].indexOf(selectedUnit) >= 0) { - unit = selectedUnit - } - cb(null, executionContext.web3().toWei(number, unit)) - } catch (e) { - cb(e) - } - }, - getGasLimit: (cb) => { - cb(null, $('#gasLimit').val()) - } - } - udapp.resetAPI(this.transactionContextAPI) self._view.recorderCount = yo`0` self._view.instanceContainer = yo`
` self._view.clearInstanceElement = yo` diff --git a/src/app/tabs/runTab/model/dropdownlogic.js b/src/app/tabs/runTab/model/dropdownlogic.js index f05b5a9ef8..afc8685760 100644 --- a/src/app/tabs/runTab/model/dropdownlogic.js +++ b/src/app/tabs/runTab/model/dropdownlogic.js @@ -27,6 +27,7 @@ class DropdownLogic { }) } + // TODO: can be moved up; the event in contractDropdown will have to refactored a method instead listenToCompilationEvents () { this.pluginManager.event.register('sendCompilationResult', (file, source, languageVersion, data) => { // TODO check whether the tab is configured From fd927e667878c1114690e4e816d59a977719f5e0 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 Jan 2019 19:09:27 -0500 Subject: [PATCH 074/636] refactor run-tab --- src/app/tabs/run-tab.js | 169 +++++++++++---------- src/app/tabs/runTab/model/dropdownlogic.js | 3 +- src/app/tabs/runTab/model/recorder.js | 7 + 3 files changed, 95 insertions(+), 84 deletions(-) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index b47df1ba66..0fe01f072e 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -1,7 +1,5 @@ var yo = require('yo-yo') var EventManager = require('../../lib/events') -var globalRegistry = require('../../global/registry') -var executionContext = require('../../execution-context') var Card = require('../ui/card') var css = require('./styles/run-tab-styles') @@ -17,125 +15,132 @@ var RecorderUI = require('./runTab/recorder.js') class RunTab { constructor (udapp, udappUI, config, fileManager, editor, logCallback, filePanel, pluginManager, compilersArtefacts) { - var self = this this.event = new EventManager() - this._view = {} - this.registry = globalRegistry + this.renderInstanceContainer() + this.renderSettings(udapp) + this.renderDropdown(udappUI, fileManager, pluginManager, compilersArtefacts, config, editor, udapp, filePanel, logCallback) + this.renderRecorder(udapp, udappUI, fileManager, config, logCallback) + this.renderRecorderCard() + this.renderContainer() + } + + renderContainer () { + this.container = yo`
` - self._view.recorderCount = yo`0` - self._view.instanceContainer = yo`
` - self._view.clearInstanceElement = yo` - self.event.trigger('clearInstance', [])} - title="Clear instances list and reset recorder" aria-hidden="true"> - ` - self._view.instanceContainerTitle = yo` + var el = yo` +
+ ${this.settingsUI.render()} + ${this.contractDropdownUI.render()} + ${this.recorderCard.render()} + ${this.instanceContainer} +
+ ` + this.container.appendChild(el) + } + + renderInstanceContainer () { + this.instanceContainer = yo`
` + + const instanceContainerTitle = yo`
Deployed Contracts - ${self._view.clearInstanceElement} + this.event.trigger('clearInstance', [])} + title="Clear instances list and reset recorder" aria-hidden="true"> +
` - self._view.noInstancesText = yo` + + this.noInstancesText = yo`
Currently you have no contract instances to interact with.
` - var container = yo`
` + this.event.register('clearInstance', () => { + this.instanceContainer.innerHTML = '' // clear the instances list + this.instanceContainer.appendChild(instanceContainerTitle) + this.instanceContainer.appendChild(this.noInstancesText) + }) - var recorder = new Recorder(udapp, fileManager, config) - recorder.event.register('newTxRecorded', (count) => { - this._view.recorderCount.innerText = count + this.instanceContainer.appendChild(instanceContainerTitle) + this.instanceContainer.appendChild(this.noInstancesText) + } + + renderSettings (udapp) { + var settings = new Settings(udapp) + this.settingsUI = new SettingsUI(settings) + + this.settingsUI.event.register('clearInstance', () => { + this.event.trigger('clearInstance', []) + }) + } + + renderDropdown (udappUI, fileManager, pluginManager, compilersArtefacts, config, editor, udapp, filePanel, logCallback) { + var dropdownLogic = new DropdownLogic(fileManager, pluginManager, compilersArtefacts, config, editor, udapp, filePanel) + this.contractDropdownUI = new ContractDropdownUI(dropdownLogic, logCallback) + + this.contractDropdownUI.event.register('clearInstance', () => { + var noInstancesText = this.noInstancesText + if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } }) - recorder.event.register('cleared', () => { - this._view.recorderCount.innerText = 0 + this.contractDropdownUI.event.register('newContractABIAdded', (abi, address) => { + this.instanceContainer.appendChild(udappUI.renderInstanceFromABI(abi, address, address)) }) - executionContext.event.register('contextChanged', recorder.clearAll.bind(recorder)) - self.event.register('clearInstance', recorder.clearAll.bind(recorder)) + this.contractDropdownUI.event.register('newContractInstanceAdded', (contractObject, address, value) => { + this.instanceContainer.appendChild(udappUI.renderInstance(contractObject, address, value)) + }) + } - var recorderInterface = new RecorderUI(recorder, logCallback) + renderRecorder (udapp, udappUI, fileManager, config, logCallback) { + this.recorderCount = yo`0` - recorderInterface.event.register('newScenario', (abi, address, contractName) => { - var noInstancesText = this._view.noInstancesText + var recorder = new Recorder(udapp, fileManager, config) + recorder.event.register('recorderCountChange', (count) => { + this.recorderCount.innerText = count + }) + this.event.register('clearInstance', recorder.clearAll.bind(recorder)) + + this.recorderInterface = new RecorderUI(recorder, logCallback) + + this.recorderInterface.event.register('newScenario', (abi, address, contractName) => { + var noInstancesText = this.noInstancesText if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } - this._view.instanceContainer.appendChild(udappUI.renderInstanceFromABI(abi, address, contractName)) + this.instanceContainer.appendChild(udappUI.renderInstanceFromABI(abi, address, contractName)) }) - recorderInterface.render() + this.recorderInterface.render() + } - self._view.collapsedView = yo` + renderRecorderCard () { + const collapsedView = yo`
-
${self._view.recorderCount}
+
${this.recorderCount}
` - self._view.expandedView = yo` + const expandedView = yo`
All transactions (deployed contracts and function executions) in this environment can be saved and replayed in another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.
- ${recorderInterface.recordButton} - ${recorderInterface.runButton} + ${this.recorderInterface.recordButton} + ${this.recorderInterface.runButton}
` - self.recorderOpts = { - title: 'Transactions recorded:', - collapsedView: self._view.collapsedView - } - - var recorderCard = new Card({}, {}, self.recorderOpts) - recorderCard.event.register('expandCollapseCard', (arrow, body, status) => { + this.recorderCard = new Card({}, {}, { title: 'Transactions recorded:', collapsedView: collapsedView }) + this.recorderCard.event.register('expandCollapseCard', (arrow, body, status) => { body.innerHTML = '' status.innerHTML = '' if (arrow === 'down') { - status.appendChild(self._view.collapsedView) - body.appendChild(self._view.expandedView) + status.appendChild(collapsedView) + body.appendChild(expandedView) } else if (arrow === 'up') { - status.appendChild(self._view.collapsedView) + status.appendChild(collapsedView) } }) - - var settings = new Settings(udapp) - var settingsUI = new SettingsUI(settings) - - self.event.register('clearInstance', () => { - this._view.instanceContainer.innerHTML = '' // clear the instances list - this._view.instanceContainer.appendChild(self._view.instanceContainerTitle) - this._view.instanceContainer.appendChild(self._view.noInstancesText) - }) - settingsUI.event.register('clearInstance', () => { - this.event.trigger('clearInstance', []) - }) - - var dropdownLogic = new DropdownLogic(fileManager, pluginManager, compilersArtefacts, null, config, editor, udapp, filePanel) - var contractDropdownUI = new ContractDropdownUI(dropdownLogic, logCallback) - - contractDropdownUI.event.register('clearInstance', () => { - var noInstancesText = this._view.noInstancesText - if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } - }) - contractDropdownUI.event.register('newContractABIAdded', (abi, address) => { - this._view.instanceContainer.appendChild(udappUI.renderInstanceFromABI(abi, address, address)) - }) - contractDropdownUI.event.register('newContractInstanceAdded', (contractObject, address, value) => { - this._view.instanceContainer.appendChild(udappUI.renderInstance(contractObject, address, value)) - }) - - this._view.instanceContainer.appendChild(this._view.instanceContainerTitle) - this._view.instanceContainer.appendChild(this._view.noInstancesText) - - var el = yo` -
- ${settingsUI.render()} - ${contractDropdownUI.render()} - ${recorderCard.render()} - ${self._view.instanceContainer} -
- ` - container.appendChild(el) - this.container = container } render () { diff --git a/src/app/tabs/runTab/model/dropdownlogic.js b/src/app/tabs/runTab/model/dropdownlogic.js index afc8685760..57a28c61e6 100644 --- a/src/app/tabs/runTab/model/dropdownlogic.js +++ b/src/app/tabs/runTab/model/dropdownlogic.js @@ -9,10 +9,9 @@ var CompilerAbstract = require('../../../compiler/compiler-abstract') var EventManager = remixLib.EventManager class DropdownLogic { - constructor (fileManager, pluginManager, compilersArtefacts, compiler, config, editor, udapp, filePanel) { + constructor (fileManager, pluginManager, compilersArtefacts, config, editor, udapp, filePanel) { this.pluginManager = pluginManager this.compilersArtefacts = compilersArtefacts - this.compiler = compiler this.config = config this.editor = editor this.udapp = udapp diff --git a/src/app/tabs/runTab/model/recorder.js b/src/app/tabs/runTab/model/recorder.js index 2f8a7a67e4..9875c4ad35 100644 --- a/src/app/tabs/runTab/model/recorder.js +++ b/src/app/tabs/runTab/model/recorder.js @@ -80,6 +80,13 @@ class Recorder { this.data._createdContracts[address] = timestamp this.data._createdContractsReverse[timestamp] = address }) + executionContext.event.register('contextChanged', this.clearAll.bind(this)) + this.event.register('newTxRecorded', (count) => { + this.event.trigger('recorderCountChange', [count]) + }) + this.event.register('cleared', () => { + this.event.trigger('recorderCountChange', [0]) + }) } /** From 9196b042df44236b7f8814f74447451299bec2ef Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 Jan 2019 19:18:18 -0500 Subject: [PATCH 075/636] refactor analysis tab --- src/app/tabs/analysis-tab.js | 41 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index a5cd12ddd4..d1f7cac60c 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -2,19 +2,15 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') var StaticAnalysis = require('../staticanalysis/staticAnalysisView') -var globalRegistry = require('../../global/registry') var EventManager = require('../../lib/events') -module.exports = class AnalysisTab { - constructor (localRegistry) { - const self = this - self.event = new EventManager() - self._view = { el: null } - self.data = {} - self._components = {} - self._components.registry = localRegistry || globalRegistry - self._deps = {} +class AnalysisTab { + + constructor (registry) { + this.event = new EventManager() + this.registry = registry } +<<<<<<< HEAD profile () { return { name: 'solidity static analysis', @@ -24,22 +20,25 @@ module.exports = class AnalysisTab { description: ' - ' } } +======= + +>>>>>>> 2b6206e1... refactor analysis tab render () { - const self = this var staticanalysis = new StaticAnalysis() + staticanalysis.event.register('staticAnaysisWarning', (count) => { - if (count > 0) { - const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Check Solidity Static Analysis Module for more information.` - const settings = { type: 'staticAnalysisWarning', useSpan: true } - self.event.trigger('newStaticAnaysisWarningMessage', [msg, settings]) - } + if (count <= 0) return + const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Check Solidity Static Analysis Module for more information.` + const settings = { type: 'staticAnalysisWarning', useSpan: true } + this.event.trigger('newStaticAnaysisWarningMessage', [msg, settings]) }) - self._components.registry.put({api: staticanalysis, name: 'staticanalysis'}) - if (self._view.el) return self._view.el - self._view.el = yo` + + this.registry.put({api: staticanalysis, name: 'staticanalysis'}) + if (this.el) return this.el + this.el = yo`
${staticanalysis.render()}
` - return self._view.el + return this.el } } const css = csjs` @@ -50,3 +49,5 @@ const css = csjs` flex-direction: column; } ` + +module.exports = AnalysisTab From 9aaffa10d1c994758584ab4700dde7924007e5d2 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 Jan 2019 19:20:41 -0500 Subject: [PATCH 076/636] move analysis tab css --- src/app/tabs/analysis-tab.js | 11 +---------- src/app/tabs/styles/analysis-tab-styles.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 src/app/tabs/styles/analysis-tab-styles.js diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index d1f7cac60c..f6c875c1ef 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -1,8 +1,7 @@ var yo = require('yo-yo') -var csjs = require('csjs-inject') var StaticAnalysis = require('../staticanalysis/staticAnalysisView') - var EventManager = require('../../lib/events') +var css = require('./styles/analysis-tab-styles') class AnalysisTab { @@ -41,13 +40,5 @@ class AnalysisTab { return this.el } } -const css = csjs` - .analysisTabView { - padding: 2%; - padding-bottom: 3em; - display: flex; - flex-direction: column; - } -` module.exports = AnalysisTab diff --git a/src/app/tabs/styles/analysis-tab-styles.js b/src/app/tabs/styles/analysis-tab-styles.js new file mode 100644 index 0000000000..cdbe8889a0 --- /dev/null +++ b/src/app/tabs/styles/analysis-tab-styles.js @@ -0,0 +1,12 @@ +var csjs = require('csjs-inject') + +const css = csjs` + .analysisTabView { + padding: 2%; + padding-bottom: 3em; + display: flex; + flex-direction: column; + } +` + +module.exports = css From 887a7497bcd6276714d575a7e59926e1c871f993 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Jan 2019 11:42:27 +0100 Subject: [PATCH 077/636] fix diff --- src/app/tabs/analysis-tab.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index f6c875c1ef..d7debdc922 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -9,7 +9,6 @@ class AnalysisTab { this.event = new EventManager() this.registry = registry } -<<<<<<< HEAD profile () { return { name: 'solidity static analysis', @@ -19,9 +18,6 @@ class AnalysisTab { description: ' - ' } } -======= - ->>>>>>> 2b6206e1... refactor analysis tab render () { var staticanalysis = new StaticAnalysis() From 32993d667a17735635e84a88c55a37c2f24fd1e0 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 Jan 2019 19:22:29 -0500 Subject: [PATCH 078/636] remove unused event registration --- src/app/tabs/analysis-tab.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index d7debdc922..2ac04aa2fe 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -20,19 +20,10 @@ class AnalysisTab { } render () { var staticanalysis = new StaticAnalysis() - - staticanalysis.event.register('staticAnaysisWarning', (count) => { - if (count <= 0) return - const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Check Solidity Static Analysis Module for more information.` - const settings = { type: 'staticAnalysisWarning', useSpan: true } - this.event.trigger('newStaticAnaysisWarningMessage', [msg, settings]) - }) - this.registry.put({api: staticanalysis, name: 'staticanalysis'}) - if (this.el) return this.el - this.el = yo` -
${staticanalysis.render()}
` + if (this.el) return this.el + this.el = yo`
${staticanalysis.render()}
` return this.el } } From d8d0704031ced85cefebcb8847201d6ca92339e8 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 14 Jan 2019 17:59:03 -0500 Subject: [PATCH 079/636] move plugin styles and refactor plugin tab --- src/app/tabs/plugin-tab.js | 42 ++++++++++-------------- src/app/tabs/styles/plugin-tab-styles.js | 15 +++++++++ 2 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 src/app/tabs/styles/plugin-tab-styles.js diff --git a/src/app/tabs/plugin-tab.js b/src/app/tabs/plugin-tab.js index 0cadf517f4..5fbb6c56a8 100644 --- a/src/app/tabs/plugin-tab.js +++ b/src/app/tabs/plugin-tab.js @@ -1,36 +1,30 @@ var yo = require('yo-yo') -var csjs = require('csjs-inject') +var css = require('./styles/plugin-tab-styles') var globalRegistry = require('../../global/registry') var EventManager = require('../../lib/events') -module.exports = class plugintab { +class PluginTab { + constructor (json, localRegistry) { - const self = this - self.event = new EventManager() - self._view = { el: null } - self.data = { json } - self._components = {} - self._components.registry = localRegistry || globalRegistry + this.event = new EventManager() + this._view = { el: null } + this.data = { json } + this._components = {} + this._components.registry = localRegistry || globalRegistry } + render () { - const self = this - if (self._view.el) return self._view.el - self._view.el = yo` + if (this._view.el) return this._view.el + + this._view.el = yo`
- +
` - return self._view.el + + return this._view.el } + } -const css = csjs` - .pluginTabView { - height: 100%; - width: 100%; - } - .iframe { - height: 100%; - width: 100%; - border: 0; - } -` + +module.exports = PluginTab diff --git a/src/app/tabs/styles/plugin-tab-styles.js b/src/app/tabs/styles/plugin-tab-styles.js new file mode 100644 index 0000000000..45c593ac46 --- /dev/null +++ b/src/app/tabs/styles/plugin-tab-styles.js @@ -0,0 +1,15 @@ +var csjs = require('csjs-inject') + +const css = csjs` + .pluginTabView { + height: 100%; + width: 100%; + } + .iframe { + height: 100%; + width: 100%; + border: 0; + } +` + +module.exports = css From 36248ba584fe021d21d8009f87059225645682bb Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 14 Jan 2019 17:59:12 -0500 Subject: [PATCH 080/636] remove unnecessary code & properties from plugin tab --- src/app/tabs/plugin-tab.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/app/tabs/plugin-tab.js b/src/app/tabs/plugin-tab.js index 5fbb6c56a8..a92f92939f 100644 --- a/src/app/tabs/plugin-tab.js +++ b/src/app/tabs/plugin-tab.js @@ -1,28 +1,22 @@ var yo = require('yo-yo') var css = require('./styles/plugin-tab-styles') -var globalRegistry = require('../../global/registry') -var EventManager = require('../../lib/events') - class PluginTab { - constructor (json, localRegistry) { - this.event = new EventManager() - this._view = { el: null } + constructor (json) { + this.el = null this.data = { json } - this._components = {} - this._components.registry = localRegistry || globalRegistry } render () { - if (this._view.el) return this._view.el + if (this.el) return this.el - this._view.el = yo` + this.el = yo`
` - return this._view.el + return this.el } } From 8338ab8ee7fc8d1ecd4068761d38755d693b6d99 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 14 Jan 2019 18:06:19 -0500 Subject: [PATCH 081/636] move support styles --- src/app/tabs/styles/support-tab-styles.js | 84 ++++++++++++++++++++++ src/app/tabs/support-tab.js | 85 +---------------------- 2 files changed, 87 insertions(+), 82 deletions(-) create mode 100644 src/app/tabs/styles/support-tab-styles.js diff --git a/src/app/tabs/styles/support-tab-styles.js b/src/app/tabs/styles/support-tab-styles.js new file mode 100644 index 0000000000..ccadbe9fac --- /dev/null +++ b/src/app/tabs/styles/support-tab-styles.js @@ -0,0 +1,84 @@ +const csjs = require('csjs-inject') +const styles = require('../../ui/styles-guide/theme-chooser').chooser() + +const css = csjs` + .supportTabView { + height: 100%; + padding: 2%; + padding-bottom: 3em; + display: flex; + flex-direction: column; + overflow: hidden; + overflow-y: auto; + } + .chat { + ${styles.rightPanel.supportTab.box_IframeContainer} + display: flex; + flex-direction: column; + align-items: center; + height: 85%; + padding: 0; + } + .chatTitle { + height: 40px; + width: 90%; + display: flex; + align-items: center; + justify-content: center; + margin-top: 15px; + } + .chatTitle:hover { + cursor: pointer; + } + .icon { + height: 70%; + margin-right: 2%; + } + .chatTitleText { + font-size: 17px; + font-weight: bold; + } + .chatTitleText { + opacity: 0.8; + } + .chatIframe { + width: 100%; + height: 100%; + transform: scale(0.9); + padding: 0; + border: none; + } + .infoBox { + ${styles.rightPanel.supportTab.box_SupportInfo} + } + .remixdinstallation { + padding: 3px; + border-radius: 2px; + margin-left: 5px; + } + .info { + ${styles.rightPanel.settingsTab.box_SolidityVersionInfo}; + margin-top: 1em; + word-break: break-word; + } + .title { + font-size: 1.1em; + font-weight: bold; + margin-bottom: 1em; + } + .crow { + display: flex; + overflow: auto; + clear: both; + padding: .2em; + } + .crow label { + cursor:pointer; + } + .crowNoFlex { + overflow: auto; + clear: both; + } +` + +module.exports = css diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index d36580f1be..286dd7b78e 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -1,12 +1,11 @@ const yo = require('yo-yo') -const csjs = require('csjs-inject') +var css = require('./styles/support-tab-styles') var globalRegistry = require('../../global/registry') -const styles = require('../ui/styles-guide/theme-chooser').chooser() var EventManager = require('../../lib/events') -module.exports = class SupportTab { +class SupportTab { constructor (localRegistry) { const self = this self.event = new EventManager() @@ -88,82 +87,4 @@ module.exports = class SupportTab { } } -const css = csjs` - .supportTabView { - height: 100%; - padding: 2%; - padding-bottom: 3em; - display: flex; - flex-direction: column; - overflow: hidden; - overflow-y: auto; - } - .chat { - ${styles.rightPanel.supportTab.box_IframeContainer} - display: flex; - flex-direction: column; - align-items: center; - height: 85%; - padding: 0; - } - .chatTitle { - height: 40px; - width: 90%; - display: flex; - align-items: center; - justify-content: center; - margin-top: 15px; - } - .chatTitle:hover { - cursor: pointer; - } - .icon { - height: 70%; - margin-right: 2%; - } - .chatTitleText { - font-size: 17px; - font-weight: bold; - } - .chatTitleText { - opacity: 0.8; - } - .chatIframe { - width: 100%; - height: 100%; - transform: scale(0.9); - padding: 0; - border: none; - } - .infoBox { - ${styles.rightPanel.supportTab.box_SupportInfo} - } - .remixdinstallation { - padding: 3px; - border-radius: 2px; - margin-left: 5px; - } - .info { - ${styles.rightPanel.settingsTab.box_SolidityVersionInfo}; - margin-top: 1em; - word-break: break-word; - } - .title { - font-size: 1.1em; - font-weight: bold; - margin-bottom: 1em; - } - .crow { - display: flex; - overflow: auto; - clear: both; - padding: .2em; - } - .crow label { - cursor:pointer; - } - .crowNoFlex { - overflow: auto; - clear: both; - } -` +module.exports = SupportTab From d33d4fad494f96af5206f5facf6dbfa7b3d248fc Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 14 Jan 2019 18:19:09 -0500 Subject: [PATCH 082/636] simplify support-tab --- src/app/tabs/support-tab.js | 59 +++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index 286dd7b78e..7b16bb7a39 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -6,25 +6,28 @@ var globalRegistry = require('../../global/registry') var EventManager = require('../../lib/events') class SupportTab { + constructor (localRegistry) { - const self = this - self.event = new EventManager() - self._view = { el: null, gitterIframe: '', config: {} } - self.data = { gitterIsLoaded: false } - self._components = {} - self._components.registry = localRegistry || globalRegistry + this.event = new EventManager() + + this.el = null + this.gitterIframe = '' + + this.data = { gitterIsLoaded: false } + this._components = {} + this._components.registry = localRegistry || globalRegistry - self._deps = { - app: self._components.registry.get('app').api + this._deps = { + app: this._components.registry.get('app').api } - self._deps.app.event.register('tabChanged', (tabName) => { - if (tabName !== 'Support' || self.data.gitterIsLoaded) return + this._deps.app.event.register('tabChanged', (tabName) => { + if (tabName !== 'Support' || this.data.gitterIsLoaded) return const iframe = yo`` this.gitterIframe.parentNode.replaceChild(iframe, this.gitterIframe) this.gitterIframe = iframe this.el.style.display = 'block' diff --git a/src/app/ui/renderer.js b/src/app/ui/renderer.js index b5b968c72c..b840ee0e4d 100644 --- a/src/app/ui/renderer.js +++ b/src/app/ui/renderer.js @@ -87,7 +87,7 @@ Renderer.prototype.error = function (message, container, opt) { }) } - var $pre = $(opt.useSpan ? yo`` : yo`
`).html(message)
+  var $pre = $(opt.useSpan ? yo`` : yo`
`).html(message)
 
   var $error = $(yo`
`).prepend($pre) $(container).append($error) From a8d8230a6d21ed4b5c5d9e996be3748304bc22ce Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 21 Feb 2019 11:04:46 +0100 Subject: [PATCH 154/636] typo --- src/app/panels/tab-proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/panels/tab-proxy.js b/src/app/panels/tab-proxy.js index 0161a91da1..fdcb1eb0fd 100644 --- a/src/app/panels/tab-proxy.js +++ b/src/app/panels/tab-proxy.js @@ -50,7 +50,7 @@ export class TabProxy { }) appStore.event.on('activate', (name) => { - const { profile } = appStore.get(name) + const { profile } = appStore.getOne(name) if (profile.prefferedLocation === 'mainPanel') { this.addTab(name, () => { this.event.emit('switchApp', name) From 7ceaab3b5beea902e77d87aa112df6e7587370a4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 14 Feb 2019 17:47:19 +0100 Subject: [PATCH 155/636] remix-tabs --- package.json | 1 + src/app/panels/tab-proxy.js | 80 ++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index 90e937e818..570831afab 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "remix-lib": "0.4.1", "remix-plugin": "latest", "remix-solidity": "0.3.1", + "remix-tabs": "^1.0.0", "remix-tests": "0.1.1", "remixd": "0.1.8-alpha.6", "request": "^2.83.0", diff --git a/src/app/panels/tab-proxy.js b/src/app/panels/tab-proxy.js index fdcb1eb0fd..dad1234045 100644 --- a/src/app/panels/tab-proxy.js +++ b/src/app/panels/tab-proxy.js @@ -2,6 +2,8 @@ var yo = require('yo-yo') var $ = require('jquery') const EventEmitter = require('events') +require('remix-tabs') + var styles = require('./styles/editor-panel-styles') var css = styles.css @@ -11,7 +13,6 @@ export class TabProxy { this.fileManager = fileManager this.appManager = appManager this.editor = editor - this.activeEntity this.entities = {} this.data = {} this._view = {} @@ -26,27 +27,26 @@ export class TabProxy { }) fileManager.event.register('currentFileChanged', (file) => { - const filesEl = document.querySelector('#files') - if (!filesEl.querySelector(`li[path="${file}"]`)) { - this.addTab(file, () => { - this.fileManager.switchFile(file) - this.event.emit('switchFile', file) - }, - () => { - this.fileManager.closeFile(file) - this.event.emit('closeFile', file) - }) - } - this.active(file) // this put the css class "active" + this.addTab(file, () => { + this.fileManager.switchFile(file) + this.event.emit('switchFile', file) + }, + () => { + this.fileManager.closeFile(file) + this.event.emit('closeFile', file) + }) }) fileManager.event.register('fileRenamed', (oldName, newName) => { - const filesEl = document.querySelector('#files') - var file = filesEl.querySelector(`li[path="${oldName}"]`) - if (file) { - filesEl.setAttribute('path', file) - file.querySelector(`.name`).innerHTML = newName - } + this.removeTab(oldName) + this.addTab(newName, () => { + this.fileManager.switchFile(newName) + this.event.emit('switchFile', newName) + }, + () => { + this.fileManager.closeFile(newName) + this.event.emit('closeFile', newName) + }) }) appStore.event.on('activate', (name) => { @@ -67,31 +67,20 @@ export class TabProxy { } addTab (name, switchTo, close, kind) { - const filesEl = document.querySelector('#files') - filesEl.appendChild(yo`
  • ${name}
  • `) + var slash = name.split('/') + let title = name.indexOf('/') !== -1 ? slash[slash.length - 1] : name + this._view.filetabs.addTab({ + id: name, + title, + icon: '', + tooltip: name + }) this._handlers[name] = { switchTo, close } } removeTab (name) { - const filesEl = document.querySelector('#files') - var file = filesEl.querySelector(`li[path="${name}"]`) - if (file) { - filesEl.removeChild(file) - delete this._handlers[name] - } - } - - active (name) { - var filesEl = document.querySelector('#files') - let file = filesEl.querySelector(`li[path="${this.activeEntity}"]`) - if (file) $(file).removeClass('active') - if (name) { - let active = filesEl.querySelector(`li[path="${name}"]`) - if (active) { - $(active).addClass('active') - this.activeEntity = name - } - } + this._view.filetabs.closeTab(name) + delete this._handlers[name] } addHandler (type, fn) { @@ -99,7 +88,15 @@ export class TabProxy { } renderTabsbar () { - this._view.filetabs = yo`` + this._view.filetabs = yo`` + this._view.filetabs.addEventListener('tabClosed', (id) => { + if (this._handlers[id]) this._handlers[id].close() + }) + this._view.filetabs.addEventListener('tabActivated', (id) => { + if (this._handlers[id]) this._handlers[id].switchTo() + }) + + this._view.filetabs.canAdd = false this._view.tabs = yo`
    @@ -133,7 +130,6 @@ export class TabProxy { ev.preventDefault() var name = $(this).find('.name').text() self._handlers[name].switchTo() - self.active(name) return false }) From 5fddaf3a7039cf3dc340e8be0e4774b998364adc Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 21 Feb 2019 10:46:15 +0100 Subject: [PATCH 156/636] fix listen handler --- src/app/panels/tab-proxy.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/panels/tab-proxy.js b/src/app/panels/tab-proxy.js index dad1234045..9abc6f3295 100644 --- a/src/app/panels/tab-proxy.js +++ b/src/app/panels/tab-proxy.js @@ -27,6 +27,10 @@ export class TabProxy { }) fileManager.event.register('currentFileChanged', (file) => { + if (this._handlers[file]) { + this._view.filetabs.activateTab(file) + return + } this.addTab(file, () => { this.fileManager.switchFile(file) this.event.emit('switchFile', file) @@ -89,11 +93,11 @@ export class TabProxy { renderTabsbar () { this._view.filetabs = yo`` - this._view.filetabs.addEventListener('tabClosed', (id) => { - if (this._handlers[id]) this._handlers[id].close() + this._view.filetabs.addEventListener('tabClosed', (event) => { + if (this._handlers[event.detail]) this._handlers[event.detail].close() }) - this._view.filetabs.addEventListener('tabActivated', (id) => { - if (this._handlers[id]) this._handlers[id].switchTo() + this._view.filetabs.addEventListener('tabActivated', (event) => { + if (this._handlers[event.detail]) this._handlers[event.detail].switchTo() }) this._view.filetabs.canAdd = false From 2ccc0beffb5ccbac1ca5b38cd13b77d9a63bfdbf Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 14:31:53 +0100 Subject: [PATCH 157/636] swap_it_workspaces --- src/app.js | 2 +- src/app/tabs/analysis-tab.js | 3 +- src/app/tabs/run-tab.js | 3 +- src/app/tabs/test-tab.js | 3 +- src/app/ui/landing-page/generate.js | 14 ++++++-- src/app/ui/landing-page/workspace.js | 50 ++++++++++++++++++++++++++++ src/remixAppManager.js | 4 +++ 7 files changed, 72 insertions(+), 7 deletions(-) create mode 100644 src/app/ui/landing-page/workspace.js diff --git a/src/app.js b/src/app.js index 69373f7a29..b98e337623 100644 --- a/src/app.js +++ b/src/app.js @@ -459,7 +459,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org let configProvider = self._components.filesProviders['config'] appManager.init([ - { profile: homepageProfile(), api: generateHomePage() }, + { profile: homepageProfile(), api: generateHomePage(appManager, appStore) }, { profile: this.profile(), api: this }, { profile: udapp.profile(), api: udapp }, { profile: fileManager.profile(), api: fileManager }, diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index cd653bb7f0..17356068ad 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -11,7 +11,8 @@ class AnalysisTab { } profile () { return { - name: 'solidity static analysis', + name: 'solidityStaticAnalysis', + displayName: 'solidity static analysis', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjA0OCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjA0OCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMDQ4IDE1MzZ2MTI4aC0yMDQ4di0xNTM2aDEyOHYxNDA4aDE5MjB6bS0xMjgtMTI0OHY0MzVxMCAyMS0xOS41IDI5LjV0LTM1LjUtNy41bC0xMjEtMTIxLTYzMyA2MzNxLTEwIDEwLTIzIDEwdC0yMy0xMGwtMjMzLTIzMy00MTYgNDE2LTE5Mi0xOTIgNTg1LTU4NXExMC0xMCAyMy0xMHQyMyAxMGwyMzMgMjMzIDQ2NC00NjQtMTIxLTEyMXEtMTYtMTYtNy41LTM1LjV0MjkuNS0xOS41aDQzNXExNCAwIDIzIDl0OSAyM3oiLz48L3N2Zz4=', diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 5d0cc73f8a..d7a8303388 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -149,7 +149,8 @@ class RunTab { profile () { return { - name: 'run transactions', + name: 'run', + displayName: 'run transactions', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNTc2IDkyN2wtMTMyOCA3MzhxLTIzIDEzLTM5LjUgM3QtMTYuNS0zNnYtMTQ3MnEwLTI2IDE2LjUtMzZ0MzkuNSAzbDEzMjggNzM4cTIzIDEzIDIzIDMxdC0yMyAzMXoiLz48L3N2Zz4=', diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index ea39a4531a..b42dbf4476 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -25,7 +25,8 @@ module.exports = class TestTab { } profile () { return { - name: 'solidity unit testing', + name: 'solidityUnitTesting', + displayName: 'solidity unit testing', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjMwNCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjMwNCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNzI4IDQ0OGwtMzg0IDcwNGg3Njh6bS0xMjgwIDBsLTM4NCA3MDRoNzY4em04MjEtMTkycS0xNCA0MC00NS41IDcxLjV0LTcxLjUgNDUuNXYxMjkxaDYwOHExNCAwIDIzIDl0OSAyM3Y2NHEwIDE0LTkgMjN0LTIzIDloLTEzNDRxLTE0IDAtMjMtOXQtOS0yM3YtNjRxMC0xNCA5LTIzdDIzLTloNjA4di0xMjkxcS00MC0xNC03MS41LTQ1LjV0LTQ1LjUtNzEuNWgtNDkxcS0xNCAwLTIzLTl0LTktMjN2LTY0cTAtMTQgOS0yM3QyMy05aDQ5MXEyMS01NyA3MC05Mi41dDExMS0zNS41IDExMSAzNS41IDcwIDkyLjVoNDkxcTE0IDAgMjMgOXQ5IDIzdjY0cTAgMTQtOSAyM3QtMjMgOWgtNDkxem0tMTgxIDE2cTMzIDAgNTYuNS0yMy41dDIzLjUtNTYuNS0yMy41LTU2LjUtNTYuNS0yMy41LTU2LjUgMjMuNS0yMy41IDU2LjUgMjMuNSA1Ni41IDU2LjUgMjMuNXptMTA4OCA4ODBxMCA3My00Ni41IDEzMXQtMTE3LjUgOTEtMTQ0LjUgNDkuNS0xMzkuNSAxNi41LTEzOS41LTE2LjUtMTQ0LjUtNDkuNS0xMTcuNS05MS00Ni41LTEzMXEwLTExIDM1LTgxdDkyLTE3NC41IDEwNy0xOTUuNSAxMDItMTg0IDU2LTEwMHExOC0zMyA1Ni0zM3Q1NiAzM3E0IDcgNTYgMTAwdDEwMiAxODQgMTA3IDE5NS41IDkyIDE3NC41IDM1IDgxem0tMTI4MCAwcTAgNzMtNDYuNSAxMzF0LTExNy41IDkxLTE0NC41IDQ5LjUtMTM5LjUgMTYuNS0xMzkuNS0xNi41LTE0NC41LTQ5LjUtMTE3LjUtOTEtNDYuNS0xMzFxMC0xMSAzNS04MXQ5Mi0xNzQuNSAxMDctMTk1LjUgMTAyLTE4NCA1Ni0xMDBxMTgtMzMgNTYtMzN0NTYgMzNxNCA3IDU2IDEwMHQxMDIgMTg0IDEwNyAxOTUuNSA5MiAxNzQuNSAzNSA4MXoiLz48L3N2Zz4=', diff --git a/src/app/ui/landing-page/generate.js b/src/app/ui/landing-page/generate.js index 134be631a8..fc14675708 100644 --- a/src/app/ui/landing-page/generate.js +++ b/src/app/ui/landing-page/generate.js @@ -1,6 +1,7 @@ -/* global alert */ +/* global */ import LandingPage from './landing-page' import Section from './section' +import { defaultWorkspaces } from './workspace' export function homepageProfile () { return { @@ -13,7 +14,8 @@ export function homepageProfile () { } } -export function generateHomePage () { +export function generateHomePage (appManager) { + /* var actions1 = [ {label: 'new file', type: `callback`, payload: () => { alert(`-new file created-`) }}, {label: 'import from GitHub', type: `callback`, payload: () => { alert(`-imported from GitHub-`) }}, @@ -51,6 +53,12 @@ export function generateHomePage () { var section3 = new Section('Learn', actions3) var section4 = new Section('Plugins', actions4) var section5 = new Section('Help', actions5) + */ - return new LandingPage([section1, section2, section3, section4, section5]) + var sectionsWorkspaces = [] + defaultWorkspaces(appManager).forEach((workspace) => { + sectionsWorkspaces.push({label: workspace.title, type: 'callback', payload: () => { workspace.activate() }}) + }) + var sectionWorkspace = new Section('Workspaces', sectionsWorkspaces) + return new LandingPage([sectionWorkspace]) } diff --git a/src/app/ui/landing-page/workspace.js b/src/app/ui/landing-page/workspace.js new file mode 100644 index 0000000000..2f8399bfe3 --- /dev/null +++ b/src/app/ui/landing-page/workspace.js @@ -0,0 +1,50 @@ +export class Workspace { + constructor (title, description, activate, deactivate) { + this.title = title + this.description = description + this.activate = activate + this.deactivate = deactivate + } +} + +export const defaultWorkspaces = (appManager, appStore) => { + return [ + new Workspace('Close All Modules', '', () => { + appStore.getActives() + .filter(({profile}) => !profile.required) + .forEach((profile) => { appManager.deactivateOne(profile.name) }) + }, () => {}), + new Workspace('Solidity Basic', '', () => { + appManager.ensureActivated('solidity') + }, () => {}), + new Workspace('Solidity Unit testing', '', () => { + appManager.ensureActivated('solidity') + appManager.ensureActivated('solidityUnitTesting') + }, () => {}), + new Workspace('Solidity Full Environement', '', () => { + appManager.ensureActivated('solidity') + appManager.ensureActivated('run') + appManager.ensureActivated('solidityStaticAnalysis') + appManager.ensureActivated('solidityUnitTesting') + }, () => {}), + new Workspace('Vyper Basic', '', () => { + appManager.ensureActivated('vyper') + }, () => {}), + new Workspace('Pipeline', '', () => { + appManager.ensureActivated('solidity') + appManager.ensureActivated('run') + appManager.ensureActivated('pipeline') + }, () => {}), + new Workspace('Deploy and Run Solidity', '', () => { + appManager.ensureActivated('solidity') + appManager.ensureActivated('run') + }, () => {}), + new Workspace('Deploy and Run Vyper', '', () => { + appManager.ensureActivated('vyper') + appManager.ensureActivated('run') + }, () => {}), + new Workspace('Debugger', '', () => { + appManager.ensureActivated('debugger') + }, () => {}) + ] +} diff --git a/src/remixAppManager.js b/src/remixAppManager.js index 6bca9c35b5..744e0e2964 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -14,6 +14,10 @@ export class RemixAppManager extends AppManagerApi { } } + ensureActivated (module) { + if (!this.store.isActive(module)) this.activateOne(module) + } + proxy () { // that's temporary. should be removed when we can have proper notification registration return this.data.proxy From 86eb049ae11a19622784fa332db41a36dc3a96b1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 14:45:39 +0100 Subject: [PATCH 158/636] fix browser test && add displayName to profile --- src/app/panels/file-panel.js | 3 ++- test-browser/tests/ballot.js | 6 +++--- test-browser/tests/compiling.js | 6 +++--- test-browser/tests/sharedFolderExplorer.js | 4 ++-- test-browser/tests/simpleContract.js | 2 +- test-browser/tests/staticanalysis.js | 2 +- test-browser/tests/units/testRecorder.js | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index bf69ecddd9..e26e815e5f 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -169,7 +169,8 @@ function filepanel (localRegistry) { self.profile = function () { return { - name: 'file explorers', + name: 'fileExplorers', + displayName: 'file explorers', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNjgtNDAgMTI4LTQwaDQxNnptLTU0NCAyMTNsLTI5OSAyOTloMjk5di0yOTl6bS02NDAtMzg0bC0yOTkgMjk5aDI5OXYtMjk5em0xOTYgNjQ3bDMxNi0zMTZ2LTQxNmgtMzg0djQxNnEwIDQwLTI4IDY4dC02OCAyOGgtNDE2djY0MGg1MTJ2LTI1NnEwLTQwIDIwLTg4dDQ4LTc2em05NTYgODA0di0xMTUyaC0zODR2NDE2cTAgNDAtMjggNjh0LTY4IDI4aC00MTZ2NjQwaDg5NnoiLz48L3N2Zz4=', diff --git a/test-browser/tests/ballot.js b/test-browser/tests/ballot.js index 2861632bc0..fe4fb245be 100644 --- a/test-browser/tests/ballot.js +++ b/test-browser/tests/ballot.js @@ -34,7 +34,7 @@ function runTests (browser, testData) { contractHelper.testContracts(browser, 'Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot'], function () { done() }) - }).clickLaunchIcon('run transactions') + }).clickLaunchIcon('run') .setValue('input[placeholder="uint8 _numProposals"]', '1') .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(2)') @@ -65,7 +65,7 @@ function runTests (browser, testData) { done() }) }) - .clickLaunchIcon('run transactions') + .clickLaunchIcon('run') .click('div[class^="udappClose"]') .perform((client, done) => { console.log('ballot.abi') @@ -79,7 +79,7 @@ function runTests (browser, testData) { done() }) }) - .clickLaunchIcon('file explorers') + .clickLaunchIcon('fileExplorers') .perform((client, done) => { console.log('addInstance 0x692a70D2e424a56D2C6C27aA97D1a86395877b3A') contractHelper.addInstance(browser, '0x692a70D2e424a56D2C6C27aA97D1a86395877b3A', true, true, () => { diff --git a/test-browser/tests/compiling.js b/test-browser/tests/compiling.js index fc82913722..7817299af6 100644 --- a/test-browser/tests/compiling.js +++ b/test-browser/tests/compiling.js @@ -38,7 +38,7 @@ function runTests (browser) { function testSimpleContract (browser, callback) { contractHelper.testContracts(browser, 'Untitled.sol', sources[0]['browser/Untitled.sol'], ['TestContract'], function () { - browser.clickLaunchIcon('run transactions') + browser.clickLaunchIcon('run') .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(2)') .click('.instance:nth-of-type(2)') @@ -69,7 +69,7 @@ function testSimpleContract (browser, callback) { function testReturnValues (browser, callback) { contractHelper.testContracts(browser, 'returnValues.sol', sources[1]['browser/returnValues.sol'], ['testReturnValues'], function () { - browser.clickLaunchIcon('run transactions') + browser.clickLaunchIcon('run') .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(2)') .click('.instance:nth-of-type(2)') @@ -107,7 +107,7 @@ function testReturnValues (browser, callback) { function testInputValues (browser, callback) { contractHelper.testContracts(browser, 'inputValues.sol', sources[2]['browser/inputValues.sol'], ['test'], function () { - browser.clickLaunchIcon('run transactions') + browser.clickLaunchIcon('run') .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(2)') .click('.instance:nth-of-type(2)') diff --git a/test-browser/tests/sharedFolderExplorer.js b/test-browser/tests/sharedFolderExplorer.js index 23ff14a47d..eb822f04e2 100644 --- a/test-browser/tests/sharedFolderExplorer.js +++ b/test-browser/tests/sharedFolderExplorer.js @@ -71,7 +71,7 @@ function runTests (browser, testData) { } browser .waitForElementVisible('#icon-panel', 10000) - .clickLaunchIcon('file explorers') + .clickLaunchIcon('fileExplorers') .click('.websocketconn') .waitForElementVisible('#modal-footer-ok', 10000) .click('#modal-footer-ok') @@ -132,7 +132,7 @@ function runTests (browser, testData) { testImportFromRemixd(browser, () => { done() }) }) .perform(function () { - browser.clickLaunchIcon('file explorers').click('[data-path="localhost"]') // collapse and expand + browser.clickLaunchIcon('fileExplorers').click('[data-path="localhost"]') // collapse and expand .waitForElementNotVisible('[data-path="localhost/folder1"]') .click('[data-path="localhost"]') .waitForElementVisible('[data-path="localhost/folder1"]') diff --git a/test-browser/tests/simpleContract.js b/test-browser/tests/simpleContract.js index 6165039b1f..b82c737c82 100644 --- a/test-browser/tests/simpleContract.js +++ b/test-browser/tests/simpleContract.js @@ -24,7 +24,7 @@ function runTests (browser) { browser .waitForElementVisible('#icon-panel', 10000) .clickLaunchIcon('solidity') - .clickLaunchIcon('file explorers') + .clickLaunchIcon('fileExplorers') .click('#swap-panel label[data-path="browser"]') .perform(() => { // the first fn is used to pass browser to the other ones. diff --git a/test-browser/tests/staticanalysis.js b/test-browser/tests/staticanalysis.js index accb26ffcc..f0af4d2129 100644 --- a/test-browser/tests/staticanalysis.js +++ b/test-browser/tests/staticanalysis.js @@ -40,7 +40,7 @@ function runTests (browser) { .clickLaunchIcon('solidity') contractHelper.testContracts(browser, 'Untitled.sol', sources[0]['browser/Untitled.sol'], ['TooMuchGas', 'test1', 'test2'], function () { browser - .clickLaunchIcon('solidity static analysis') + .clickLaunchIcon('solidityStaticAnalysis') .click('#staticanalysisView button') .waitForElementPresent('#staticanalysisresult .staticAnalysisWarning', 2000, true, function () { dom.listSelectorContains(['browser/Untitled.sol:2:33:Use of tx.origin', diff --git a/test-browser/tests/units/testRecorder.js b/test-browser/tests/units/testRecorder.js index 745daa98c2..5f5f5f201d 100644 --- a/test-browser/tests/units/testRecorder.js +++ b/test-browser/tests/units/testRecorder.js @@ -10,7 +10,7 @@ module.exports = { browser.clickLaunchIcon = contractHelper.clickLaunchIcon contractHelper.addFile(browser, 'scenario.json', {content: records}, () => { browser - .clickLaunchIcon('run transactions') + .clickLaunchIcon('run') .click('div[class^="cardContainer"] i[class^="arrow"]') .click('#runTabView .runtransaction') .waitForElementPresent('.instance:nth-of-type(2)') From d7d9c8b53bd4dacc8202227138b09fa2e022fc20 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 15:31:12 +0100 Subject: [PATCH 159/636] fix browser test && rename module --- src/framingService.js | 6 +++--- test-browser/helpers/contracts.js | 10 +++++----- test-browser/helpers/init.js | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/framingService.js b/src/framingService.js index fa50132742..e39bebbb19 100644 --- a/src/framingService.js +++ b/src/framingService.js @@ -2,12 +2,12 @@ export default { start: (appStore, swapPanelApi, verticalIconApi, mainPanelApi, resizeFeature) => { swapPanelApi.event.on('toggle', (moduleName) => { resizeFeature.panel1.clientWidth !== 0 ? resizeFeature.minimize() : resizeFeature.maximise() - if (moduleName === 'file explorers') { + if (moduleName === 'fileExplorers') { mainPanelApi.showContent('code editor') } }) swapPanelApi.event.on('showing', (moduleName) => { - if (moduleName === 'file explorers') { + if (moduleName === 'fileExplorers') { mainPanelApi.showContent('code editor') } resizeFeature.panel1.clientWidth === 0 ? resizeFeature.maximise() : '' @@ -21,7 +21,7 @@ export default { }) // mainPanelApi.event.on('showing', (moduleName) => {}) - verticalIconApi.select('file explorers') + verticalIconApi.select('fileExplorers') verticalIconApi.select('homepage') resizeFeature.minimize() } diff --git a/test-browser/helpers/contracts.js b/test-browser/helpers/contracts.js index fef021a582..d7ac4df799 100644 --- a/test-browser/helpers/contracts.js +++ b/test-browser/helpers/contracts.js @@ -50,14 +50,14 @@ function getCompiledContracts (browser, compiled, callback) { } function selectContract (browser, contractName, callback) { - browser.clickLaunchIcon('settings').clickLaunchIcon('run transactions') + browser.clickLaunchIcon('settings').clickLaunchIcon('run') .setValue('#runTabView select[class^="contractNames"]', contractName).perform(() => { callback() }) } function createContract (browser, inputParams, callback) { - browser.clickLaunchIcon('settings').clickLaunchIcon('run transactions') + browser.clickLaunchIcon('settings').clickLaunchIcon('run') .setValue('div[class^="contractActionsContainerSingle"] input', inputParams, function () { browser.click('#runTabView button[class^="instanceButton"]').pause(500).perform(function () { callback() }) }) @@ -217,7 +217,7 @@ function setEditorValue (value, callback) { } function addInstance (browser, address, isValidFormat, isValidChecksum, callback) { - browser.clickLaunchIcon('run transactions').clearValue('.ataddressinput').setValue('.ataddressinput', address, function () { + browser.clickLaunchIcon('run').clearValue('.ataddressinput').setValue('.ataddressinput', address, function () { browser.click('div[class^="atAddress"]') .execute(function () { var ret = document.querySelector('div[class^="modalBody"] div').innerHTML @@ -265,7 +265,7 @@ function modalFooterOKClick () { } function addFile (browser, name, content, done) { - browser.clickLaunchIcon('run transactions').clickLaunchIcon('file explorers').click('.newFile') + browser.clickLaunchIcon('run').clickLaunchIcon('fileExplorers').click('.newFile') .perform((client, done) => { browser.execute(function (fileName) { if (fileName !== 'Untitled.sol') { @@ -372,7 +372,7 @@ function useFilter (browser, filter, test, done) { } function switchFile (browser, name, done) { - browser.clickLaunchIcon('settings').clickLaunchIcon('file explorers') + browser.clickLaunchIcon('settings').clickLaunchIcon('fileExplorers') .click('li[key="' + name + '"]') .pause(2000) .perform(() => { diff --git a/test-browser/helpers/init.js b/test-browser/helpers/init.js index f3c186a34d..3e913bdfd8 100644 --- a/test-browser/helpers/init.js +++ b/test-browser/helpers/init.js @@ -22,10 +22,10 @@ function initModules (browser, callback) { document.querySelector('div[title="pluginManager"]').scrollTop = document.querySelector('div[title="pluginManager"]').scrollHeight }, [], function () { browser.click('#pluginManager div[title="solidity"] button') - .click('#pluginManager div[title="run transactions"] button') - .click('#pluginManager div[title="solidity static analysis"] button') + .click('#pluginManager div[title="run"] button') + .click('#pluginManager div[title="solidityStaticAnalysis"] button') .click('#pluginManager div[title="debugger"] button') - .click('#icon-panel div[title="file explorers"]') + .click('#icon-panel div[title="fileExplorers"]') .perform(() => { callback() }) }) } From 7d2e1c7b831efb9af55f897f57aa27b6b9c89965 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Sat, 2 Mar 2019 15:22:45 +0100 Subject: [PATCH 160/636] Add new version of vyper url --- src/remixAppManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remixAppManager.js b/src/remixAppManager.js index 744e0e2964..98efacf440 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -64,7 +64,7 @@ export class RemixAppManager extends AppManagerApi { events: [], methods: [], notifications: {}, - url: 'https://plugin.vyper.live', + url: 'https://remix-vyper.surge.sh/', description: 'compile vyper contracts', icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDA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H 161/636] step 1 of bootstrap --- index.html | 1 + .../components/plugin-manager-component.js | 19 ++++---- src/app/ui/styles-guide/theme-chooser.js | 45 +++++++++++++++---- 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index e1c6d92b80..934a8e74a1 100644 --- a/index.html +++ b/index.html @@ -28,6 +28,7 @@ --> Remix - Solidity IDE + diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index fce979f919..fcadba7aaa 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -1,8 +1,8 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') -const styleguide = require('../ui/styles-guide/theme-chooser') -const styles = styleguide.chooser() +// const styleguide = require('../ui/styles-guide/theme-chooser') +// const styles = styleguide.chooser() const EventEmitter = require('events') @@ -120,11 +120,16 @@ class PluginManagerComponent { } ctrBtns = yo`
    - +
    ` + //
    + // + // + //
    + return yo` -
    +

    ${displayName}

    ${mod.profile.description} ${ctrBtns} @@ -160,7 +165,7 @@ module.exports = PluginManagerComponent const css = csjs` .plugins_settings h2 { font-size: 1em; - border-bottom: 1px ${styles.appProperties.solidBorderBox_BorderColor} solid; + border-bottom: 1px red solid; padding: 10px 20px; font-size: 10px; padding: 10px 20px; @@ -170,10 +175,8 @@ const css = csjs` margin-bottom: 0; } .plugin { - ${styles.rightPanel.compileTab.box_CompileContainer}; margin: 0; margin-bottom: 2%; - border-bottom: 1px ${styles.appProperties.solidBorderBox_BorderColor} solid; padding: 0px 20px 10px; } .plugin h3 { @@ -183,8 +186,6 @@ const css = csjs` } .plugin button { - ${styles.rightPanel.settingsTab.button_LoadPlugin}; - cursor: pointer; font-size: 10px; } .activePlugins { diff --git a/src/app/ui/styles-guide/theme-chooser.js b/src/app/ui/styles-guide/theme-chooser.js index fb0e999406..efd2e50cfe 100644 --- a/src/app/ui/styles-guide/theme-chooser.js +++ b/src/app/ui/styles-guide/theme-chooser.js @@ -2,34 +2,61 @@ var styleGuideLight = require('./style-guide') var styleGuideDark = require('./styleGuideDark') var styleGuideClean = require('./styleGuideClean') var Storage = require('remix-lib').Storage + +// Boostrap themes +// TODO : Put it somewhere else +const themes = { + dark: 'https://bootstrap.themes.guide/darkster/theme.min.css', + light: 'https://bootstrap.themes.guide/herbie/theme.min.css', + clean: 'https://bootstrap.themes.guide/signal/theme.min.css' +} module.exports = { chooser: function () { var themeStorage = new Storage('style:') if (themeStorage.exists('theme')) { if (themeStorage.get('theme') === 'dark') { + document.getElementById('theme-link').setAttribute('href', themes['dark']) return styleGuideDark() } else if (themeStorage.get('theme') === 'clean') { + document.getElementById('theme-link').setAttribute('href', themes['clean']) return styleGuideClean() } else { + document.getElementById('theme-link').setAttribute('href', themes['light']) return styleGuideLight() } } else { + document.getElementById('theme-link').setAttribute('href', themes['light']) return styleGuideLight() } }, switchTheme: function (theme) { var themeStorage = new Storage('style:') + console.log(document) themeStorage.set('theme', theme) - if (theme === 'dark') { - return styleGuideDark() - } else if (theme === 'light') { - return styleGuideLight() - } else if (theme === 'clean') { - return styleGuideClean() - } else { - return styleGuideLight() - } + // if (theme === 'dark') { + // return styleGuideDark() + // } else if (theme === 'light') { + // return styleGuideLight() + // } else if (theme === 'clean') { + // return styleGuideClean() + // } else { + // return styleGuideLight() + // } + // // Boostrap themes + // // TODO : Put it somewhere else + // const themes = { + // dark: 'https://bootstrap.themes.guide/darkster/theme.min.css', + // light: 'https://bootstrap.themes.guide/herbie/theme.min.css', + // clean: 'https://bootstrap.themes.guide/signal/theme.min.css' + // } + + // if (themes[theme]) { + // document.getElementById('theme-link').setAttribute('href', themes[theme]) + // } + // else { + // document.getElementById('theme-link').setProperty('href', themes['light']) + // } } } From b1f3a8c3909229283b9c2d01291b76bdaa42a5d4 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 19 Feb 2019 10:28:52 +0100 Subject: [PATCH 162/636] Change remixd script to make it work on Windows --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 570831afab..f429b4a1b1 100644 --- a/package.json +++ b/package.json @@ -174,7 +174,7 @@ "nightwatch_remote_debugger_parallel": "nightwatch --config nightwatch_debugger.js --env safari,chrome,default", "onchange": "onchange build/app.js -- npm-run-all lint", "prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build", - "remixd": "./node_modules/remixd/bin/remixd -s ./contracts --remix-ide http://127.0.0.1:8080", + "remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080", "selenium": "execr --silent selenium-standalone start", "selenium-install": "selenium-standalone install", "serve": "execr --silent http-server .", From 5a518572e3c5f6a62d1b060dd5aa0499cba7f196 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 19 Feb 2019 10:37:06 +0100 Subject: [PATCH 163/636] Switch theme without reload --- src/app/tabs/settings-tab.js | 6 +++--- src/app/ui/styles-guide/theme-chooser.js | 18 +++--------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 164741cdd5..619cf06452 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -142,15 +142,15 @@ module.exports = class SettingsTab { } function onswitch2darkTheme (event) { styleGuide.switchTheme('dark') - window.location.reload() + // window.location.reload() } function onswitch2lightTheme (event) { styleGuide.switchTheme('light') - window.location.reload() + // window.location.reload() } function onswitch2cleanTheme (event) { styleGuide.switchTheme('clean') - window.location.reload() + // window.location.reload() } function onchangePersonal (event) { self._deps.config.set('settings/personal-mode', !self._deps.config.get('settings/personal-mode')) diff --git a/src/app/ui/styles-guide/theme-chooser.js b/src/app/ui/styles-guide/theme-chooser.js index efd2e50cfe..25ce70405f 100644 --- a/src/app/ui/styles-guide/theme-chooser.js +++ b/src/app/ui/styles-guide/theme-chooser.js @@ -33,8 +33,10 @@ module.exports = { switchTheme: function (theme) { var themeStorage = new Storage('style:') - console.log(document) themeStorage.set('theme', theme) + if (themes[theme]) { + document.getElementById('theme-link').setAttribute('href', themes[theme]) + } // if (theme === 'dark') { // return styleGuideDark() // } else if (theme === 'light') { @@ -44,19 +46,5 @@ module.exports = { // } else { // return styleGuideLight() // } - // // Boostrap themes - // // TODO : Put it somewhere else - // const themes = { - // dark: 'https://bootstrap.themes.guide/darkster/theme.min.css', - // light: 'https://bootstrap.themes.guide/herbie/theme.min.css', - // clean: 'https://bootstrap.themes.guide/signal/theme.min.css' - // } - - // if (themes[theme]) { - // document.getElementById('theme-link').setAttribute('href', themes[theme]) - // } - // else { - // document.getElementById('theme-link').setProperty('href', themes['light']) - // } } } From 47026d1d9262e0ccced0a3975969937bfefabc38 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 19 Feb 2019 15:12:18 +0100 Subject: [PATCH 164/636] update test scripts to make it work on Windows --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f429b4a1b1..c1df7fcc2e 100644 --- a/package.json +++ b/package.json @@ -181,7 +181,7 @@ "serve_debugger": "execr --silent http-server src/app/debugger/remix-debugger", "sourcemap": "exorcist --root ../ build/app.js.map > build/app.js", "start": "npm-run-all -lpr serve watch onchange remixd", - "test": "npm run csslint; standard && node test/index.js", + "test": "csslint && standard && node test/index.js", "test-browser": "npm-run-all -lpr selenium downloadsolc_root make-mock-compiler serve browsertest", "watch": "watchify src/index.js -dv -p browserify-reload -o build/app.js --exclude solc" } From eaba9b716519dd2d1a2df34fd644be4fcb07eb50 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 19 Feb 2019 15:12:48 +0100 Subject: [PATCH 165/636] Plugin Manager with checkboxes and reactive filter --- .../components/plugin-manager-component.js | 214 ++++++------------ src/app/ui/styles-guide/theme-chooser.js | 2 +- 2 files changed, 70 insertions(+), 146 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index fcadba7aaa..6c659691ff 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -1,11 +1,14 @@ -var yo = require('yo-yo') -var csjs = require('csjs-inject') - -// const styleguide = require('../ui/styles-guide/theme-chooser') -// const styles = styleguide.chooser() +const yo = require('yo-yo') +const csjs = require('csjs-inject') const EventEmitter = require('events') +const css = csjs` + .pluginManager { + padding: 10px; + } +` + class PluginManagerComponent { constructor () { @@ -14,6 +17,7 @@ class PluginManagerComponent { root: null, items: {} } + this.filter = '' } profile () { @@ -40,103 +44,72 @@ class PluginManagerComponent { this.store.event.on('remove', (entity) => { this.reRender() }) } - render () { - let activeMods = yo` -
    -

    Active Modules

    -
    - ` - let inactiveMods = yo` -
    -

    Inactive Modules

    -
    - ` - let searchbox = yo` - - ` - var rootView = yo` -
    -

    Plugin Manager

    - ${searchbox} - ${activeMods} - ${inactiveMods} -
    - ` - - searchbox.addEventListener('keyup', (event) => { this.filterPlugins(event.target) }) - - var modulesActiveNotReq = this.store.getActives().filter(({profile}) => !profile.required) - this.sortObject(modulesActiveNotReq) - - if (modulesActiveNotReq.length > 0) { - modulesActiveNotReq.forEach((mod) => { - activeMods.appendChild(this.renderItem(mod.profile.name)) - }) - activeMods.style.display = 'block' - } else { - activeMods.style.display = 'none' - } - - var modulesAllNotReq = this.store.getAll().filter(({profile}) => !profile.required) - this.sortObject(modulesAllNotReq) - modulesAllNotReq.forEach((mod) => { - if (!modulesActiveNotReq.includes(mod)) { - inactiveMods.appendChild(this.renderItem(mod.profile.name)) - } - }) - if (!this.views.root) { - this.views.root = rootView - } - return rootView - } - - searchBox () { - if (this.views.root) { - return this.views.root.querySelector('#filter_plugins') - } - return null - } - - sortObject (obj) { - obj.sort((a, b) => { - var textA = a.profile.name.toUpperCase() - var textB = b.profile.name.toUpperCase() - return (textA < textB) ? -1 : (textA > textB) ? 1 : 0 - }) - } - renderItem (item) { - let ctrBtns - const mod = this.store.getOne(item) if (!mod) return - let displayName = (mod.profile.displayName) ? mod.profile.displayName : mod.profile.name - let action = () => { - if (this.store.isActive(item)) { - this.appManager.deactivateOne(item) - } else { - this.appManager.activateOne(item) - } - } - - ctrBtns = yo`
    - -
    ` + const isActive = this.store.actives.includes(mod.profile.name) + const displayName = (mod.profile.displayName) ? mod.profile.displayName : mod.profile.name - //
    - // - // - //
    + const input = isActive + ? yo`` + : yo`` return yo` -
    -

    ${displayName}

    - ${mod.profile.description} - ${ctrBtns} -
    +
    +
    + ${input} +
    ${displayName}
    +
    +

    ${mod.profile.description}

    +
    ` } + render () { + // Filtering helpers + const isFiltered = ({profile}) => profile.name.toLowerCase().includes(this.filter) + const isNotRequired = ({profile}) => !profile.required + const sortByName = (a, b) => { + const nameA = a.profile.name.toUpperCase() + const nameB = b.profile.name.toUpperCase() + return (nameA < nameB) ? -1 : (nameA > nameB) ? 1 : 0 + } + + // Filter all active and inactive modules that are not required + const { actives, inactives } = this.store.getAll() + .filter(isFiltered) + .filter(isNotRequired) + .sort(sortByName) + .reduce(({actives, inactives}, {profile}) => { + return this.store.actives.includes(profile.name) + ? { actives: [...actives, profile.name], inactives } + : { inactives: [...inactives, profile.name], actives } + }, { actives: [], inactives: [] }) + + const activeTile = actives.length !== 0 + ? yo`

    Active Modules

    ` + : '' + const inactiveTile = inactives.length !== 0 + ? yo`

    Inactive Modules

    ` + : '' + + const rootView = yo` +
    +

    Plugin Manager

    +
    +
    + +
    + ${activeTile} + ${actives.map(name => this.renderItem(name))} + ${inactiveTile} + ${inactives.map(name => this.renderItem(name))} +
    + ` + if (!this.views.root) this.views.root = rootView + return rootView + } + reRender () { if (this.views.root) { yo.update(this.views.root, this.render()) @@ -144,59 +117,10 @@ class PluginManagerComponent { } } - filterPlugins (target) { - if (!target) return - let filterOn = target.value.toUpperCase() - var nodes = this.views.root.querySelectorAll(`.${css.plugin}`) - nodes.forEach((node) => { - let h = node.querySelector('h3') - let txtValue = h.textContent || h.innerText - if (txtValue.toLowerCase().indexOf(filterOn.toLowerCase()) !== -1) { - node.style.display = 'block' - } else { - node.style.display = 'none' - } - }) + filterPlugins ({ target }) { + this.filter = target.value.toLowerCase() + this.reRender() } } module.exports = PluginManagerComponent - -const css = csjs` - .plugins_settings h2 { - font-size: 1em; - border-bottom: 1px red solid; - padding: 10px 20px; - font-size: 10px; - padding: 10px 20px; - text-transform: uppercase; - font-weight: normal; - background-color: white; - margin-bottom: 0; - } - .plugin { - margin: 0; - margin-bottom: 2%; - padding: 0px 20px 10px; - } - .plugin h3 { - margin-bottom: 5px; - font-size: 12px; - margin-top: 9px; - } - - .plugin button { - font-size: 10px; - } - .activePlugins { - } - - .inactivePlugins { - } - .plugins_settings input { - margin: 10px; - } - .hideIt { - display: none; - } -` diff --git a/src/app/ui/styles-guide/theme-chooser.js b/src/app/ui/styles-guide/theme-chooser.js index 25ce70405f..9ede538992 100644 --- a/src/app/ui/styles-guide/theme-chooser.js +++ b/src/app/ui/styles-guide/theme-chooser.js @@ -36,7 +36,7 @@ module.exports = { themeStorage.set('theme', theme) if (themes[theme]) { document.getElementById('theme-link').setAttribute('href', themes[theme]) - } + } // if (theme === 'dark') { // return styleGuideDark() // } else if (theme === 'light') { From f8c7308cb6a93fc870cc9d2ad1dba2d2d50c6ab1 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 19 Feb 2019 15:48:27 +0100 Subject: [PATCH 166/636] modify gist handler for testing --- test/gist-handler-test.js | 110 ++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 64 deletions(-) diff --git a/test/gist-handler-test.js b/test/gist-handler-test.js index 367fc58bf5..226f2cbc69 100644 --- a/test/gist-handler-test.js +++ b/test/gist-handler-test.js @@ -1,70 +1,52 @@ 'use strict' - -var test = require('tape') - -var GistHandler = require('../src/lib/gist-handler') - -test('gistHandler.handleLoad with no gist param', function (t) { - t.plan(1) - - var gistHandler = new GistHandler({}) - - var params = {} - var result = gistHandler.handleLoad(params, null) - - t.equal(result, false) -}) - -test('gistHandler.handleLoad with blank gist param, and invalid user input', function (t) { - t.plan(3) - - var fakeWindow = {prompt: function (title, message, input, cb) { - t.ok(message) - t.ok(message.match(/gist/i)) - cb('invalid') - }} - - var gistHandler = new GistHandler(fakeWindow) - - var params = {'gist': ''} - var result = gistHandler.handleLoad(params, null) - - t.equal(result, true) -}) - -test('gistHandler.handleLoad with blank gist param, and valid user input', function (t) { - t.plan(4) - - var fakeWindow = {prompt: function (title, message, input, cb) { - t.ok(message) - t.ok(message.match(/gist/i)) - cb('Beef1234') - }} - - var cb = function (gistId) { - t.equal(gistId, 'Beef1234') +var modalDialogCustom +if (typeof window !== 'undefined') { + modalDialogCustom = require('../app/ui/modal-dialog-custom') +} +// ^ this class can be load in a non browser context when running node unit testing. +// should not load UI in that case + +// Allowing window to be overriden for testing +function GistHandler (_window) { + if (_window !== undefined) { + modalDialogCustom = _window } - var gistHandler = new GistHandler(fakeWindow) - - var params = {'gist': ''} - var result = gistHandler.handleLoad(params, cb) - - t.equal(result, true) -}) - -test('gistHandler.handleLoad with gist param', function (t) { - t.plan(2) - - var gistHandler = new GistHandler({}) - - var params = {'gist': 'abc'} - - var cb = function (gistId) { - t.equal(gistId, 'abc') + this.handleLoad = function (params, cb) { + if (!cb) cb = () => {} + var loadingFromGist = false + var gistId + if (params['gist'] === '') { + loadingFromGist = true + modalDialogCustom.prompt( + null, + 'Enter the URL or ID of the Gist you would like to load.', + null, + target => { + if (target !== '') { + gistId = getGistId(target) + if (gistId) { + cb(gistId) + } + } + } + ) + return loadingFromGist + } else { + gistId = params['gist'] + loadingFromGist = !!gistId + } + if (loadingFromGist) { + cb(gistId) + } + return loadingFromGist } - var result = gistHandler.handleLoad(params, cb) + function getGistId (str) { + var idr = /[0-9A-Fa-f]{8,}/ + var match = idr.exec(str) + return match ? match[0] : null + } +} - t.equal(result, true) -}) +module.exports = GistHandler From fe313515752f697742c1cd0a74224699f23b8230 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 19 Feb 2019 17:18:35 +0100 Subject: [PATCH 167/636] Add themeVariable for scrollbar --- src/app/ui/styles-guide/theme-chooser.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/ui/styles-guide/theme-chooser.js b/src/app/ui/styles-guide/theme-chooser.js index 9ede538992..671f0e5f8a 100644 --- a/src/app/ui/styles-guide/theme-chooser.js +++ b/src/app/ui/styles-guide/theme-chooser.js @@ -10,6 +10,12 @@ const themes = { light: 'https://bootstrap.themes.guide/herbie/theme.min.css', clean: 'https://bootstrap.themes.guide/signal/theme.min.css' } +// Used for the scroll color +const themeVariable = { + dark: 'dark', + light: 'light', + clean: 'light' +} module.exports = { chooser: function () { @@ -17,16 +23,20 @@ module.exports = { if (themeStorage.exists('theme')) { if (themeStorage.get('theme') === 'dark') { document.getElementById('theme-link').setAttribute('href', themes['dark']) + document.documentElement.style.setProperty('--theme', 'dark') return styleGuideDark() } else if (themeStorage.get('theme') === 'clean') { document.getElementById('theme-link').setAttribute('href', themes['clean']) + document.documentElement.style.setProperty('--theme', 'light') return styleGuideClean() } else { document.getElementById('theme-link').setAttribute('href', themes['light']) + document.documentElement.style.setProperty('--theme', 'light') return styleGuideLight() } } else { document.getElementById('theme-link').setAttribute('href', themes['light']) + document.documentElement.style.setProperty('--theme', 'light') return styleGuideLight() } }, @@ -36,6 +46,7 @@ module.exports = { themeStorage.set('theme', theme) if (themes[theme]) { document.getElementById('theme-link').setAttribute('href', themes[theme]) + document.documentElement.style.setProperty('--theme', themeVariable[theme]) } // if (theme === 'dark') { // return styleGuideDark() From c809ec1c0bbc5ec57dd48aacfc22800466aca000 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 19 Feb 2019 17:18:47 +0100 Subject: [PATCH 168/636] update style for plugin manager --- .../components/plugin-manager-component.js | 84 +++++++++++++------ 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 6c659691ff..c40969b406 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -4,8 +4,21 @@ const csjs = require('csjs-inject') const EventEmitter = require('events') const css = csjs` - .pluginManager { + .pluginSearch { padding: 10px; + position: sticky; + top: 0; + z-index: 2; + } + .displayName { + text-transform: capitalize; + } + .description { + text-transform: capitalize; + } + .row { + display: flex; + flex-direction: row; } ` @@ -44,23 +57,29 @@ class PluginManagerComponent { this.store.event.on('remove', (entity) => { this.reRender() }) } - renderItem (item) { - const mod = this.store.getOne(item) + renderItem (name) { + const mod = this.store.getOne(name) if (!mod) return - const isActive = this.store.actives.includes(mod.profile.name) - const displayName = (mod.profile.displayName) ? mod.profile.displayName : mod.profile.name - - const input = isActive - ? yo`` - : yo`` + const isActive = this.store.actives.includes(name) + const displayName = (mod.profile.displayName) ? mod.profile.displayName : name + + const activationButton = isActive + ? yo` + ` + : yo` + ` return yo` -
    -
    - ${input} -
    ${displayName}
    +
    +
    +
    ${displayName}
    + ${activationButton}
    -

    ${mod.profile.description}

    +

    ${mod.profile.description}

    ` } @@ -87,24 +106,39 @@ class PluginManagerComponent { }, { actives: [], inactives: [] }) const activeTile = actives.length !== 0 - ? yo`

    Active Modules

    ` + ? yo` + ` : '' const inactiveTile = inactives.length !== 0 - ? yo`

    Inactive Modules

    ` + ? yo` + ` : '' const rootView = yo` -
    -

    Plugin Manager

    -
    -
    +
    + +
    - ${activeTile} - ${actives.map(name => this.renderItem(name))} - ${inactiveTile} - ${inactives.map(name => this.renderItem(name))} -
    +
    + ${activeTile} +
    + ${actives.map(name => this.renderItem(name))} +
    + ${inactiveTile} +
    + ${inactives.map(name => this.renderItem(name))} +
    +
    +
    ` if (!this.views.root) this.views.root = rootView return rootView From 05e140e5fdb7cca9455ed789e70cc70cf5df6edc Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Tue, 19 Feb 2019 17:43:12 +0100 Subject: [PATCH 169/636] update some colors --- src/app/components/plugin-manager-component.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index c40969b406..30e4889550 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -20,6 +20,10 @@ const css = csjs` display: flex; flex-direction: row; } + .isStuck { + background-color: var(--primary); + color: + } ` class PluginManagerComponent { @@ -69,7 +73,7 @@ class PluginManagerComponent { Deactivate ` : yo` - ` From 186cfbd2fe9a37ab949a50093ded0ae495273fd8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 20 Feb 2019 10:33:36 +0100 Subject: [PATCH 170/636] add missing client id --- src/app/components/plugin-manager-component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/plugin-manager-component.js b/src/app/components/plugin-manager-component.js index 30e4889550..4c70be13c4 100644 --- a/src/app/components/plugin-manager-component.js +++ b/src/app/components/plugin-manager-component.js @@ -125,7 +125,7 @@ class PluginManagerComponent { : '' const rootView = yo` -
    +
    From fc9b090da75e636137eb9a39d81f8281112e9347 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 20 Feb 2019 18:05:52 +0100 Subject: [PATCH 171/636] bootstrap_debugger --- .../debugger/debuggerUI/ButtonNavigator.js | 26 +++++++------------ src/app/debugger/debuggerUI/TxBrowser.js | 18 +++++-------- src/app/debugger/debuggerUI/VmDebugger.js | 10 +++---- .../debuggerUI/vmDebugger/CodeListView.js | 4 --- .../debuggerUI/vmDebugger/DropdownPanel.js | 11 +------- 5 files changed, 21 insertions(+), 48 deletions(-) diff --git a/src/app/debugger/debuggerUI/ButtonNavigator.js b/src/app/debugger/debuggerUI/ButtonNavigator.js index 86719dc41b..ab93272492 100644 --- a/src/app/debugger/debuggerUI/ButtonNavigator.js +++ b/src/app/debugger/debuggerUI/ButtonNavigator.js @@ -3,8 +3,6 @@ var EventManager = require('../../../lib/events') var yo = require('yo-yo') var csjs = require('csjs-inject') -var styleGuide = require('../../ui/styles-guide/theme-chooser') -var styles = styleGuide.chooser() var css = csjs` .buttons { @@ -17,7 +15,6 @@ var css = csjs` justify-content: center; } .stepButton { - ${styles.rightPanel.debuggerTab.button_Debugger} } .jumpButtons { width: 100%; @@ -25,13 +22,10 @@ var css = csjs` justify-content: center; } .jumpButton { - ${styles.rightPanel.debuggerTab.button_Debugger} } .navigator { - color: ${styles.rightPanel.debuggerTab.text_Primary}; } .navigator:hover { - color: ${styles.rightPanel.debuggerTab.button_Debugger_icon_HoverColor}; } ` @@ -51,20 +45,20 @@ function ButtonNavigator () { ButtonNavigator.prototype.render = function () { var self = this var view = yo`
    -
    - - - - +
    + + + +
    -
    - - - +
    + + +
    + +
    + Compiler Configuration +
      +
    • + ${this._view.autoCompile} + +
    • +
    • + ${this._view.optimize} + +
    • +
    • + ${this._view.hideWarningsBox} + +
    • +
    +
    + ` return this._view.compileContainer } @@ -160,14 +192,18 @@ class CompilerContainer { _updateVersionSelector () { this._view.versionSelector.innerHTML = '' - this._view.versionSelector.appendChild(yo``) - this.data.allversions.forEach(build => this._view.versionSelector.appendChild(yo``)) + this.data.allversions.forEach(build => { + const option = build.path === this.data.selectedVersion + ? yo`` + : yo`` + this._view.versionSelector.appendChild(option) + }) this._view.versionSelector.removeAttribute('disabled') this.queryParams.update({ version: this.data.selectedVersion }) - var url + let url if (this.data.selectedVersion === 'builtin') { - var location = window.document.location - location = location.protocol + '//' + location.host + '/' + location.pathname + let location = window.document.location + location = `${location.protocol}//${location.host}/${location.pathname}` if (location.endsWith('index.html')) location = location.substring(0, location.length - 10) if (!location.endsWith('/')) location += '/' url = location + 'soljson.js' @@ -177,7 +213,7 @@ class CompilerContainer { } url = `${this.data.baseurl}/${this.data.selectedVersion}` } - var isFirefox = typeof InstallTrigger !== 'undefined' + const isFirefox = typeof InstallTrigger !== 'undefined' if (document.location.protocol !== 'file:' && Worker !== undefined && isFirefox) { // Workers cannot load js on "file:"-URLs and we get a // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, From 034807000dbb76dd38bf404e9c281b68f623d9b4 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Wed, 27 Feb 2019 09:40:09 +0100 Subject: [PATCH 202/636] standard --- src/app/tabs/compile-tab.js | 20 ++++++++++++-------- src/app/tabs/compileTab/compilerContainer.js | 8 +++----- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index abb7ef9963..cdd418a354 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -153,7 +153,7 @@ class CompileTab { * Section to select the compiled contract * @param {string[]} contractList Names of the compiled contracts */ - contractSelection(contractList = []) { + contractSelection (contractList = []) { return contractList.length !== 0 ? yo`
    @@ -161,7 +161,7 @@ class CompileTab {
    - ${contractList.map((name) => yo``)} @@ -195,11 +195,11 @@ class CompileTab { } // TODO : Add success alert when compilation succeed - contractCompiledSuccess() { + contractCompiledSuccess () { return yo`` } // TODO : Add error alert when compilation failed - contractCompiledError() { + contractCompiledError () { return yo`` } @@ -207,7 +207,11 @@ class CompileTab { * METHODS */ - publish() { + selectContract (contractName) { + this.selectContract = contractName + } + + publish () { const selectContractNames = this._view.contractNames if (selectContractNames.children.length > 0 && selectContractNames.selectedIndex >= 0) { var contract = this.data.contractsDetails[selectContractNames.children[selectContractNames.selectedIndex].innerHTML] @@ -234,7 +238,7 @@ class CompileTab { } } - details() { + details () { const help = { 'Assembly': 'Assembly opcodes describing the contract including corresponding solidity source code', 'Opcodes': 'Assembly opcodes describing the contract', @@ -306,7 +310,7 @@ class CompileTab { } copyContractProperty (property) { - let content = getContractProperty(property) + let content = this.getContractProperty(property) if (!content) { addTooltip('No content available for ' + property) return @@ -325,7 +329,7 @@ class CompileTab { copyABI () { this.copyContractProperty('abi') } - + copyBytecode () { this.copyContractProperty('bytecode') } diff --git a/src/app/tabs/compileTab/compilerContainer.js b/src/app/tabs/compileTab/compilerContainer.js index 738637368c..36ba2b9dca 100644 --- a/src/app/tabs/compileTab/compilerContainer.js +++ b/src/app/tabs/compileTab/compilerContainer.js @@ -34,7 +34,7 @@ class CompilerContainer { /** * Update the compilation button with the name of the current file */ - set currentFile(name) { + set currentFile (name) { if (!this._view.compilationButton) return const button = this.compilationButton(name.split('/').pop()) yo.update(this._view.compilationButton, button) @@ -92,8 +92,7 @@ class CompilerContainer { /************** * SUBCOMPONENT */ - compilationButton(name) { - console.log({name}) + compilationButton (name) { return yo`
    ` } - render () { this.compileTabLogic.compiler.event.register('compilerLoaded', (version) => this.setVersionText(version)) this.fetchAllVersion((allversions, selectedVersion) => { @@ -193,7 +191,7 @@ class CompilerContainer { _updateVersionSelector () { this._view.versionSelector.innerHTML = '' this.data.allversions.forEach(build => { - const option = build.path === this.data.selectedVersion + const option = build.path === this.data.selectedVersion ? yo`` : yo`` this._view.versionSelector.appendChild(option) From 82458b0bfe97bf6fd4f6217e13ac576fb31be46f Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 10:54:17 +0100 Subject: [PATCH 203/636] remove errorContainerHead --- src/app/tabs/compile-tab.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index cdd418a354..e499e2404b 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -25,7 +25,6 @@ class CompileTab { el: null, warnCompilationSlow: null, errorContainer: null, - errorContainerHead: null, contractNames: null, contractEl: null } @@ -67,7 +66,6 @@ class CompileTab { this.compiler.event.register('compilationStarted', () => { if (this._view.errorContainer) { this._view.errorContainer.innerHTML = '' - this._view.errorContainerHead.innerHTML = '' } }) @@ -337,8 +335,7 @@ class CompileTab { render () { if (this._view.el) return this._view.el - this._view.errorContainer = yo`
    ` - this._view.errorContainerHead = yo`
    ` + this._view.errorContainer = yo`
    ` this._view.contractSelection = this.contractSelection() this._view.compilerContainer = this.compilerContainer.render() this.compilerContainer.currentFile = this._deps.fileManager.currentFile() @@ -347,7 +344,6 @@ class CompileTab {
    ${this._view.compilerContainer} ${this._view.contractSelection} - ${this._view.errorContainerHead} ${this._view.errorContainer}
    ` return this._view.el From a74538eba030a4fa0b4b410a052c814006114fcc Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 10:54:43 +0100 Subject: [PATCH 204/636] use visit contract instead of getContract --- src/app/tabs/compile-tab.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index e499e2404b..3de65ff930 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -87,11 +87,11 @@ class CompileTab { }) } // Update contract Selection - const contractMap = this.compiler.getContracts() - const contractSelection = this.contractSelection(Object.keys(contractMap) || []) + let contractMap = {} + if (success) this.compiler.visitContracts((contract) => { contractMap[contract.name] = contract }) + let contractSelection = this.contractSelection(Object.keys(contractMap) || []) yo.update(this._view.contractSelection, contractSelection) - let error = false if (data['error']) { error = true this._deps.renderer.error(data['error'].formattedMessage, this._view.errorContainer, {type: data['error'].severity || 'error'}) From 7c9b07af141a5321a2ba1fb80d3d026a054761f3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 10:55:10 +0100 Subject: [PATCH 205/636] remove "no error" label --- src/app/tabs/compile-tab.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 3de65ff930..1fbe56f860 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -93,7 +93,6 @@ class CompileTab { yo.update(this._view.contractSelection, contractSelection) if (data['error']) { - error = true this._deps.renderer.error(data['error'].formattedMessage, this._view.errorContainer, {type: data['error'].severity || 'error'}) if (data['error'].mode === 'panic') { return modalDialogCustom.alert(yo`
    @@ -104,7 +103,6 @@ class CompileTab { } } if (data.errors && data.errors.length) { - error = true data.errors.forEach((err) => { if (this._deps.config.get('hideWarnings')) { if (err.severity !== 'warning') { @@ -115,12 +113,7 @@ class CompileTab { } }) } - if (!error && data.contracts) { - this.compiler.visitContracts((contract) => { - this._deps.renderer.error(contract.name, this._view.errorContainer, {type: 'success'}) }) - } - }) // Run the compiler instead of trying to save the website $(window).keydown((e) => { From b7dfd3bf53e721da3508b0aa1333e49da591b60d Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 10:55:51 +0100 Subject: [PATCH 206/636] typo && set selectedContract onload --- src/app/tabs/compile-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 1fbe56f860..296917aea2 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -152,7 +152,7 @@ class CompileTab {
    - ${contractList.map((name) => yo``)} From 3a4452c10bb762750c20415248ea6592cc67fabb Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 10:56:06 +0100 Subject: [PATCH 207/636] remove label --- src/app/tabs/compile-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 296917aea2..f1277e0491 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -159,7 +159,7 @@ class CompileTab {
    -
    Copy to Clipboard :
    - - From 4c8c85eb90e7f3377411592d1cb16b3e3baad2a2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 10:56:39 +0100 Subject: [PATCH 209/636] fix yoyo issue --- src/app/tabs/compile-tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index a245105752..3d24b3f29f 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -187,11 +187,11 @@ class CompileTab { // TODO : Add success alert when compilation succeed contractCompiledSuccess () { - return yo`` + return yo`
    ` } // TODO : Add error alert when compilation failed contractCompiledError () { - return yo`` + return yo`
    ` } /************ From 672fdd9064dc3851ab81e68914955903bd45b2fb Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 10:56:48 +0100 Subject: [PATCH 210/636] typo --- src/app/tabs/compile-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 3d24b3f29f..e1dd9f3fcd 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -199,7 +199,7 @@ class CompileTab { */ selectContract (contractName) { - this.selectContract = contractName + this.selectedContract = contractName } publish () { From dc4b4e829cb179154b421d21851a13a6b46eea3f Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 10:57:08 +0100 Subject: [PATCH 211/636] fix yoyo update use --- src/app/tabs/compile-tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index e1dd9f3fcd..ebc067798c 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -180,9 +180,9 @@ class CompileTab {
    ` - : yo`
    + : yo`
    No Contract Compiled Yet -
    ` +
    ` } // TODO : Add success alert when compilation succeed From e21229ccf04c99112806328b76a59c2f0bc4bcda Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 10:59:50 +0100 Subject: [PATCH 212/636] standard --- src/app/tabs/compile-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index ebc067798c..fd4f924119 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -113,7 +113,7 @@ class CompileTab { } }) } - }) + }) // Run the compiler instead of trying to save the website $(window).keydown((e) => { From 61f8a620abcb79563f190eca75041bce4ffc69a4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 Feb 2019 11:17:38 +0100 Subject: [PATCH 213/636] fix browser tests --- test-browser/tests/simpleContract.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-browser/tests/simpleContract.js b/test-browser/tests/simpleContract.js index b82c737c82..c76a15305e 100644 --- a/test-browser/tests/simpleContract.js +++ b/test-browser/tests/simpleContract.js @@ -97,7 +97,7 @@ function testAutoDeployLib (browser, callback) { function testManualDeployLib (browser, callback) { console.log('testManualDeployLib') browser.click('i[class^="clearinstance"]').pause(5000).clickLaunchIcon('settings').click('#generatecontractmetadata').perform(() => { - browser.clickLaunchIcon('solidity').click('#compile').perform(() => { // that should generate the JSON artefact + browser.clickLaunchIcon('solidity').click('#compileTabView button[title="Compile"]').perform(() => { // that should generate the JSON artefact contractHelper.verifyContract(browser, ['test'], () => { contractHelper.selectContract(browser, 'lib', () => { // deploy lib contractHelper.createContract(browser, '', () => { From 38cb9139ec2c9a63ced8d2f58a90c488793dc685 Mon Sep 17 00:00:00 2001 From: Rob Stupay Date: Wed, 27 Feb 2019 13:04:39 +0100 Subject: [PATCH 214/636] remvoing style-guide colorsand take out of flex-box in warning --- src/app/staticanalysis/staticAnalysisView.js | 42 ++++++++++--------- .../styles/staticAnalysisView-styles.js | 14 ++----- src/app/tabs/analysis-tab.js | 2 +- src/app/tabs/styles/analysis-tab-styles.js | 2 - 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/src/app/staticanalysis/staticAnalysisView.js b/src/app/staticanalysis/staticAnalysisView.js index 3f0718ef0c..ddfd8a78c3 100644 --- a/src/app/staticanalysis/staticAnalysisView.js +++ b/src/app/staticanalysis/staticAnalysisView.js @@ -42,28 +42,30 @@ staticAnalysisView.prototype.render = function () { var self = this var view = yo`
    -
    +
    ${this.modulesView}
    - - - +
    + + + +
    @@ -166,7 +168,7 @@ staticAnalysisView.prototype.renderModules = function () { ` }) - return yo`
    + return yo`
    ${entriesDom}
    ` diff --git a/src/app/staticanalysis/styles/staticAnalysisView-styles.js b/src/app/staticanalysis/styles/staticAnalysisView-styles.js index c6e2c27fd1..4aa5f5450a 100644 --- a/src/app/staticanalysis/styles/staticAnalysisView-styles.js +++ b/src/app/staticanalysis/styles/staticAnalysisView-styles.js @@ -1,8 +1,5 @@ var csjs = require('csjs-inject') -var styleGuide = require('../../ui/styles-guide/theme-chooser') -var styles = styleGuide.chooser() - var css = csjs` .analysis { display: flex; @@ -12,20 +9,17 @@ var css = csjs` margin-top: 1%; } .buttons { - ${styles.rightPanel.analysisTab.box_AnalysisContainer} + margin: 1rem 0; + } + .buttonsInner { display: flex; align-items: center; + justify-content: space-around; } .buttonRun { - ${styles.rightPanel.analysisTab.button_Run_AnalysisTab} margin-right: 1%; } .analysisModulesContainer { - ${styles.rightPanel.analysisTab.box_AnalysisContainer} - margin-bottom: 1%; - line-height: 2em; - display: flex; - flex-direction: column; } .label { display: flex; diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index 17356068ad..f3fed652c6 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -25,7 +25,7 @@ class AnalysisTab { this.registry.put({api: staticanalysis, name: 'staticanalysis'}) if (this.el) return this.el - this.el = yo`
    ${staticanalysis.render()}
    ` + this.el = yo`
    ${staticanalysis.render()}
    ` return this.el } } diff --git a/src/app/tabs/styles/analysis-tab-styles.js b/src/app/tabs/styles/analysis-tab-styles.js index cdbe8889a0..2552a151b5 100644 --- a/src/app/tabs/styles/analysis-tab-styles.js +++ b/src/app/tabs/styles/analysis-tab-styles.js @@ -4,8 +4,6 @@ const css = csjs` .analysisTabView { padding: 2%; padding-bottom: 3em; - display: flex; - flex-direction: column; } ` From fd2fbce7a366ed1da68e81f0d90e5608b531103d Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 25 Feb 2019 16:58:47 +0100 Subject: [PATCH 215/636] bootstrap unit testing --- src/app/tabs/styles/test-tab-styles.js | 11 -------- src/app/tabs/test-tab.js | 36 +++++++++++++------------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/src/app/tabs/styles/test-tab-styles.js b/src/app/tabs/styles/test-tab-styles.js index 7a3c663a79..8eab2c9e0b 100644 --- a/src/app/tabs/styles/test-tab-styles.js +++ b/src/app/tabs/styles/test-tab-styles.js @@ -1,23 +1,18 @@ var csjs = require('csjs-inject') -var styleGuide = require('../../ui/styles-guide/theme-chooser') -var styles = styleGuide.chooser() var css = csjs` .testTabView {} .infoBox { - ${styles.rightPanel.testTab.box_listTests}; margin: 2%; } .tests {} .testList { - ${styles.rightPanel.testTab.box_listTests}; line-height: 2em; display: flex; flex-direction: column; margin: 2%; } .container { - ${styles.rightPanel.testTab.box_listTests}; margin: 2%; padding-bottom: 5%; } @@ -29,7 +24,6 @@ var css = csjs` font-weight: bold; } .testPass { - background-color: ${styles.rightPanel.testTab.color_testPass}; } .testLog { margin-bottom: 1%; @@ -37,22 +31,17 @@ var css = csjs` padding: 1% 1% 1% 5%; } .testFailure { - background-color: ${styles.rightPanel.testTab.color_testFail}; } .testFailureSummary { - color: ${styles.appProperties.errorText_Color}; } .buttons { - ${styles.rightPanel.testTab.box_listTests}; margin: 2%; display: flex; align-items: center; } .runButton { - ${styles.rightPanel.testTab.button_runTests}; } .generateTestFile { - ${styles.rightPanel.testTab.button_generateTestFile}; min-width: 100px } .title { diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index a3f63ebfc0..ff50aa331c 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -35,17 +35,17 @@ module.exports = class TestTab { } render () { const self = this - var testsOutput = yo`` - var testsSummary = yo`` + var testsOutput = yo`` + var testsSummary = yo`` var testCallback = function (result) { testsOutput.hidden = false if (result.type === 'contract') { - testsOutput.appendChild(yo`
    ${result.filename} (${result.value})
    `) + testsOutput.appendChild(yo`
    ${result.filename} (${result.value})
    `) } else if (result.type === 'testPass') { - testsOutput.appendChild(yo`
    ✓ (${result.value})
    `) + testsOutput.appendChild(yo`
    ✓ (${result.value})
    `) } else if (result.type === 'testFailure') { - testsOutput.appendChild(yo`
    ✘ (${result.value})
    `) + testsOutput.appendChild(yo`
    ✘ (${result.value})
    `) } } @@ -60,21 +60,21 @@ module.exports = class TestTab { var updateFinalResult = function (_err, result, filename) { testsSummary.hidden = false if (_err) { - testsSummary.appendChild(yo`
    ${_err.message}
    `) + testsSummary.appendChild(yo`
    ${_err.message}
    `) return } testsSummary.appendChild(yo`
    ${filename}
    `) if (result.totalPassing > 0) { - testsSummary.appendChild(yo`
    ${result.totalPassing} passing (${result.totalTime}s)
    `) + testsSummary.appendChild(yo`
    ${result.totalPassing} passing (${result.totalTime}s)
    `) testsSummary.appendChild(yo`
    `) } if (result.totalFailing > 0) { - testsSummary.appendChild(yo`
    ${result.totalFailing} failing
    `) + testsSummary.appendChild(yo`
    ${result.totalFailing} failing
    `) testsSummary.appendChild(yo`
    `) } result.errors.forEach((error, index) => { - testsSummary.appendChild(yo`
    ${error.context} - ${error.value}
    `) - testsSummary.appendChild(yo`
    ${error.message}
    `) + testsSummary.appendChild(yo`
    ${error.context} - ${error.value}
    `) + testsSummary.appendChild(yo`
    ${error.message}
    `) testsSummary.appendChild(yo`
    `) }) } @@ -87,7 +87,7 @@ module.exports = class TestTab { remixTests.runTestSources(runningTest, testCallback, resultsCallback, (error, result) => { updateFinalResult(error, result, testFilePath) callback(error) - }, (url, cb) => { self.compileTab.importFileCb(url, cb) }) + }, (url, cb) => { self.compileTab.compileTabLogic.importFileCb(url, cb) }) } }) } @@ -171,8 +171,7 @@ module.exports = class TestTab { } var runTests = function () { - testsOutput.innerHTML = '' - testsSummary.innerHTML = '' + testsOutput.innerHTML = 'Running tests ...' var tests = self.data.selectedTests async.eachOfSeries(tests, (value, key, callback) => { runTest(value, callback) }) } @@ -194,9 +193,9 @@ module.exports = class TestTab { } var el = yo` -
    +
    -
    Unit Testing
    +

    Unit Testing

    Test your smart contract by creating a foo_test.sol file (open ballot_test.sol to see the example).
    You will find more informations in the documentation @@ -205,12 +204,13 @@ module.exports = class TestTab {
    For more details, see How to test smart contracts guide in our documentation. -
    Generate test file
    +
    +
    ${self.testList} -
    -
    Run Tests
    +
    +
    diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index 819e968477..47abfc628c 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -115,21 +115,17 @@ function filepanel (localRegistry) { fileExplorer.ensureRoot() configExplorer.ensureRoot() self._deps.fileProviders['localhost'].event.register('connecting', (event) => { - tooltip('Connecting to localhost. ' + JSON.stringify(event)) }) self._deps.fileProviders['localhost'].event.register('connected', (event) => { - tooltip('Connected to localhost. ' + JSON.stringify(event)) fileSystemExplorer.show() }) self._deps.fileProviders['localhost'].event.register('errored', (event) => { - tooltip('localhost connection errored. ' + JSON.stringify(event)) fileSystemExplorer.hide() }) self._deps.fileProviders['localhost'].event.register('closed', (event) => { - tooltip('localhost connection closed. ' + JSON.stringify(event)) fileSystemExplorer.hide() }) diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 2d666378e2..65dc06815d 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -6,7 +6,6 @@ var globalRegistry = require('../../global/registry') var tooltip = require('../ui/tooltip') var copyToClipboard = require('../ui/copy-to-clipboard') var styleGuide = require('../ui/styles-guide/theme-chooser') -// var styles = styleGuide.chooser() var Storage = remixLib.Storage var EventManager = require('../../lib/events') diff --git a/src/app/tabs/styles/compile-tab-styles.js b/src/app/tabs/styles/compile-tab-styles.js index afd328055d..41dc0aa911 100644 --- a/src/app/tabs/styles/compile-tab-styles.js +++ b/src/app/tabs/styles/compile-tab-styles.js @@ -1,6 +1,4 @@ const csjs = require('csjs-inject') -// const styleGuide = require('../../ui/styles-guide/theme-chooser') -// const styles = styleGuide.chooser() const css = csjs` .compilerArticle { diff --git a/src/app/tabs/styles/settings-tab-styles.js b/src/app/tabs/styles/settings-tab-styles.js index cb000b14fd..ba3c0506a6 100644 --- a/src/app/tabs/styles/settings-tab-styles.js +++ b/src/app/tabs/styles/settings-tab-styles.js @@ -1,6 +1,4 @@ var csjs = require('csjs-inject') -var styleGuide = require('../../ui/styles-guide/theme-chooser') -var styles = styleGuide.chooser() var css = csjs` .settingsTabView { @@ -8,7 +6,6 @@ var css = csjs` display: flex; } .info { - ${styles.rightPanel.settingsTab.box_SolidityVersionInfo} margin-bottom: 1em; word-break: break-word; } @@ -41,7 +38,6 @@ var css = csjs` .select { font-weight: bold; margin-top: 1em; - ${styles.rightPanel.settingsTab.dropdown_SelectCompiler} } .heading { margin-bottom: 0; @@ -64,7 +60,7 @@ var css = csjs` vertical-align: top; } i.warnIt { - color: ${styles.appProperties.warningText_Color}; + color: var(--warning); } .icon { margin-right: .5em; diff --git a/src/app/tabs/styles/support-tab-styles.js b/src/app/tabs/styles/support-tab-styles.js index ccadbe9fac..7debd88c3f 100644 --- a/src/app/tabs/styles/support-tab-styles.js +++ b/src/app/tabs/styles/support-tab-styles.js @@ -1,5 +1,4 @@ const csjs = require('csjs-inject') -const styles = require('../../ui/styles-guide/theme-chooser').chooser() const css = csjs` .supportTabView { @@ -12,7 +11,6 @@ const css = csjs` overflow-y: auto; } .chat { - ${styles.rightPanel.supportTab.box_IframeContainer} display: flex; flex-direction: column; align-items: center; @@ -49,7 +47,6 @@ const css = csjs` border: none; } .infoBox { - ${styles.rightPanel.supportTab.box_SupportInfo} } .remixdinstallation { padding: 3px; @@ -57,7 +54,6 @@ const css = csjs` margin-left: 5px; } .info { - ${styles.rightPanel.settingsTab.box_SolidityVersionInfo}; margin-top: 1em; word-break: break-word; } diff --git a/src/app/tabs/styles/tabbed-menu-styles.js b/src/app/tabs/styles/tabbed-menu-styles.js index f0adb87f55..4480912135 100644 --- a/src/app/tabs/styles/tabbed-menu-styles.js +++ b/src/app/tabs/styles/tabbed-menu-styles.js @@ -1,17 +1,13 @@ const csjs = require('csjs-inject') -const styles = require('../../ui/styles-guide/theme-chooser').chooser() const css = csjs` .menu { display: flex; - background-color: ${styles.rightPanel.BackgroundColor_Pre}; list-style: none; margin: 0; padding: 0; } .active { - background-color: ${styles.rightPanel.backgroundColor_Tab}; - color: ${styles.appProperties.mainText_Color} } .options { float: left; @@ -23,7 +19,6 @@ const css = csjs` text-align: center; } .optionViews { - background-color: ${styles.rightPanel.backgroundColor_Tab}; overflow: scroll; height: 100%; } @@ -32,7 +27,6 @@ const css = csjs` } .optionViews .pre { word-wrap: break-word; - background-color: ${styles.rightPanel.BackgroundColor_Pre}; border-radius: 3px; display: inline-block; padding: 0 0.6em; diff --git a/src/app/ui/contextMenu.js b/src/app/ui/contextMenu.js index cbd1bf0ac2..4a82b19cdd 100644 --- a/src/app/ui/contextMenu.js +++ b/src/app/ui/contextMenu.js @@ -1,17 +1,14 @@ var yo = require('yo-yo') // -------------- copyToClipboard ---------------------- var csjs = require('csjs-inject') -var styleGuide = require('./styles-guide/theme-chooser') -var styles = styleGuide.chooser() var css = csjs` .container { display: none; position: fixed; - border: 1px solid ${styles.appProperties.solidBorderBox_BorderColor}; + border: 1px solid var(--primary); width:150px; - background: ${styles.appProperties.solidBorderBox_BackgroundColor}; border-radius: 2px; z-index: 1000; } @@ -31,12 +28,12 @@ var css = csjs` padding-left: 5px; padding-right: 5px; padding-bottom: 3px; - color: ${styles.appProperties.solidBorderBox_TextColor}; + color: var(--primary); } #menuitems :hover { - background: ${styles.appProperties.highlight_BackgroundColor}; + background: $var(--seconday); border-radius: 2px; } ` diff --git a/src/app/ui/copy-to-clipboard.js b/src/app/ui/copy-to-clipboard.js index c1875a62e3..bda6acf3a3 100644 --- a/src/app/ui/copy-to-clipboard.js +++ b/src/app/ui/copy-to-clipboard.js @@ -4,8 +4,6 @@ const copy = require('clipboard-copy') var addTooltip = require('./tooltip') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var styleGuide = require('./styles-guide/theme-chooser') -var styles = styleGuide.chooser() var css = csjs` .copyIcon { @@ -16,9 +14,6 @@ var css = csjs` module.exports = function copyToClipboard (getContent, tip = 'Copy value to clipboard', icon = 'fa-clipboard') { var copyIcon = yo`` - copyIcon.style.color = styles.remix.icon_Color_CopyToClipboard - copyIcon.onmouseenter = function (event) { copyIcon.style.color = styles.remix.icon_HoverColor_CopyToClipboard } - copyIcon.onmouseleave = function (event) { copyIcon.style.color = styles.remix.icon_Color_CopyToClipboard } copyIcon.onclick = (event) => { event.stopPropagation() var copiableContent diff --git a/src/app/ui/draggableContent.js b/src/app/ui/draggableContent.js index 52c2b024d2..a052326062 100644 --- a/src/app/ui/draggableContent.js +++ b/src/app/ui/draggableContent.js @@ -1,41 +1,32 @@ 'use strict' var yo = require('yo-yo') var csjs = require('csjs-inject') -var styleGuide = require('./styles-guide/theme-chooser') -var styles = styleGuide.chooser() var css = csjs` .containerDraggableModal { position: absolute; z-index: 1000; - background-color: ${styles.appProperties.light_BackgroundColor}; text-align: center; width: 500px; height: 500px; - border: 1px solid ${styles.appProperties.solidBorderBox_BorderColor}; overflow-y: hidden; } .headerDraggableModal { cursor: move; z-index: 10; - color: ${styles.appProperties.mainText_Color}; - background-color: ${styles.appProperties.primary_BackgroundColor}; - border-bottom: 1px solid ${styles.appProperties.solidBorderBox_BorderColor}; text-overflow: ellipsis; overflow-x: hidden; } .modalActions { float: right; - color: ${styles.appProperties.solidBorderBox_BorderColor}; } .modalAction { padding-right: 1px; padding-left: 1px; cursor: pointer; - color: ${styles.appProperties.solidBorderBox_BorderColor}; } ` diff --git a/src/app/ui/modaldialog.js b/src/app/ui/modaldialog.js index 664dd9b0bc..ec4b13a4a4 100644 --- a/src/app/ui/modaldialog.js +++ b/src/app/ui/modaldialog.js @@ -82,7 +82,7 @@ module.exports = (title, content, ok, cancel, focusSelector) => { function html () { return yo`