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
4e9299bd
Commit
4e9299bd
authored
Aug 12, 2021
by
lianahus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added flatten to menu (WIP)
parent
ca5bdc19
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
12 deletions
+53
-12
app.js
apps/remix-ide/src/app.js
+2
-2
plugin-manager-component.js
.../remix-ide/src/app/components/plugin-manager-component.js
+43
-8
compile-tab.js
apps/remix-ide/src/app/tabs/compile-tab.js
+8
-2
No files found.
apps/remix-ide/src/app.js
View file @
4e9299bd
...
@@ -356,8 +356,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -356,8 +356,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
landingPage
,
landingPage
,
hiddenPanel
,
hiddenPanel
,
sidePanel
,
sidePanel
,
pluginManagerComponent
,
filePanel
,
filePanel
,
pluginManagerComponent
,
settings
settings
])
])
...
@@ -481,7 +481,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -481,7 +481,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
await
appManager
.
activatePlugin
([
'sidePanel'
])
// activating host plugin separately
await
appManager
.
activatePlugin
([
'sidePanel'
])
// activating host plugin separately
await
appManager
.
activatePlugin
([
'home'
])
await
appManager
.
activatePlugin
([
'home'
])
await
appManager
.
activatePlugin
([
'settings'
])
await
appManager
.
activatePlugin
([
'settings'
])
await
appManager
.
activatePlugin
([
'hiddenPanel'
,
'
pluginManager'
,
'filePanel
'
,
'contextualListener'
,
'terminal'
,
'fetchAndCompile'
,
'contentImport'
])
await
appManager
.
activatePlugin
([
'hiddenPanel'
,
'
filePanel'
,
'pluginManager
'
,
'contextualListener'
,
'terminal'
,
'fetchAndCompile'
,
'contentImport'
])
// Set workspace after initial activation
// Set workspace after initial activation
if
(
Array
.
isArray
(
workspace
))
{
if
(
Array
.
isArray
(
workspace
))
{
...
...
apps/remix-ide/src/app/components/plugin-manager-component.js
View file @
4e9299bd
...
@@ -71,7 +71,7 @@ const css = csjs`
...
@@ -71,7 +71,7 @@ const css = csjs`
const
profile
=
{
const
profile
=
{
name
:
'pluginManager'
,
name
:
'pluginManager'
,
displayName
:
'Plugin manager'
,
displayName
:
'Plugin manager'
,
methods
:
[],
methods
:
[
'registerFlattener'
],
events
:
[],
events
:
[],
icon
:
'assets/img/pluginManager.webp'
,
icon
:
'assets/img/pluginManager.webp'
,
description
:
'Start/stop services, modules and plugins'
,
description
:
'Start/stop services, modules and plugins'
,
...
@@ -102,17 +102,52 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -102,17 +102,52 @@ class PluginManagerComponent extends ViewPlugin {
return
this
.
appManager
.
actives
.
includes
(
name
)
return
this
.
appManager
.
actives
.
includes
(
name
)
}
}
activateP
(
name
)
{
async
registerFlattener
(
event
)
{
if
(
!
this
.
appManager
.
isActive
(
'solidity'
))
{
await
this
.
appManager
.
activatePlugin
(
'solidity'
)
}
const
compiledSuccessfully
=
await
this
.
call
(
'solidity'
,
'compileFile'
,
event
)
const
reporCompileIssue
=
()
=>
{
this
.
call
(
'fileManager'
,
'open'
,
event
.
path
[
0
])
addToolTip
(
'Cannot flatten the file. Please make sure it is compiling successfully.'
)
this
.
call
(
'menuicons'
,
'select'
,
'solidity'
)
}
setTimeout
(
async
()
=>
{
if
(
compiledSuccessfully
)
{
const
res
=
await
this
.
call
(
'solidity'
,
'getCompilationResult'
)
if
(
!
res
)
{
reporCompileIssue
()
}
else
{
this
.
call
(
'menuicons'
,
'select'
,
'flattener1'
)
await
this
.
call
(
'flattener1'
,
'flatten'
,
res
)
}
}
else
{
reporCompileIssue
()
}
},
1000
)
}
onActivation
()
{
this
.
call
(
'filePanel'
,
'registerContextMenuItem'
,
{
id
:
'pluginManager'
,
name
:
'registerFlattener'
,
label
:
'Flatten'
,
type
:
[],
extension
:
[
'.sol'
],
path
:
[],
pattern
:
[]
})
}
activateP
(
name
)
{
this
.
appManager
.
activatePlugin
(
name
)
this
.
appManager
.
activatePlugin
(
name
)
_paq
.
push
([
'trackEvent'
,
'manager'
,
'activate'
,
name
])
_paq
.
push
([
'trackEvent'
,
'manager'
,
'activate'
,
name
])
}
}
deactivateP
(
name
)
{
deactivateP
(
name
)
{
this
.
call
(
'manager'
,
'deactivatePlugin'
,
name
)
this
.
call
(
'manager'
,
'deactivatePlugin'
,
name
)
_paq
.
push
([
'trackEvent'
,
'manager'
,
'deactivate'
,
name
])
_paq
.
push
([
'trackEvent'
,
'manager'
,
'deactivate'
,
name
])
}
}
renderItem
(
profile
)
{
renderItem
(
profile
)
{
const
displayName
=
(
profile
.
displayName
)
?
profile
.
displayName
:
profile
.
name
const
displayName
=
(
profile
.
displayName
)
?
profile
.
displayName
:
profile
.
name
const
doclink
=
profile
.
documentation
?
yo
`<a href="
${
profile
.
documentation
}
" class="px-1" title="link to documentation" target="_blank"><i aria-hidden="true" class="fas fa-book"></i></a>`
const
doclink
=
profile
.
documentation
?
yo
`<a href="
${
profile
.
documentation
}
" class="px-1" title="link to documentation" target="_blank"><i aria-hidden="true" class="fas fa-book"></i></a>`
:
yo
``
:
yo
``
...
@@ -171,7 +206,7 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -171,7 +206,7 @@ class PluginManagerComponent extends ViewPlugin {
/**
/**
* Add a local plugin to the list of plugins
* Add a local plugin to the list of plugins
*/
*/
async
openLocalPlugin
()
{
async
openLocalPlugin
()
{
try
{
try
{
const
profile
=
await
this
.
localPlugin
.
open
(
this
.
appManager
.
getAll
())
const
profile
=
await
this
.
localPlugin
.
open
(
this
.
appManager
.
getAll
())
if
(
!
profile
)
return
if
(
!
profile
)
return
...
@@ -188,7 +223,7 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -188,7 +223,7 @@ class PluginManagerComponent extends ViewPlugin {
}
}
}
}
render
()
{
render
()
{
// Filtering helpers
// Filtering helpers
const
isFiltered
=
(
profile
)
=>
(
profile
.
displayName
?
profile
.
displayName
:
profile
.
name
).
toLowerCase
().
includes
(
this
.
filter
)
const
isFiltered
=
(
profile
)
=>
(
profile
.
displayName
?
profile
.
displayName
:
profile
.
name
).
toLowerCase
().
includes
(
this
.
filter
)
const
isNotRequired
=
(
profile
)
=>
!
this
.
appManager
.
isRequired
(
profile
.
name
)
const
isNotRequired
=
(
profile
)
=>
!
this
.
appManager
.
isRequired
(
profile
.
name
)
...
@@ -255,13 +290,13 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -255,13 +290,13 @@ class PluginManagerComponent extends ViewPlugin {
return
rootView
return
rootView
}
}
reRender
()
{
reRender
()
{
if
(
this
.
views
.
root
)
{
if
(
this
.
views
.
root
)
{
yo
.
update
(
this
.
views
.
root
,
this
.
render
())
yo
.
update
(
this
.
views
.
root
,
this
.
render
())
}
}
}
}
filterPlugins
({
target
})
{
filterPlugins
({
target
})
{
this
.
filter
=
target
.
value
.
toLowerCase
()
this
.
filter
=
target
.
value
.
toLowerCase
()
this
.
reRender
()
this
.
reRender
()
}
}
...
...
apps/remix-ide/src/app/tabs/compile-tab.js
View file @
4e9299bd
...
@@ -292,11 +292,17 @@ class CompileTab extends ViewPlugin {
...
@@ -292,11 +292,17 @@ class CompileTab extends ViewPlugin {
})
})
}
}
compileFile
(
event
)
{
// Returns if the compilation was successfull
async
compileFile
(
event
)
{
if
(
event
.
path
.
length
>
0
)
{
if
(
event
.
path
.
length
>
0
)
{
this
.
compileTabLogic
.
compileFile
(
event
.
path
[
0
])
try
{
return
await
this
.
compileTabLogic
.
compileFile
(
event
.
path
[
0
])
}
catch
(
error
)
{
return
false
}
}
}
}
return
false
}
onDeactivation
()
{
onDeactivation
()
{
this
.
editor
.
event
.
unregister
(
'contentChanged'
)
this
.
editor
.
event
.
unregister
(
'contentChanged'
)
...
...
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