mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 15:43:48 +00:00
[Selection] Go through openmct API
This commit is contained in:
@ -28,12 +28,12 @@
|
|||||||
<script src="bower_components/requirejs/require.js">
|
<script src="bower_components/requirejs/require.js">
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
require(['main'], function (mct) {
|
require(['main'], function (openmct) {
|
||||||
require([
|
require([
|
||||||
'./example/imagery/bundle',
|
'./example/imagery/bundle',
|
||||||
'./example/eventGenerator/bundle',
|
'./example/eventGenerator/bundle',
|
||||||
'./example/generator/bundle'
|
'./example/generator/bundle'
|
||||||
], mct.run.bind(mct));
|
], openmct.start.bind(openmct));
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css">
|
<link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css">
|
||||||
|
16
main.js
16
main.js
@ -68,6 +68,7 @@ requirejs.config({
|
|||||||
});
|
});
|
||||||
|
|
||||||
define([
|
define([
|
||||||
|
'./src/openmct',
|
||||||
'./platform/framework/src/Main',
|
'./platform/framework/src/Main',
|
||||||
'legacyRegistry',
|
'legacyRegistry',
|
||||||
|
|
||||||
@ -105,12 +106,11 @@ define([
|
|||||||
'./platform/entanglement/bundle',
|
'./platform/entanglement/bundle',
|
||||||
'./platform/search/bundle',
|
'./platform/search/bundle',
|
||||||
'./platform/status/bundle',
|
'./platform/status/bundle',
|
||||||
'./platform/commonUI/regions/bundle'
|
'./platform/commonUI/regions/bundle',
|
||||||
], function (Main, legacyRegistry) {
|
'./src/adapter/legacyBundle'
|
||||||
return {
|
], function (openmct, Main, legacyRegistry) {
|
||||||
legacyRegistry: legacyRegistry,
|
openmct.legacyRegistry = legacyRegistry;
|
||||||
run: function () {
|
openmct.on('start', function () {
|
||||||
return new Main().run(legacyRegistry);
|
return new Main().run(legacyRegistry);
|
||||||
}
|
});
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
@ -21,24 +21,28 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
|
'EventEmitter',
|
||||||
'./selection/Selection',
|
'./selection/Selection',
|
||||||
'./selection/ContextManager',
|
'./selection/ContextManager',
|
||||||
'./selection/SelectGesture',
|
'./selection/SelectGesture',
|
||||||
'./ui/menu/ContextMenuGesture',
|
'./ui/menu/ContextMenuGesture',
|
||||||
'./ui/ViewRegistry'
|
'./ui/ViewRegistry'
|
||||||
], function (
|
], function (
|
||||||
|
EventEmitter,
|
||||||
Selection,
|
Selection,
|
||||||
ContextManager,
|
ContextManager,
|
||||||
SelectGesture,
|
SelectGesture,
|
||||||
ContextMenuGesture,
|
ContextMenuGesture,
|
||||||
ViewRegistry
|
ViewRegistry
|
||||||
) {
|
) {
|
||||||
var openmct = {};
|
var openmct = Object.create(EventEmitter.prototype);
|
||||||
var selection = new Selection();
|
var selection = new Selection();
|
||||||
var manager = new ContextManager();
|
var manager = new ContextManager();
|
||||||
var select = new SelectGesture(manager, selection);
|
var select = new SelectGesture(manager, selection);
|
||||||
var contextMenu = new ContextMenuGesture(selection, {}, {}, manager);
|
var contextMenu = new ContextMenuGesture(selection, {}, {}, manager);
|
||||||
|
|
||||||
|
EventEmitter.call(openmct);
|
||||||
|
|
||||||
openmct.selection = selection;
|
openmct.selection = selection;
|
||||||
|
|
||||||
openmct.inspectors = new ViewRegistry();
|
openmct.inspectors = new ViewRegistry();
|
||||||
@ -48,5 +52,7 @@ define([
|
|||||||
contextual: contextMenu.apply.bind(contextMenu)
|
contextual: contextMenu.apply.bind(contextMenu)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
openmct.start = openmct.emit.bind(openmct, 'start');
|
||||||
|
|
||||||
return openmct;
|
return openmct;
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user