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
fd8aeb2c
Commit
fd8aeb2c
authored
Jun 05, 2018
by
serapath
Committed by
yann300
Jun 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rhp: refactor var2const
parent
e48f8507
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
righthand-panel.js
src/app/panels/righthand-panel.js
+33
-33
No files found.
src/app/panels/righthand-panel.js
View file @
fd8aeb2c
var
yo
=
require
(
'yo-yo'
)
const
yo
=
require
(
'yo-yo'
)
var
csjs
=
require
(
'csjs-inject'
)
const
csjs
=
require
(
'csjs-inject'
)
var
remixLib
=
require
(
'remix-lib'
)
const
remixLib
=
require
(
'remix-lib'
)
var
styleguide
=
require
(
'../ui/styles-guide/theme-chooser'
)
const
styleguide
=
require
(
'../ui/styles-guide/theme-chooser'
)
var
PluginManager
=
require
(
'../plugin/pluginManager'
)
const
PluginManager
=
require
(
'../plugin/pluginManager'
)
var
TabbedMenu
=
require
(
'../tabs/tabbed-menu'
)
const
TabbedMenu
=
require
(
'../tabs/tabbed-menu'
)
var
CompileTab
=
require
(
'../tabs/compile-tab'
)
const
CompileTab
=
require
(
'../tabs/compile-tab'
)
var
SettingsTab
=
require
(
'../tabs/settings-tab'
)
const
SettingsTab
=
require
(
'../tabs/settings-tab'
)
var
AnalysisTab
=
require
(
'../tabs/analysis-tab'
)
const
AnalysisTab
=
require
(
'../tabs/analysis-tab'
)
var
DebuggerTab
=
require
(
'../tabs/debugger-tab'
)
const
DebuggerTab
=
require
(
'../tabs/debugger-tab'
)
var
SupportTab
=
require
(
'../tabs/support-tab'
)
const
SupportTab
=
require
(
'../tabs/support-tab'
)
var
PluginTab
=
require
(
'../tabs/plugin-tab'
)
const
PluginTab
=
require
(
'../tabs/plugin-tab'
)
var
TestTab
=
require
(
'../tabs/test-tab'
)
const
TestTab
=
require
(
'../tabs/test-tab'
)
var
RunTab
=
require
(
'../tabs/run-tab'
)
const
RunTab
=
require
(
'../tabs/run-tab'
)
var
EventManager
=
remixLib
.
EventManager
const
EventManager
=
remixLib
.
EventManager
var
styles
=
styleguide
.
chooser
()
const
styles
=
styleguide
.
chooser
()
module
.
exports
=
function
RighthandPanel
(
appAPI
=
{},
events
=
{},
opts
=
{})
{
module
.
exports
=
function
RighthandPanel
(
appAPI
=
{},
events
=
{},
opts
=
{})
{
var
self
=
this
const
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>`
const
optionViews
=
yo
`<div id="optionViews"></div>`
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
// load tabbed menu component
var
tabEvents
=
{
compiler
:
events
.
compiler
,
app
:
events
.
app
,
rhp
:
self
.
event
}
const
tabEvents
=
{
compiler
:
events
.
compiler
,
app
:
events
.
app
,
rhp
:
self
.
event
}
self
.
_view
.
tabbedMenu
=
new
TabbedMenu
(
appAPI
,
tabEvents
)
self
.
_view
.
tabbedMenu
=
new
TabbedMenu
(
appAPI
,
tabEvents
)
var
options
=
self
.
_view
.
tabbedMenu
.
render
()
const
options
=
self
.
_view
.
tabbedMenu
.
render
()
options
.
classList
.
add
(
css
.
opts
)
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
}
>
...
@@ -46,17 +46,17 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
...
@@ -46,17 +46,17 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
events
.
rhp
=
self
.
event
events
.
rhp
=
self
.
event
var
compileTab
=
new
CompileTab
(
appAPI
,
events
,
opts
)
const
compileTab
=
new
CompileTab
(
appAPI
,
events
,
opts
)
optionViews
.
appendChild
(
compileTab
.
render
())
optionViews
.
appendChild
(
compileTab
.
render
())
var
runTab
=
new
RunTab
(
appAPI
,
events
,
opts
)
const
runTab
=
new
RunTab
(
appAPI
,
events
,
opts
)
optionViews
.
appendChild
(
runTab
.
render
())
optionViews
.
appendChild
(
runTab
.
render
())
var
settingsTab
=
new
SettingsTab
(
appAPI
,
events
,
opts
)
const
settingsTab
=
new
SettingsTab
(
appAPI
,
events
,
opts
)
optionViews
.
appendChild
(
settingsTab
.
render
())
optionViews
.
appendChild
(
settingsTab
.
render
())
var
analysisTab
=
new
AnalysisTab
(
appAPI
,
events
,
opts
)
const
analysisTab
=
new
AnalysisTab
(
appAPI
,
events
,
opts
)
optionViews
.
appendChild
(
analysisTab
.
render
())
optionViews
.
appendChild
(
analysisTab
.
render
())
var
debuggerTab
=
new
DebuggerTab
(
appAPI
,
events
,
opts
)
const
debuggerTab
=
new
DebuggerTab
(
appAPI
,
events
,
opts
)
optionViews
.
appendChild
(
debuggerTab
.
render
())
optionViews
.
appendChild
(
debuggerTab
.
render
())
var
supportTab
=
new
SupportTab
(
appAPI
,
events
,
opts
)
const
supportTab
=
new
SupportTab
(
appAPI
,
events
,
opts
)
optionViews
.
appendChild
(
supportTab
.
render
())
optionViews
.
appendChild
(
supportTab
.
render
())
var
testTab
=
new
TestTab
(
appAPI
,
events
,
opts
)
var
testTab
=
new
TestTab
(
appAPI
,
events
,
opts
)
optionViews
.
appendChild
(
testTab
.
render
())
optionViews
.
appendChild
(
testTab
.
render
())
...
@@ -71,8 +71,8 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
...
@@ -71,8 +71,8 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
self
.
pluginManager
=
new
PluginManager
(
opts
.
pluginAPI
,
events
)
self
.
pluginManager
=
new
PluginManager
(
opts
.
pluginAPI
,
events
)
events
.
rhp
.
register
(
'plugin-loadRequest'
,
(
json
)
=>
{
events
.
rhp
.
register
(
'plugin-loadRequest'
,
(
json
)
=>
{
var
tab
=
new
PluginTab
({},
events
,
json
)
const
tab
=
new
PluginTab
({},
events
,
json
)
var
content
=
tab
.
render
()
const
content
=
tab
.
render
()
optionViews
.
appendChild
(
content
)
optionViews
.
appendChild
(
content
)
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
)
...
@@ -84,9 +84,9 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
...
@@ -84,9 +84,9 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
;[...
options
.
children
].
forEach
((
el
)
=>
{
el
.
classList
.
add
(
css
.
options
)
})
;[...
options
.
children
].
forEach
((
el
)
=>
{
el
.
classList
.
add
(
css
.
options
)
})
// ----------------- resizeable ui ---------------
// ----------------- resizeable ui ---------------
var
limit
=
60
const
limit
=
60
self
.
_view
.
dragbar
.
addEventListener
(
'mousedown'
,
mousedown
)
self
.
_view
.
dragbar
.
addEventListener
(
'mousedown'
,
mousedown
)
var
ghostbar
=
yo
`<div class=
${
css
.
ghostbar
}
></div>`
const
ghostbar
=
yo
`<div class=
${
css
.
ghostbar
}
></div>`
function
mousedown
(
event
)
{
function
mousedown
(
event
)
{
event
.
preventDefault
()
event
.
preventDefault
()
if
(
event
.
which
===
1
)
{
if
(
event
.
which
===
1
)
{
...
@@ -106,8 +106,8 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
...
@@ -106,8 +106,8 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
}
}
}
}
function
getPosition
(
event
)
{
function
getPosition
(
event
)
{
var
lhp
=
window
[
'filepanel'
].
offsetWidth
const
lhp
=
window
[
'filepanel'
].
offsetWidth
var
max
=
document
.
body
.
offsetWidth
-
limit
const
max
=
document
.
body
.
offsetWidth
-
limit
var
newpos
=
(
event
.
pageX
>
max
)
?
max
:
event
.
pageX
var
newpos
=
(
event
.
pageX
>
max
)
?
max
:
event
.
pageX
newpos
=
(
newpos
>
(
lhp
+
limit
))
?
newpos
:
lhp
+
limit
newpos
=
(
newpos
>
(
lhp
+
limit
))
?
newpos
:
lhp
+
limit
return
newpos
return
newpos
...
@@ -125,7 +125,7 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
...
@@ -125,7 +125,7 @@ module.exports = function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
}
}
}
}
var
css
=
csjs
`
const
css
=
csjs
`
#righthand-panel {
#righthand-panel {
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
...
...
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