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
a73e2c4c
Unverified
Commit
a73e2c4c
authored
Oct 19, 2018
by
yann300
Committed by
GitHub
Oct 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1555 from ethereum/APIImprovement
Plugin API improvement
parents
0f99a72f
fb403049
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
15 deletions
+19
-15
righthand-panel.js
src/app/panels/righthand-panel.js
+1
-1
pluginAPI.js
src/app/plugin/pluginAPI.js
+5
-4
pluginManager.js
src/app/plugin/pluginManager.js
+2
-0
settings-tab.js
src/app/tabs/settings-tab.js
+9
-8
draggableContent.js
src/app/ui/draggableContent.js
+2
-2
No files found.
src/app/panels/righthand-panel.js
View file @
a73e2c4c
...
...
@@ -83,7 +83,7 @@ module.exports = class RighthandPanel {
})
var
tab
=
new
PluginTab
(
json
)
var
content
=
tab
.
render
()
document
.
querySelector
(
'body'
).
appendChild
(
modal
.
render
(
json
.
title
,
content
))
document
.
querySelector
(
'body'
).
appendChild
(
modal
.
render
(
json
.
title
,
json
.
url
,
content
))
self
.
_components
.
pluginManager
.
register
(
json
,
modal
,
content
)
}
...
...
src/app/plugin/pluginAPI.js
View file @
a73e2c4c
...
...
@@ -5,7 +5,7 @@ var SourceHighlighter = require('../editor/sourceHighlighter')
Defines available API. `key` / `type`
*/
module
.
exports
=
(
pluginManager
,
fileProviders
,
fileManager
,
compiler
,
udapp
)
=>
{
var
highlighter
=
new
SourceHighlighter
()
let
highlighters
=
{}
return
{
app
:
{
getExecutionContextProvider
:
(
mod
,
cb
)
=>
{
...
...
@@ -136,12 +136,13 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) =>
}
catch
(
e
)
{
return
cb
(
e
.
message
)
}
highlighter
.
currentSourceLocation
(
null
)
highlighter
.
currentSourceLocationFromfileName
(
position
,
filePath
,
hexColor
)
if
(
!
highlighters
[
mod
])
highlighters
[
mod
]
=
new
SourceHighlighter
()
highlighters
[
mod
].
currentSourceLocation
(
null
)
highlighters
[
mod
].
currentSourceLocationFromfileName
(
position
,
filePath
,
hexColor
)
cb
()
},
discardHighlight
:
(
mod
,
cb
)
=>
{
highlighter
.
currentSourceLocation
(
null
)
if
(
highlighters
[
mod
])
highlighters
[
mod
]
.
currentSourceLocation
(
null
)
cb
()
}
}
...
...
src/app/plugin/pluginManager.js
View file @
a73e2c4c
...
...
@@ -90,6 +90,7 @@ module.exports = class PluginManager {
compiler
,
udapp
)
self
.
_components
=
{
pluginAPI
}
self
.
plugins
=
{}
self
.
origins
=
{}
self
.
inFocus
...
...
@@ -181,6 +182,7 @@ module.exports = class PluginManager {
}
unregister
(
desc
)
{
const
self
=
this
self
.
_components
.
pluginAPI
.
editor
.
discardHighlight
(
desc
.
title
,
()
=>
{})
delete
self
.
plugins
[
desc
.
title
]
delete
self
.
origins
[
desc
.
url
]
}
...
...
src/app/tabs/settings-tab.js
View file @
a73e2c4c
...
...
@@ -136,14 +136,15 @@ module.exports = class SettingsTab {
function
loadPlugins
(
plugins
,
opt
)
{
for
(
var
k
in
plugins
)
{
var
plugin
=
plugins
[
k
]
if
(
!
self
.
_view
.
plugins
[
plugin
.
title
])
self
.
_view
.
plugins
[
plugin
.
title
]
=
{}
self
.
_view
.
plugins
[
plugin
.
title
].
json
=
plugin
self
.
_view
.
plugins
[
plugin
.
title
].
el
=
yo
`<div title=
${
plugin
.
title
}
class="
${
css
.
pluginLoad
}
">
<div class="
${
css
.
aPlugin
}
" onclick=
${()
=>
{
onLoadPlugin
(
plugin
.
title
)
}}
>
$
{
plugin
.
title
}
</div>
${
opt
.
removable
?
yo
`<span class="
${
css
.
removePlugin
}
" onclick=
${()
=>
{
onRemovePlugin
(
plugin
.
title
)
}}
><
i
class
=
"fa fa-close"
><
/i></
span
>
` : yo`
<
span
><
/span>`
}
<
/div>
`
self
.
_view
.
config
.
plugins
.
appendChild
(
self
.
_view
.
plugins
[
plugin
.
title
].
el
)
(
function
(
plugin
)
{
if
(
!
self
.
_view
.
plugins
[
plugin
.
title
])
self
.
_view
.
plugins
[
plugin
.
title
]
=
{}
self
.
_view
.
plugins
[
plugin
.
title
].
json
=
plugin
self
.
_view
.
plugins
[
plugin
.
title
].
el
=
yo
`<div title=
${
plugin
.
title
}
class="
${
css
.
pluginLoad
}
">
<div class="
${
css
.
aPlugin
}
" onclick=
${()
=>
{
onLoadPlugin
(
plugin
.
title
)
}}
>
$
{
plugin
.
title
}
</div>
${
opt
.
removable
?
yo
`<span class="
${
css
.
removePlugin
}
" onclick=
${()
=>
{
onRemovePlugin
(
plugin
.
title
)
}}
><
i
class
=
"fa fa-close"
><
/i></
span
>
` : yo`
<
span
><
/span>`
}
<
/div>
`
self
.
_view
.
config
.
plugins
.
appendChild
(
self
.
_view
.
plugins
[
plugin
.
title
].
el
)
}
)(plugins[k])
}
}
...
...
src/app/ui/draggableContent.js
View file @
a73e2c4c
...
...
@@ -43,12 +43,12 @@ module.exports =
this
.
closeCb
=
closeCb
}
render
(
title
,
content
)
{
render
(
title
,
url
,
content
)
{
this
.
content
=
content
var
el
=
yo
`
<div class=
${
css
.
containerDraggableModal
}
>
<div>
<div class="
${
css
.
headerDraggableModal
}
title" title=
${
title
}
><span
>
${
title
}
</span>
<div class="
${
css
.
headerDraggableModal
}
title" title=
${
title
}
><span
title="
${
title
}
" >
${
title
}
</span><span title="
${
url
}
" > -
${
url
}
</span>
<div class=
${
css
.
modalActions
}
>
<i onclick=
${()
=>
{
this
.
minimize
()
}}
class
=
"fa fa-window-minimize ${css.modalAction}"
><
/i
>
<
i
onclick
=
$
{()
=>
{
this
.
maximise
()
}}
class
=
"fa fa-window-maximize ${css.modalAction}"
><
/i
>
...
...
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