mirror of
https://github.com/nasa/openmct.git
synced 2025-05-29 21:54:20 +00:00
[API] Add legacy bundle registry
This commit is contained in:
parent
9f66f39d8d
commit
76aa9e1fd2
8
main.js
8
main.js
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
"paths": {
|
"paths": {
|
||||||
"bundleRegistry": "./src/bundleRegistry",
|
"legacyRegistry": "./src/legacyRegistry",
|
||||||
"angular": "./platform/framework/lib/angular.min",
|
"angular": "./platform/framework/lib/angular.min",
|
||||||
"angular-route": "./platform/framework/lib/angular-route.min"
|
"angular-route": "./platform/framework/lib/angular-route.min"
|
||||||
},
|
},
|
||||||
@ -39,10 +39,10 @@ requirejs.config({
|
|||||||
|
|
||||||
define([
|
define([
|
||||||
'./platform/framework/src/Main',
|
'./platform/framework/src/Main',
|
||||||
'bundleRegistry',
|
'legacyRegistry',
|
||||||
"angular",
|
"angular",
|
||||||
"angular-route"
|
"angular-route"
|
||||||
], function (Main, bundleRegistry, angular) {
|
], function (Main, legacyRegistry, angular) {
|
||||||
'use strict';
|
'use strict';
|
||||||
new Main(angular).run(bundleRegistry);
|
new Main(angular).run(legacyRegistry);
|
||||||
});
|
});
|
42
src/BundleRegistry.js
Normal file
42
src/BundleRegistry.js
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||||
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
|
* Administration. All rights reserved.
|
||||||
|
*
|
||||||
|
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
* Open MCT Web includes source code licensed under additional open source
|
||||||
|
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||||
|
* this source code distribution or the Licensing information page available
|
||||||
|
* at runtime from the About dialog for additional information.
|
||||||
|
*****************************************************************************/
|
||||||
|
/*global define*/
|
||||||
|
|
||||||
|
define(function () {
|
||||||
|
function BundleRegistry() {
|
||||||
|
this.bundles = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
BundleRegistry.prototype.registry = function (path, definition) {
|
||||||
|
this.bundles[path] = definition;
|
||||||
|
};
|
||||||
|
|
||||||
|
BundleRegistry.prototype.contains = function (path) {
|
||||||
|
return !!this.bundles[path];
|
||||||
|
};
|
||||||
|
|
||||||
|
BundleRegistry.prototype.get = function (path) {
|
||||||
|
return this.bundles[path];
|
||||||
|
};
|
||||||
|
|
||||||
|
return BundleRegistry;
|
||||||
|
});
|
@ -21,6 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/*global define, window, requirejs*/
|
/*global define, window, requirejs*/
|
||||||
|
|
||||||
define(function () {
|
define(['./BundleRegistry'], function (BundleRegistry) {
|
||||||
return {};
|
'use strict';
|
||||||
|
return new BundleRegistry();
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user