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
9293f87c
Commit
9293f87c
authored
Feb 12, 2019
by
Rob Stupay
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'swap_it' of
https://github.com/ethereum/remix-ide
into swap_it
parents
509a07a3
b0bd68b4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
161 additions
and
153 deletions
+161
-153
config.yml
.circleci/config.yml
+2
-2
app.js
src/app.js
+4
-4
swap-panel-component.js
src/app/components/swap-panel-component.js
+9
-1
vertical-icons-component.js
src/app/components/vertical-icons-component.js
+20
-4
SourceHighlighters.js
src/app/editor/SourceHighlighters.js
+5
-3
contextView.js
src/app/editor/contextView.js
+51
-53
contextualListener.js
src/app/editor/contextualListener.js
+55
-61
editor.js
src/app/editor/editor.js
+0
-0
sourceHighlighter.js
src/app/editor/sourceHighlighter.js
+13
-14
remixAppManager.js
src/remixAppManager.js
+0
-9
init.js
test-browser/helpers/init.js
+2
-2
No files found.
.circleci/config.yml
View file @
9293f87c
...
@@ -26,10 +26,10 @@ jobs:
...
@@ -26,10 +26,10 @@ jobs:
-
checkout
-
checkout
-
restore_cache
:
-
restore_cache
:
keys
:
keys
:
-
dep-bundle-2
7
-{{ checksum "package.json" }}
-
dep-bundle-2
8
-{{ checksum "package.json" }}
-
run
:
npm install
-
run
:
npm install
-
save_cache
:
-
save_cache
:
key
:
dep-bundle-2
7
-{{ checksum "package.json" }}
key
:
dep-bundle-2
8
-{{ checksum "package.json" }}
paths
:
paths
:
-
~/repo/node_modules
-
~/repo/node_modules
-
run
:
npm run lint && npm run test && npm run make-mock-compiler && npm run build
-
run
:
npm run lint && npm run test && npm run make-mock-compiler && npm run build
...
...
src/app.js
View file @
9293f87c
...
@@ -411,15 +411,15 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -411,15 +411,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
// TODOs those are instanciated before hand. should be instanciated on demand
let
appStore
=
new
EntityStore
(
'module'
,
{
actives
:
[],
ids
:
[],
entities
:
{}
})
const
pluginManagerComponent
=
new
PluginManagerComponent
()
const
pluginManagerComponent
=
new
PluginManagerComponent
()
const
swapPanelComponent
=
new
SwapPanelComponent
()
const
swapPanelComponent
=
new
SwapPanelComponent
(
appStore
)
const
mainPanelComponent
=
new
SwapPanelComponent
()
const
mainPanelComponent
=
new
SwapPanelComponent
(
appStore
)
const
verticalIconsComponent
=
new
VerticalIconsComponent
()
const
verticalIconsComponent
=
new
VerticalIconsComponent
(
appStore
)
const
swapPanelApi
=
new
SwapPanelApi
(
swapPanelComponent
,
verticalIconsComponent
)
// eslint-disable-line
const
swapPanelApi
=
new
SwapPanelApi
(
swapPanelComponent
,
verticalIconsComponent
)
// eslint-disable-line
const
mainPanelApi
=
new
SwapPanelApi
(
mainPanelComponent
,
verticalIconsComponent
)
// eslint-disable-line
const
mainPanelApi
=
new
SwapPanelApi
(
mainPanelComponent
,
verticalIconsComponent
)
// eslint-disable-line
const
verticalIconsApi
=
new
VerticalIconsApi
(
verticalIconsComponent
)
// eslint-disable-line
const
verticalIconsApi
=
new
VerticalIconsApi
(
verticalIconsComponent
)
// eslint-disable-line
let
appStore
=
new
EntityStore
(
'module'
,
{
actives
:
[],
ids
:
[],
entities
:
{}
})
const
appManager
=
new
RemixAppManager
(
appStore
,
swapPanelApi
,
mainPanelApi
,
verticalIconsApi
)
const
appManager
=
new
RemixAppManager
(
appStore
,
swapPanelApi
,
mainPanelApi
,
verticalIconsApi
)
registry
.
put
({
api
:
appManager
.
proxy
(),
name
:
'pluginmanager'
})
registry
.
put
({
api
:
appManager
.
proxy
(),
name
:
'pluginmanager'
})
...
...
src/app/components/swap-panel-component.js
View file @
9293f87c
...
@@ -6,11 +6,19 @@ var csjs = require('csjs-inject')
...
@@ -6,11 +6,19 @@ var csjs = require('csjs-inject')
// const styles = styleguide.chooser()
// const styles = styleguide.chooser()
class
SwapPanelComponent
{
class
SwapPanelComponent
{
constructor
()
{
constructor
(
appStore
)
{
this
.
store
=
appStore
// list of contents
// list of contents
this
.
contents
=
{}
this
.
contents
=
{}
// name of the current displayed content
// name of the current displayed content
this
.
currentNode
this
.
currentNode
this
.
store
.
event
.
on
(
'activate'
,
(
name
)
=>
{
})
this
.
store
.
event
.
on
(
'deactivate'
,
(
name
)
=>
{
if
(
this
.
contents
[
name
])
this
.
remove
(
name
)
})
this
.
store
.
event
.
on
(
'add'
,
(
name
)
=>
{
})
this
.
store
.
event
.
on
(
'remove'
,
(
name
)
=>
{
})
}
}
showContent
(
moduleName
)
{
showContent
(
moduleName
)
{
...
...
src/app/components/vertical-icons-component.js
View file @
9293f87c
...
@@ -10,10 +10,22 @@ const EventEmmitter = require('events')
...
@@ -10,10 +10,22 @@ const EventEmmitter = require('events')
// Component
// Component
class
VerticalIconComponent
{
class
VerticalIconComponent
{
constructor
()
{
constructor
(
appStore
)
{
this
.
store
=
appStore
this
.
event
=
new
EventEmmitter
()
this
.
event
=
new
EventEmmitter
()
this
.
icons
=
{}
this
.
icons
=
{}
this
.
iconKind
=
{}
this
.
iconKind
=
{}
this
.
store
.
event
.
on
(
'activate'
,
(
name
)
=>
{
const
item
=
this
.
store
.
get
(
name
)
if
(
item
&&
item
.
profile
.
icon
&&
name
!==
'code editor'
)
this
.
addIcon
(
item
.
profile
)
})
this
.
store
.
event
.
on
(
'deactivate'
,
(
name
)
=>
{
const
item
=
this
.
store
.
get
(
name
)
if
(
item
&&
this
.
icons
[
name
])
this
.
removeIcon
(
item
.
profile
)
})
this
.
store
.
event
.
on
(
'add'
,
(
name
)
=>
{
})
this
.
store
.
event
.
on
(
'remove'
,
(
name
)
=>
{
})
}
}
addIcon
(
mod
)
{
addIcon
(
mod
)
{
...
@@ -24,7 +36,7 @@ class VerticalIconComponent {
...
@@ -24,7 +36,7 @@ class VerticalIconComponent {
removeIcon
(
mod
)
{
removeIcon
(
mod
)
{
let
kind
=
mod
.
kind
||
'other'
let
kind
=
mod
.
kind
||
'other'
let
el
=
this
.
icon
s
[
kind
]
let
el
=
this
.
icon
Kind
[
kind
]
if
(
el
)
el
.
parentElement
.
removeChild
(
el
)
if
(
el
)
el
.
parentElement
.
removeChild
(
el
)
}
}
...
@@ -53,7 +65,7 @@ class VerticalIconComponent {
...
@@ -53,7 +65,7 @@ class VerticalIconComponent {
<div id='fileExplorerIcons'>
<div id='fileExplorerIcons'>
</div>
</div>
`
`
this
.
iconKind
[
'compile'
]
=
yo
`
this
.
iconKind
[
'compile'
]
=
yo
`
<div id='compileIcons'>
<div id='compileIcons'>
</div>
</div>
...
@@ -78,7 +90,7 @@ class VerticalIconComponent {
...
@@ -78,7 +90,7 @@ class VerticalIconComponent {
<div id='debuggingIcons'>
<div id='debuggingIcons'>
</div>
</div>
`
`
this
.
iconKind
[
'other'
]
=
yo
`
this
.
iconKind
[
'other'
]
=
yo
`
<div id='otherIcons'>
<div id='otherIcons'>
</div>
</div>
...
@@ -130,4 +142,8 @@ const css = csjs`
...
@@ -130,4 +142,8 @@ const css = csjs`
padding-top: 1px;
padding-top: 1px;
padding-left: 1px;
padding-left: 1px;
}
}
.icon[title='settings'] {
position: absolute;
bottom: 0;
}
`
`
src/app/editor/SourceHighlighters.js
View file @
9293f87c
'use strict'
'use strict'
var
SourceHighlighter
=
require
(
'./sourceHighlighter'
)
const
SourceHighlighter
=
require
(
'./sourceHighlighter'
)
module
.
exports
=
class
SourceHighlighters
{
class
SourceHighlighters
{
constructor
()
{
constructor
()
{
this
.
highlighters
=
{}
this
.
highlighters
=
{}
...
@@ -17,7 +17,7 @@ module.exports = class SourceHighlighters {
...
@@ -17,7 +17,7 @@ module.exports = class SourceHighlighters {
// TODO what to do with mod?
// TODO what to do with mod?
highlight
(
mod
,
lineColumnPos
,
filePath
,
hexColor
,
cb
)
{
highlight
(
mod
,
lineColumnPos
,
filePath
,
hexColor
,
cb
)
{
var
position
let
position
try
{
try
{
position
=
JSON
.
parse
(
lineColumnPos
)
position
=
JSON
.
parse
(
lineColumnPos
)
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -34,3 +34,5 @@ module.exports = class SourceHighlighters {
...
@@ -34,3 +34,5 @@ module.exports = class SourceHighlighters {
cb
()
cb
()
}
}
}
}
module
.
exports
=
SourceHighlighters
src/app/editor/contextView.js
View file @
9293f87c
'use strict'
'use strict'
var
yo
=
require
(
'yo-yo'
)
const
yo
=
require
(
'yo-yo'
)
var
remixLib
=
require
(
'remix-lib'
)
const
remixLib
=
require
(
'remix-lib'
)
var
SourceMappingDecoder
=
remixLib
.
SourceMappingDecoder
const
SourceMappingDecoder
=
remixLib
.
SourceMappingDecoder
var
globalRegistry
=
require
(
'../../global/registry'
)
const
globalRegistry
=
require
(
'../../global/registry'
)
var
css
=
require
(
'./styles/contextView-styles'
)
const
css
=
require
(
'./styles/contextView-styles'
)
/*
/*
Display information about the current focused code:
Display information about the current focused code:
...
@@ -15,30 +15,29 @@ var css = require('./styles/contextView-styles')
...
@@ -15,30 +15,29 @@ var css = require('./styles/contextView-styles')
*/
*/
class
ContextView
{
class
ContextView
{
constructor
(
opts
,
localRegistry
)
{
constructor
(
opts
,
localRegistry
)
{
const
self
=
this
this
.
_components
=
{}
self
.
_components
=
{}
this
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
this
.
contextualListener
=
opts
.
contextualListener
self
.
contextualListener
=
opts
.
contextualListener
this
.
editor
=
opts
.
editor
self
.
editor
=
opts
.
editor
this
.
_deps
=
{
self
.
_deps
=
{
compilersArtefacts
:
this
.
_components
.
registry
.
get
(
'compilersartefacts'
).
api
,
compilersArtefacts
:
self
.
_components
.
registry
.
get
(
'compilersartefacts'
).
api
,
offsetToLineColumnConverter
:
this
.
_components
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
offsetToLineColumnConverter
:
self
.
_components
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
config
:
this
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
fileManager
:
this
.
_components
.
registry
.
get
(
'filemanager'
).
api
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
}
}
this
.
_view
this
.
_view
this
.
_nodes
this
.
_nodes
this
.
_current
this
.
_current
this
.
sourceMappingDecoder
=
new
SourceMappingDecoder
()
this
.
sourceMappingDecoder
=
new
SourceMappingDecoder
()
this
.
previousElement
=
null
this
.
previousElement
=
null
self
.
contextualListener
.
event
.
register
(
'contextChanged'
,
nodes
=>
{
this
.
contextualListener
.
event
.
register
(
'contextChanged'
,
nodes
=>
{
this
.
_nodes
=
nodes
this
.
_nodes
=
nodes
this
.
update
()
this
.
update
()
})
})
}
}
render
()
{
render
()
{
var
view
=
yo
`<div class=
${
css
.
contextview
}
>
const
view
=
yo
`<div class=
${
css
.
contextview
}
>
<div class=
${
css
.
container
}
>
<div class=
${
css
.
container
}
>
${
this
.
_renderTarget
()}
${
this
.
_renderTarget
()}
</div>
</div>
...
@@ -70,13 +69,14 @@ class ContextView {
...
@@ -70,13 +69,14 @@ class ContextView {
}
}
_renderTarget
()
{
_renderTarget
()
{
var
previous
=
this
.
_current
let
last
const
previous
=
this
.
_current
if
(
this
.
_nodes
&&
this
.
_nodes
.
length
)
{
if
(
this
.
_nodes
&&
this
.
_nodes
.
length
)
{
var
last
=
this
.
_nodes
[
this
.
_nodes
.
length
-
1
]
last
=
this
.
_nodes
[
this
.
_nodes
.
length
-
1
]
if
(
isDefinition
(
last
))
{
if
(
isDefinition
(
last
))
{
this
.
_current
=
last
this
.
_current
=
last
}
else
{
}
else
{
var
target
=
this
.
contextualListener
.
declarationOf
(
last
)
const
target
=
this
.
contextualListener
.
declarationOf
(
last
)
if
(
target
)
{
if
(
target
)
{
this
.
_current
=
target
this
.
_current
=
target
}
else
{
}
else
{
...
@@ -91,27 +91,26 @@ class ContextView {
...
@@ -91,27 +91,26 @@ class ContextView {
}
}
_jumpToInternal
(
position
)
{
_jumpToInternal
(
position
)
{
var
self
=
this
const
jumpToLine
=
(
lineColumn
)
=>
{
function
jumpToLine
(
lineColumn
)
{
if
(
lineColumn
.
start
&&
lineColumn
.
start
.
line
&&
lineColumn
.
start
.
column
)
{
if
(
lineColumn
.
start
&&
lineColumn
.
start
.
line
&&
lineColumn
.
start
.
column
)
{
self
.
editor
.
gotoLine
(
lineColumn
.
start
.
line
,
lineColumn
.
end
.
column
+
1
)
this
.
editor
.
gotoLine
(
lineColumn
.
start
.
line
,
lineColumn
.
end
.
column
+
1
)
}
}
}
}
let
lastCompilationResult
=
self
.
_deps
.
compilersArtefacts
[
'__last'
]
let
lastCompilationResult
=
this
.
_deps
.
compilersArtefacts
[
'__last'
]
if
(
lastCompilationResult
&&
lastCompilationResult
.
data
)
{
if
(
lastCompilationResult
&&
lastCompilationResult
.
data
)
{
var
lineColumn
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
const
lineColumn
=
this
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
,
position
.
file
,
position
.
file
,
lastCompilationResult
.
getSourceCode
().
sources
,
lastCompilationResult
.
getSourceCode
().
sources
,
lastCompilationResult
.
getAsts
())
lastCompilationResult
.
getAsts
())
var
filename
=
lastCompilationResult
.
getSourceName
(
position
.
file
)
const
filename
=
lastCompilationResult
.
getSourceName
(
position
.
file
)
// TODO: refactor with rendererAPI.errorClick
// TODO: refactor with rendererAPI.errorClick
if
(
filename
!==
self
.
_deps
.
config
.
get
(
'currentFile'
))
{
if
(
filename
!==
this
.
_deps
.
config
.
get
(
'currentFile'
))
{
var
provider
=
self
.
_deps
.
fileManager
.
fileProviderOf
(
filename
)
const
provider
=
this
.
_deps
.
fileManager
.
fileProviderOf
(
filename
)
if
(
provider
)
{
if
(
provider
)
{
provider
.
exists
(
filename
,
(
error
,
exist
)
=>
{
provider
.
exists
(
filename
,
(
error
,
exist
)
=>
{
if
(
error
)
return
console
.
log
(
error
)
if
(
error
)
return
console
.
log
(
error
)
self
.
_deps
.
fileManager
.
switchFile
(
filename
)
this
.
_deps
.
fileManager
.
switchFile
(
filename
)
jumpToLine
(
lineColumn
)
jumpToLine
(
lineColumn
)
})
})
}
}
...
@@ -123,14 +122,13 @@ class ContextView {
...
@@ -123,14 +122,13 @@ class ContextView {
_render
(
node
,
nodeAtCursorPosition
)
{
_render
(
node
,
nodeAtCursorPosition
)
{
if
(
!
node
)
return
yo
`<div></div>`
if
(
!
node
)
return
yo
`<div></div>`
var
self
=
this
let
references
=
this
.
contextualListener
.
referencesOf
(
node
)
var
references
=
self
.
contextualListener
.
referencesOf
(
node
)
const
type
=
(
node
.
attributes
&&
node
.
attributes
.
type
)
?
node
.
attributes
.
type
:
node
.
name
var
type
=
(
node
.
attributes
&&
node
.
attributes
.
type
)
?
node
.
attributes
.
type
:
node
.
name
references
=
`
${
references
?
references
.
length
:
'0'
}
reference(s)`
references
=
`
${
references
?
references
.
length
:
'0'
}
reference(s)`
var
ref
=
0
let
ref
=
0
var
nodes
=
self
.
contextualListener
.
getActiveHighlights
()
const
nodes
=
this
.
contextualListener
.
getActiveHighlights
()
for
(
var
k
in
nodes
)
{
for
(
const
k
in
nodes
)
{
if
(
nodeAtCursorPosition
.
id
===
nodes
[
k
].
nodeId
)
{
if
(
nodeAtCursorPosition
.
id
===
nodes
[
k
].
nodeId
)
{
ref
=
k
ref
=
k
break
break
...
@@ -138,22 +136,35 @@ class ContextView {
...
@@ -138,22 +136,35 @@ class ContextView {
}
}
// JUMP BETWEEN REFERENCES
// JUMP BETWEEN REFERENCES
function
jump
(
e
)
{
const
jump
=
(
e
)
=>
{
e
.
target
.
dataset
.
action
===
'next'
?
ref
++
:
ref
--
e
.
target
.
dataset
.
action
===
'next'
?
ref
++
:
ref
--
if
(
ref
<
0
)
ref
=
nodes
.
length
-
1
if
(
ref
<
0
)
ref
=
nodes
.
length
-
1
if
(
ref
>=
nodes
.
length
)
ref
=
0
if
(
ref
>=
nodes
.
length
)
ref
=
0
self
.
_jumpToInternal
(
nodes
[
ref
].
position
)
this
.
_jumpToInternal
(
nodes
[
ref
].
position
)
}
}
function
jumpTo
()
{
const
jumpTo
=
()
=>
{
if
(
node
&&
node
.
src
)
{
if
(
node
&&
node
.
src
)
{
var
position
=
self
.
sourceMappingDecoder
.
decode
(
node
.
src
)
const
position
=
this
.
sourceMappingDecoder
.
decode
(
node
.
src
)
if
(
position
)
{
if
(
position
)
{
self
.
_jumpToInternal
(
position
)
this
.
_jumpToInternal
(
position
)
}
}
}
}
}
}
const
showGasEstimation
=
()
=>
{
if
(
node
.
name
===
'FunctionDefinition'
)
{
const
result
=
this
.
contextualListener
.
gasEstimation
(
node
)
const
executionCost
=
'Execution cost: '
+
result
.
executionCost
+
' gas'
const
codeDepositCost
=
'Code deposit cost: '
+
result
.
codeDepositCost
+
' gas'
const
estimatedGas
=
result
.
codeDepositCost
?
`
${
codeDepositCost
}
,
${
executionCost
}
`
:
`
${
executionCost
}
`
return
yo
`<div class=
${
css
.
gasEstimation
}
>
<img class=
${
css
.
gasStationIcon
}
title='Gas estimation' src='assets/img/gasStation_50.png'>
${
estimatedGas
}
</div>`
}
}
return
yo
`<div class=
${
css
.
line
}
>
return
yo
`<div class=
${
css
.
line
}
>
<div title=
${
type
}
class=
${
css
.
type
}
>
${
type
}
</div>
<div title=
${
type
}
class=
${
css
.
type
}
>
${
type
}
</div>
<div title=
${
node
.
attributes
.
name
}
class=
${
css
.
name
}
>
${
node
.
attributes
.
name
}
</div>
<div title=
${
node
.
attributes
.
name
}
class=
${
css
.
name
}
>
${
node
.
attributes
.
name
}
</div>
...
@@ -163,19 +174,6 @@ class ContextView {
...
@@ -163,19 +174,6 @@ class ContextView {
<i data-action='next' class="fa fa-chevron-down
${
css
.
jump
}
" aria-hidden="true" onclick=
${
jump
}
></i>
<i data-action='next' class="fa fa-chevron-down
${
css
.
jump
}
" aria-hidden="true" onclick=
${
jump
}
></i>
${
showGasEstimation
()}
${
showGasEstimation
()}
</div>`
</div>`
function
showGasEstimation
()
{
if
(
node
.
name
===
'FunctionDefinition'
)
{
var
result
=
self
.
contextualListener
.
gasEstimation
(
node
)
var
executionCost
=
'Execution cost: '
+
result
.
executionCost
+
' gas'
var
codeDepositCost
=
'Code deposit cost: '
+
result
.
codeDepositCost
+
' gas'
var
estimatedGas
=
result
.
codeDepositCost
?
`
${
codeDepositCost
}
,
${
executionCost
}
`
:
`
${
executionCost
}
`
return
yo
`<div class=
${
css
.
gasEstimation
}
>
<img class=
${
css
.
gasStationIcon
}
title='Gas estimation' src='assets/img/gasStation_50.png'>
${
estimatedGas
}
</div>`
}
}
}
}
}
}
...
...
src/app/editor/contextualListener.js
View file @
9293f87c
This diff is collapsed.
Click to expand it.
src/app/editor/editor.js
View file @
9293f87c
This diff is collapsed.
Click to expand it.
src/app/editor/sourceHighlighter.js
View file @
9293f87c
'use strict'
'use strict'
var
csjs
=
require
(
'csjs-inject'
)
const
csjs
=
require
(
'csjs-inject'
)
var
globlalRegistry
=
require
(
'../../global/registry'
)
const
globlalRegistry
=
require
(
'../../global/registry'
)
var
styleGuide
=
require
(
'../ui/styles-guide/theme-chooser'
)
const
styleGuide
=
require
(
'../ui/styles-guide/theme-chooser'
)
var
styles
=
styleGuide
.
chooser
()
const
styles
=
styleGuide
.
chooser
()
class
SourceHighlighter
{
class
SourceHighlighter
{
constructor
(
localRegistry
)
{
constructor
(
localRegistry
)
{
const
self
=
this
this
.
_components
=
{}
self
.
_components
=
{}
this
.
_components
.
registry
=
localRegistry
||
globlalRegistry
self
.
_components
.
registry
=
localRegistry
||
globlalRegistry
// dependencies
// dependencies
self
.
_deps
=
{
this
.
_deps
=
{
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
editor
:
this
.
_components
.
registry
.
get
(
'editor'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
this
.
_components
.
registry
.
get
(
'config'
).
api
,
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
,
fileManager
:
this
.
_components
.
registry
.
get
(
'filemanager'
).
api
,
compilerArtefacts
:
self
.
_components
.
registry
.
get
(
'compilersartefacts'
).
api
compilerArtefacts
:
this
.
_components
.
registry
.
get
(
'compilersartefacts'
).
api
}
}
this
.
statementMarker
=
null
this
.
statementMarker
=
null
this
.
fullLineMarker
=
null
this
.
fullLineMarker
=
null
...
@@ -26,7 +25,7 @@ class SourceHighlighter {
...
@@ -26,7 +25,7 @@ class SourceHighlighter {
if
(
this
.
fullLineMarker
)
this
.
_deps
.
editor
.
removeMarker
(
this
.
fullLineMarker
,
this
.
source
)
if
(
this
.
fullLineMarker
)
this
.
_deps
.
editor
.
removeMarker
(
this
.
fullLineMarker
,
this
.
source
)
let
lastCompilationResult
=
this
.
_deps
.
compilerArtefacts
[
'__last'
]
let
lastCompilationResult
=
this
.
_deps
.
compilerArtefacts
[
'__last'
]
if
(
location
&&
location
.
file
!==
undefined
&&
lastCompilationResult
)
{
if
(
location
&&
location
.
file
!==
undefined
&&
lastCompilationResult
)
{
var
path
=
lastCompilationResult
.
getSourceName
(
location
.
file
)
const
path
=
lastCompilationResult
.
getSourceName
(
location
.
file
)
if
(
path
)
{
if
(
path
)
{
this
.
currentSourceLocationFromfileName
(
lineColumnPos
,
path
)
this
.
currentSourceLocationFromfileName
(
lineColumnPos
,
path
)
}
}
...
@@ -45,7 +44,7 @@ class SourceHighlighter {
...
@@ -45,7 +44,7 @@ class SourceHighlighter {
this
.
_deps
.
fileManager
.
switchFile
(
this
.
source
)
this
.
_deps
.
fileManager
.
switchFile
(
this
.
source
)
}
}
var
css
=
csjs
`
const
css
=
csjs
`
.highlightcode {
.highlightcode {
position:absolute;
position:absolute;
z-index:20;
z-index:20;
...
...
src/remixAppManager.js
View file @
9293f87c
...
@@ -61,10 +61,6 @@ export class RemixAppManager extends AppManagerApi {
...
@@ -61,10 +61,6 @@ export class RemixAppManager extends AppManagerApi {
domEl
.
style
.
width
=
'100%'
domEl
.
style
.
width
=
'100%'
domEl
.
style
.
border
=
'0'
domEl
.
style
.
border
=
'0'
panel
.
add
(
profile
,
domEl
)
panel
.
add
(
profile
,
domEl
)
// TODO perhaps should not be here
if
(
profile
.
name
!==
'code editor'
)
{
this
.
verticalIconsApi
.
addIcon
(
profile
)
}
return
return
}
}
this
.
hiddenNodes
[
profile
.
name
]
=
domEl
this
.
hiddenNodes
[
profile
.
name
]
=
domEl
...
@@ -72,11 +68,6 @@ export class RemixAppManager extends AppManagerApi {
...
@@ -72,11 +68,6 @@ export class RemixAppManager extends AppManagerApi {
}
}
removeComponent
(
profile
)
{
removeComponent
(
profile
)
{
if
(
profile
.
icon
)
{
this
.
swapPanelApi
.
remove
(
profile
)
this
.
verticalIconsApi
.
removeIcon
(
profile
)
return
}
let
hiddenNode
=
this
.
hiddenNodes
[
profile
.
name
]
let
hiddenNode
=
this
.
hiddenNodes
[
profile
.
name
]
if
(
hiddenNode
)
document
.
body
.
removeChild
(
hiddenNode
)
if
(
hiddenNode
)
document
.
body
.
removeChild
(
hiddenNode
)
}
}
...
...
test-browser/helpers/init.js
View file @
9293f87c
...
@@ -17,9 +17,9 @@ module.exports = function (browser, callback) {
...
@@ -17,9 +17,9 @@ module.exports = function (browser, callback) {
}
}
function
initModules
(
browser
,
callback
)
{
function
initModules
(
browser
,
callback
)
{
browser
.
click
(
'#icon-panel div[title="plugin
m
anager"]'
)
browser
.
click
(
'#icon-panel div[title="plugin
M
anager"]'
)
.
execute
(
function
()
{
.
execute
(
function
()
{
document
.
querySelector
(
'div[title="plugin
manager"]'
).
scrollTop
=
document
.
querySelector
(
'div[title="plugin m
anager"]'
).
scrollHeight
document
.
querySelector
(
'div[title="plugin
Manager"]'
).
scrollTop
=
document
.
querySelector
(
'div[title="pluginM
anager"]'
).
scrollHeight
},
[],
function
()
{
},
[],
function
()
{
browser
.
click
(
'#pluginManager div[title="solidity"] button'
)
browser
.
click
(
'#pluginManager div[title="solidity"] button'
)
.
click
(
'#pluginManager div[title="run transactions"] button'
)
.
click
(
'#pluginManager div[title="run transactions"] button'
)
...
...
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