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
12c41cb9
Commit
12c41cb9
authored
Dec 18, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move tabs instanciation to app.js
parent
dda660ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
56 deletions
+33
-56
app.js
src/app.js
+23
-1
righthand-panel.js
src/app/panels/righthand-panel.js
+9
-53
settings-tab.js
src/app/tabs/settings-tab.js
+1
-2
No files found.
src/app.js
View file @
12c41cb9
...
@@ -36,6 +36,16 @@ var NotPersistedExplorer = require('./app/files/NotPersistedExplorer')
...
@@ -36,6 +36,16 @@ var NotPersistedExplorer = require('./app/files/NotPersistedExplorer')
var
toolTip
=
require
(
'./app/ui/tooltip'
)
var
toolTip
=
require
(
'./app/ui/tooltip'
)
var
TransactionReceiptResolver
=
require
(
'./transactionReceiptResolver'
)
var
TransactionReceiptResolver
=
require
(
'./transactionReceiptResolver'
)
const
CompilerAbstract
=
require
(
'./app/compiler/compiler-abstract'
)
const
PluginManager
=
require
(
'./app/plugin/pluginManager'
)
const
CompileTab
=
require
(
'./app/tabs/compile-tab'
)
const
SettingsTab
=
require
(
'./app/tabs/settings-tab'
)
const
AnalysisTab
=
require
(
'./app/tabs/analysis-tab'
)
const
DebuggerTab
=
require
(
'./app/tabs/debugger-tab'
)
const
SupportTab
=
require
(
'./app/tabs/support-tab'
)
const
TestTab
=
require
(
'./app/tabs/test-tab'
)
const
RunTab
=
require
(
'./app/tabs/run-tab'
)
var
styleGuide
=
require
(
'./app/ui/styles-guide/theme-chooser'
)
var
styleGuide
=
require
(
'./app/ui/styles-guide/theme-chooser'
)
var
styles
=
styleGuide
.
chooser
()
var
styles
=
styleGuide
.
chooser
()
...
@@ -389,8 +399,20 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -389,8 +399,20 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
var
renderer
=
new
Renderer
()
var
renderer
=
new
Renderer
()
registry
.
put
({
api
:
renderer
,
name
:
'renderer'
})
registry
.
put
({
api
:
renderer
,
name
:
'renderer'
})
// ---------------- Tabs -------------------------------
let
compileTab
=
new
CompileTab
(
self
.
_components
.
registry
)
let
tabs
=
{
compile
:
compileTab
,
run
:
new
RunTab
(
self
.
_components
.
registry
),
settings
:
new
SettingsTab
(
self
.
_components
.
registry
),
analysis
:
new
AnalysisTab
(
self
.
_components
.
registry
),
debug
:
new
DebuggerTab
(
self
.
_components
.
registry
),
support
:
new
SupportTab
(
self
.
_components
.
registry
),
test
:
new
TestTab
(
self
.
_components
.
registry
,
compileTab
)
}
// ---------------- Righthand-panel --------------------
// ---------------- Righthand-panel --------------------
self
.
_components
.
righthandpanel
=
new
RighthandPanel
()
self
.
_components
.
righthandpanel
=
new
RighthandPanel
(
{
tabs
,
pluginManager
}
)
self
.
_view
.
rightpanel
.
appendChild
(
self
.
_components
.
righthandpanel
.
render
())
self
.
_view
.
rightpanel
.
appendChild
(
self
.
_components
.
righthandpanel
.
render
())
self
.
_components
.
righthandpanel
.
init
()
self
.
_components
.
righthandpanel
.
init
()
self
.
_components
.
righthandpanel
.
event
.
register
(
'resize'
,
delta
=>
self
.
_adjustLayout
(
'right'
,
delta
))
self
.
_components
.
righthandpanel
.
event
.
register
(
'resize'
,
delta
=>
self
.
_adjustLayout
(
'right'
,
delta
))
...
...
src/app/panels/righthand-panel.js
View file @
12c41cb9
...
@@ -5,22 +5,14 @@ const EventManager = require('../../lib/events')
...
@@ -5,22 +5,14 @@ const EventManager = require('../../lib/events')
var
globalRegistry
=
require
(
'../../global/registry'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
const
styleguide
=
require
(
'../ui/styles-guide/theme-chooser'
)
const
styleguide
=
require
(
'../ui/styles-guide/theme-chooser'
)
const
PluginManager
=
require
(
'../plugin/pluginManager'
)
const
TabbedMenu
=
require
(
'../tabs/tabbed-menu'
)
const
TabbedMenu
=
require
(
'../tabs/tabbed-menu'
)
const
CompileTab
=
require
(
'../tabs/compile-tab'
)
const
SettingsTab
=
require
(
'../tabs/settings-tab'
)
const
AnalysisTab
=
require
(
'../tabs/analysis-tab'
)
const
DebuggerTab
=
require
(
'../tabs/debugger-tab'
)
const
SupportTab
=
require
(
'../tabs/support-tab'
)
const
PluginTab
=
require
(
'../tabs/plugin-tab'
)
const
PluginTab
=
require
(
'../tabs/plugin-tab'
)
const
TestTab
=
require
(
'../tabs/test-tab'
)
const
RunTab
=
require
(
'../tabs/run-tab'
)
const
DraggableContent
=
require
(
'../ui/draggableContent'
)
const
DraggableContent
=
require
(
'../ui/draggableContent'
)
const
styles
=
styleguide
.
chooser
()
const
styles
=
styleguide
.
chooser
()
module
.
exports
=
class
RighthandPanel
{
module
.
exports
=
class
RighthandPanel
{
constructor
(
localRegistry
)
{
constructor
(
{
pluginManager
,
tabs
},
localRegistry
)
{
const
self
=
this
const
self
=
this
self
.
_components
=
{}
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
...
@@ -33,57 +25,25 @@ module.exports = class RighthandPanel {
...
@@ -33,57 +25,25 @@ module.exports = class RighthandPanel {
dragbar
:
null
dragbar
:
null
}
}
self
.
_deps
=
{
fileProviders
:
self
.
_components
.
registry
.
get
(
'fileproviders'
).
api
,
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
udapp
:
self
.
_components
.
registry
.
get
(
'udapp'
).
api
,
app
:
self
.
_components
.
registry
.
get
(
'app'
).
api
,
txlistener
:
self
.
_components
.
registry
.
get
(
'txlistener'
).
api
}
var
tabbedMenu
=
new
TabbedMenu
(
self
.
_components
.
registry
)
var
tabbedMenu
=
new
TabbedMenu
(
self
.
_components
.
registry
)
var
pluginManager
=
new
PluginManager
(
self
.
_deps
.
app
,
self
.
_deps
.
compiler
,
self
.
_deps
.
txlistener
,
self
.
_deps
.
fileProviders
,
self
.
_deps
.
fileManager
,
self
.
_deps
.
udapp
)
self
.
_components
.
registry
.
put
({
api
:
pluginManager
,
name
:
'pluginmanager'
})
var
analysisTab
=
new
AnalysisTab
(
self
.
_components
.
registry
)
analysisTab
.
event
.
register
(
'newStaticAnaysisWarningMessage'
,
(
msg
,
settings
)
=>
{
self
.
_components
.
compile
.
addWarning
(
msg
,
settings
)
})
self
.
_components
.
debuggerTab
=
new
DebuggerTab
(
self
.
_components
.
registry
)
self
.
_components
=
{
self
.
_components
=
{
pluginManager
:
pluginManager
,
tabbedMenu
:
tabbedMenu
,
tabbedMenu
:
tabbedMenu
,
compile
:
new
CompileTab
(
self
.
_components
.
registry
),
tabs
run
:
new
RunTab
(
self
.
_components
.
registry
),
settings
:
new
SettingsTab
(
self
.
_components
.
registry
),
analysis
:
analysisTab
,
debug
:
self
.
_components
.
debuggerTab
,
support
:
new
SupportTab
(
self
.
_components
.
registry
),
test
:
new
TestTab
(
self
.
_components
.
registry
)
}
}
self
.
_components
.
settings
.
event
.
register
(
'plugin-loadRequest'
,
json
=>
{
self
.
_components
.
tabs
.
settings
.
event
.
register
(
'plugin-loadRequest'
,
json
=>
{
self
.
loadPlugin
(
json
)
self
.
loadPlugin
(
json
)
})
})
self
.
loadPlugin
=
function
(
json
)
{
self
.
loadPlugin
=
function
(
json
)
{
var
modal
=
new
DraggableContent
(()
=>
{
var
modal
=
new
DraggableContent
(()
=>
{
self
.
_components
.
pluginManager
.
unregister
(
json
)
pluginManager
.
unregister
(
json
)
})
})
var
tab
=
new
PluginTab
(
json
)
var
tab
=
new
PluginTab
(
json
)
var
content
=
tab
.
render
()
var
content
=
tab
.
render
()
document
.
querySelector
(
'body'
).
appendChild
(
modal
.
render
(
json
.
title
,
json
.
url
,
content
))
document
.
querySelector
(
'body'
).
appendChild
(
modal
.
render
(
json
.
title
,
json
.
url
,
content
))
self
.
_components
.
pluginManager
.
register
(
json
,
modal
,
content
)
pluginManager
.
register
(
json
,
modal
,
content
)
}
}
self
.
_view
.
dragbar
=
yo
`<div id="dragbar" class=
${
css
.
dragbar
}
></div>`
self
.
_view
.
dragbar
=
yo
`<div id="dragbar" class=
${
css
.
dragbar
}
></div>`
...
@@ -96,7 +56,7 @@ module.exports = class RighthandPanel {
...
@@ -96,7 +56,7 @@ module.exports = class RighthandPanel {
</div>
</div>
</div>`
</div>`
const
{
compile
,
run
,
settings
,
analysis
,
debug
,
support
,
test
}
=
self
.
_component
s
const
{
compile
,
run
,
settings
,
analysis
,
debug
,
support
,
test
}
=
tab
s
self
.
_components
.
tabbedMenu
.
addTab
(
'Compile'
,
'compileView'
,
compile
.
render
())
self
.
_components
.
tabbedMenu
.
addTab
(
'Compile'
,
'compileView'
,
compile
.
render
())
self
.
_components
.
tabbedMenu
.
addTab
(
'Run'
,
'runView'
,
run
.
render
())
self
.
_components
.
tabbedMenu
.
addTab
(
'Run'
,
'runView'
,
run
.
render
())
self
.
_components
.
tabbedMenu
.
addTab
(
'Analysis'
,
'staticanalysisView'
,
analysis
.
render
())
self
.
_components
.
tabbedMenu
.
addTab
(
'Analysis'
,
'staticanalysisView'
,
analysis
.
render
())
...
@@ -106,11 +66,7 @@ module.exports = class RighthandPanel {
...
@@ -106,11 +66,7 @@ module.exports = class RighthandPanel {
self
.
_components
.
tabbedMenu
.
addTab
(
'Support'
,
'supportView'
,
support
.
render
())
self
.
_components
.
tabbedMenu
.
addTab
(
'Support'
,
'supportView'
,
support
.
render
())
self
.
_components
.
tabbedMenu
.
selectTabByTitle
(
'Compile'
)
self
.
_components
.
tabbedMenu
.
selectTabByTitle
(
'Compile'
)
}
}
// showDebugger () {
// const self = this
// if (!self._components.tabbedMenu) return
// self._components.tabbedMenu.selectTab(self._view.el.querySelector('li.debugView'))
// }
render
()
{
render
()
{
const
self
=
this
const
self
=
this
if
(
self
.
_view
.
element
)
return
self
.
_view
.
element
if
(
self
.
_view
.
element
)
return
self
.
_view
.
element
...
@@ -118,7 +74,7 @@ module.exports = class RighthandPanel {
...
@@ -118,7 +74,7 @@ module.exports = class RighthandPanel {
}
}
debugger
()
{
debugger
()
{
return
this
.
_components
.
debug
.
debugger
()
return
this
.
_components
.
tabs
.
debug
.
debugger
()
}
}
focusOn
(
x
)
{
focusOn
(
x
)
{
...
...
src/app/tabs/settings-tab.js
View file @
12c41cb9
...
@@ -20,8 +20,7 @@ module.exports = class SettingsTab {
...
@@ -20,8 +20,7 @@ module.exports = class SettingsTab {
self
.
_deps
=
{
self
.
_deps
=
{
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
editorPanel
:
self
.
_components
.
registry
.
get
(
'editorpanel'
).
api
,
editorPanel
:
self
.
_components
.
registry
.
get
(
'editorpanel'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
righthandpanel
:
self
.
_components
.
registry
.
get
(
'righthandpanel'
).
api
}
}
self
.
_view
=
{
/* eslint-disable */
self
.
_view
=
{
/* eslint-disable */
el
:
null
,
el
:
null
,
...
...
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