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
fc1be582
Commit
fc1be582
authored
Feb 18, 2020
by
yann300
Committed by
LianaHus
Feb 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix emitting and registering to pluginActivated and pluginDeactivated
parent
9280d2c8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
23 deletions
+31
-23
side-panel.js
src/app/components/side-panel.js
+1
-1
tab-proxy.js
src/app/panels/tab-proxy.js
+8
-9
test-tab.js
src/app/tabs/test-tab.js
+4
-4
auto-complete-popup.js
src/app/ui/auto-complete-popup.js
+3
-4
remixAppManager.js
src/remixAppManager.js
+15
-5
No files found.
src/app/components/side-panel.js
View file @
fc1be582
...
@@ -127,7 +127,7 @@ export class SidePanel extends AbstractPanel {
...
@@ -127,7 +127,7 @@ export class SidePanel extends AbstractPanel {
}
}
}
}
const
header
=
yo
`
const
header
=
yo
`
<header class="
${
css
.
swapitHeader
}
px-3">
<header class="
${
css
.
swapitHeader
}
px-3">
<h6 class="
${
css
.
swapitTitle
}
" data-id="sidePanelSwapitTitle">
${
name
}
</h6>
<h6 class="
${
css
.
swapitTitle
}
" data-id="sidePanelSwapitTitle">
${
name
}
</h6>
${
docLink
}
${
docLink
}
...
...
src/app/panels/tab-proxy.js
View file @
fc1be582
...
@@ -49,25 +49,24 @@ export class TabProxy {
...
@@ -49,25 +49,24 @@ export class TabProxy {
})
})
})
})
appManager
.
event
.
on
(
'activate'
,
(
name
)
=>
{
appManager
.
event
.
on
(
'activate'
,
(
profile
)
=>
{
const
{
profile
}
=
appManager
.
getPlugin
(
name
)
if
(
profile
.
location
===
'mainPanel'
)
{
if
(
profile
.
location
===
'mainPanel'
)
{
this
.
addTab
(
this
.
addTab
(
name
,
profile
.
name
,
profile
.
displayName
,
profile
.
displayName
,
()
=>
this
.
event
.
emit
(
'switchApp'
,
name
),
()
=>
this
.
event
.
emit
(
'switchApp'
,
profile
.
name
),
()
=>
{
()
=>
{
this
.
event
.
emit
(
'closeApp'
,
name
)
this
.
event
.
emit
(
'closeApp'
,
profile
.
name
)
this
.
appManager
.
deactivatePlugin
(
name
)
this
.
appManager
.
deactivatePlugin
(
profile
.
name
)
},
},
profile
.
icon
profile
.
icon
)
)
this
.
switchTab
(
name
)
this
.
switchTab
(
profile
.
name
)
}
}
})
})
appManager
.
event
.
on
(
'deactivate'
,
(
nam
e
)
=>
{
appManager
.
event
.
on
(
'deactivate'
,
(
profil
e
)
=>
{
this
.
removeTab
(
name
)
this
.
removeTab
(
profile
.
name
)
})
})
appManager
.
event
.
on
(
'ensureActivated'
,
(
name
)
=>
{
appManager
.
event
.
on
(
'ensureActivated'
,
(
name
)
=>
{
...
...
src/app/tabs/test-tab.js
View file @
fc1be582
...
@@ -30,11 +30,11 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -30,11 +30,11 @@ module.exports = class TestTab extends ViewPlugin {
this
.
appManager
=
appManager
this
.
appManager
=
appManager
this
.
renderer
=
renderer
this
.
renderer
=
renderer
this
.
baseurl
=
'https://solc-bin.ethereum.org/bin'
this
.
baseurl
=
'https://solc-bin.ethereum.org/bin'
appManager
.
event
.
on
(
'activate'
,
(
nam
e
)
=>
{
appManager
.
event
.
on
(
'activate'
,
(
profil
e
)
=>
{
if
(
name
===
'solidity'
)
this
.
updateRunAction
(
fileManager
.
currentFile
())
if
(
profile
.
name
===
'solidity'
)
this
.
updateRunAction
(
fileManager
.
currentFile
())
})
})
appManager
.
event
.
on
(
'deactivate'
,
(
nam
e
)
=>
{
appManager
.
event
.
on
(
'deactivate'
,
(
profil
e
)
=>
{
if
(
name
===
'solidity'
)
this
.
updateRunAction
(
fileManager
.
currentFile
())
if
(
profile
.
name
===
'solidity'
)
this
.
updateRunAction
(
fileManager
.
currentFile
())
})
})
}
}
...
...
src/app/ui/auto-complete-popup.js
View file @
fc1be582
...
@@ -189,13 +189,12 @@ class AutoCompletePopup {
...
@@ -189,13 +189,12 @@ class AutoCompletePopup {
extendAutocompletion
()
{
extendAutocompletion
()
{
// TODO: this is not using the appManager interface. Terminal should be put as module
// TODO: this is not using the appManager interface. Terminal should be put as module
this
.
opts
.
appManager
.
event
.
on
(
'activate'
,
async
(
id
)
=>
{
this
.
opts
.
appManager
.
event
.
on
(
'activate'
,
async
(
profile
)
=>
{
const
profile
=
await
this
.
opts
.
appManager
.
getProfile
(
id
)
if
(
!
profile
.
methods
)
return
if
(
!
profile
.
methods
)
return
profile
.
methods
.
forEach
((
method
)
=>
{
profile
.
methods
.
forEach
((
method
)
=>
{
const
key
=
`remix.call({name: '
${
id
}
', key:'
${
method
}
', payload: []}).then((result) => { console.log(result) }).catch((error) => { console.log(error) })`
const
key
=
`remix.call({name: '
${
profile
.
name
}
', key:'
${
method
}
', payload: []}).then((result) => { console.log(result) }).catch((error) => { console.log(error) })`
const
keyValue
=
{}
const
keyValue
=
{}
keyValue
[
key
]
=
`call
${
id
}
-
${
method
}
`
keyValue
[
key
]
=
`call
${
profile
.
name
}
-
${
method
}
`
if
(
this
.
extraCommands
.
includes
(
keyValue
))
return
if
(
this
.
extraCommands
.
includes
(
keyValue
))
return
this
.
extraCommands
.
push
(
keyValue
)
this
.
extraCommands
.
push
(
keyValue
)
})
})
...
...
src/remixAppManager.js
View file @
fc1be582
...
@@ -8,7 +8,7 @@ const requiredModules = [ // services + layout views + system views
...
@@ -8,7 +8,7 @@ const requiredModules = [ // services + layout views + system views
'mainPanel'
,
'hiddenPanel'
,
'sidePanel'
,
'menuicons'
,
'fileExplorers'
,
'mainPanel'
,
'hiddenPanel'
,
'sidePanel'
,
'menuicons'
,
'fileExplorers'
,
'terminal'
,
'settings'
,
'pluginManager'
]
'terminal'
,
'settings'
,
'pluginManager'
]
export
function
isNative
(
name
)
{
export
function
isNative
(
name
)
{
const
nativePlugins
=
[
'vyper'
,
'workshops'
,
'ethdoc'
,
'etherscan'
]
const
nativePlugins
=
[
'vyper'
,
'workshops'
,
'ethdoc'
,
'etherscan'
]
return
nativePlugins
.
includes
(
name
)
||
requiredModules
.
includes
(
name
)
return
nativePlugins
.
includes
(
name
)
||
requiredModules
.
includes
(
name
)
}
}
...
@@ -36,9 +36,9 @@ export class RemixAppManager extends PluginManager {
...
@@ -36,9 +36,9 @@ export class RemixAppManager extends PluginManager {
return
true
return
true
}
}
onActivated
(
plugin
)
{
on
Plugin
Activated
(
plugin
)
{
this
.
pluginLoader
.
set
(
plugin
,
this
.
actives
)
this
.
pluginLoader
.
set
(
plugin
,
this
.
actives
)
this
.
event
.
emit
(
'activate'
,
plugin
.
name
)
this
.
event
.
emit
(
'activate'
,
plugin
)
}
}
getAll
()
{
getAll
()
{
...
@@ -51,9 +51,9 @@ export class RemixAppManager extends PluginManager {
...
@@ -51,9 +51,9 @@ export class RemixAppManager extends PluginManager {
return
Object
.
keys
(
this
.
registered
)
return
Object
.
keys
(
this
.
registered
)
}
}
onDeactivated
(
plugin
)
{
on
Plugin
Deactivated
(
plugin
)
{
this
.
pluginLoader
.
set
(
plugin
,
this
.
actives
)
this
.
pluginLoader
.
set
(
plugin
,
this
.
actives
)
this
.
event
.
emit
(
'deactivate'
,
plugin
.
name
)
this
.
event
.
emit
(
'deactivate'
,
plugin
)
}
}
onRegistration
(
plugin
)
{
onRegistration
(
plugin
)
{
...
@@ -62,6 +62,16 @@ export class RemixAppManager extends PluginManager {
...
@@ -62,6 +62,16 @@ export class RemixAppManager extends PluginManager {
this
.
event
.
emit
(
'added'
,
plugin
.
name
)
this
.
event
.
emit
(
'added'
,
plugin
.
name
)
}
}
ensureActivated
(
apiName
)
{
if
(
!
this
.
isActive
(
apiName
))
this
.
activateOne
(
apiName
)
this
.
event
.
emit
(
'ensureActivated'
,
apiName
)
}
ensureDeactivated
(
apiName
)
{
if
(
this
.
isActive
(
apiName
))
this
.
deactivateOne
(
apiName
)
this
.
event
.
emit
(
'ensureDeactivated'
,
apiName
)
}
deactivatePlugin
(
name
)
{
deactivatePlugin
(
name
)
{
if
(
requiredModules
.
includes
(
name
))
return
if
(
requiredModules
.
includes
(
name
))
return
super
.
deactivatePlugin
(
name
)
super
.
deactivatePlugin
(
name
)
...
...
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