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
4e820c62
Commit
4e820c62
authored
Feb 26, 2018
by
serapath
Committed by
yann300
Mar 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimal preparing tabs refactoring
parent
a73f820e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
65 additions
and
68 deletions
+65
-68
app.js
src/app.js
+2
-2
righthand-panel.js
src/app/panels/righthand-panel.js
+32
-23
analysis-tab.js
src/app/tabs/analysis-tab.js
+2
-3
compile-tab.js
src/app/tabs/compile-tab.js
+6
-12
debugger-tab.js
src/app/tabs/debugger-tab.js
+2
-3
plugin-tab.js
src/app/tabs/plugin-tab.js
+3
-4
run-tab.js
src/app/tabs/run-tab.js
+9
-8
settings-tab.js
src/app/tabs/settings-tab.js
+3
-7
support-tab.js
src/app/tabs/support-tab.js
+2
-3
tabbed-menu.js
src/app/tabs/tabbed-menu.js
+3
-2
pluginManager.js
src/pluginManager.js
+1
-1
No files found.
src/app.js
View file @
4e820c62
...
@@ -110,7 +110,7 @@ var css = csjs`
...
@@ -110,7 +110,7 @@ var css = csjs`
`
`
class
App
{
class
App
{
constructor
(
opts
=
{})
{
constructor
(
api
=
{},
events
=
{},
opts
=
{})
{
var
self
=
this
var
self
=
this
self
.
_api
=
{}
self
.
_api
=
{}
var
fileStorage
=
new
Storage
(
'sol:'
)
var
fileStorage
=
new
Storage
(
'sol:'
)
...
@@ -792,7 +792,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -792,7 +792,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
editor
:
editor
.
event
,
editor
:
editor
.
event
,
staticAnalysis
:
staticanalysis
.
event
staticAnalysis
:
staticanalysis
.
event
}
}
self
.
_components
.
righthandpanel
=
new
RighthandPanel
(
rhpAPI
,
rhpEvents
,
{}
)
self
.
_components
.
righthandpanel
=
new
RighthandPanel
(
rhpAPI
,
rhpEvents
)
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 @
4e820c62
...
@@ -2,29 +2,30 @@ var yo = require('yo-yo')
...
@@ -2,29 +2,30 @@ var yo = require('yo-yo')
var
remixLib
=
require
(
'remix-lib'
)
var
remixLib
=
require
(
'remix-lib'
)
var
EventManager
=
remixLib
.
EventManager
var
EventManager
=
remixLib
.
EventManager
var
TabbedMenu
=
require
(
'../tabs/tabbed-menu'
)
var
TabbedMenu
=
require
(
'../tabs/tabbed-menu'
)
var
c
ompileTab
=
require
(
'../tabs/compile-tab'
)
var
C
ompileTab
=
require
(
'../tabs/compile-tab'
)
var
r
unTab
=
require
(
'../tabs/run-tab'
)
var
R
unTab
=
require
(
'../tabs/run-tab'
)
var
s
ettingsTab
=
require
(
'../tabs/settings-tab'
)
var
S
ettingsTab
=
require
(
'../tabs/settings-tab'
)
var
a
nalysisTab
=
require
(
'../tabs/analysis-tab'
)
var
A
nalysisTab
=
require
(
'../tabs/analysis-tab'
)
var
d
ebuggerTab
=
require
(
'../tabs/debugger-tab'
)
var
D
ebuggerTab
=
require
(
'../tabs/debugger-tab'
)
var
s
upportTab
=
require
(
'../tabs/support-tab'
)
var
S
upportTab
=
require
(
'../tabs/support-tab'
)
var
p
luginTab
=
require
(
'../tabs/plugin-tab'
)
var
P
luginTab
=
require
(
'../tabs/plugin-tab'
)
var
PluginManager
=
require
(
'../../pluginManager'
)
var
PluginManager
=
require
(
'../../pluginManager'
)
var
css
=
require
(
'./styles/righthand-panel-styles'
)
var
css
=
require
(
'./styles/righthand-panel-styles'
)
function
RighthandPanel
(
appAPI
,
events
,
opts
)
{
function
RighthandPanel
(
appAPI
=
{},
events
=
{},
opts
=
{}
)
{
var
self
=
this
var
self
=
this
self
.
_api
=
appAPI
self
.
_api
=
appAPI
self
.
event
=
new
EventManager
()
self
.
event
=
new
EventManager
()
self
.
_view
=
{}
self
.
_view
=
{}
var
optionViews
=
yo
`<div id="optionViews"></div>`
var
optionViews
=
yo
`<div id="optionViews"></div>`
var
options
=
yo
`
<ul class=
${
css
.
opts
}
>
</ul>
`
self
.
_view
.
dragbar
=
yo
`<div id="dragbar" class=
${
css
.
dragbar
}
></div>`
self
.
_view
.
dragbar
=
yo
`<div id="dragbar" class=
${
css
.
dragbar
}
></div>`
// load tabbed menu component
var
tabEvents
=
{
compiler
:
events
.
compiler
,
app
:
events
.
app
,
rhp
:
self
.
event
}
self
.
_view
.
tabbedMenu
=
new
TabbedMenu
(
self
.
_api
,
tabEvents
)
var
options
=
self
.
_view
.
tabbedMenu
.
render
()
options
.
classList
.
add
(
css
.
opts
)
self
.
_view
.
element
=
yo
`
self
.
_view
.
element
=
yo
`
<div id="righthand-panel" class=
${
css
.
panel
}
>
<div id="righthand-panel" class=
${
css
.
panel
}
>
${
self
.
_view
.
dragbar
}
${
self
.
_view
.
dragbar
}
...
@@ -40,23 +41,31 @@ function RighthandPanel (appAPI, events, opts) {
...
@@ -40,23 +41,31 @@ function RighthandPanel (appAPI, events, opts) {
this
.
event
.
trigger
(
'switchTab'
,
[
tabClass
])
this
.
event
.
trigger
(
'switchTab'
,
[
tabClass
])
}
}
// load tabbed menu component
var
tabEvents
=
{
compiler
:
events
.
compiler
,
app
:
events
.
app
,
rhp
:
self
.
event
}
self
.
_view
.
tabbedMenu
=
new
TabbedMenu
(
options
,
tabEvents
)
events
.
rhp
=
self
.
event
events
.
rhp
=
self
.
event
this
.
_view
.
tabbedMenu
.
addTab
(
'Compile'
,
'compileView'
,
compileTab
(
optionViews
,
appAPI
,
events
,
opts
))
var
compileTab
=
new
CompileTab
(
appAPI
,
events
)
this
.
_view
.
tabbedMenu
.
addTab
(
'Run'
,
'runView'
,
runTab
(
optionViews
,
appAPI
,
events
))
optionViews
.
appendChild
(
compileTab
.
render
())
this
.
_view
.
tabbedMenu
.
addTab
(
'Settings'
,
'settingsView'
,
settingsTab
(
optionViews
,
appAPI
,
events
))
var
runTab
=
new
RunTab
(
appAPI
,
events
)
this
.
_view
.
tabbedMenu
.
addTab
(
'Analysis'
,
'staticanalysisView'
,
analysisTab
(
optionViews
))
optionViews
.
appendChild
(
runTab
.
render
())
this
.
_view
.
tabbedMenu
.
addTab
(
'Debugger'
,
'debugView'
,
debuggerTab
(
optionViews
))
var
settingsTab
=
new
SettingsTab
(
appAPI
,
events
)
this
.
_view
.
tabbedMenu
.
addTab
(
'Support'
,
'supportView'
,
supportTab
(
optionViews
,
events
))
optionViews
.
appendChild
(
settingsTab
.
render
())
var
analysisTab
=
new
AnalysisTab
(
appAPI
,
events
)
optionViews
.
appendChild
(
analysisTab
.
render
())
var
debuggerTab
=
new
DebuggerTab
(
appAPI
,
events
)
optionViews
.
appendChild
(
debuggerTab
.
render
())
var
supportTab
=
new
SupportTab
(
appAPI
,
events
)
optionViews
.
appendChild
(
supportTab
.
render
())
this
.
_view
.
tabbedMenu
.
addTab
(
'Compile'
,
'compileView'
,
compileTab
.
render
())
this
.
_view
.
tabbedMenu
.
addTab
(
'Run'
,
'runView'
,
runTab
.
render
())
this
.
_view
.
tabbedMenu
.
addTab
(
'Settings'
,
'settingsView'
,
settingsTab
.
render
())
this
.
_view
.
tabbedMenu
.
addTab
(
'Analysis'
,
'staticanalysisView'
,
analysisTab
.
render
())
this
.
_view
.
tabbedMenu
.
addTab
(
'Debugger'
,
'debugView'
,
debuggerTab
.
render
())
this
.
_view
.
tabbedMenu
.
addTab
(
'Support'
,
'supportView'
,
supportTab
.
render
())
this
.
_view
.
tabbedMenu
.
selectTabByTitle
(
'Compile'
)
this
.
_view
.
tabbedMenu
.
selectTabByTitle
(
'Compile'
)
self
.
pluginManager
=
new
PluginManager
(
appAPI
,
events
)
self
.
pluginManager
=
new
PluginManager
(
appAPI
,
events
)
events
.
rhp
.
register
(
'plugin-loadRequest'
,
(
json
)
=>
{
events
.
rhp
.
register
(
'plugin-loadRequest'
,
(
json
)
=>
{
var
content
=
pluginTab
(
optionViews
,
json
.
url
)
var
content
=
new
PluginTab
(
appAPI
,
events
,
json
)
this
.
_view
.
tabbedMenu
.
addTab
(
json
.
title
,
'plugin'
,
content
)
this
.
_view
.
tabbedMenu
.
addTab
(
json
.
title
,
'plugin'
,
content
)
self
.
pluginManager
.
register
(
json
,
content
)
self
.
pluginManager
.
register
(
json
,
content
)
})
})
...
...
src/app/tabs/analysis-tab.js
View file @
4e820c62
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
var
css
=
require
(
'./styles/analysis-tab-styles'
)
var
css
=
require
(
'./styles/analysis-tab-styles'
)
function
analysisTab
(
container
)
{
function
analysisTab
(
api
=
{},
events
=
{},
opts
=
{}
)
{
var
el
=
yo
`
var
el
=
yo
`
<div class="
${
css
.
analysisTabView
}
"id="staticanalysisView">
<div class="
${
css
.
analysisTabView
}
"id="staticanalysisView">
</div>
</div>
`
`
container
.
appendChild
(
el
)
return
{
render
()
{
return
el
}
}
return
el
}
}
module
.
exports
=
analysisTab
module
.
exports
=
analysisTab
src/app/tabs/compile-tab.js
View file @
4e820c62
...
@@ -14,10 +14,7 @@ var remixLib = require('remix-lib')
...
@@ -14,10 +14,7 @@ var remixLib = require('remix-lib')
var
styleGuide
=
remixLib
.
ui
.
themeChooser
var
styleGuide
=
remixLib
.
ui
.
themeChooser
var
styles
=
styleGuide
.
chooser
()
var
styles
=
styleGuide
.
chooser
()
function
compileTab
(
container
,
appAPI
,
appEvents
,
opts
)
{
function
compileTab
(
appAPI
=
{},
appEvents
=
{},
opts
=
{})
{
if
(
typeof
container
===
'string'
)
container
=
document
.
querySelector
(
container
)
if
(
!
container
)
throw
new
Error
(
'no container given'
)
// Containers
// Containers
var
warnCompilationSlow
=
yo
`<i title="Copy Address" style="display:none" class="
${
css
.
warnCompilationSlow
}
fa fa-exclamation-triangle" aria-hidden="true"></i>`
var
warnCompilationSlow
=
yo
`<i title="Copy Address" style="display:none" class="
${
css
.
warnCompilationSlow
}
fa fa-exclamation-triangle" aria-hidden="true"></i>`
var
compileIcon
=
yo
`<i class="fa fa-refresh
${
css
.
icon
}
" aria-hidden="true"></i>`
var
compileIcon
=
yo
`<i class="fa fa-refresh
${
css
.
icon
}
" aria-hidden="true"></i>`
...
@@ -115,24 +112,23 @@ function compileTab (container, appAPI, appEvents, opts) {
...
@@ -115,24 +112,23 @@ function compileTab (container, appAPI, appEvents, opts) {
compileIcon
.
setAttribute
(
'title'
,
''
)
compileIcon
.
setAttribute
(
'title'
,
''
)
})
})
var
errorContainer
=
yo
`<div class='error'></div>`
var
el
=
yo
`
var
el
=
yo
`
<div class="
${
css
.
compileTabView
}
" id="compileTabView">
<div class="
${
css
.
compileTabView
}
" id="compileTabView">
${
compileContainer
}
${
compileContainer
}
${
contractNames
(
container
,
appAPI
,
appEvents
,
op
ts
)}
${
contractNames
(
appAPI
,
appEven
ts
)}
<div class='error'></div>
${
errorContainer
}
</div>
</div>
`
`
container
.
appendChild
(
el
)
/* ------------------------------------------------
/* ------------------------------------------------
section CONTRACT DROPDOWN, DETAILS AND PUBLISH
section CONTRACT DROPDOWN, DETAILS AND PUBLISH
------------------------------------------------ */
------------------------------------------------ */
function
contractNames
(
container
,
appAPI
,
appEvents
,
op
ts
)
{
function
contractNames
(
appAPI
,
appEven
ts
)
{
var
contractsDetails
=
{}
var
contractsDetails
=
{}
appEvents
.
compiler
.
register
(
'compilationStarted'
,
()
=>
{
appEvents
.
compiler
.
register
(
'compilationStarted'
,
()
=>
{
var
errorContainer
=
container
.
querySelector
(
'.error'
)
errorContainer
.
innerHTML
=
''
errorContainer
.
innerHTML
=
''
})
})
...
@@ -148,7 +144,6 @@ function compileTab (container, appAPI, appEvents, opts) {
...
@@ -148,7 +144,6 @@ function compileTab (container, appAPI, appEvents, opts) {
document
.
querySelector
(
'.compileView'
).
style
.
color
=
styles
.
colors
.
red
document
.
querySelector
(
'.compileView'
).
style
.
color
=
styles
.
colors
.
red
}
}
// display warning error if any
// display warning error if any
var
errorContainer
=
container
.
querySelector
(
'.error'
)
var
error
=
false
var
error
=
false
if
(
data
[
'error'
])
{
if
(
data
[
'error'
])
{
error
=
true
error
=
true
...
@@ -171,7 +166,6 @@ function compileTab (container, appAPI, appEvents, opts) {
...
@@ -171,7 +166,6 @@ function compileTab (container, appAPI, appEvents, opts) {
appEvents
.
staticAnalysis
.
register
(
'staticAnaysisWarning'
,
(
count
)
=>
{
appEvents
.
staticAnalysis
.
register
(
'staticAnaysisWarning'
,
(
count
)
=>
{
if
(
count
)
{
if
(
count
)
{
var
errorContainer
=
container
.
querySelector
(
'.error'
)
appAPI
.
compilationMessage
(
`Static Analysis raised
${
count
}
warning(s) that requires your attention.`
,
$
(
errorContainer
),
{
appAPI
.
compilationMessage
(
`Static Analysis raised
${
count
}
warning(s) that requires your attention.`
,
$
(
errorContainer
),
{
type
:
'warning'
,
type
:
'warning'
,
click
:
()
=>
appAPI
.
switchTab
(
'staticanalysisView'
)
click
:
()
=>
appAPI
.
switchTab
(
'staticanalysisView'
)
...
@@ -303,7 +297,7 @@ function compileTab (container, appAPI, appEvents, opts) {
...
@@ -303,7 +297,7 @@ function compileTab (container, appAPI, appEvents, opts) {
}
}
return
el
return
el
}
}
return
el
return
{
render
()
{
return
el
}
}
}
}
function
detailsHelpSection
()
{
function
detailsHelpSection
()
{
...
...
src/app/tabs/debugger-tab.js
View file @
4e820c62
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
var
css
=
require
(
'./styles/debugger-tab-styles'
)
var
css
=
require
(
'./styles/debugger-tab-styles'
)
function
debuggerTab
(
container
)
{
function
debuggerTab
(
api
=
{},
events
=
{},
opts
=
{}
)
{
var
el
=
yo
`
var
el
=
yo
`
<div class="
${
css
.
debuggerTabView
}
"id="debugView">
<div class="
${
css
.
debuggerTabView
}
"id="debugView">
<div id="debugger" class="
${
css
.
debugger
}
"></div>
<div id="debugger" class="
${
css
.
debugger
}
"></div>
</div>`
</div>`
container
.
appendChild
(
el
)
return
{
render
()
{
return
el
}
}
return
el
}
}
module
.
exports
=
debuggerTab
module
.
exports
=
debuggerTab
src/app/tabs/plugin-tab.js
View file @
4e820c62
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
var
css
=
require
(
'./styles/plugin-tab-styles'
)
var
css
=
require
(
'./styles/plugin-tab-styles'
)
function
plugintab
(
container
,
url
)
{
function
plugintab
(
api
=
{},
events
=
{},
opts
=
{}
)
{
var
el
=
yo
`
var
el
=
yo
`
<div class="
${
css
.
pluginTabView
}
" id="pluginView">
<div class="
${
css
.
pluginTabView
}
" id="pluginView">
<iframe class="
${
css
.
iframe
}
" src="
${
url
}
/index.html"></iframe>
<iframe class="
${
css
.
iframe
}
" src="
${
opts
.
url
}
/index.html"></iframe>
</div>`
</div>`
container
.
appendChild
(
el
)
return
{
render
()
{
return
el
}
}
return
el
}
}
module
.
exports
=
plugintab
module
.
exports
=
plugintab
src/app/tabs/run-tab.js
View file @
4e820c62
...
@@ -22,14 +22,15 @@ var noInstancesText = yo`<div class="${css.noInstancesText}">0 contract Instance
...
@@ -22,14 +22,15 @@ var noInstancesText = yo`<div class="${css.noInstancesText}">0 contract Instance
var
pendingTxsText
=
yo
`<span>0 pending transactions</span>`
var
pendingTxsText
=
yo
`<span>0 pending transactions</span>`
function
runTab
(
container
,
appAPI
,
appEvents
)
{
function
runTab
(
appAPI
=
{},
appEvents
=
{},
opts
=
{})
{
var
events
=
new
EventManager
()
var
container
=
document
.
createElement
(
'div'
)
var
event
=
new
EventManager
()
var
clearInstanceElement
=
yo
`<i class="
${
css
.
clearinstance
}
${
css
.
icon
}
fa fa-trash" title="Clear Instances List" aria-hidden="true"></i>`
var
clearInstanceElement
=
yo
`<i class="
${
css
.
clearinstance
}
${
css
.
icon
}
fa fa-trash" title="Clear Instances List" aria-hidden="true"></i>`
clearInstanceElement
.
addEventListener
(
'click'
,
()
=>
{
clearInstanceElement
.
addEventListener
(
'click'
,
()
=>
{
event
s
.
trigger
(
'clearInstance'
,
[])
event
.
trigger
(
'clearInstance'
,
[])
})
})
var
recorderInterface
=
makeRecorder
(
event
s
,
appAPI
,
appEvents
)
var
recorderInterface
=
makeRecorder
(
event
,
appAPI
,
appEvents
)
var
pendingTxsContainer
=
yo
`
var
pendingTxsContainer
=
yo
`
<div class="
${
css
.
pendingTxsContainer
}
">
<div class="
${
css
.
pendingTxsContainer
}
">
<div class="
${
css
.
pendingTxsText
}
">
<div class="
${
css
.
pendingTxsText
}
">
...
@@ -45,7 +46,7 @@ function runTab (container, appAPI, appEvents) {
...
@@ -45,7 +46,7 @@ function runTab (container, appAPI, appEvents) {
var
el
=
yo
`
var
el
=
yo
`
<div class="
${
css
.
runTabView
}
" id="runTabView">
<div class="
${
css
.
runTabView
}
" id="runTabView">
${
settings
(
container
,
appAPI
,
appEvents
)}
${
settings
(
container
,
appAPI
,
appEvents
)}
${
contractDropdown
(
event
s
,
appAPI
,
appEvents
,
instanceContainer
)}
${
contractDropdown
(
event
,
appAPI
,
appEvents
,
instanceContainer
)}
${
pendingTxsContainer
}
${
pendingTxsContainer
}
${
instanceContainer
}
${
instanceContainer
}
</div>
</div>
...
@@ -65,7 +66,7 @@ function runTab (container, appAPI, appEvents) {
...
@@ -65,7 +66,7 @@ function runTab (container, appAPI, appEvents) {
// set the final context. Cause it is possible that this is not the one we've originaly selected
// set the final context. Cause it is possible that this is not the one we've originaly selected
selectExEnv
.
value
=
executionContext
.
getProvider
()
selectExEnv
.
value
=
executionContext
.
getProvider
()
fillAccountsList
(
appAPI
,
el
)
fillAccountsList
(
appAPI
,
el
)
event
s
.
trigger
(
'clearInstance'
,
[])
event
.
trigger
(
'clearInstance'
,
[])
}
}
selectExEnv
.
addEventListener
(
'change'
,
function
(
event
)
{
selectExEnv
.
addEventListener
(
'change'
,
function
(
event
)
{
...
@@ -95,12 +96,12 @@ function runTab (container, appAPI, appEvents) {
...
@@ -95,12 +96,12 @@ function runTab (container, appAPI, appEvents) {
updatePendingTxs
(
container
,
appAPI
)
updatePendingTxs
(
container
,
appAPI
)
},
10000
)
},
10000
)
event
s
.
register
(
'clearInstance'
,
()
=>
{
event
.
register
(
'clearInstance'
,
()
=>
{
instanceContainer
.
innerHTML
=
''
// clear the instances list
instanceContainer
.
innerHTML
=
''
// clear the instances list
noInstancesText
.
style
.
display
=
'block'
noInstancesText
.
style
.
display
=
'block'
instanceContainer
.
appendChild
(
noInstancesText
)
instanceContainer
.
appendChild
(
noInstancesText
)
})
})
return
el
return
{
render
()
{
return
container
}
}
}
}
function
fillAccountsList
(
appAPI
,
container
)
{
function
fillAccountsList
(
appAPI
,
container
)
{
...
...
src/app/tabs/settings-tab.js
View file @
4e820c62
...
@@ -10,10 +10,7 @@ var modal = require('../ui/modal-dialog-custom')
...
@@ -10,10 +10,7 @@ var modal = require('../ui/modal-dialog-custom')
var
css
=
require
(
'./styles/settings-tab-styles'
)
var
css
=
require
(
'./styles/settings-tab-styles'
)
function
SettingsTab
(
container
,
appAPI
,
appEvents
)
{
function
SettingsTab
(
appAPI
=
{},
appEvents
=
{},
opts
=
{})
{
if
(
typeof
container
===
'string'
)
container
=
document
.
querySelector
(
container
)
if
(
!
container
)
throw
new
Error
(
'no container given'
)
var
queryParams
=
new
QueryParams
()
var
queryParams
=
new
QueryParams
()
var
optionVM
=
yo
`<input id="alwaysUseVM" type="checkbox">`
var
optionVM
=
yo
`<input id="alwaysUseVM" type="checkbox">`
...
@@ -78,7 +75,7 @@ function SettingsTab (container, appAPI, appEvents) {
...
@@ -78,7 +75,7 @@ function SettingsTab (container, appAPI, appEvents) {
<input class="
${
css
.
col1
}
" name="theme" id="themeDark" type="checkbox">
<input class="
${
css
.
col1
}
" name="theme" id="themeDark" type="checkbox">
<label for="themeDark">Dark Theme</label>
<label for="themeDark">Dark Theme</label>
</div>
</div>
</div>
</div>
<div class="
${
css
.
info
}
">
<div class="
${
css
.
info
}
">
<div class=
${
css
.
title
}
>Plugin</div>
<div class=
${
css
.
title
}
>Plugin</div>
<div class="
${
css
.
crowNoFlex
}
">
<div class="
${
css
.
crowNoFlex
}
">
...
@@ -203,8 +200,7 @@ function SettingsTab (container, appAPI, appEvents) {
...
@@ -203,8 +200,7 @@ function SettingsTab (container, appAPI, appEvents) {
loadVersion
(
'builtin'
,
queryParams
,
appAPI
,
el
)
loadVersion
(
'builtin'
,
queryParams
,
appAPI
,
el
)
})
})
container
.
appendChild
(
el
)
return
{
render
()
{
return
el
}
}
return
el
}
}
function
setVersionText
(
text
,
el
)
{
function
setVersionText
(
text
,
el
)
{
...
...
src/app/tabs/support-tab.js
View file @
4e820c62
...
@@ -33,7 +33,7 @@ function supportTabView (gitterIframe) {
...
@@ -33,7 +33,7 @@ function supportTabView (gitterIframe) {
`
`
}
}
function
supportTab
(
container
,
events
)
{
function
supportTab
(
api
=
{},
events
=
{},
opts
=
{}
)
{
let
el
=
supportTabView
(
''
)
let
el
=
supportTabView
(
''
)
let
gitterIsLoaded
=
false
let
gitterIsLoaded
=
false
...
@@ -47,8 +47,7 @@ function supportTab (container, events) {
...
@@ -47,8 +47,7 @@ function supportTab (container, events) {
gitterIsLoaded
=
true
gitterIsLoaded
=
true
})
})
container
.
appendChild
(
el
)
return
{
render
()
{
return
el
}
}
return
el
}
}
function
openLink
()
{
function
openLink
()
{
...
...
src/app/tabs/tabbed-menu.js
View file @
4e820c62
...
@@ -4,8 +4,9 @@ var helper = require('../../lib/helper')
...
@@ -4,8 +4,9 @@ var helper = require('../../lib/helper')
var
css
=
require
(
'./styles/tabbed-menu-styles'
)
var
css
=
require
(
'./styles/tabbed-menu-styles'
)
class
TabbedMenu
{
class
TabbedMenu
{
constructor
(
tabView
,
events
)
{
constructor
(
api
=
{},
events
=
{},
opts
=
{}
)
{
var
self
=
this
var
self
=
this
var
tabView
=
document
.
createElement
(
'ul'
)
this
.
tabView
=
tabView
this
.
tabView
=
tabView
this
.
events
=
events
this
.
events
=
events
this
.
tabs
=
{}
this
.
tabs
=
{}
...
@@ -19,7 +20,7 @@ class TabbedMenu {
...
@@ -19,7 +20,7 @@ class TabbedMenu {
self
.
selectTab
(
tabView
.
querySelector
(
`li.
${
tabName
}
`
))
self
.
selectTab
(
tabView
.
querySelector
(
`li.
${
tabName
}
`
))
})
})
}
}
render
()
{
return
this
.
tabView
}
selectTabByTitle
(
title
)
{
selectTabByTitle
(
title
)
{
this
.
selectTab
(
this
.
tabs
[
title
])
this
.
selectTab
(
this
.
tabs
[
title
])
}
}
...
...
src/pluginManager.js
View file @
4e820c62
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
*
*
*/
*/
class
PluginManager
{
class
PluginManager
{
constructor
(
api
,
events
)
{
constructor
(
api
=
{},
events
=
{},
opts
=
{}
)
{
var
self
=
this
var
self
=
this
this
.
plugins
=
{}
this
.
plugins
=
{}
this
.
inFocus
this
.
inFocus
...
...
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