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
cf81deee
Commit
cf81deee
authored
Nov 30, 2020
by
GrandSchtroumpf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create plugin for TabProxy
parent
62bd8fca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
16 deletions
+34
-16
app.js
apps/remix-ide/src/app.js
+4
-1
vertical-icons.js
apps/remix-ide/src/app/components/vertical-icons.js
+4
-1
main-view.js
apps/remix-ide/src/app/panels/main-view.js
+1
-0
tab-proxy.js
apps/remix-ide/src/app/panels/tab-proxy.js
+25
-14
No files found.
apps/remix-ide/src/app.js
View file @
cf81deee
...
@@ -314,7 +314,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -314,7 +314,10 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const
mainview
=
new
MainView
(
contextualListener
,
editor
,
appPanel
,
fileManager
,
appManager
,
terminal
)
const
mainview
=
new
MainView
(
contextualListener
,
editor
,
appPanel
,
fileManager
,
appManager
,
terminal
)
registry
.
put
({
api
:
mainview
,
name
:
'mainview'
})
registry
.
put
({
api
:
mainview
,
name
:
'mainview'
})
engine
.
register
(
appPanel
)
engine
.
register
([
appPanel
,
mainview
.
tabProxy
])
// those views depend on app_manager
// those views depend on app_manager
const
menuicons
=
new
VerticalIcons
(
appManager
)
const
menuicons
=
new
VerticalIcons
(
appManager
)
...
...
apps/remix-ide/src/app/components/vertical-icons.js
View file @
cf81deee
...
@@ -225,7 +225,10 @@ export class VerticalIcons extends Plugin {
...
@@ -225,7 +225,10 @@ export class VerticalIcons extends Plugin {
const
home
=
yo
`
const
home
=
yo
`
<div
<div
class="
${
css
.
homeIcon
}
"
class="
${
css
.
homeIcon
}
"
onclick="
${(
e
)
=>
this
.
appManager
.
activatePlugin
(
'home'
)}
"
onclick="
${
async
()
=>
{
await
this
.
appManager
.
activatePlugin
(
'home'
)
this
.
call
(
'tabs'
,
'focus'
,
'home'
)
}}
"
plugin="
home
" title="
Home
"
plugin="
home
" title="
Home
"
data-id="
verticalIconsHomeIcon
"
data-id="
verticalIconsHomeIcon
"
>
>
...
...
apps/remix-ide/src/app/panels/main-view.js
View file @
cf81deee
...
@@ -17,6 +17,7 @@ var css = csjs`
...
@@ -17,6 +17,7 @@ var css = csjs`
}
}
`
`
// @todo(#650) Extract this into two classes: MainPanel (TabsProxy + Iframe/Editor) & BottomPanel (Terminal)
export
class
MainView
{
export
class
MainView
{
constructor
(
contextualListener
,
editor
,
mainPanel
,
fileManager
,
appManager
,
terminal
)
{
constructor
(
contextualListener
,
editor
,
mainPanel
,
fileManager
,
appManager
,
terminal
)
{
var
self
=
this
var
self
=
this
...
...
apps/remix-ide/src/app/panels/tab-proxy.js
View file @
cf81deee
...
@@ -3,7 +3,7 @@ var $ = require('jquery')
...
@@ -3,7 +3,7 @@ var $ = require('jquery')
const
EventEmitter
=
require
(
'events'
)
const
EventEmitter
=
require
(
'events'
)
const
globalRegistry
=
require
(
'../../global/registry'
)
const
globalRegistry
=
require
(
'../../global/registry'
)
const
csjs
=
require
(
'csjs-inject'
)
const
csjs
=
require
(
'csjs-inject'
)
import
{
Plugin
}
from
'@remixproject/engine'
require
(
'remix-tabs'
)
require
(
'remix-tabs'
)
const
css
=
csjs
`
const
css
=
csjs
`
...
@@ -12,8 +12,15 @@ const css = csjs`
...
@@ -12,8 +12,15 @@ const css = csjs`
}
}
`
`
export
class
TabProxy
{
const
profile
=
{
name
:
'tabs'
,
methods
:
[
'focus'
],
}
// @todo(#650) Merge this with MainPanel into one plugin
export
class
TabProxy
extends
Plugin
{
constructor
(
fileManager
,
editor
,
appManager
)
{
constructor
(
fileManager
,
editor
,
appManager
)
{
super
(
profile
)
this
.
event
=
new
EventEmitter
()
this
.
event
=
new
EventEmitter
()
this
.
fileManager
=
fileManager
this
.
fileManager
=
fileManager
this
.
appManager
=
appManager
this
.
appManager
=
appManager
...
@@ -85,22 +92,25 @@ export class TabProxy {
...
@@ -85,22 +92,25 @@ export class TabProxy {
this
.
removeTab
(
profile
.
name
)
this
.
removeTab
(
profile
.
name
)
})
})
appManager
.
event
.
on
(
'ensureActivated'
,
(
name
)
=>
{
// appManager.event.on('pluginActivated', ({name}) => {
if
(
name
===
'home'
)
{
// if (name === 'home') {
// if someone force activation of home, we switch to it
// // if someone force activation of home, we switch to it
this
.
event
.
emit
(
'switchApp'
,
name
)
// this.event.emit('switchApp', name)
this
.
_view
.
filetabs
.
activateTab
(
name
)
// this._view.filetabs.activateTab(name)
}
// }
})
// })
}
focus
(
name
)
{
this
.
event
.
emit
(
'switchApp'
,
name
)
this
.
_view
.
filetabs
.
activateTab
(
name
)
}
}
updateImgStyles
()
{
updateImgStyles
()
{
const
images
=
this
.
_view
.
filetabs
.
getElementsByClassName
(
'iconImage'
)
const
images
=
this
.
_view
.
filetabs
.
getElementsByClassName
(
'iconImage'
)
if
(
images
.
length
!==
0
)
{
for
(
const
element
of
images
)
{
for
(
const
element
of
images
)
{
globalRegistry
.
get
(
'themeModule'
).
api
.
fixInvert
(
element
)
globalRegistry
.
get
(
'themeModule'
).
api
.
fixInvert
(
element
)
};
};
}
}
}
switchTab
(
tabName
)
{
switchTab
(
tabName
)
{
...
@@ -205,6 +215,7 @@ export class TabProxy {
...
@@ -205,6 +215,7 @@ export class TabProxy {
delete
this
.
_handlers
[
name
]
delete
this
.
_handlers
[
name
]
this
.
switchToActiveTab
()
this
.
switchToActiveTab
()
this
.
loadedTabs
=
this
.
loadedTabs
.
filter
(
tab
=>
tab
.
name
!==
name
)
this
.
loadedTabs
=
this
.
loadedTabs
.
filter
(
tab
=>
tab
.
name
!==
name
)
this
.
updateImgStyles
()
}
}
addHandler
(
type
,
fn
)
{
addHandler
(
type
,
fn
)
{
...
...
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