[API] Rename module to openmct

This commit is contained in:
Victor Woeltjen
2016-09-01 14:35:52 -07:00
parent 1e0fb3611d
commit ff2ec6690a
5 changed files with 25 additions and 28 deletions

View File

@ -5,7 +5,7 @@ module.exports = {
var memberof = doclet.memberof || ""; var memberof = doclet.memberof || "";
var longname = doclet.longname || ""; var longname = doclet.longname || "";
if (longname !== 'mct' && memberof.indexOf('mct') !== 0) { if (longname !== 'module:openmct' && memberof.indexOf('module:openmct') !== 0) {
e.preventDefault = true; e.preventDefault = true;
e.stopPropagation = true; e.stopPropagation = true;
doclet.ignore = true; doclet.ignore = true;

View File

@ -23,10 +23,9 @@ define([
* by the `mct` module, or exposed as `mct` in the global scope if * by the `mct` module, or exposed as `mct` in the global scope if
* loaded via a script tag. * loaded via a script tag.
* @constructor * @constructor
* @memberof mct * @memberof module:openmct
* @augments {EventEmitter}
*/ */
function OpenMCT() { function MCT() {
EventEmitter.call(this); EventEmitter.call(this);
this.legacyBundle = { extensions: {} }; this.legacyBundle = { extensions: {} };
@ -34,14 +33,14 @@ define([
this.on('navigation', this.selection.clear.bind(this.selection)); this.on('navigation', this.selection.clear.bind(this.selection));
} }
OpenMCT.prototype = Object.create(EventEmitter.prototype); MCT.prototype = Object.create(EventEmitter.prototype);
Object.keys(api).forEach(function (k) { Object.keys(api).forEach(function (k) {
OpenMCT.prototype[k] = api[k]; MCT.prototype[k] = api[k];
}); });
OpenMCT.prototype.OpenMCT = OpenMCT; MCT.prototype.MCT = MCT;
OpenMCT.prototype.legacyExtension = function (category, extension) { MCT.prototype.legacyExtension = function (category, extension) {
this.legacyBundle.extensions[category] = this.legacyBundle.extensions[category] =
this.legacyBundle.extensions[category] || []; this.legacyBundle.extensions[category] || [];
this.legacyBundle.extensions[category].push(extension); this.legacyBundle.extensions[category].push(extension);
@ -50,7 +49,7 @@ define([
/** /**
* Set path to where assets are hosted. This should be the path to main.js. * Set path to where assets are hosted. This should be the path to main.js.
*/ */
OpenMCT.prototype.setAssetPath = function (path) { MCT.prototype.setAssetPath = function (path) {
this.legacyExtension('constants', { this.legacyExtension('constants', {
key: "ASSETS_PATH", key: "ASSETS_PATH",
value: path value: path
@ -64,7 +63,7 @@ define([
* @param {ViewDefinition} definition the definition for this view * @param {ViewDefinition} definition the definition for this view
* @method * @method
*/ */
OpenMCT.prototype.view = function (region, definition) { MCT.prototype.view = function (region, definition) {
var viewKey = region + uuid(); var viewKey = region + uuid();
var adaptedViewKey = "adapted-view-" + region; var adaptedViewKey = "adapted-view-" + region;
@ -113,7 +112,7 @@ define([
}); });
}; };
OpenMCT.prototype.type = function (key, type) { MCT.prototype.type = function (key, type) {
var legacyDef = type.toLegacyDefinition(); var legacyDef = type.toLegacyDefinition();
legacyDef.key = key; legacyDef.key = key;
type.key = key; type.key = key;
@ -127,11 +126,11 @@ define([
}); });
}; };
OpenMCT.prototype.dialog = function (view, title) { MCT.prototype.dialog = function (view, title) {
return new Dialog(view, title).show(); return new Dialog(view, title).show();
}; };
OpenMCT.prototype.start = function () { MCT.prototype.start = function () {
this.legacyExtension('runs', { this.legacyExtension('runs', {
depends: ['navigationService'], depends: ['navigationService'],
implementation: function (navigationService) { implementation: function (navigationService) {
@ -151,14 +150,14 @@ define([
* @param {Function} plugin a plugin install function which will be * @param {Function} plugin a plugin install function which will be
* invoked with the mct instance. * invoked with the mct instance.
*/ */
OpenMCT.prototype.install = function (plugin) { MCT.prototype.install = function (plugin) {
plugin(this); plugin(this);
}; };
OpenMCT.prototype.regions = { MCT.prototype.regions = {
main: "MAIN", main: "MAIN",
toolbar: "TOOLBAR" toolbar: "TOOLBAR"
}; };
return OpenMCT; return MCT;
}); });

View File

@ -4,7 +4,8 @@ define([], function () {
* A View is used to provide displayable content, and to react to * A View is used to provide displayable content, and to react to
* associated life cycle events. * associated life cycle events.
* *
* @interface * @constructor
* @memberof module:openmct
*/ */
function View() { function View() {

View File

@ -1,11 +0,0 @@
define(['./OpenMCT'], function (OpenMCT) {
/**
* This is Open MCT.
* @namespace mct
* @augments {mct.OpenMCT}
*/
var mct = new OpenMCT();
return mct;
});

8
src/openmct.js Normal file
View File

@ -0,0 +1,8 @@
define(['./MCT'], function (MCT) {
/**
* @exports openmct
*/
var openmct = new MCT();
return openmct;
});