Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
51fb91ea
Commit
51fb91ea
authored
Sep 03, 2017
by
serapath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REFACTOR + setup filter method stubs
parent
224eb8b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
60 deletions
+91
-60
editor-panel.js
src/app/panels/editor-panel.js
+43
-1
terminal.js
src/app/panels/terminal.js
+48
-59
No files found.
src/app/panels/editor-panel.js
View file @
51fb91ea
...
...
@@ -157,7 +157,49 @@ class EditorPanel {
context
()
{
return
self
.
_api
.
context
()
}
}
},
banner
:
`
/******************************************************************************
...........................................
.....................:.....................
....................o:;....................
...................oo:;;...................
..................ooo:;;;..................
.................oooo:;;;;.................
................ooooo:;;;;;................
...............oooooo:;;;;;;...............
..............ooooooo:;;;;;;;..............
.............ooooooo;:';;;;;;;.............
............ooooo;;;;:'''';;;;;............
...........oo;;;;;;;;:'''''''';;...........
..........;;;;;;;;;;;:'''''''''''..........
..............;;;;;;;:'''''''..............
...........oo...;;;;;:'''''...;;...........
............oooo...;;:''...;;;;............
..............oooo...:...;;;;..............
...............oooooo:;;;;;;...............
................ooooo:;;;;;................
.................oooo:;;;;.................
..................ooo:;;;..................
...................oo:;;...................
....................o:;....................
.....................:.....................
...........................................
######## ######## ## ## #### ## ##
## ## ## ### ### ## ## ##
## ## ## #### #### ## ## ##
######## ###### ## ### ## ## ###
## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ##
## ## ######## ## ## #### ## ##
welcome to browser solidity
******************************************************************************/
`
})
}
self
.
_components
.
terminal
.
event
.
register
(
'resize'
,
delta
=>
self
.
_adjustLayout
(
'top'
,
delta
))
...
...
src/app/panels/terminal.js
View file @
51fb91ea
...
...
@@ -123,58 +123,15 @@ var ghostbar = yo`<div class=${css.ghostbar}></div>`
class
Terminal
{
constructor
(
opts
=
{
auto
:
true
})
{
var
self
=
this
self
.
event
=
new
EventManager
()
self
.
_api
=
opts
.
api
self
.
data
=
{
lineLength
:
opts
.
lineLength
||
80
,
session
:
[],
banner
:
opts
.
banner
||
`
/******************************************************************************
...........................................
.....................:.....................
....................o:;....................
...................oo:;;...................
..................ooo:;;;..................
.................oooo:;;;;.................
................ooooo:;;;;;................
...............oooooo:;;;;;;...............
..............ooooooo:;;;;;;;..............
.............ooooooo;:';;;;;;;.............
............ooooo;;;;:'''';;;;;............
...........oo;;;;;;;;:'''''''';;...........
..........;;;;;;;;;;;:'''''''''''..........
..............;;;;;;;:'''''''..............
...........oo...;;;;;:'''''...;;...........
............oooo...;;:''...;;;;............
..............oooo...:...;;;;..............
...............oooooo:;;;;;;...............
................ooooo:;;;;;................
.................oooo:;;;;.................
..................ooo:;;;..................
...................oo:;;...................
....................o:;....................
.....................:.....................
...........................................
######## ######## ## ## #### ## ##
## ## ## ### ### ## ## ##
## ## ## #### #### ## ## ##
######## ###### ## ### ## ## ###
## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ##
## ## ######## ## ## #### ## ##
welcome to browser solidity
new features:
- dom terminal v0.0.1-alpha
******************************************************************************/
`
banner
:
opts
.
banner
,
activeFilters
:
{
commands
:
{},
input
:
''
}
}
self
.
event
=
new
EventManager
()
self
.
_api
=
opts
.
api
self
.
_view
=
{
el
:
null
,
bar
:
null
,
input
:
null
,
term
:
null
,
journal
:
null
,
cli
:
null
}
self
.
_components
=
{}
self
.
_components
.
dropdown
=
new
Dropdown
({
options
:
[
...
...
@@ -185,12 +142,11 @@ class Terminal {
defaults
:
[
'knownTransaction'
,
'script'
]
})
self
.
_components
.
dropdown
.
event
.
register
(
'deselect'
,
function
(
label
)
{
console
.
log
(
'deselect'
,
label
)
self
.
updateJournal
({
type
:
'deselect'
,
value
:
label
}
)
})
self
.
_components
.
dropdown
.
event
.
register
(
'select'
,
function
(
label
)
{
console
.
log
(
'select'
,
label
)
self
.
updateJournal
({
type
:
'select'
,
value
:
label
}
)
})
self
.
_view
=
{
el
:
null
,
bar
:
null
,
input
:
null
,
term
:
null
,
journal
:
null
,
cli
:
null
}
self
.
_commands
=
{}
self
.
commands
=
{}
self
.
_INDEX
=
{}
...
...
@@ -256,7 +212,7 @@ class Terminal {
${
self
.
_view
.
term
}
</div>
`
self
.
commands
.
log
(
self
.
data
.
banner
)
if
(
self
.
data
.
banner
)
self
.
commands
.
log
(
self
.
data
.
banner
)
function
throttle
(
fn
,
wait
)
{
var
time
=
Date
.
now
()
...
...
@@ -361,11 +317,11 @@ class Terminal {
background
.
style
.
height
=
(
self
.
_view
.
journal
.
offsetHeight
-
(
placeholder
.
offsetTop
+
placeholder
.
offsetHeight
))
+
'px'
background
.
onclick
=
undefined
background
.
style
.
cursor
=
'default'
background
.
style
.
pointerEvents
=
'none'
}
else
{
background
.
style
=
''
text
.
style
=
''
background
.
onclick
=
function
(
event
)
{
console
.
error
(
'background click'
)
placeholder
.
scrollIntoView
()
check
()
}
...
...
@@ -385,7 +341,7 @@ class Terminal {
function
filter
(
event
)
{
var
input
=
event
.
currentTarget
setTimeout
(
function
()
{
console
.
log
(
'filter'
,
input
.
value
)
self
.
updateJournal
({
type
:
'search'
,
value
:
input
.
value
}
)
},
0
)
}
function
clear
(
event
)
{
...
...
@@ -469,6 +425,43 @@ class Terminal {
editable
.
focus
()
}
}
updateJournal
(
filterEvent
)
{
// @TODO: updates `self.data.activeFilters: { commands: {}, input: '' }`
var
value
=
filterEvent
.
value
if
(
filterEvent
.
type
===
'select'
)
{
console
.
log
(
value
)
}
else
if
(
filterEvent
.
type
===
'deselect'
)
{
console
.
log
(
value
)
}
else
if
(
filterEvent
.
type
===
'search'
)
{
console
.
log
(
value
)
}
}
_keep
(
item
)
{
// @TODO: checks `self.data.activeFilters: { commands: {}, input: '' }`
// @TODO: return false (if item is currently filtered out / irrelevant
// according to `self.data.activeFilters`
// self._INDEX.all[item.gidx]
//
// self._INDEX.allMain
// self._INDEX.commands
// self._INDEX.commandsMain
//
// if ()
// self.updateJournal(
// _INDEX
//
return
true
// false
}
_appendItem
(
item
)
{
var
self
=
this
var
{
el
,
gidx
}
=
item
if
(
self
.
_keep
(
item
))
{
self
.
_view
.
journal
.
appendChild
(
yo
`
<div data-gidx=
${
gidx
}
class=
${
css
.
block
}
>
${
el
}
</div>
`
)
self
.
scroll2bottom
()
}
}
scroll2bottom
()
{
var
self
=
this
setTimeout
(
function
()
{
...
...
@@ -534,10 +527,7 @@ class Terminal {
item
.
idx
=
self
.
_INDEX
.
commands
[
cmd
].
push
(
item
)
-
1
item
.
step
=
steps
.
push
(
item
)
-
1
item
.
args
=
params
self
.
_view
.
journal
.
appendChild
(
yo
`
<div data-gidx=
${
item
.
gidx
}
class=
${
css
.
block
}
>
${
el
}
</div>
`
)
self
.
scroll2bottom
()
self
.
_appendItem
(
item
)
}
var
scopedCommands
=
self
.
_scopeCommands
(
append
)
command
(
args
,
scopedCommands
,
el
=>
append
(
null
,
args
,
el
))
...
...
@@ -564,7 +554,6 @@ class Terminal {
}
function
domTerminalFeatures
(
self
)
{
// @TODO add all the `console` functions
return
{
web3
:
executionContext
.
getProvider
()
!==
'vm'
?
new
Web3
(
executionContext
.
web3
().
currentProvider
)
:
null
,
console
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment