All builtin plugins now standardized as functions

This commit is contained in:
Henry 2017-02-22 12:27:24 -08:00
parent c74fdb816f
commit b10fb4533e
2 changed files with 16 additions and 14 deletions

View File

@ -36,9 +36,9 @@
].forEach( ].forEach(
openmct.legacyRegistry.enable.bind(openmct.legacyRegistry) openmct.legacyRegistry.enable.bind(openmct.legacyRegistry)
); );
openmct.install(openmct.plugins.myItems); openmct.install(openmct.plugins.MyItems());
openmct.install(openmct.plugins.localStorage); openmct.install(openmct.plugins.LocalStorage());
openmct.install(openmct.plugins.espresso); openmct.install(openmct.plugins.Espresso());
openmct.start(); openmct.start();
}); });
</script> </script>

View File

@ -24,18 +24,20 @@ define([
'lodash' 'lodash'
], function (_) { ], function (_) {
var bundleMap = { var bundleMap = {
couchDB: 'platform/persistence/couch', CouchDB: 'platform/persistence/couch',
elasticsearch: 'platform/persistence/elastic', Elasticsearch: 'platform/persistence/elastic',
espresso: 'platform/commonUI/themes/espresso', Espresso: 'platform/commonUI/themes/espresso',
localStorage: 'platform/persistence/local', LocalStorage: 'platform/persistence/local',
myItems: 'platform/features/my-items', MyItems: 'platform/features/my-items',
snow: 'platform/commonUI/themes/snow', Snow: 'platform/commonUI/themes/snow',
utcTimeSystem: 'platform/features/conductor/utcTimeSystem' UTCTimeSystem: 'platform/features/conductor/utcTimeSystem'
}; };
var plugins = _.mapValues(bundleMap, function (bundleName, pluginName) { var plugins = _.mapValues(bundleMap, function (bundleName, pluginName) {
return function (openmct) { return function pluginConstructor() {
openmct.legacyRegistry.enable(bundleName); return function (openmct) {
openmct.legacyRegistry.enable(bundleName);
};
}; };
}); });
@ -57,7 +59,7 @@ define([
openmct.legacyRegistry.enable(bundleName); openmct.legacyRegistry.enable(bundleName);
} }
openmct.legacyRegistry.enable(bundleMap.couchDB); openmct.legacyRegistry.enable(bundleMap.CouchDB);
}; };
}; };
@ -79,7 +81,7 @@ define([
openmct.legacyRegistry.enable(bundleName); openmct.legacyRegistry.enable(bundleName);
} }
openmct.legacyRegistry.enable(bundleMap.elasticsearch); openmct.legacyRegistry.enable(bundleMap.Elasticsearch);
}; };
}; };