|
|
@ -17,72 +17,71 @@ const RunTab = require('../tabs/run-tab') |
|
|
|
const EventManager = remixLib.EventManager |
|
|
|
const EventManager = remixLib.EventManager |
|
|
|
const styles = styleguide.chooser() |
|
|
|
const styles = styleguide.chooser() |
|
|
|
|
|
|
|
|
|
|
|
function RighthandPanel (api = {}, events = {}, opts = {}) { |
|
|
|
var prototype = { |
|
|
|
const self = this |
|
|
|
constructor: function RighthandPanel (api = {}, events = {}, opts = {}) { |
|
|
|
self._api = api |
|
|
|
const self = this |
|
|
|
self._events = events |
|
|
|
self._api = api |
|
|
|
self._opts = opts |
|
|
|
self._events = events |
|
|
|
self.event = new EventManager() |
|
|
|
self._opts = opts |
|
|
|
self._view = { el: null, tabbedMenu: null, tabbedMenuViewport: null, dragbar: null } |
|
|
|
self.event = new EventManager() |
|
|
|
self._components = {} |
|
|
|
self._view = { el: null, tabbedMenu: null, tabbedMenuViewport: null, dragbar: null } |
|
|
|
|
|
|
|
self._components = {} |
|
|
|
|
|
|
|
|
|
|
|
const 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
|
|
|
|
const tabEvents = {compiler: self._events.compiler, app: self._events.app, rhp: self.event} |
|
|
|
const tabEvents = {compiler: self._events.compiler, app: self._events.app, rhp: self.event} |
|
|
|
self._view.tabbedMenu = new TabbedMenu(self._api, tabEvents) |
|
|
|
self._view.tabbedMenu = new TabbedMenu(self._api, tabEvents) |
|
|
|
const 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}> |
|
|
|
${self._view.dragbar} |
|
|
|
${self._view.dragbar} |
|
|
|
<div id="header" class=${css.header}> |
|
|
|
<div id="header" class=${css.header}> |
|
|
|
<div class=${css.menu}> |
|
|
|
<div class=${css.menu}> |
|
|
|
${options} |
|
|
|
${options} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
${optionViews} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
${optionViews} |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
` |
|
|
|
` |
|
|
|
// selectTabByClassName
|
|
|
|
// selectTabByClassName
|
|
|
|
self._api.switchTab = tabClass => self._view.tabbedMenu.selectTabByClassName(tabClass) |
|
|
|
self._api.switchTab = tabClass => self._view.tabbedMenu.selectTabByClassName(tabClass) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self._events.rhp = self.event |
|
|
|
self._events.rhp = self.event |
|
|
|
|
|
|
|
|
|
|
|
const compileTab = new CompileTab(self._api, self._events, self._opts) |
|
|
|
const compileTab = new CompileTab(self._api, self._events, self._opts) |
|
|
|
optionViews.appendChild(compileTab.render()) |
|
|
|
optionViews.appendChild(compileTab.render()) |
|
|
|
const runTab = new RunTab(self._api, self._events, self._opts) |
|
|
|
const runTab = new RunTab(self._api, self._events, self._opts) |
|
|
|
optionViews.appendChild(runTab.render()) |
|
|
|
optionViews.appendChild(runTab.render()) |
|
|
|
const settingsTab = new SettingsTab(self._api, self._events, self._opts) |
|
|
|
const settingsTab = new SettingsTab(self._api, self._events, self._opts) |
|
|
|
optionViews.appendChild(settingsTab.render()) |
|
|
|
optionViews.appendChild(settingsTab.render()) |
|
|
|
const analysisTab = new AnalysisTab(self._api, self._events, self._opts) |
|
|
|
const analysisTab = new AnalysisTab(self._api, self._events, self._opts) |
|
|
|
optionViews.appendChild(analysisTab.render()) |
|
|
|
optionViews.appendChild(analysisTab.render()) |
|
|
|
const debuggerTab = new DebuggerTab(self._api, self._events, self._opts) |
|
|
|
const debuggerTab = new DebuggerTab(self._api, self._events, self._opts) |
|
|
|
optionViews.appendChild(debuggerTab.render()) |
|
|
|
optionViews.appendChild(debuggerTab.render()) |
|
|
|
const supportTab = new SupportTab(self._api, self._events, self._opts) |
|
|
|
const supportTab = new SupportTab(self._api, self._events, self._opts) |
|
|
|
optionViews.appendChild(supportTab.render()) |
|
|
|
optionViews.appendChild(supportTab.render()) |
|
|
|
var testTab = new TestTab(appAPI, events, opts) |
|
|
|
const testTab = new TestTab(self._api, events, opts) |
|
|
|
optionViews.appendChild(testTab.render()) |
|
|
|
optionViews.appendChild(testTab.render()) |
|
|
|
this._view.tabbedMenu.addTab('Compile', 'compileView', optionViews.querySelector('#compileTabView')) |
|
|
|
this._view.tabbedMenu.addTab('Compile', 'compileView', optionViews.querySelector('#compileTabView')) |
|
|
|
this._view.tabbedMenu.addTab('Run', 'runView', optionViews.querySelector('#runTabView')) |
|
|
|
this._view.tabbedMenu.addTab('Run', 'runView', optionViews.querySelector('#runTabView')) |
|
|
|
this._view.tabbedMenu.addTab('Settings', 'settingsView', optionViews.querySelector('#settingsView')) |
|
|
|
this._view.tabbedMenu.addTab('Settings', 'settingsView', optionViews.querySelector('#settingsView')) |
|
|
|
this._view.tabbedMenu.addTab('Analysis', 'staticanalysisView', optionViews.querySelector('#staticanalysisView')) |
|
|
|
this._view.tabbedMenu.addTab('Analysis', 'staticanalysisView', optionViews.querySelector('#staticanalysisView')) |
|
|
|
this._view.tabbedMenu.addTab('Debugger', 'debugView', optionViews.querySelector('#debugView')) |
|
|
|
this._view.tabbedMenu.addTab('Debugger', 'debugView', optionViews.querySelector('#debugView')) |
|
|
|
this._view.tabbedMenu.addTab('Support', 'supportView', optionViews.querySelector('#supportView')) |
|
|
|
this._view.tabbedMenu.addTab('Support', 'supportView', optionViews.querySelector('#supportView')) |
|
|
|
this._view.tabbedMenu.addTab('Test', 'testView', optionViews.querySelector('#testView')) |
|
|
|
this._view.tabbedMenu.addTab('Test', 'testView', optionViews.querySelector('#testView')) |
|
|
|
this._view.tabbedMenu.selectTabByTitle('Compile') |
|
|
|
this._view.tabbedMenu.selectTabByTitle('Compile') |
|
|
|
|
|
|
|
|
|
|
|
self.pluginManager = new PluginManager(self._opts.pluginAPI, self._events) |
|
|
|
self.pluginManager = new PluginManager(self._opts.pluginAPI, self._events) |
|
|
|
self._events.rhp.register('plugin-loadRequest', (json) => { |
|
|
|
self._events.rhp.register('plugin-loadRequest', (json) => { |
|
|
|
const tab = new PluginTab({}, self._events, json) |
|
|
|
const tab = new PluginTab({}, self._events, json) |
|
|
|
const 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) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
var prototype = { |
|
|
|
|
|
|
|
constructor: RighthandPanel, |
|
|
|
|
|
|
|
render: function () { |
|
|
|
render: function () { |
|
|
|
const self = this |
|
|
|
const self = this |
|
|
|
return self._view.element |
|
|
|
return self._view.element |
|
|
|