Commit b9fac011 authored by Rob Stupay's avatar Rob Stupay

Merge branch 'swap_it' into fa5

parents 539fbe43 15a86498
...@@ -40,7 +40,8 @@ CodeListView.prototype.indexChanged = function (index) { ...@@ -40,7 +40,8 @@ CodeListView.prototype.indexChanged = function (index) {
} }
} }
this.itemSelected = this.codeView.children[index] this.itemSelected = this.codeView.children[index]
this.itemSelected.style.setProperty('background-color', 'var(--danger)') this.itemSelected.style.setProperty('background-color', 'var(--info)')
this.itemSelected.style.setProperty('color', 'var(--light)')
this.itemSelected.setAttribute('selected', 'selected') this.itemSelected.setAttribute('selected', 'selected')
if (this.itemSelected.firstChild) { if (this.itemSelected.firstChild) {
this.itemSelected.firstChild.setAttribute('style', 'margin-left: 2px') this.itemSelected.firstChild.setAttribute('style', 'margin-left: 2px')
......
...@@ -98,11 +98,10 @@ DropdownPanel.prototype.update = function (_data, _header) { ...@@ -98,11 +98,10 @@ DropdownPanel.prototype.update = function (_data, _header) {
DropdownPanel.prototype.setContent = function (node) { DropdownPanel.prototype.setContent = function (node) {
if (!this.view) return if (!this.view) return
var parent = this.view.querySelector('.dropdownpanel div.dropdowncontent') yo.update(this.view, this.render(null, node))
parent.replaceChild(node, parent.firstElementChild)
} }
DropdownPanel.prototype.render = function (overridestyle) { DropdownPanel.prototype.render = function (overridestyle, node) {
var content = yo`<div>Empty</div>` var content = yo`<div>Empty</div>`
if (this.json) { if (this.json) {
content = this.treeView.render({}) content = this.treeView.render({})
...@@ -117,7 +116,7 @@ DropdownPanel.prototype.render = function (overridestyle) { ...@@ -117,7 +116,7 @@ DropdownPanel.prototype.render = function (overridestyle) {
var contentNode = yo`<div class='dropdownpanel ${css.dropdownpanel}' style='display:none'> var contentNode = yo`<div class='dropdownpanel ${css.dropdownpanel}' style='display:none'>
<i class="${css.refresh} fas fa-sync" aria-hidden="true"></i> <i class="${css.refresh} fas fa-sync" aria-hidden="true"></i>
<div class='dropdowncontent'>${content}</div> <div class='dropdowncontent'>${node || content}</div>
<div class='dropdownrawcontent' style='display:none'></div> <div class='dropdownrawcontent' style='display:none'></div>
<div class='message' style='display:none'></div> <div class='message' style='display:none'></div>
</div>` </div>`
......
...@@ -161,22 +161,6 @@ class TxLogger { ...@@ -161,22 +161,6 @@ class TxLogger {
append(el) append(el)
}, { activate: true }) }, { activate: true })
this._deps.editorPanel.event.register('terminalFilterChanged', (type, label) => {
if (type === 'deselect') {
if (label === 'only remix transactions') {
this._deps.editorPanel.updateTerminalFilter({ type: 'select', value: 'unknownTransaction' })
} else if (label === 'all transactions') {
this._deps.editorPanel.updateTerminalFilter({ type: 'deselect', value: 'unknownTransaction' })
}
} else if (type === 'select') {
if (label === 'only remix transactions') {
this._deps.editorPanel.updateTerminalFilter({ type: 'deselect', value: 'unknownTransaction' })
} else if (label === 'all transactions') {
this._deps.editorPanel.updateTerminalFilter({ type: 'select', value: 'unknownTransaction' })
}
}
})
this._deps.txListener.event.register('newBlock', (block) => { this._deps.txListener.event.register('newBlock', (block) => {
if (!block.transactions || block.transactions && !block.transactions.length) { if (!block.transactions || block.transactions && !block.transactions.length) {
this.logEmptyBlock({ block: block }) this.logEmptyBlock({ block: block })
...@@ -190,6 +174,9 @@ class TxLogger { ...@@ -190,6 +174,9 @@ class TxLogger {
this._deps.txListener.event.register('newCall', (tx) => { this._deps.txListener.event.register('newCall', (tx) => {
log(this, tx, null) log(this, tx, null)
}) })
this._deps.editorPanel.updateTerminalFilter({ type: 'select', value: 'unknownTransaction' })
this._deps.editorPanel.updateTerminalFilter({ type: 'select', value: 'knownTransaction' })
} }
} }
......
...@@ -114,9 +114,6 @@ class EditorPanel { ...@@ -114,9 +114,6 @@ class EditorPanel {
} }
}) })
self._components.terminal.event.register('filterChanged', (type, value) => {
this.event.trigger('terminalFilterChanged', [type, value])
})
self._components.terminal.event.register('resize', delta => self._adjustLayout('top', delta)) self._components.terminal.event.register('resize', delta => self._adjustLayout('top', delta))
if (self._deps.txListener) { if (self._deps.txListener) {
self._components.terminal.event.register('listenOnNetWork', (listenOnNetWork) => { self._components.terminal.event.register('listenOnNetWork', (listenOnNetWork) => {
......
...@@ -11,7 +11,6 @@ var swarmgw = require('swarmgw')() ...@@ -11,7 +11,6 @@ var swarmgw = require('swarmgw')()
var CommandInterpreterAPI = require('../../lib/cmdInterpreterAPI') var CommandInterpreterAPI = require('../../lib/cmdInterpreterAPI')
var executionContext = require('../../execution-context') var executionContext = require('../../execution-context')
var Dropdown = require('../ui/dropdown')
var AutoCompletePopup = require('../ui/auto-complete-popup') var AutoCompletePopup = require('../ui/auto-complete-popup')
var csjs = require('csjs-inject') var csjs = require('csjs-inject')
...@@ -52,27 +51,6 @@ class Terminal extends BaseApi { ...@@ -52,27 +51,6 @@ class Terminal extends BaseApi {
self._view = { el: null, bar: null, input: null, term: null, journal: null, cli: null } self._view = { el: null, bar: null, input: null, term: null, journal: null, cli: null }
self._components = {} self._components = {}
self._components.cmdInterpreter = new CommandInterpreterAPI(this) self._components.cmdInterpreter = new CommandInterpreterAPI(this)
self._components.dropdown = new Dropdown({
options: [
'only remix transactions',
'all transactions',
'script'
],
defaults: ['only remix transactions', 'script'],
dependencies: {'all transactions': ['only remix transactions'], 'only remix transactions': ['all transactions']}
})
self._components.dropdown.event.register('deselect', function (label) {
self.event.trigger('filterChanged', ['deselect', label])
if (label === 'script') {
self.updateJournal({ type: 'deselect', value: label })
}
})
self._components.dropdown.event.register('select', function (label) {
self.event.trigger('filterChanged', ['select', label])
if (label === 'script') {
self.updateJournal({ type: 'select', value: label })
}
})
self._components.autoCompletePopup = new AutoCompletePopup(self._opts) self._components.autoCompletePopup = new AutoCompletePopup(self._opts)
self._components.autoCompletePopup.event.register('handleSelect', function (input) { self._components.autoCompletePopup.event.register('handleSelect', function (input) {
let textList = self._view.input.innerText.split(' ') let textList = self._view.input.innerText.split(' ')
...@@ -145,7 +123,7 @@ class Terminal extends BaseApi { ...@@ -145,7 +123,7 @@ class Terminal extends BaseApi {
class="btn btn-secondary btn-sm align-items-center ${css.toggleTerminal} fas fa-angle-double-down"></i>` class="btn btn-secondary btn-sm align-items-center ${css.toggleTerminal} fas fa-angle-double-down"></i>`
self._view.dragbar = yo` self._view.dragbar = yo`
<div onmousedown=${mousedown} class=${css.dragbarHorizontal}></div>` <div onmousedown=${mousedown} class=${css.dragbarHorizontal}></div>`
self._view.dropdown = self._components.dropdown.render()
self._view.pendingTxCount = yo`<div class=${css.pendingTx} title='Pending Transactions'>0</div>` self._view.pendingTxCount = yo`<div class=${css.pendingTx} title='Pending Transactions'>0</div>`
self._view.inputSearch = yo`<input spellcheck="false" type="text" class="${css.filter} form-control" id="input" onkeydown=${filter} placeholder="Search transactions"></input>` self._view.inputSearch = yo`<input spellcheck="false" type="text" class="${css.filter} form-control" id="input" onkeydown=${filter} placeholder="Search transactions"></input>`
self._view.bar = yo` self._view.bar = yo`
...@@ -164,7 +142,6 @@ class Terminal extends BaseApi { ...@@ -164,7 +142,6 @@ class Terminal extends BaseApi {
title="If checked Remix will listen on all transactions mined in the current environment and not only transactions created by you"> title="If checked Remix will listen on all transactions mined in the current environment and not only transactions created by you">
<label class="form-check-label" title="If checked Remix will listen on all transactions mined in the current environment and not only transactions created by you" for="listenNetworkCheck">listen on network</label> <label class="form-check-label" title="If checked Remix will listen on all transactions mined in the current environment and not only transactions created by you" for="listenNetworkCheck">listen on network</label>
</div> </div>
${self._view.dropdown}
<div class=${css.search}> <div class=${css.search}>
<i class="fas fa-search ${css.searchIcon} bg-light" aria-hidden="true"></i> <i class="fas fa-search ${css.searchIcon} bg-light" aria-hidden="true"></i>
${self._view.inputSearch} ${self._view.inputSearch}
...@@ -364,6 +341,7 @@ class Terminal extends BaseApi { ...@@ -364,6 +341,7 @@ class Terminal extends BaseApi {
} }
filtertimeout = setTimeout(() => { filtertimeout = setTimeout(() => {
self.updateJournal({ type: 'search', value: self._view.inputSearch.value }) self.updateJournal({ type: 'search', value: self._view.inputSearch.value })
self.scroll2bottom()
}, 500) }, 500)
} }
function clear (event) { function clear (event) {
...@@ -535,8 +513,8 @@ class Terminal extends BaseApi { ...@@ -535,8 +513,8 @@ class Terminal extends BaseApi {
self._JOURNAL.forEach(item => { self._JOURNAL.forEach(item => {
if (item && item.el && !item.hide) df.appendChild(item.el) if (item && item.el && !item.hide) df.appendChild(item.el)
}) })
self._view.journal.innerHTML = ''
requestAnimationFrame(function updateDOM () { requestAnimationFrame(function updateDOM () {
self._view.journal.innerHTML = ''
self._view.journal.appendChild(df) self._view.journal.appendChild(df)
}) })
} }
......
...@@ -183,9 +183,6 @@ class CompileTab extends CompilerApi { ...@@ -183,9 +183,6 @@ class CompileTab extends CompilerApi {
<!-- Copy to Clipboard --> <!-- Copy to Clipboard -->
<div class="${css.contractHelperButtons} btn-secondary"> <div class="${css.contractHelperButtons} btn-secondary">
<div class="input-group"> <div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Copy to clipboard</span>
</div>
<div class="btn-group" role="group" aria-label="Copy to Clipboard"> <div class="btn-group" role="group" aria-label="Copy to Clipboard">
<button class="btn btn-secondary" title="Copy ABI to clipboard" onclick="${() => { this.copyABI() }}"> <button class="btn btn-secondary" title="Copy ABI to clipboard" onclick="${() => { this.copyABI() }}">
<i class="${css.copyIcon} far fa-clipboard" aria-hidden="true"></i> <i class="${css.copyIcon} far fa-clipboard" aria-hidden="true"></i>
......
...@@ -61,7 +61,7 @@ class ContractDropdownUI { ...@@ -61,7 +61,7 @@ class ContractDropdownUI {
${this.createPanel} ${this.createPanel}
${this.orLabel} ${this.orLabel}
<div class="${css.button} ${css.atAddressSect}"> <div class="${css.button} ${css.atAddressSect}">
<div class="${css.atAddress} btn btn-sm btn-primary" onclick=${this.loadFromAddress.bind(this)}>At Address</div> <div class="${css.atAddress} btn btn-sm btn-info" onclick=${this.loadFromAddress.bind(this)}>At Address</div>
${this.atAddressButtonInput} ${this.atAddressButtonInput}
</div> </div>
</div> </div>
......
...@@ -34,9 +34,11 @@ module.exports = class Card { ...@@ -34,9 +34,11 @@ module.exports = class Card {
function trigger (el) { function trigger (el) {
var body = self._view.cardBody var body = self._view.cardBody
var status = self._view.statusBar var status = self._view.statusBar
el.classList.toggle('fa-angle-up') if (el.classList) {
var arrow = el.classList.toggle('fa-angle-down') ? 'up' : 'down' el.classList.toggle('fa-angle-up')
self.event.trigger('expandCollapseCard', [arrow, body, status]) var arrow = el.classList.toggle('fa-angle-down') ? 'up' : 'down'
self.event.trigger('expandCollapseCard', [arrow, body, status])
}
} }
// HTML // HTML
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment