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
6c6651b2
Commit
6c6651b2
authored
Jun 27, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EditorPanel
parent
ca8261f4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
26 deletions
+24
-26
app.js
src/app.js
+4
-10
editor-panel.js
src/app/panels/editor-panel.js
+20
-16
No files found.
src/app.js
View file @
6c6651b2
...
@@ -501,6 +501,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -501,6 +501,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
})
})
})
})
registry
.
put
({
api
:
cmdInterpreter
,
name
:
'cmdinterpreter'
})
// ----------------- editor ----------------------------
// ----------------- editor ----------------------------
this
.
_components
.
editor
=
new
Editor
({})
// @TODO: put into editorpanel
this
.
_components
.
editor
=
new
Editor
({})
// @TODO: put into editorpanel
var
editor
=
self
.
_components
.
editor
// shortcut for the editor
var
editor
=
self
.
_components
.
editor
// shortcut for the editor
...
@@ -526,18 +528,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -526,18 +528,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// ---------------- ContextView -----------------------
// ---------------- ContextView -----------------------
this
.
_components
.
contextView
=
new
ContextView
()
this
.
_components
.
contextView
=
new
ContextView
()
registry
.
put
({
api
:
this
.
_components
.
contextView
,
name
:
'contextview'
})
// ----------------- editor panel ----------------------
// ----------------- editor panel ----------------------
this
.
_components
.
editorpanel
=
new
EditorPanel
({
this
.
_components
.
editorpanel
=
new
EditorPanel
()
api
:
{
cmdInterpreter
:
cmdInterpreter
,
editor
:
self
.
_components
.
editor
,
config
:
self
.
_api
.
config
,
txListener
:
txlistener
,
contextview
:
self
.
_components
.
contextView
,
udapp
:
()
=>
{
return
udapp
}
}
})
registry
.
put
({
api
:
this
.
_components
.
editorpanel
,
name
:
'editorpanel'
})
registry
.
put
({
api
:
this
.
_components
.
editorpanel
,
name
:
'editorpanel'
})
this
.
_components
.
editorpanel
.
event
.
register
(
'resize'
,
direction
=>
self
.
_adjustLayout
(
direction
))
this
.
_components
.
editorpanel
.
event
.
register
(
'resize'
,
direction
=>
self
.
_adjustLayout
(
direction
))
...
...
src/app/panels/editor-panel.js
View file @
6c6651b2
...
@@ -3,32 +3,42 @@ var remixLib = require('remix-lib')
...
@@ -3,32 +3,42 @@ var remixLib = require('remix-lib')
var
EventManager
=
remixLib
.
EventManager
var
EventManager
=
remixLib
.
EventManager
var
Terminal
=
require
(
'./terminal'
)
var
Terminal
=
require
(
'./terminal'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
styles
=
require
(
'./styles/editor-panel-styles'
)
var
styles
=
require
(
'./styles/editor-panel-styles'
)
var
cssTabs
=
styles
.
cssTabs
var
cssTabs
=
styles
.
cssTabs
var
css
=
styles
.
css
var
css
=
styles
.
css
class
EditorPanel
{
class
EditorPanel
{
constructor
(
opts
=
{}
)
{
constructor
(
localRegistry
)
{
var
self
=
this
var
self
=
this
self
.
_api
=
opts
.
api
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_deps
=
{
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
txlistener
:
self
.
_components
.
registry
.
get
(
'txlistener'
).
api
,
contextView
:
self
.
_components
.
registry
.
get
(
'contextview'
).
api
,
udapp
:
self
.
_components
.
registry
.
get
(
'udapp'
).
api
,
cmdInterpreter
:
self
.
_components
.
registry
.
get
(
'cmdinterpreter'
).
api
}
self
.
event
=
new
EventManager
()
self
.
event
=
new
EventManager
()
self
.
data
=
{
self
.
data
=
{
_FILE_SCROLL_DELTA
:
200
,
_FILE_SCROLL_DELTA
:
200
,
_layout
:
{
_layout
:
{
top
:
{
top
:
{
offset
:
self
.
_
api
.
config
.
get
(
'terminal-top-offset'
)
||
500
,
offset
:
self
.
_
deps
.
config
.
get
(
'terminal-top-offset'
)
||
500
,
show
:
true
show
:
true
}
}
}
}
}
}
self
.
_view
=
{}
self
.
_view
=
{}
self
.
_components
=
{
self
.
_components
=
{
editor
:
opts
.
api
.
editor
,
// @TODO: instantiate in eventpanel instead of passing via `opts`
editor
:
self
.
_deps
.
editor
,
// @TODO: instantiate in eventpanel instead of passing via `opts`
terminal
:
new
Terminal
({
terminal
:
new
Terminal
({
api
:
{
api
:
{
cmdInterpreter
:
self
.
_
api
.
cmdInterpreter
,
cmdInterpreter
:
self
.
_
deps
.
cmdInterpreter
,
udapp
:
self
.
_
api
.
udapp
,
udapp
:
self
.
_
deps
.
udapp
,
getPosition
(
event
)
{
getPosition
(
event
)
{
var
limitUp
=
36
var
limitUp
=
36
var
limitDown
=
20
var
limitDown
=
20
...
@@ -36,12 +46,6 @@ class EditorPanel {
...
@@ -36,12 +46,6 @@ class EditorPanel {
var
newpos
=
(
event
.
pageY
<
limitUp
)
?
limitUp
:
event
.
pageY
var
newpos
=
(
event
.
pageY
<
limitUp
)
?
limitUp
:
event
.
pageY
newpos
=
(
newpos
<
height
-
limitDown
)
?
newpos
:
height
-
limitDown
newpos
=
(
newpos
<
height
-
limitDown
)
?
newpos
:
height
-
limitDown
return
newpos
return
newpos
},
web3
()
{
return
self
.
_api
.
web3
()
},
context
()
{
return
self
.
_api
.
context
()
}
}
}
}
})
})
...
@@ -50,9 +54,9 @@ class EditorPanel {
...
@@ -50,9 +54,9 @@ class EditorPanel {
this
.
event
.
trigger
(
'terminalFilterChanged'
,
[
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
.
_
api
.
txListener
)
{
if
(
self
.
_
deps
.
txListener
)
{
self
.
_components
.
terminal
.
event
.
register
(
'listenOnNetWork'
,
(
listenOnNetWork
)
=>
{
self
.
_components
.
terminal
.
event
.
register
(
'listenOnNetWork'
,
(
listenOnNetWork
)
=>
{
self
.
_
api
.
txListener
.
setListenOnNetwork
(
listenOnNetWork
)
self
.
_
deps
.
txListener
.
setListenOnNetwork
(
listenOnNetWork
)
})
})
}
}
if
(
document
&&
document
.
head
)
{
if
(
document
&&
document
.
head
)
{
...
@@ -72,7 +76,7 @@ class EditorPanel {
...
@@ -72,7 +76,7 @@ class EditorPanel {
else
delta
=
containerHeight
else
delta
=
containerHeight
}
else
{
}
else
{
layout
.
show
=
true
layout
.
show
=
true
self
.
_
api
.
config
.
set
(
`terminal-
${
direction
}
-offset`
,
delta
)
self
.
_
deps
.
config
.
set
(
`terminal-
${
direction
}
-offset`
,
delta
)
layout
.
offset
=
delta
layout
.
offset
=
delta
}
}
}
}
...
@@ -113,7 +117,7 @@ class EditorPanel {
...
@@ -113,7 +117,7 @@ class EditorPanel {
<div class=
${
css
.
content
}
>
<div class=
${
css
.
content
}
>
${
self
.
_renderTabsbar
()}
${
self
.
_renderTabsbar
()}
<div class=
${
css
.
contextviewcontainer
}
>
<div class=
${
css
.
contextviewcontainer
}
>
${
self
.
_
api
.
contextv
iew
.
render
()}
${
self
.
_
deps
.
contextV
iew
.
render
()}
</div>
</div>
${
self
.
_view
.
editor
}
${
self
.
_view
.
editor
}
${
self
.
_view
.
terminal
}
${
self
.
_view
.
terminal
}
...
...
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