Merge branch 'master' into open670_master

This commit is contained in:
Henry 2016-03-01 12:56:08 -08:00
commit b9a7ee423a
101 changed files with 3193 additions and 639 deletions

View File

@ -416,6 +416,66 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- ---
### CSV.js
#### Info
* Link: https://github.com/knrz/CSV.js
* Version: 3.6.4
* Authors: Kash Nouroozi
* Description: Encoder for CSV (comma separated values) export
#### License
Copyright (c) 2014 Kash Nouroozi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
### FileSaver.js
#### Info
* Link: https://github.com/eligrey/FileSaver.js/
* Version: 0.0.2
* Authors: Eli Grey
* Description: File download initiator (for file exports)
#### License
Copyright © 2015 Eli Grey.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
### Json.NET ### Json.NET
#### Info #### Info

View File

@ -45,7 +45,7 @@ When `npm test` is run, test results will be written as HTML to
The tests described above are all at the unit-level; an additional The tests described above are all at the unit-level; an additional
test suite using [Protractor](https://angular.github.io/protractor/) test suite using [Protractor](https://angular.github.io/protractor/)
us under development, in the `protractor` folder. is under development, in the `protractor` folder.
To run: To run:

View File

@ -15,6 +15,8 @@
"text": "requirejs-text#^2.0.14", "text": "requirejs-text#^2.0.14",
"es6-promise": "^3.0.2", "es6-promise": "^3.0.2",
"screenfull": "^3.0.0", "screenfull": "^3.0.0",
"node-uuid": "^1.4.7" "node-uuid": "^1.4.7",
"comma-separated-values": "^3.6.4",
"FileSaver.js": "^0.0.2"
} }
} }

View File

@ -910,7 +910,24 @@ A capability's implementation may also expose a static method `appliesTo(model)`
which should return a boolean value, and will be used by the platform to filter which should return a boolean value, and will be used by the platform to filter
down capabilities to those which should be exposed by specific domain objects, down capabilities to those which should be exposed by specific domain objects,
based on their domain object models. based on their domain object models.
## Containers Category
Containers provide options for the `mct-container` directive.
The definition for an extension in the `containers` category should include:
* `key`: An identifier for the container.
* `template`: An Angular template for the container, including an
`ng-transclude` where contained content should go.
* `attributes`: An array of attribute names. The values associated with
these attributes will be exposed in the template's scope under the
name provided by the `alias` property.
* `alias`: The property name in scope under which attributes will be
exposed. Optional; defaults to "container".
Note that `templateUrl` is not supported for `containers`.
## Controls Category ## Controls Category
Controls provide options for the `mct-control` directive. Controls provide options for the `mct-control` directive.

View File

@ -0,0 +1,80 @@
/*****************************************************************************
* 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 () {
'use strict';
/**
* An example of using the `exportService`; queries for telemetry
* and provides the results as a CSV file.
* @param {platform/exporters.ExportService} exportService the
* service which will handle the CSV export
* @param {ActionContext} context the action's context
* @constructor
* @memberof example/export
* @implements {Action}
*/
function ExportTelemetryAsCSVAction(exportService, context) {
this.exportService = exportService;
this.context = context;
}
ExportTelemetryAsCSVAction.prototype.perform = function () {
var context = this.context,
domainObject = context.domainObject,
telemetry = domainObject.getCapability("telemetry"),
metadata = telemetry.getMetadata(),
domains = metadata.domains,
ranges = metadata.ranges,
exportService = this.exportService;
function getName(domainOrRange) {
return domainOrRange.name;
}
telemetry.requestData({}).then(function (series) {
var headers = domains.map(getName).concat(ranges.map(getName)),
rows = [],
row,
i;
for (i = 0; i < series.getPointCount(); i += 1) {
row = {};
domains.forEach(function (domain) {
row[domain.name] = series.getDomainValue(i, domain.key);
});
ranges.forEach(function (range) {
row[range.name] = series.getRangeValue(i, range.key);
});
rows.push(row);
}
exportService.exportCSV(rows, { headers: headers });
});
};
ExportTelemetryAsCSVAction.appliesTo = function (context) {
return context.domainObject &&
context.domainObject.hasCapability("telemetry");
};
return ExportTelemetryAsCSVAction;
});

45
example/export/bundle.js Normal file
View File

@ -0,0 +1,45 @@
/*****************************************************************************
* 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([
'legacyRegistry',
'./ExportTelemetryAsCSVAction'
], function (legacyRegistry, ExportTelemetryAsCSVAction) {
"use strict";
legacyRegistry.register("example/export", {
"name": "Example of using CSV Export",
"extensions": {
"actions": [
{
"key": "example.export",
"name": "Export Telemetry as CSV",
"implementation": ExportTelemetryAsCSVAction,
"category": "contextual",
"glyph": "\u0033",
"depends": [ "exportService" ]
}
]
}
});
});

View File

@ -1,10 +1,9 @@
<span class="status block ok" ng-controller="DialogLaunchController"> <span class="status block ok" ng-controller="DialogLaunchController">
<span class="ui-symbol status-indicator">&#xe600;</span> <!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
<span class="label"> <span class="ui-symbol status-indicator">&#xe600;</span><span class="label">
<a ng-click="launchProgress(true)">Known</a> | <a ng-click="launchProgress(true)">Known</a> |
<a ng-click="launchProgress(false)">Unknown</a> | <a ng-click="launchProgress(false)">Unknown</a> |
<a ng-click="launchError()">Error</a> | <a ng-click="launchError()">Error</a> |
<a ng-click="launchInfo()">Info</a> <a ng-click="launchInfo()">Info</a>
</span> </span><span class="count">Dialogs</span>
<span class="count">Dialogs</span>
</span> </span>

View File

@ -1,10 +1,9 @@
<span class="status block ok" ng-controller="NotificationLaunchController"> <span class="status block ok" ng-controller="NotificationLaunchController">
<span class="ui-symbol status-indicator">&#xe600;</span> <!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
<span class="label"> <span class="ui-symbol status-indicator">&#xe600;</span><span class="label">
<a ng-click="newInfo()">Success</a> | <a ng-click="newInfo()">Success</a> |
<a ng-click="newError()">Error</a> | <a ng-click="newError()">Error</a> |
<a ng-click="newAlert()">Alert</a> | <a ng-click="newAlert()">Alert</a> |
<a ng-click="newProgress()">Progress</a> <a ng-click="newProgress()">Progress</a>
</span> </span><span class="count">Notifications</span>
<span class="count">Notifications</span>
</span> </span>

View File

@ -0,0 +1,145 @@
/*****************************************************************************
* 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([
'legacyRegistry',
'../../platform/commonUI/browse/src/InspectorRegion',
'../../platform/commonUI/regions/src/Region'
], function (
legacyRegistry,
InspectorRegion,
Region
) {
"use strict";
/**
* Add a 'plot options' region part to the inspector region for the
* Telemetry Plot type only. {@link InspectorRegion} is a default region
* implementation that is added automatically to all types. In order to
* customize what appears in the inspector region, you can start from a
* blank slate by using Region, or customize the default inspector
* region by using {@link InspectorRegion}.
*/
var plotInspector = new InspectorRegion(),
/**
* Two region parts are defined here. One that appears only in browse
* mode, and one that appears only in edit mode. For not they both point
* to the same representation, but a different key could be used here to
* include a customized representation for edit mode.
*/
plotOptionsBrowseRegion = new Region({
name: "plot-options",
title: "Plot Options",
modes: ['browse'],
content: {
key: "plot-options-browse"
}
}),
plotOptionsEditRegion = new Region({
name: "plot-options",
title: "Plot Options",
modes: ['edit'],
content: {
key: "plot-options-browse"
}
});
/**
* Both parts are added, and policies of type 'region' will determine
* which is shown based on domain object state. A default policy is
* provided which will check the 'modes' attribute of the region part
* definition.
*/
plotInspector.addRegion(plotOptionsBrowseRegion);
plotInspector.addRegion(plotOptionsEditRegion);
legacyRegistry.register("example/plotType", {
"name": "Plot Type",
"description": "Example illustrating registration of a new object type",
"extensions": {
"types": [
{
"key": "plot",
"name": "Telemetry Plot",
"glyph": "t",
"description": "A plot for displaying telemetry",
"delegates": [
"telemetry"
],
"features": "creation",
"contains": [
{
"has": "telemetry"
}
],
"model": {
"composition": []
},
"inspector": plotInspector,
"telemetry": {
"source": "generator",
"domains": [
{
"key": "time",
"name": "Time"
},
{
"key": "yesterday",
"name": "Yesterday"
},
{
"key": "delta",
"name": "Delta",
"format": "example.delta"
}
],
"ranges": [
{
"key": "sin",
"name": "Sine"
},
{
"key": "cos",
"name": "Cosine"
}
]
},
"properties": [
{
"name": "Period",
"control": "textfield",
"cssclass": "l-small l-numeric",
"key": "period",
"required": true,
"property": [
"telemetry",
"period"
],
"pattern": "^\\d*(\\.\\d*)?$"
}
]
}
]
}
});
});

View File

@ -33,13 +33,18 @@
mct.run(); mct.run();
}); });
</script> </script>
<link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css">
<link rel="stylesheet" href="platform/commonUI/general/res/css/openmct.css">
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-16x16.png" sizes="16x16">
<link rel="shortcut icon" href="platform/commonUI/general/res/images/favicons/favicon.ico"> <link rel="shortcut icon" href="platform/commonUI/general/res/images/favicons/favicon.ico">
</head> </head>
<body class="user-environ" ng-view> <body class="user-environ">
<div class="l-splash-holder s-splash-holder">
<div class="l-splash s-splash"></div>
</div>
<div ng-view></div>
</body> </body>
</html> </html>

View File

@ -39,6 +39,7 @@ module.exports = function(config) {
{pattern: 'example/**/*.js', included: false}, {pattern: 'example/**/*.js', included: false},
{pattern: 'platform/**/*.js', included: false}, {pattern: 'platform/**/*.js', included: false},
{pattern: 'warp/**/*.js', included: false}, {pattern: 'warp/**/*.js', included: false},
{pattern: 'platform/**/*.html', included: false},
'test-main.js' 'test-main.js'
], ],

View File

@ -26,9 +26,11 @@ requirejs.config({
"legacyRegistry": "src/legacyRegistry", "legacyRegistry": "src/legacyRegistry",
"angular": "bower_components/angular/angular.min", "angular": "bower_components/angular/angular.min",
"angular-route": "bower_components/angular-route/angular-route.min", "angular-route": "bower_components/angular-route/angular-route.min",
"csv": "bower_components/comma-separated-values/csv.min",
"es6-promise": "bower_components/es6-promise/promise.min", "es6-promise": "bower_components/es6-promise/promise.min",
"moment": "bower_components/moment/moment", "moment": "bower_components/moment/moment",
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format", "moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
"saveAs": "bower_components/FileSaver.js/FileSaver.min",
"screenfull": "bower_components/screenfull/dist/screenfull.min", "screenfull": "bower_components/screenfull/dist/screenfull.min",
"text": "bower_components/text/text", "text": "bower_components/text/text",
"uuid": "bower_components/node-uuid/uuid" "uuid": "bower_components/node-uuid/uuid"
@ -65,6 +67,7 @@ define([
'./platform/commonUI/notification/bundle', './platform/commonUI/notification/bundle',
'./platform/containment/bundle', './platform/containment/bundle',
'./platform/execution/bundle', './platform/execution/bundle',
'./platform/exporters/bundle',
'./platform/telemetry/bundle', './platform/telemetry/bundle',
'./platform/features/clock/bundle', './platform/features/clock/bundle',
'./platform/features/events/bundle', './platform/features/events/bundle',
@ -84,6 +87,7 @@ define([
'./platform/entanglement/bundle', './platform/entanglement/bundle',
'./platform/search/bundle', './platform/search/bundle',
'./platform/status/bundle', './platform/status/bundle',
'./platform/commonUI/regions/bundle',
'./example/imagery/bundle', './example/imagery/bundle',
'./example/eventGenerator/bundle', './example/eventGenerator/bundle',

View File

@ -28,7 +28,7 @@
"karma-coverage": "^0.5.3", "karma-coverage": "^0.5.3",
"karma-html-reporter": "^0.2.7", "karma-html-reporter": "^0.2.7",
"karma-jasmine": "^0.1.5", "karma-jasmine": "^0.1.5",
"karma-phantomjs-launcher": "^0.2.3", "karma-phantomjs-launcher": "^1.0.0",
"karma-requirejs": "^0.2.2", "karma-requirejs": "^0.2.2",
"lodash": "^3.10.1", "lodash": "^3.10.1",
"markdown-toc": "^0.11.7", "markdown-toc": "^0.11.7",
@ -36,7 +36,7 @@
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"moment": "^2.11.1", "moment": "^2.11.1",
"node-bourbon": "^4.2.3", "node-bourbon": "^4.2.3",
"phantomjs": "^1.9.19", "phantomjs-prebuilt": "^2.1.0",
"requirejs": "^2.1.17", "requirejs": "^2.1.17",
"split": "^1.0.0" "split": "^1.0.0"
}, },

View File

@ -26,12 +26,26 @@ define([
"./src/LogoController", "./src/LogoController",
"./src/AboutController", "./src/AboutController",
"./src/LicenseController", "./src/LicenseController",
"text!./res/templates/app-logo.html",
"text!./res/templates/about-logo.html",
"text!./res/templates/overlay-about.html",
"text!./res/templates/license-apache.html",
"text!./res/templates/license-mit.html",
"text!./res/templates/licenses.html",
"text!./res/templates/licenses-export-md.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
aboutDialogTemplate, aboutDialogTemplate,
LogoController, LogoController,
AboutController, AboutController,
LicenseController, LicenseController,
appLogoTemplate,
aboutLogoTemplate,
overlayAboutTemplate,
licenseApacheTemplate,
licenseMitTemplate,
licensesTemplate,
licensesExportMdTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -43,12 +57,12 @@ define([
{ {
"key": "app-logo", "key": "app-logo",
"priority": "optional", "priority": "optional",
"templateUrl": "templates/app-logo.html" "template": appLogoTemplate
}, },
{ {
"key": "about-logo", "key": "about-logo",
"priority": "preferred", "priority": "preferred",
"templateUrl": "templates/about-logo.html" "template": aboutLogoTemplate
}, },
{ {
"key": "about-dialog", "key": "about-dialog",
@ -56,15 +70,15 @@ define([
}, },
{ {
"key": "overlay-about", "key": "overlay-about",
"templateUrl": "templates/overlay-about.html" "template": overlayAboutTemplate
}, },
{ {
"key": "license-apache", "key": "license-apache",
"templateUrl": "templates/license-apache.html" "template": licenseApacheTemplate
}, },
{ {
"key": "license-mit", "key": "license-mit",
"templateUrl": "templates/license-mit.html" "template": licenseMitTemplate
} }
], ],
"controllers": [ "controllers": [
@ -156,11 +170,11 @@ define([
"routes": [ "routes": [
{ {
"when": "/licenses", "when": "/licenses",
"templateUrl": "templates/licenses.html" "template": licensesTemplate
}, },
{ {
"when": "/licenses-md", "when": "/licenses-md",
"templateUrl": "templates/licenses-export-md.html" "template": licensesExportMdTemplate
} }
] ]
} }

View File

@ -20,11 +20,7 @@
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<div class="abs t-about l-about t-about-openmctweb s-about" ng-controller = "AboutController as about"> <div class="abs t-about l-about t-about-openmctweb s-about" ng-controller = "AboutController as about">
<div class="l-logo-holder s-logo-holder"> <div class="l-splash s-splash"></div>
<div class="l-logo s-logo s-logo-nasa"></div>
<div class="l-logo l-logo-app s-logo s-logo-openmctweb"></div>
</div>
<div class="s-text l-content"> <div class="s-text l-content">
<h1 class="l-title s-title">OpenMCT Web</h1> <h1 class="l-title s-title">OpenMCT Web</h1>
<div class="l-description s-description"> <div class="l-description s-description">

View File

@ -37,6 +37,18 @@ define([
"./src/creation/AddActionProvider", "./src/creation/AddActionProvider",
"./src/creation/CreationService", "./src/creation/CreationService",
"./src/windowing/WindowTitler", "./src/windowing/WindowTitler",
"text!./res/templates/browse.html",
"text!./res/templates/create/locator.html",
"text!./res/templates/browse-object.html",
"text!./res/templates/create/create-button.html",
"text!./res/templates/create/create-menu.html",
"text!./res/templates/items/grid-item.html",
"text!./res/templates/browse/object-header.html",
"text!./res/templates/menu-arrow.html",
"text!./res/templates/back-arrow.html",
"text!./res/templates/items/items.html",
"text!./res/templates/browse/object-properties.html",
"text!./res/templates/browse/inspector-region.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
BrowseController, BrowseController,
@ -54,6 +66,18 @@ define([
AddActionProvider, AddActionProvider,
CreationService, CreationService,
WindowTitler, WindowTitler,
browseTemplate,
locatorTemplate,
browseObjectTemplate,
createButtonTemplate,
createMenuTemplate,
gridItemTemplate,
objectHeaderTemplate,
menuArrowTemplate,
backArrowTemplate,
itemsTemplate,
objectPropertiesTemplate,
inspectorRegionTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -63,15 +87,22 @@ define([
"routes": [ "routes": [
{ {
"when": "/browse/:ids*", "when": "/browse/:ids*",
"templateUrl": "templates/browse.html", "template": browseTemplate,
"reloadOnSearch": false "reloadOnSearch": false
}, },
{ {
"when": "", "when": "",
"templateUrl": "templates/browse.html", "template": browseTemplate,
"reloadOnSearch": false "reloadOnSearch": false
} }
], ],
"constants": [
{
"key": "DEFAULT_PATH",
"value": "mine",
"priority": "fallback"
}
],
"controllers": [ "controllers": [
{ {
"key": "BrowseController", "key": "BrowseController",
@ -83,7 +114,8 @@ define([
"$q", "$q",
"objectService", "objectService",
"navigationService", "navigationService",
"urlService" "urlService",
"DEFAULT_PATH"
] ]
}, },
{ {
@ -134,13 +166,13 @@ define([
"controls": [ "controls": [
{ {
"key": "locator", "key": "locator",
"templateUrl": "templates/create/locator.html" "template": locatorTemplate
} }
], ],
"representations": [ "representations": [
{ {
"key": "browse-object", "key": "browse-object",
"templateUrl": "templates/browse-object.html", "template": browseObjectTemplate,
"gestures": [ "gestures": [
"drop" "drop"
], ],
@ -150,18 +182,18 @@ define([
}, },
{ {
"key": "create-button", "key": "create-button",
"templateUrl": "templates/create/create-button.html" "template": createButtonTemplate
}, },
{ {
"key": "create-menu", "key": "create-menu",
"templateUrl": "templates/create/create-menu.html", "template": createMenuTemplate,
"uses": [ "uses": [
"action" "action"
] ]
}, },
{ {
"key": "grid-item", "key": "grid-item",
"templateUrl": "templates/items/grid-item.html", "template": gridItemTemplate,
"uses": [ "uses": [
"type", "type",
"action", "action",
@ -174,14 +206,14 @@ define([
}, },
{ {
"key": "object-header", "key": "object-header",
"templateUrl": "templates/browse/object-header.html", "template": objectHeaderTemplate,
"uses": [ "uses": [
"type" "type"
] ]
}, },
{ {
"key": "menu-arrow", "key": "menu-arrow",
"templateUrl": "templates/menu-arrow.html", "template": menuArrowTemplate,
"uses": [ "uses": [
"action" "action"
], ],
@ -194,7 +226,15 @@ define([
"uses": [ "uses": [
"context" "context"
], ],
"templateUrl": "templates/back-arrow.html" "template": backArrowTemplate
},
{
"key": "object-properties",
"template": objectPropertiesTemplate
},
{
"key": "inspector-region",
"template": inspectorRegionTemplate
} }
], ],
"services": [ "services": [
@ -250,7 +290,7 @@ define([
"name": "Items", "name": "Items",
"glyph": "9", "glyph": "9",
"description": "Grid of available items", "description": "Grid of available items",
"templateUrl": "templates/items/items.html", "template": itemsTemplate,
"uses": [ "uses": [
"composition" "composition"
], ],

View File

@ -44,7 +44,7 @@
</div> </div>
</div> </div>
<div class="holder l-flex-col flex-elem grows l-object-wrapper"> <div class="holder l-flex-col flex-elem grows l-object-wrapper">
<div class="holder l-flex-col flex-elem grows l-object-wrapper-inner"> <div ng-if="isEditable" class="holder l-flex-col flex-elem grows l-object-wrapper-inner">
<!-- Toolbar and Save/Cancel buttons --> <!-- Toolbar and Save/Cancel buttons -->
<div class="l-edit-controls flex-elem l-flex-row flex-align-end"> <div class="l-edit-controls flex-elem l-flex-row flex-align-end">
<mct-toolbar name="mctToolbar" <mct-toolbar name="mctToolbar"
@ -63,6 +63,20 @@
class="abs flex-elem grows object-holder-main scroll" class="abs flex-elem grows object-holder-main scroll"
toolbar="toolbar"> toolbar="toolbar">
</mct-representation> </mct-representation>
</div><!--/ l-object-wrapper-inner --> </div>
<div ng-if="!isEditable" class="holder l-flex-col flex-elem grows l-object-wrapper-inner">
<!-- Toolbar and Save/Cancel buttons -->
<div class="l-edit-controls flex-elem l-flex-row flex-align-end">
<mct-representation key="'edit-action-buttons'"
mct-object="domainObject"
class='flex-elem conclude-editing'>
</mct-representation>
</div>
<mct-representation key="representation.selected.key"
mct-object="representation.selected.key && domainObject"
class="abs flex-elem grows object-holder-main scroll">
</mct-representation>
</div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,30 @@
<!--
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.
-->
<div ng-controller="InspectorController">
<div ng-repeat="region in regions">
<mct-representation
key="region.content.key"
mct-object="domainObject"
ng-model="ngModel">
</mct-representation>
</div>
</div>

View File

@ -0,0 +1,60 @@
<!--
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.
-->
<div ng-controller="ObjectInspectorController as controller">
<ul class="flex-elem grows l-inspector-part">
<li>
<em class="t-inspector-part-header">Properties</em>
<div class="inspector-properties"
ng-repeat="data in metadata"
ng-class="{ first:$index === 0 }">
<div class="label">{{ data.name }}</div>
<div class="value">{{ data.value }}</div>
</div>
</li>
<li ng-if="contextutalParents.length > 0">
<em class="t-inspector-part-header" title="The location of this linked object.">Location</em>
<span class="inspector-location"
ng-repeat="parent in contextutalParents"
ng-class="{ last:($index + 1) === contextualParents.length }">
<mct-representation key="'label'"
mct-object="parent"
ng-model="ngModel"
ng-click="ngModel.selectedObject = parent"
class="location-item">
</mct-representation>
</span>
</li>
<li ng-if="primaryParents.length > 0">
<em class="t-inspector-part-header" title="The location of the original object that this was linked from.">Original Location</em>
<span class="inspector-location"
ng-repeat="parent in primaryParents"
ng-class="{ last:($index + 1) === primaryParents.length }">
<mct-representation key="'label'"
mct-object="parent"
ng-model="ngModel"
ng-click="ngModel.selectedObject = parent"
class="location-item">
</mct-representation>
</span>
</li>
</ul>
</div>

View File

@ -34,7 +34,6 @@ define(
"use strict"; "use strict";
var ROOT_ID = "ROOT", var ROOT_ID = "ROOT",
DEFAULT_PATH = "mine",
CONFIRM_MSG = "Unsaved changes will be lost if you leave this page."; CONFIRM_MSG = "Unsaved changes will be lost if you leave this page.";
/** /**
@ -47,9 +46,18 @@ define(
* @memberof platform/commonUI/browse * @memberof platform/commonUI/browse
* @constructor * @constructor
*/ */
function BrowseController($scope, $route, $location, $q, objectService, navigationService, urlService) { function BrowseController(
$scope,
$route,
$location,
$q,
objectService,
navigationService,
urlService,
defaultPath
) {
var path = [ROOT_ID].concat( var path = [ROOT_ID].concat(
($route.current.params.ids || DEFAULT_PATH).split("/") ($route.current.params.ids || defaultPath).split("/")
); );
function isDirty(){ function isDirty(){
@ -143,6 +151,12 @@ define(
} else { } else {
doNavigate(nextObject, index + 1); doNavigate(nextObject, index + 1);
} }
} else if (index === 1 && c.length > 0) {
// Roots are in a top-level container that we don't
// want to be selected, so if we couldn't find an
// object at the path we wanted, at least select
// one of its children.
navigateTo(c[c.length - 1]);
} else { } else {
// Couldn't find the next element of the path // Couldn't find the next element of the path
// so navigate to the last path object we did find // so navigate to the last path object we did find

View File

@ -0,0 +1,69 @@
/*****************************************************************************
* 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,window*/
define(
[
'../../regions/src/Region'
],
function (Region) {
"use strict";
/**
* Defines the a default Inspector region. Captured in a class to
* allow for modular extension and customization of regions based on
* the typical case.
* @memberOf platform/commonUI/regions
* @constructor
*/
function InspectorRegion() {
Region.call(this, {'name': 'Inspector'});
this.buildRegion();
}
InspectorRegion.prototype = Object.create(Region.prototype);
InspectorRegion.prototype.constructor = Region;
/**
* @private
*/
InspectorRegion.prototype.buildRegion = function() {
var metadataRegion = {
name: 'metadata',
title: 'Metadata Region',
// Which modes should the region part be visible in? If
// nothing provided here, then assumed that part is visible
// in both. The visibility or otherwise of a region part
// should be decided by a policy. In this case, 'modes' is a
// shortcut that is used by the EditableRegionPolicy.
modes: ['browse', 'edit'],
content: {
key: 'object-properties'
}
};
this.addRegion(new Region(metadataRegion), 0);
};
return InspectorRegion;
}
);

View File

@ -40,6 +40,7 @@ define(
mockUrlService, mockUrlService,
mockDomainObject, mockDomainObject,
mockNextObject, mockNextObject,
testDefaultRoot,
controller; controller;
function mockPromise(value) { function mockPromise(value) {
@ -50,7 +51,21 @@ define(
}; };
} }
function instantiateController() {
controller = new BrowseController(
mockScope,
mockRoute,
mockLocation,
mockObjectService,
mockNavigationService,
mockUrlService,
testDefaultRoot
);
}
beforeEach(function () { beforeEach(function () {
testDefaultRoot = "some-root-level-domain-object";
mockScope = jasmine.createSpyObj( mockScope = jasmine.createSpyObj(
"$scope", "$scope",
[ "$on", "$watch" ] [ "$on", "$watch" ]
@ -101,41 +116,28 @@ define(
])); ]));
mockNextObject.useCapability.andReturn(undefined); mockNextObject.useCapability.andReturn(undefined);
mockNextObject.getId.andReturn("next"); mockNextObject.getId.andReturn("next");
mockDomainObject.getId.andReturn("mine"); mockDomainObject.getId.andReturn(testDefaultRoot);
controller = new BrowseController( instantiateController();
mockScope,
mockRoute,
mockLocation,
mockObjectService,
mockNavigationService,
mockUrlService
);
}); });
it("uses composition to set the navigated object, if there is none", function () { it("uses composition to set the navigated object, if there is none", function () {
controller = new BrowseController( instantiateController();
mockScope, expect(mockNavigationService.setNavigation)
mockRoute, .toHaveBeenCalledWith(mockDomainObject);
mockLocation, });
mockObjectService,
mockNavigationService, it("navigates to a root-level object, even when default path is not found", function () {
mockUrlService mockDomainObject.getId
); .andReturn("something-other-than-the-" + testDefaultRoot);
instantiateController();
expect(mockNavigationService.setNavigation) expect(mockNavigationService.setNavigation)
.toHaveBeenCalledWith(mockDomainObject); .toHaveBeenCalledWith(mockDomainObject);
}); });
it("does not try to override navigation", function () { it("does not try to override navigation", function () {
mockNavigationService.getNavigation.andReturn(mockDomainObject); mockNavigationService.getNavigation.andReturn(mockDomainObject);
controller = new BrowseController( instantiateController();
mockScope,
mockRoute,
mockLocation,
mockObjectService,
mockNavigationService,
mockUrlService
);
expect(mockScope.navigatedObject).toBe(mockDomainObject); expect(mockScope.navigatedObject).toBe(mockDomainObject);
}); });
@ -162,14 +164,8 @@ define(
}); });
it("uses route parameters to choose initially-navigated object", function () { it("uses route parameters to choose initially-navigated object", function () {
mockRoute.current.params.ids = "mine/next"; mockRoute.current.params.ids = testDefaultRoot + "/next";
controller = new BrowseController( instantiateController();
mockScope,
mockRoute,
mockLocation,
mockObjectService,
mockNavigationService
);
expect(mockScope.navigatedObject).toBe(mockNextObject); expect(mockScope.navigatedObject).toBe(mockNextObject);
expect(mockNavigationService.setNavigation) expect(mockNavigationService.setNavigation)
.toHaveBeenCalledWith(mockNextObject); .toHaveBeenCalledWith(mockNextObject);
@ -179,14 +175,8 @@ define(
// Idea here is that if we get a bad path of IDs, // Idea here is that if we get a bad path of IDs,
// browse controller should traverse down it until // browse controller should traverse down it until
// it hits an invalid ID. // it hits an invalid ID.
mockRoute.current.params.ids = "mine/junk"; mockRoute.current.params.ids = testDefaultRoot + "/junk";
controller = new BrowseController( instantiateController();
mockScope,
mockRoute,
mockLocation,
mockObjectService,
mockNavigationService
);
expect(mockScope.navigatedObject).toBe(mockDomainObject); expect(mockScope.navigatedObject).toBe(mockDomainObject);
expect(mockNavigationService.setNavigation) expect(mockNavigationService.setNavigation)
.toHaveBeenCalledWith(mockDomainObject); .toHaveBeenCalledWith(mockDomainObject);
@ -196,14 +186,8 @@ define(
// Idea here is that if we get a path which passes // Idea here is that if we get a path which passes
// through an object without a composition, browse controller // through an object without a composition, browse controller
// should stop at it since remaining IDs cannot be loaded. // should stop at it since remaining IDs cannot be loaded.
mockRoute.current.params.ids = "mine/next/junk"; mockRoute.current.params.ids = testDefaultRoot + "/next/junk";
controller = new BrowseController( instantiateController();
mockScope,
mockRoute,
mockLocation,
mockObjectService,
mockNavigationService
);
expect(mockScope.navigatedObject).toBe(mockNextObject); expect(mockScope.navigatedObject).toBe(mockNextObject);
expect(mockNavigationService.setNavigation) expect(mockNavigationService.setNavigation)
.toHaveBeenCalledWith(mockNextObject); .toHaveBeenCalledWith(mockNextObject);

View File

@ -0,0 +1,45 @@
/*****************************************************************************
* 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,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/**
* MCTIncudeSpec. Created by vwoeltje on 11/6/14.
*/
define(
["../src/InspectorRegion"],
function (InspectorRegion) {
"use strict";
describe("The inspector region", function () {
var inspectorRegion;
beforeEach(function () {
inspectorRegion = new InspectorRegion();
});
it("creates default region parts", function () {
expect(inspectorRegion.regions.length).toBe(1);
});
});
}
);

View File

@ -24,10 +24,24 @@
define([ define([
"./src/DialogService", "./src/DialogService",
"./src/OverlayService", "./src/OverlayService",
"text!./res/templates/overlay-dialog.html",
"text!./res/templates/overlay-options.html",
"text!./res/templates/dialog.html",
"text!./res/templates/overlay-blocking-message.html",
"text!./res/templates/message.html",
"text!./res/templates/overlay-message-list.html",
"text!./res/templates/overlay.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
DialogService, DialogService,
OverlayService, OverlayService,
overlayDialogTemplate,
overlayOptionsTemplate,
dialogTemplate,
overlayBlockingMessageTemplate,
messageTemplate,
overlayMessageListTemplate,
overlayTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -57,33 +71,33 @@ define([
"templates": [ "templates": [
{ {
"key": "overlay-dialog", "key": "overlay-dialog",
"templateUrl": "templates/overlay-dialog.html" "template": overlayDialogTemplate
}, },
{ {
"key": "overlay-options", "key": "overlay-options",
"templateUrl": "templates/overlay-options.html" "template": overlayOptionsTemplate
}, },
{ {
"key": "form-dialog", "key": "form-dialog",
"templateUrl": "templates/dialog.html" "template": dialogTemplate
}, },
{ {
"key": "overlay-blocking-message", "key": "overlay-blocking-message",
"templateUrl": "templates/overlay-blocking-message.html" "template": overlayBlockingMessageTemplate
}, },
{ {
"key": "message", "key": "message",
"templateUrl": "templates/message.html" "template": messageTemplate
}, },
{ {
"key": "overlay-message-list", "key": "overlay-message-list",
"templateUrl": "templates/overlay-message-list.html" "template": overlayMessageListTemplate
} }
], ],
"containers": [ "containers": [
{ {
"key": "overlay", "key": "overlay",
"templateUrl": "templates/overlay.html" "template": overlayTemplate
} }
] ]
} }

View File

@ -36,6 +36,12 @@ define([
"./src/policies/EditActionPolicy", "./src/policies/EditActionPolicy",
"./src/representers/EditRepresenter", "./src/representers/EditRepresenter",
"./src/representers/EditToolbarRepresenter", "./src/representers/EditToolbarRepresenter",
"text!./res/templates/edit.html",
"text!./res/templates/library.html",
"text!./res/templates/edit-object.html",
"text!./res/templates/edit-action-buttons.html",
"text!./res/templates/elements.html",
"text!./res/templates/topbar-edit.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
EditController, EditController,
@ -52,6 +58,12 @@ define([
EditActionPolicy, EditActionPolicy,
EditRepresenter, EditRepresenter,
EditToolbarRepresenter, EditToolbarRepresenter,
editTemplate,
libraryTemplate,
editObjectTemplate,
editActionButtonsTemplate,
elementsTemplate,
topbarEditTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -61,7 +73,7 @@ define([
"routes": [ "routes": [
{ {
"when": "/edit", "when": "/edit",
"templateUrl": "templates/edit.html" "template": editTemplate
} }
], ],
"controllers": [ "controllers": [
@ -185,27 +197,27 @@ define([
"templates": [ "templates": [
{ {
"key": "edit-library", "key": "edit-library",
"templateUrl": "templates/library.html" "template": libraryTemplate
} }
], ],
"representations": [ "representations": [
{ {
"key": "edit-object", "key": "edit-object",
"templateUrl": "templates/edit-object.html", "template": editObjectTemplate,
"uses": [ "uses": [
"view" "view"
] ]
}, },
{ {
"key": "edit-action-buttons", "key": "edit-action-buttons",
"templateUrl": "templates/edit-action-buttons.html", "template": editActionButtonsTemplate,
"uses": [ "uses": [
"action" "action"
] ]
}, },
{ {
"key": "edit-elements", "key": "edit-elements",
"templateUrl": "templates/elements.html", "template": elementsTemplate,
"uses": [ "uses": [
"composition" "composition"
], ],
@ -215,7 +227,7 @@ define([
}, },
{ {
"key": "topbar-edit", "key": "topbar-edit",
"templateUrl": "templates/topbar-edit.html" "template": topbarEditTemplate
} }
], ],
"representers": [ "representers": [

View File

@ -109,6 +109,8 @@ define(
// Track the represented object // Track the represented object
this.domainObject = representedObject; this.domainObject = representedObject;
this.scope.isEditable = representedObject.getCapability('status').get('editing');
// Ensure existing watches are released // Ensure existing watches are released
this.destroy(); this.destroy();
}; };

View File

@ -33,6 +33,8 @@ define(
testRepresentation, testRepresentation,
mockDomainObject, mockDomainObject,
mockPersistence, mockPersistence,
mockCapabilities,
mockStatusCapability,
representer; representer;
function mockPromise(value) { function mockPromise(value) {
@ -57,11 +59,20 @@ define(
]); ]);
mockPersistence = mockPersistence =
jasmine.createSpyObj("persistence", ["persist"]); jasmine.createSpyObj("persistence", ["persist"]);
mockStatusCapability =
jasmine.createSpyObj("status", ["get"]);
mockStatusCapability.get.andReturn(false);
mockCapabilities = {
'persistence': mockPersistence,
'status': mockStatusCapability
};
mockDomainObject.getModel.andReturn({}); mockDomainObject.getModel.andReturn({});
mockDomainObject.hasCapability.andReturn(true); mockDomainObject.hasCapability.andReturn(true);
mockDomainObject.useCapability.andReturn(true); mockDomainObject.useCapability.andReturn(true);
mockDomainObject.getCapability.andReturn(mockPersistence); mockDomainObject.getCapability.andCallFake(function(capability){
return mockCapabilities[capability];
});
representer = new EditRepresenter(mockQ, mockLog, mockScope); representer = new EditRepresenter(mockQ, mockLog, mockScope);
representer.represent(testRepresentation, mockDomainObject); representer.represent(testRepresentation, mockDomainObject);

View File

@ -24,6 +24,7 @@
define([ define([
"./src/services/UrlService", "./src/services/UrlService",
"./src/services/PopupService", "./src/services/PopupService",
"./src/SplashScreenManager",
"./src/StyleSheetLoader", "./src/StyleSheetLoader",
"./src/UnsupportedBrowserWarning", "./src/UnsupportedBrowserWarning",
"./src/controllers/TimeRangeController", "./src/controllers/TimeRangeController",
@ -48,10 +49,30 @@ define([
"./src/directives/MCTScroll", "./src/directives/MCTScroll",
"./src/directives/MCTSplitPane", "./src/directives/MCTSplitPane",
"./src/directives/MCTSplitter", "./src/directives/MCTSplitter",
"text!./res/templates/bottombar.html",
"text!./res/templates/controls/action-button.html",
"text!./res/templates/controls/input-filter.html",
"text!./res/templates/indicator.html",
"text!./res/templates/message-banner.html",
"text!./res/templates/progress-bar.html",
"text!./res/templates/controls/time-controller.html",
"text!./res/templates/containers/accordion.html",
"text!./res/templates/subtree.html",
"text!./res/templates/tree.html",
"text!./res/templates/tree-node.html",
"text!./res/templates/label.html",
"text!./res/templates/controls/action-group.html",
"text!./res/templates/menu/context-menu.html",
"text!./res/templates/controls/switcher.html",
"text!./res/templates/object-inspector.html",
"text!./res/templates/controls/selector.html",
"text!./res/templates/controls/datetime-picker.html",
"text!./res/templates/controls/datetime-field.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
UrlService, UrlService,
PopupService, PopupService,
SplashScreenManager,
StyleSheetLoader, StyleSheetLoader,
UnsupportedBrowserWarning, UnsupportedBrowserWarning,
TimeRangeController, TimeRangeController,
@ -76,6 +97,25 @@ define([
MCTScroll, MCTScroll,
MCTSplitPane, MCTSplitPane,
MCTSplitter, MCTSplitter,
bottombarTemplate,
actionButtonTemplate,
inputFilterTemplate,
indicatorTemplate,
messageBannerTemplate,
progressBarTemplate,
timeControllerTemplate,
accordionTemplate,
subtreeTemplate,
treeTemplate,
treeNodeTemplate,
labelTemplate,
actionGroupTemplate,
contextMenuTemplate,
switcherTemplate,
objectInspectorTemplate,
selectorTemplate,
datetimePickerTemplate,
datetimeFieldTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -117,6 +157,12 @@ define([
"notificationService", "notificationService",
"agentService" "agentService"
] ]
},
{
"implementation": SplashScreenManager,
"depends": [
"$document"
]
} }
], ],
"filters": [ "filters": [
@ -138,31 +184,31 @@ define([
"templates": [ "templates": [
{ {
"key": "bottombar", "key": "bottombar",
"templateUrl": "templates/bottombar.html" "template": bottombarTemplate
}, },
{ {
"key": "action-button", "key": "action-button",
"templateUrl": "templates/controls/action-button.html" "template": actionButtonTemplate
}, },
{ {
"key": "input-filter", "key": "input-filter",
"templateUrl": "templates/controls/input-filter.html" "template": inputFilterTemplate
}, },
{ {
"key": "indicator", "key": "indicator",
"templateUrl": "templates/indicator.html" "template": indicatorTemplate
}, },
{ {
"key": "message-banner", "key": "message-banner",
"templateUrl": "templates/message-banner.html" "template": messageBannerTemplate
}, },
{ {
"key": "progress-bar", "key": "progress-bar",
"templateUrl": "templates/progress-bar.html" "template": progressBarTemplate
}, },
{ {
"key": "time-controller", "key": "time-controller",
"templateUrl": "templates/controls/time-controller.html" "template": timeControllerTemplate
} }
], ],
"controllers": [ "controllers": [
@ -371,7 +417,7 @@ define([
"containers": [ "containers": [
{ {
"key": "accordion", "key": "accordion",
"templateUrl": "templates/containers/accordion.html", "template": accordionTemplate,
"attributes": [ "attributes": [
"label" "label"
] ]
@ -380,7 +426,7 @@ define([
"representations": [ "representations": [
{ {
"key": "tree", "key": "tree",
"templateUrl": "templates/subtree.html", "template": subtreeTemplate,
"uses": [ "uses": [
"composition" "composition"
], ],
@ -389,25 +435,25 @@ define([
}, },
{ {
"key": "tree", "key": "tree",
"templateUrl": "templates/tree.html" "template": treeTemplate
}, },
{ {
"key": "subtree", "key": "subtree",
"templateUrl": "templates/subtree.html", "template": subtreeTemplate,
"uses": [ "uses": [
"composition" "composition"
] ]
}, },
{ {
"key": "tree-node", "key": "tree-node",
"templateUrl": "templates/tree-node.html", "template": treeNodeTemplate,
"uses": [ "uses": [
"action" "action"
] ]
}, },
{ {
"key": "label", "key": "label",
"templateUrl": "templates/label.html", "template": labelTemplate,
"uses": [ "uses": [
"type", "type",
"location" "location"
@ -420,7 +466,7 @@ define([
}, },
{ {
"key": "node", "key": "node",
"templateUrl": "templates/label.html", "template": labelTemplate,
"uses": [ "uses": [
"type" "type"
], ],
@ -431,42 +477,42 @@ define([
}, },
{ {
"key": "action-group", "key": "action-group",
"templateUrl": "templates/controls/action-group.html", "template": actionGroupTemplate,
"uses": [ "uses": [
"action" "action"
] ]
}, },
{ {
"key": "context-menu", "key": "context-menu",
"templateUrl": "templates/menu/context-menu.html", "template": contextMenuTemplate,
"uses": [ "uses": [
"action" "action"
] ]
}, },
{ {
"key": "switcher", "key": "switcher",
"templateUrl": "templates/controls/switcher.html", "template": switcherTemplate,
"uses": [ "uses": [
"view" "view"
] ]
}, },
{ {
"key": "object-inspector", "key": "object-inspector",
"templateUrl": "templates/object-inspector.html" "template": objectInspectorTemplate
} }
], ],
"controls": [ "controls": [
{ {
"key": "selector", "key": "selector",
"templateUrl": "templates/controls/selector.html" "template": selectorTemplate
}, },
{ {
"key": "datetime-picker", "key": "datetime-picker",
"templateUrl": "templates/controls/datetime-picker.html" "template": datetimePickerTemplate
}, },
{ {
"key": "datetime-field", "key": "datetime-field",
"templateUrl": "templates/controls/datetime-field.html" "template": datetimeFieldTemplate
} }
], ],
"licenses": [ "licenses": [

View File

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 218 KiB

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="20 0 640 150" enable-background="new 20 0 640 150" xml:space="preserve">
<filter height="130%" width="150%" id="AI_Shadow_Custom" x="-15%" filterUnits="objectBoundingBox" y="-15%">
<feGaussianBlur in="SourceAlpha" result="blur" stdDeviation="6"></feGaussianBlur>
<feOffset in="blur" dy="3" result="offsetBlurredAlpha" dx="0"></feOffset>
<feMerge>
<feMergeNode in="offsetBlurredAlpha"></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
<g filter="url(#AI_Shadow_Custom)">
<path fill="#FFFFFF" d="M90.7,13.2c14.8,0,22.8,8,22.8,22.8v46.3c0,14.8-8,22.8-22.8,22.8H62.8c-14.8,0-22.8-8-22.8-22.8V36
c0-14.8,8-22.8,22.8-22.8H90.7z M97.8,36.2c0-5.8-3.1-9.2-9.2-9.2h-24c-5.8,0-9.2,3.2-9.2,9.2v45.9c0,6,3.4,9.2,9.2,9.2h24
c6,0,9.2-3.2,9.2-9.2V36.2z"/>
<path fill="#FFFFFF" d="M173.2,13.2c14.8,0,22.8,8,22.8,22.8v46.3c0,14.8-8,22.8-22.8,22.8h-9c-11.2,0-19.2-6.6-26.5-13.6v44.2
h-15.5V13.2h15.5v13.6c7.3-7,15.3-13.6,26.5-13.6H173.2z M180.3,36.2c0-5.8-3.1-9.2-9.2-9.2h-8.3c-9.4,0-17,3.6-25.2,9.2v45.9
c8.2,5.6,15.8,9.2,25.2,9.2h8.3c6.1,0,9.2-3.4,9.2-9.2V36.2z"/>
<path fill="#FFFFFF" d="M220.3,82.8c0,6,3.2,9.2,9.2,9.2h23c6,0,9.2-3.4,9.2-9.2V76h15.6v6.3c0,14.8-8,22.8-22.8,22.8h-27
c-14.8,0-22.8-8-22.8-22.8V36c0-14.8,8-22.8,22.8-22.8h27c14.8,0,22.8,8,22.8,22.8v26.9h-57V82.8z M229.5,26.3
c-6,0-9.2,3.2-9.2,9.2v15.8h41.3V35.5c0-6-3.1-9.2-9.2-9.2H229.5z"/>
<path fill="#FFFFFF" d="M285.7,13.2h15.5v13.6c7.3-7,15.3-13.6,26.5-13.6h7.1c14.8,0,22.8,8,22.8,22.8v69.1h-15.5V36.6
c0-6-3.2-9.2-9.2-9.2h-6.6c-9.4,0-17,3.4-25.2,9.2v68.5h-15.5V13.2z"/>
<path fill="#4F79F7" d="M495.4,105.1c-12.5,0-18.4-6-18.4-18.4V28.7c0-12.5,6.2-18.4,18.7-18.4h42.2c12.5,0,18.1,6,18.1,18.4v17.7
h-25.4V33.9c0-1.9-0.5-2.4-2.4-2.4h-23.3c-1.9,0-2.4,0.5-2.4,2.4v47.6c0,1.9,0.5,2.4,2.4,2.4h23.3c1.9,0,2.4-0.5,2.4-2.4V69H556
v17.7c0,12.5-6,18.4-18.4,18.4H495.4z"/>
<path fill="#4F79F7" d="M613.7,32v73.1h-25.4V32H562V10.3h78V32H613.7z"/>
<path fill="#4F79F7" d="M425.3,93.6l17.4-42.4v48.6c0,3,2.4,5.4,5.4,5.4h19V15.7c0-3-2.4-5.4-5.4-5.4h-23.3l-21.2,49.4l-21.2-49.4
h-23.3c-3,0-5.4,2.4-5.4,5.4v89.5h19c3,0,5.4-2.4,5.4-5.4V51.2l17.4,42.4H425.3z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="20 0 640 150" enable-background="new 20 0 640 150" xml:space="preserve">
<g>
<path fill="#FFFFFF" d="M90.7,13.2c14.8,0,22.8,8,22.8,22.8v46.3c0,14.8-8,22.8-22.8,22.8H62.8c-14.8,0-22.8-8-22.8-22.8V36
c0-14.8,8-22.8,22.8-22.8H90.7z M97.8,36.2c0-5.8-3.1-9.2-9.2-9.2h-24c-5.8,0-9.2,3.2-9.2,9.2v45.9c0,6,3.4,9.2,9.2,9.2h24
c6,0,9.2-3.2,9.2-9.2V36.2z"/>
<path fill="#FFFFFF" d="M173.2,13.2c14.8,0,22.8,8,22.8,22.8v46.3c0,14.8-8,22.8-22.8,22.8h-9c-11.2,0-19.2-6.6-26.5-13.6v44.2
h-15.5V13.2h15.5v13.6c7.3-7,15.3-13.6,26.5-13.6H173.2z M180.3,36.2c0-5.8-3.1-9.2-9.2-9.2h-8.3c-9.4,0-17,3.6-25.2,9.2v45.9
c8.2,5.6,15.8,9.2,25.2,9.2h8.3c6.1,0,9.2-3.4,9.2-9.2V36.2z"/>
<path fill="#FFFFFF" d="M220.3,82.8c0,6,3.2,9.2,9.2,9.2h23c6,0,9.2-3.4,9.2-9.2V76h15.6v6.3c0,14.8-8,22.8-22.8,22.8h-27
c-14.8,0-22.8-8-22.8-22.8V36c0-14.8,8-22.8,22.8-22.8h27c14.8,0,22.8,8,22.8,22.8v26.9h-57V82.8z M229.5,26.3
c-6,0-9.2,3.2-9.2,9.2v15.8h41.3V35.5c0-6-3.1-9.2-9.2-9.2H229.5z"/>
<path fill="#FFFFFF" d="M285.7,13.2h15.5v13.6c7.3-7,15.3-13.6,26.5-13.6h7.1c14.8,0,22.8,8,22.8,22.8v69.1h-15.5V36.6
c0-6-3.2-9.2-9.2-9.2h-6.6c-9.4,0-17,3.4-25.2,9.2v68.5h-15.5V13.2z"/>
<path fill="#4F79F7" d="M495.4,105.1c-12.5,0-18.4-6-18.4-18.4V28.7c0-12.5,6.2-18.4,18.7-18.4h42.2c12.5,0,18.1,6,18.1,18.4v17.7
h-25.4V33.9c0-1.9-0.5-2.4-2.4-2.4h-23.3c-1.9,0-2.4,0.5-2.4,2.4v47.6c0,1.9,0.5,2.4,2.4,2.4h23.3c1.9,0,2.4-0.5,2.4-2.4V69H556
v17.7c0,12.5-6,18.4-18.4,18.4H495.4z"/>
<path fill="#4F79F7" d="M613.7,32v73.1h-25.4V32H562V10.3h78V32H613.7z"/>
<path fill="#4F79F7" d="M425.3,93.6l17.4-42.4v48.6c0,3,2.4,5.4,5.4,5.4h19V15.7c0-3-2.4-5.4-5.4-5.4h-23.3l-21.2,49.4l-21.2-49.4
h-23.3c-3,0-5.4,2.4-5.4,5.4v89.5h19c3,0,5.4-2.4,5.4-5.4V51.2l17.4,42.4H425.3z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1,99 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="1040px" height="150px" viewBox="0 0 1040 150" enable-background="new 0 0 1040 150" xml:space="preserve">
<filter width="150%" height="130%" x="-15%" y="-15%" filterUnits="objectBoundingBox" id="AI_Shadow_Custom">
<feGaussianBlur in="SourceAlpha" stdDeviation="6" result="blur"></feGaussianBlur>
<feOffset dy="3" dx="0" in="blur" result="offsetBlurredAlpha"></feOffset>
<feMerge>
<feMergeNode in="offsetBlurredAlpha"></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
<g filter="url(#AI_Shadow_Custom)">
<path fill="#FFFFFF" d="M121.932,76.064c0,5.952-0.992,11.507-3.174,16.665c-1.984,4.96-4.96,9.324-8.531,13.094
c-3.769,3.769-7.936,6.547-13.094,8.531c-4.96,1.984-10.515,2.976-16.466,2.976H56.463c-5.952,0-11.507-0.992-16.466-2.976
s-9.523-4.96-13.094-8.531c-3.769-3.769-6.547-8.134-8.729-13.094C15.992,87.57,15,82.015,15,76.064V57.217
c0-5.952,0.992-11.507,3.174-16.665s4.96-9.523,8.729-13.094c3.571-3.571,7.936-6.547,12.895-8.531s10.515-3.174,16.466-3.174
h24.203c5.952,0,11.507,0.992,16.466,3.174c4.96,1.984,9.324,4.96,13.094,8.531s6.547,7.936,8.531,13.094
c1.984,5.158,3.174,10.515,3.174,16.665v18.847H121.932z M103.878,57.217c0-3.571-0.595-6.745-1.786-9.523
c-1.19-2.777-2.777-5.357-4.761-7.34c-1.984-1.984-4.563-3.571-7.34-4.761c-2.777-1.19-5.952-1.786-9.523-1.786H56.463
c-3.571,0-6.745,0.595-9.523,1.786c-2.777,1.19-5.357,2.777-7.34,4.761c-1.984,1.984-3.571,4.563-4.761,7.34
c-1.389,2.777-1.984,5.952-1.984,9.523v18.847c0,3.571,0.595,6.745,1.786,9.523c1.19,2.976,2.777,5.357,4.761,7.34
s4.563,3.571,7.34,4.761c2.777,1.19,6.15,1.786,9.523,1.786h24.203c3.571,0,6.745-0.595,9.523-1.786
c2.777-1.19,5.357-2.777,7.34-4.761s3.571-4.563,4.761-7.34c1.19-2.777,1.786-6.15,1.786-9.523L103.878,57.217z"/>
<path fill="#FFFFFF" d="M209.62,90.943c0,3.174-0.397,5.753-1.19,8.332c-0.794,2.381-1.786,4.563-3.174,6.547
c-1.19,1.786-2.777,3.373-4.563,4.761c-1.786,1.389-3.571,2.381-5.357,3.174c-1.786,0.794-3.769,1.389-5.555,1.786
c-1.984,0.397-3.769,0.595-5.357,0.595h-32.337V98.283h32.337c2.381,0,4.166-0.595,5.357-1.786c1.19-1.19,1.786-2.976,1.786-5.357
V66.739c0-2.579-0.595-4.365-1.786-5.555c-1.19-1.19-2.976-1.786-5.357-1.786h-32.139c-2.381,0-4.365,0.595-5.555,1.786
c-1.19,1.19-1.786,2.976-1.786,5.357v72.809H127.09V66.541c0-3.174,0.397-5.753,1.19-8.332c0.794-2.381,1.786-4.563,3.174-6.547
c1.389-1.786,2.777-3.373,4.563-4.761s3.571-2.381,5.357-3.174s3.769-1.389,5.555-1.786c1.984-0.397,3.769-0.595,5.357-0.595
h32.337c3.174,0,5.753,0.397,8.332,1.19c2.381,0.794,4.563,1.786,6.348,3.174c1.786,1.19,3.373,2.777,4.761,4.563
s2.381,3.571,3.174,5.357c0.794,1.786,1.389,3.769,1.785,5.555c0.397,1.984,0.595,3.769,0.595,5.357L209.62,90.943L209.62,90.943z"
/>
<path fill="#FFFFFF" d="M295.126,66.144c0,2.579-0.397,5.158-1.389,7.936c-0.794,2.777-2.381,5.555-4.166,7.936
c-1.984,2.381-4.563,4.563-7.737,6.15c-3.174,1.587-6.944,2.579-11.507,2.579H237.99V73.683h32.337
c2.381,0,4.365-0.794,5.555-2.182c1.389-1.587,1.984-3.373,1.984-5.555c0-2.381-0.794-4.166-2.182-5.555
c-1.587-1.389-3.373-1.984-5.357-1.984H237.99c-2.381,0-4.365,0.794-5.753,2.182c-1.389,1.587-1.984,3.373-1.984,5.555V91.34
c0,2.381,0.794,4.166,2.182,5.555c1.587,1.389,3.373,1.984,5.555,1.984h46.82v17.061h-47.018c-2.579,0-5.158-0.397-7.936-1.389
c-2.777-0.794-5.555-2.381-7.936-4.166c-2.381-1.984-4.563-4.563-6.15-7.737c-1.587-3.174-2.381-6.944-2.381-11.507V66.144
c0-2.579,0.397-5.158,1.389-7.936c0.794-2.777,2.381-5.555,4.166-7.936c1.984-2.381,4.563-4.563,7.737-6.15
s6.944-2.579,11.507-2.579h32.337c2.579,0,5.158,0.397,7.936,1.389c2.777,0.794,5.555,2.381,7.936,4.166
c2.381,1.984,4.563,4.563,6.15,7.737C294.332,57.812,295.126,61.78,295.126,66.144z"/>
<path fill="#FFFFFF" d="M379.838,116.138h-17.855V74.675c0-2.381-0.397-4.365-1.19-6.348c-0.794-1.785-1.984-3.373-3.373-4.761
c-1.389-1.389-2.976-2.381-4.96-2.976c-1.785-0.794-3.968-0.992-5.952-0.992h-31.346v56.541h-17.855V50.471
c0-1.19,0.198-2.381,0.595-3.571c0.397-0.992,1.19-1.984,1.984-2.777c0.794-0.794,1.785-1.389,2.976-1.984
c1.19-0.397,2.182-0.595,3.571-0.595h40.471c2.182,0,4.563,0.198,7.142,0.794c2.579,0.595,4.96,1.389,7.539,2.381
c2.381,1.19,4.761,2.579,6.944,4.365c2.182,1.786,4.166,3.769,5.952,6.348c1.785,2.381,3.174,5.357,4.166,8.531
c0.992,3.174,1.587,6.944,1.587,10.911v41.265H379.838z"/>
<path fill="#FFFFFF" d="M502.839,116.138h-18.053V57.217l-31.742,55.946c-0.794,1.389-1.785,2.579-3.373,3.174
c-1.389,0.794-2.976,1.19-4.563,1.19s-2.976-0.397-4.365-1.19c-1.389-0.794-2.381-1.786-3.174-3.174l-31.941-55.946v58.922h-17.855
V24.879c0-1.984,0.595-3.968,1.785-5.555c1.19-1.587,2.777-2.777,4.761-3.174c0.992-0.198,1.984-0.397,2.976-0.198
c0.992,0,1.984,0.198,2.777,0.595c0.992,0.397,1.785,0.794,2.381,1.389c0.794,0.595,1.389,1.389,1.785,2.182l40.868,71.023
l40.868-71.023c0.992-1.786,2.579-2.976,4.365-3.769c1.785-0.794,3.769-0.794,5.753-0.397c1.984,0.595,3.571,1.587,4.761,3.174
c1.19,1.587,1.785,3.373,1.785,5.555v91.457H502.839z"/>
<path fill="#FFFFFF" d="M595.685,116.138h-62.493c-1.587,0-3.373-0.198-5.357-0.595c-1.984-0.397-3.769-0.992-5.753-1.786
c-1.786-0.794-3.571-1.984-5.357-3.174c-1.786-1.389-3.174-2.976-4.563-4.761c-1.389-1.786-2.381-3.968-3.174-6.547
c-0.794-2.381-1.19-5.158-1.19-8.332V42.337c0-1.587,0.198-3.373,0.595-5.357c0.397-1.984,0.992-3.769,1.785-5.753
c0.794-1.786,1.984-3.571,3.174-5.357c1.389-1.786,2.976-3.174,4.761-4.563c1.786-1.389,3.968-2.381,6.348-3.174
c2.381-0.794,5.158-1.19,8.332-1.19h62.493v17.855h-62.493c-2.381,0-4.166,0.595-5.357,1.786c-1.19,1.19-1.785,3.174-1.785,5.555
v48.407c0,2.381,0.595,4.166,1.984,5.357c1.19,1.19,2.976,1.984,5.357,1.984h62.493v18.252H595.685z"/>
<path fill="#FFFFFF" d="M697.658,35.195h-39.479v80.943h-17.855V35.195h-39.479V17.34h97.012v17.855H697.658z"/>
<path fill="#4F79F7" d="M98.125,49.083c-0.992-2.381-2.182-4.166-3.769-5.952c-1.587-1.587-3.571-2.777-5.952-3.769
c-2.381-0.992-4.96-1.389-7.936-1.389H65.192c-1.389,7.34-1.389,12.697-0.794,15.474c0.198-0.198,0.397-0.198,0.397-0.397
c1.587-1.389,3.571-3.174,6.15-4.166c1.785-0.794,3.769-1.19,5.555-1.19c3.174,0,5.952,1.19,7.936,3.373
c2.777,3.174,3.968,8.332,3.174,14.879c-1.984,16.07-11.308,17.26-14.086,17.26c-1.786,0-3.769-0.397-5.555-1.19
c-2.579-1.19-4.365-2.976-5.555-4.365l-0.198-0.198c-1.389,2.579-2.976,8.531-3.571,17.26h21.823c2.976,0,5.555-0.397,7.936-1.389
c2.381-0.992,4.365-2.182,5.952-3.769c1.587-1.587,2.777-3.571,3.769-5.753c0.992-2.381,1.389-4.96,1.389-7.936V57.018
C99.514,54.241,99.117,51.463,98.125,49.083z M61.82,72.096c2.777,0,4.365,4.365,7.936,5.952c4.761,2.182,11.308,0.397,12.895-12.3
s-4.761-14.482-9.919-12.3c-3.968,1.587-6.547,5.952-9.324,5.952c-3.571,0-5.158-8.134-2.976-21.426h-4.166
c-2.976,0-5.555,0.397-7.936,1.389c-2.381,0.992-4.365,2.182-5.952,3.769c-1.587,1.587-2.976,3.571-3.769,5.952
c-0.992,2.381-1.389,4.96-1.389,7.936v18.847c0,2.976,0.397,5.753,1.389,7.936c0.992,2.381,2.182,4.166,3.769,5.753
c1.587,1.587,3.571,2.777,5.952,3.769c1.587,0.595,3.373,0.992,5.357,1.19C54.479,80.825,58.249,72.096,61.82,72.096z"/>
<path fill="#4F79F7" d="M858.155,17.142l-16.665,93.045c-0.397,1.786-1.19,3.373-2.579,4.761c-1.389,1.389-2.777,2.182-4.761,2.579
s-3.769,0.198-5.357-0.595c-1.587-0.794-2.976-1.984-3.968-3.373l-32.933-54.16l-32.933,54.16
c-0.794,1.389-1.786,2.381-3.174,3.174c-1.389,0.794-2.777,1.19-4.365,1.19c-2.182,0-4.166-0.595-5.753-1.984
s-2.579-3.174-2.976-5.357l-16.665-93.045h18.252l11.903,65.468l28.37-45.233c0.794-1.389,1.786-2.381,3.174-3.174
s2.777-1.19,4.365-1.19c1.587,0,2.976,0.397,4.365,1.19c1.389,0.794,2.381,1.786,3.373,3.174l28.171,45.233l11.903-65.468h18.252
V17.142z"/>
<path fill="#4F79F7" d="M1024.802,91.141c0,1.786-0.198,3.571-0.595,5.357c-0.397,1.984-0.992,3.769-1.786,5.555
c-0.794,1.786-1.984,3.571-3.174,5.357c-1.389,1.786-2.976,3.174-4.761,4.563c-1.786,1.389-3.968,2.381-6.547,3.174
c-2.381,0.794-5.158,1.19-8.332,1.19H967.07c-1.786,0-3.571-0.198-5.357-0.595c-1.984-0.397-3.769-0.992-5.555-1.786
c-1.785-0.794-3.571-1.984-5.357-3.174c-1.786-1.389-3.174-2.976-4.563-4.761c-1.389-1.786-2.381-3.968-3.174-6.547
c-0.794-2.381-1.19-5.158-1.19-8.332V10h18.053v81.141c0,2.182,0.595,3.968,1.984,5.357s3.174,1.984,5.158,1.984h32.536
c2.182,0,3.968-0.595,5.357-1.984c1.19-1.389,1.984-3.174,1.984-5.357V66.938c0-2.182-0.595-3.968-1.984-5.357
c-1.389-1.19-2.976-1.984-5.158-1.984h-32.536V41.544h32.536c1.786,0,3.571,0.198,5.357,0.595c1.984,0.397,3.769,0.992,5.555,1.786
c1.786,0.794,3.571,1.984,5.357,3.174c1.785,1.389,3.174,2.976,4.563,4.761s2.381,3.968,3.174,6.547
c0.794,2.381,1.19,5.158,1.19,8.332v24.402H1024.802z"/>
<path fill="#4F79F7" d="M937.709,66.144c0,2.579-0.397,5.158-1.389,7.936c-0.794,2.777-2.381,5.555-4.166,7.936
c-1.984,2.381-4.563,4.563-7.737,6.15c-3.174,1.587-6.944,2.579-11.507,2.579h-32.337V73.683h32.337
c2.381,0,4.365-0.794,5.555-2.182c1.389-1.587,1.984-3.373,1.984-5.555c0-2.381-0.794-4.166-2.182-5.555
c-1.587-1.389-3.373-1.984-5.357-1.984h-32.337c-2.381,0-4.365,0.794-5.753,2.182c-1.389,1.587-1.984,3.373-1.984,5.555V91.34
c0,2.381,0.794,4.166,2.182,5.555c1.587,1.389,3.373,1.984,5.555,1.984h47.018v17.061h-47.018c-2.579,0-5.158-0.397-7.936-1.389
c-2.777-0.794-5.555-2.381-7.936-4.166c-2.381-1.984-4.563-4.563-6.15-7.737c-1.587-3.174-2.381-6.944-2.381-11.507V66.144
c0-2.579,0.397-5.158,1.389-7.936c0.794-2.777,2.381-5.555,4.166-7.936c1.984-2.381,4.563-4.563,7.737-6.15
c3.174-1.587,6.944-2.579,11.507-2.579h32.337c2.579,0,5.158,0.397,7.936,1.389c2.777,0.794,5.555,2.381,7.936,4.166
c2.381,1.984,4.563,4.563,6.15,7.737C936.717,57.812,937.709,61.78,937.709,66.144z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.8 KiB

View File

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 509 65.2" enable-background="new 0 0 509 65.2" xml:space="preserve">
<g id="logo_s3_4_">
<g>
<g>
<path fill="#FFFFFF" d="M53.9,33.3c0,3-0.5,5.8-1.6,8.4c-1,2.5-2.5,4.7-4.3,6.6c-1.9,1.9-4,3.3-6.6,4.3c-2.5,1-5.3,1.5-8.3,1.5
H20.9c-3,0-5.8-0.5-8.3-1.5c-2.5-1-4.8-2.5-6.6-4.3c-1.9-1.9-3.3-4.1-4.4-6.6C0.5,39.1,0,36.3,0,33.3v-9.5c0-3,0.5-5.8,1.6-8.4
c1.1-2.6,2.5-4.8,4.4-6.6C7.8,7,10,5.5,12.5,4.5c2.5-1,5.3-1.6,8.3-1.6h12.2c3,0,5.8,0.5,8.3,1.6c2.5,1,4.7,2.5,6.6,4.3
c1.9,1.8,3.3,4,4.3,6.6c1,2.6,1.6,5.3,1.6,8.4V33.3z M44.8,23.8c0-1.8-0.3-3.4-0.9-4.8c-0.6-1.4-1.4-2.7-2.4-3.7
c-1-1-2.3-1.8-3.7-2.4c-1.4-0.6-3-0.9-4.8-0.9H20.9c-1.8,0-3.4,0.3-4.8,0.9c-1.4,0.6-2.7,1.4-3.7,2.4c-1,1-1.8,2.3-2.4,3.7
C9.3,20.4,9,22,9,23.8v9.5c0,1.8,0.3,3.4,0.9,4.8c0.6,1.5,1.4,2.7,2.4,3.7c1,1,2.3,1.8,3.7,2.4c1.4,0.6,3.1,0.9,4.8,0.9H33
c1.8,0,3.4-0.3,4.8-0.9c1.4-0.6,2.7-1.4,3.7-2.4c1-1,1.8-2.3,2.4-3.7c0.6-1.4,0.9-3.1,0.9-4.8V23.8z"/>
<path fill="#FFFFFF" d="M98.1,40.8c0,1.6-0.2,2.9-0.6,4.2c-0.4,1.2-0.9,2.3-1.6,3.3c-0.6,0.9-1.4,1.7-2.3,2.4
c-0.9,0.7-1.8,1.2-2.7,1.6c-0.9,0.4-1.9,0.7-2.8,0.9c-1,0.2-1.9,0.3-2.7,0.3H69.1v-9h16.3c1.2,0,2.1-0.3,2.7-0.9
c0.6-0.6,0.9-1.5,0.9-2.7V28.6c0-1.3-0.3-2.2-0.9-2.8c-0.6-0.6-1.5-0.9-2.7-0.9H69.2c-1.2,0-2.2,0.3-2.8,0.9
c-0.6,0.6-0.9,1.5-0.9,2.7v36.7h-9V28.5c0-1.6,0.2-2.9,0.6-4.2c0.4-1.2,0.9-2.3,1.6-3.3c0.7-0.9,1.4-1.7,2.3-2.4
c0.9-0.7,1.8-1.2,2.7-1.6c0.9-0.4,1.9-0.7,2.8-0.9c1-0.2,1.9-0.3,2.7-0.3h16.3c1.6,0,2.9,0.2,4.2,0.6c1.2,0.4,2.3,0.9,3.2,1.6
c0.9,0.6,1.7,1.4,2.4,2.3c0.7,0.9,1.2,1.8,1.6,2.7c0.4,0.9,0.7,1.9,0.9,2.8c0.2,1,0.3,1.9,0.3,2.7V40.8z"/>
<path fill="#FFFFFF" d="M141.2,28.3c0,1.3-0.2,2.6-0.7,4c-0.4,1.4-1.2,2.8-2.1,4c-1,1.2-2.3,2.3-3.9,3.1
c-1.6,0.8-3.5,1.3-5.8,1.3h-16.3v-8.6h16.3c1.2,0,2.2-0.4,2.8-1.1c0.7-0.8,1-1.7,1-2.8c0-1.2-0.4-2.1-1.1-2.8
c-0.8-0.7-1.7-1-2.7-1h-16.3c-1.2,0-2.2,0.4-2.9,1.1c-0.7,0.8-1,1.7-1,2.8V41c0,1.2,0.4,2.1,1.1,2.8c0.8,0.7,1.7,1,2.8,1h23.6
v8.6h-23.7c-1.3,0-2.6-0.2-4-0.7c-1.4-0.4-2.8-1.2-4-2.1c-1.2-1-2.3-2.3-3.1-3.9c-0.8-1.6-1.2-3.5-1.2-5.8V28.3
c0-1.3,0.2-2.6,0.7-4c0.4-1.4,1.2-2.8,2.1-4c1-1.2,2.3-2.3,3.9-3.1c1.6-0.8,3.5-1.3,5.8-1.3h16.3c1.3,0,2.6,0.2,4,0.7
c1.4,0.4,2.8,1.2,4,2.1c1.2,1,2.3,2.3,3.1,3.9C140.8,24.1,141.2,26.1,141.2,28.3z"/>
<path fill="#FFFFFF" d="M183.9,53.5h-9V32.6c0-1.2-0.2-2.2-0.6-3.2c-0.4-0.9-1-1.7-1.7-2.4c-0.7-0.7-1.5-1.2-2.5-1.5
c-0.9-0.4-2-0.5-3-0.5h-15.8v28.5h-9V20.4c0-0.6,0.1-1.2,0.3-1.8c0.2-0.5,0.6-1,1-1.4c0.4-0.4,0.9-0.7,1.5-1
c0.6-0.2,1.1-0.3,1.8-0.3h20.4c1.1,0,2.3,0.1,3.6,0.4c1.3,0.3,2.5,0.7,3.8,1.2c1.2,0.6,2.4,1.3,3.5,2.2c1.1,0.9,2.1,1.9,3,3.2
c0.9,1.2,1.6,2.7,2.1,4.3c0.5,1.6,0.8,3.5,0.8,5.5V53.5z"/>
<path fill="#FFFFFF" d="M245.9,53.5h-9.1V23.8l-16,28.2c-0.4,0.7-0.9,1.3-1.7,1.6c-0.7,0.4-1.5,0.6-2.3,0.6
c-0.8,0-1.5-0.2-2.2-0.6c-0.7-0.4-1.2-0.9-1.6-1.6l-16.1-28.2v29.7h-9v-46c0-1,0.3-2,0.9-2.8c0.6-0.8,1.4-1.4,2.4-1.6
c0.5-0.1,1-0.2,1.5-0.1c0.5,0,1,0.1,1.4,0.3c0.5,0.2,0.9,0.4,1.2,0.7c0.4,0.3,0.7,0.7,0.9,1.1l20.6,35.8l20.6-35.8
c0.5-0.9,1.3-1.5,2.2-1.9c0.9-0.4,1.9-0.4,2.9-0.2c1,0.3,1.8,0.8,2.4,1.6c0.6,0.8,0.9,1.7,0.9,2.8V53.5z"/>
<path fill="#FFFFFF" d="M292.7,53.5h-31.5c-0.8,0-1.7-0.1-2.7-0.3c-1-0.2-1.9-0.5-2.9-0.9c-0.9-0.4-1.8-1-2.7-1.6
c-0.9-0.7-1.6-1.5-2.3-2.4c-0.7-0.9-1.2-2-1.6-3.3c-0.4-1.2-0.6-2.6-0.6-4.2V16.3c0-0.8,0.1-1.7,0.3-2.7c0.2-1,0.5-1.9,0.9-2.9
c0.4-0.9,1-1.8,1.6-2.7c0.7-0.9,1.5-1.6,2.4-2.3c0.9-0.7,2-1.2,3.2-1.6c1.2-0.4,2.6-0.6,4.2-0.6h31.5v9h-31.5
c-1.2,0-2.1,0.3-2.7,0.9c-0.6,0.6-0.9,1.6-0.9,2.8v24.4c0,1.2,0.3,2.1,1,2.7c0.6,0.6,1.5,1,2.7,1h31.5V53.5z"/>
<path fill="#FFFFFF" d="M344.1,12.7h-19.9v40.8h-9V12.7h-19.9v-9h48.9V12.7z"/>
<path fill="#4F79F7" d="M41.9,19.7c-0.5-1.2-1.1-2.1-1.9-3c-0.8-0.8-1.8-1.4-3-1.9c-1.2-0.5-2.5-0.7-4-0.7h-7.7
c-0.7,3.7-0.7,6.4-0.4,7.8c0.1-0.1,0.2-0.1,0.2-0.2c0.8-0.7,1.8-1.6,3.1-2.1c0.9-0.4,1.9-0.6,2.8-0.6c1.6,0,3,0.6,4,1.7
c1.4,1.6,2,4.2,1.6,7.5c-1,8.1-5.7,8.7-7.1,8.7c-0.9,0-1.9-0.2-2.8-0.6c-1.3-0.6-2.2-1.5-2.8-2.2c0,0-0.1-0.1-0.1-0.1
c-0.7,1.3-1.5,4.3-1.8,8.7h11c1.5,0,2.8-0.2,4-0.7c1.2-0.5,2.2-1.1,3-1.9c0.8-0.8,1.4-1.8,1.9-2.9c0.5-1.2,0.7-2.5,0.7-4v-9.5
C42.6,22.3,42.4,20.9,41.9,19.7z M23.6,31.3c1.4,0,2.2,2.2,4,3c2.4,1.1,5.7,0.2,6.5-6.2c0.8-6.4-2.4-7.3-5-6.2
c-2,0.8-3.3,3-4.7,3c-1.8,0-2.6-4.1-1.5-10.8h-2.1c-1.5,0-2.8,0.2-4,0.7c-1.2,0.5-2.2,1.1-3,1.9c-0.8,0.8-1.5,1.8-1.9,3
c-0.5,1.2-0.7,2.5-0.7,4v9.5c0,1.5,0.2,2.9,0.7,4c0.5,1.2,1.1,2.1,1.9,2.9c0.8,0.8,1.8,1.4,3,1.9c0.8,0.3,1.7,0.5,2.7,0.6
C19.9,35.7,21.8,31.3,23.6,31.3z"/>
</g>
<g>
<path fill="#4F79F7" d="M425,3.6l-8.4,46.9c-0.2,0.9-0.6,1.7-1.3,2.4c-0.7,0.7-1.4,1.1-2.4,1.3c-1,0.2-1.9,0.1-2.7-0.3
c-0.8-0.4-1.5-1-2-1.7l-16.6-27.3L375,52.2c-0.4,0.7-0.9,1.2-1.6,1.6s-1.4,0.6-2.2,0.6c-1.1,0-2.1-0.3-2.9-1
c-0.8-0.7-1.3-1.6-1.5-2.7l-8.4-46.9h9.2l6,33l14.3-22.8c0.4-0.7,0.9-1.2,1.6-1.6c0.7-0.4,1.4-0.6,2.2-0.6c0.8,0,1.5,0.2,2.2,0.6
c0.7,0.4,1.2,0.9,1.7,1.6l14.2,22.8l6-33H425z"/>
<path fill="#4F79F7" d="M509,40.9c0,0.9-0.1,1.8-0.3,2.7c-0.2,1-0.5,1.9-0.9,2.8c-0.4,0.9-1,1.8-1.6,2.7
c-0.7,0.9-1.5,1.6-2.4,2.3c-0.9,0.7-2,1.2-3.3,1.6c-1.2,0.4-2.6,0.6-4.2,0.6h-16.4c-0.9,0-1.8-0.1-2.7-0.3
c-1-0.2-1.9-0.5-2.8-0.9c-0.9-0.4-1.8-1-2.7-1.6c-0.9-0.7-1.6-1.5-2.3-2.4c-0.7-0.9-1.2-2-1.6-3.3c-0.4-1.2-0.6-2.6-0.6-4.2V0
h9.1v40.9c0,1.1,0.3,2,1,2.7c0.7,0.7,1.6,1,2.6,1h16.4c1.1,0,2-0.3,2.7-1c0.6-0.7,1-1.6,1-2.7V28.7c0-1.1-0.3-2-1-2.7
c-0.7-0.6-1.5-1-2.6-1h-16.4v-9.1h16.4c0.9,0,1.8,0.1,2.7,0.3c1,0.2,1.9,0.5,2.8,0.9c0.9,0.4,1.8,1,2.7,1.6
c0.9,0.7,1.6,1.5,2.3,2.4c0.7,0.9,1.2,2,1.6,3.3c0.4,1.2,0.6,2.6,0.6,4.2V40.9z"/>
<path fill="#4F79F7" d="M465.1,28.3c0,1.3-0.2,2.6-0.7,4c-0.4,1.4-1.2,2.8-2.1,4c-1,1.2-2.3,2.3-3.9,3.1
c-1.6,0.8-3.5,1.3-5.8,1.3h-16.3v-8.6h16.3c1.2,0,2.2-0.4,2.8-1.1c0.7-0.8,1-1.7,1-2.8c0-1.2-0.4-2.1-1.1-2.8
c-0.8-0.7-1.7-1-2.7-1h-16.3c-1.2,0-2.2,0.4-2.9,1.1c-0.7,0.8-1,1.7-1,2.8V41c0,1.2,0.4,2.1,1.1,2.8c0.8,0.7,1.7,1,2.8,1H460v8.6
h-23.7c-1.3,0-2.6-0.2-4-0.7c-1.4-0.4-2.8-1.2-4-2.1c-1.2-1-2.3-2.3-3.1-3.9c-0.8-1.6-1.2-3.5-1.2-5.8V28.3c0-1.3,0.2-2.6,0.7-4
c0.4-1.4,1.2-2.8,2.1-4c1-1.2,2.3-2.3,3.9-3.1c1.6-0.8,3.5-1.3,5.8-1.3h16.3c1.3,0,2.6,0.2,4,0.7c1.4,0.4,2.8,1.2,4,2.1
c1.2,1,2.3,2.3,3.1,3.9C464.6,24.1,465.1,26.1,465.1,28.3z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -20,64 +20,29 @@
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
// General About dialog styling // General About dialog styling
// Depends on styles loaded via /platform/commonUI/general/res/sass/startup-base.scss
.l-about { .l-about {
// Layout
&.abs { &.abs {
// top: 20px;
overflow: auto; overflow: auto;
} }
$contentH: 200px; $contentH: 200px;
.l-logo-holder { .l-splash {
position: relative; position: relative;
height: 45%; height: 45%;
.l-logo {
$w: 5%;
position: absolute;
&.l-logo-app {
// @include test(blue);
top: 0; right: 15%; bottom: 0; left: 15%;
}
&.s-logo-nasa {
// @include test(red);
$m: 10px;
background-image: url($dirImgs + 'logo-nasa.svg');
top: $m; right: auto; bottom: auto; left: $m;
width: $w * 2; height: auto; padding-bottom: $w; padding-top: $w;
}
}
} }
.l-content { .l-content {
// @include test();
position: relative; position: relative;
margin-top: $interiorMarginLg; margin-top: $interiorMarginLg;
} }
} }
.s-about { .s-about {
// Styling
line-height: 120%; line-height: 120%;
a { a {
color: $colorAboutLink; color: $colorAboutLink;
} }
.s-description, .s-description,
.s-info {
// font-size: 0.8em;
}
.s-logo-holder {
background: url($dirImgs + "bg-about-openmctweb.jpg") no-repeat center; // For OpenMCT Web.
background-size: cover;
}
.s-logo {
// @include txtShdwLarge(); // text-shadow doesn't work for svg
background-position: center;
background-repeat: no-repeat;
background-size: contain;
}
.s-logo-openmctweb {
background-image: url($dirImgs + 'logo-openmctweb-shdw.svg');
}
.s-btn { .s-btn {
line-height: 2em; line-height: 2em;
} }
@ -90,10 +55,6 @@
} }
em { em {
color: pushBack($colorBodyFg, 20%); color: pushBack($colorBodyFg, 20%);
// margin-left: 2em;
&:first-child {
// margin-left: 0;
}
} }
h3 { h3 {
font-size: 1.25em; font-size: 1.25em;
@ -104,4 +65,3 @@
} }
} }
} }

View File

@ -40,7 +40,7 @@ $ueTopBarEditH: 30px;
$ueTopBarBtnH: 35px; $ueTopBarBtnH: 35px;
$ueFooterH: 25px; $ueFooterH: 25px;
$ueColMargin: 1.5%; $ueColMargin: 1.5%;
$ueAppLogoW: 105px; $ueAppLogoW: 80px;
$ueEditToolBarH: 25px; $ueEditToolBarH: 25px;
$ueCollapsedPaneEdgeM: 22px; $ueCollapsedPaneEdgeM: 22px;
$uePaneMiniTabH: $ueTopBarH; $uePaneMiniTabH: $ueTopBarH;

View File

@ -19,26 +19,6 @@
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
.disabled,
a.disabled {
opacity: $controlDisabledOpacity;
pointer-events: none !important;
cursor: default !important;
}
.incised {
@include boxIncised(0.8);
border-bottom: 1px solid rgba(#fff, 0.3);
}
.test-stripes {
@include bgDiagonalStripes();
}
.test {
@include test();
}
@mixin pulse($animName: pulse, $dur: 500ms, $iteration: infinite, $opacity0: 0.5, $opacity100: 1) { @mixin pulse($animName: pulse, $dur: 500ms, $iteration: infinite, $opacity0: 0.5, $opacity100: 1) {
@include keyframes($animName) { @include keyframes($animName) {
0% { opacity: $opacity0; } 0% { opacity: $opacity0; }

View File

@ -112,6 +112,13 @@ mct-container {
padding: 1em; padding: 1em;
} }
.disabled,
a.disabled {
opacity: $controlDisabledOpacity;
pointer-events: none !important;
cursor: default !important;
}
.align-right { .align-right {
text-align: right; text-align: right;
} }
@ -158,4 +165,12 @@ mct-container {
.sep { .sep {
color: rgba(#fff, 0.2); color: rgba(#fff, 0.2);
} }
.test-stripes {
@include bgDiagonalStripes();
}
.test {
@include test();
}

View File

@ -32,14 +32,16 @@
color: $colorInspectorFg; color: $colorInspectorFg;
line-height: 140%; line-height: 140%;
.flex-elem.holder:not(:last-child) { margin-bottom: $interiorMargin; } .flex-elem.holder:not(:last-child) {
margin-bottom: $interiorMargin;
}
.pane-header { .pane-header {
color: pushBack($colorInspectorFg, 20%); color: pushBack($colorInspectorFg, 20%);
font-size: 0.8rem; font-size: 0.8rem;
&:before { &:before {
color: pushBack($colorInspectorFg, 10%); color: pushBack($colorInspectorFg, 10%);
content:'\e615'; // e615 Crosshair symbol content: '\e615'; // e615 Crosshair symbol
display: inline; display: inline;
font-family: symbolsfont; font-family: symbolsfont;
margin-right: $interiorMargin; margin-right: $interiorMargin;
@ -56,14 +58,28 @@
} }
} }
} }
.l-inspector-part {
ul {
box-sizing: border-box; box-sizing: border-box;
padding-right: $interiorMargin; padding-right: $interiorMargin;
.form {
margin-left: $treeVCW + $interiorMarginLg;
margin-bottom: $interiorMarginLg;
.form-section {
margin-bottom: 0;
&:not(.first) {
border-top: 1px solid $colorFormLines;
}
.form-row {
@include align-items(center);
border: none;
padding: 0;
}
}
}
} }
ul li, ul li,
em { em.t-inspector-part-header {
display: block; display: block;
position: relative; position: relative;
} }
@ -71,8 +87,8 @@
ul li { ul li {
margin-bottom: $interiorMarginLg; margin-bottom: $interiorMarginLg;
} }
em { em.t-inspector-part-header {
border-radius: $basicCr; border-radius: $basicCr;
background-color: $colorInspectorSectionHeaderBg; background-color: $colorInspectorSectionHeaderBg;
color: $colorInspectorSectionHeaderFg; color: $colorInspectorSectionHeaderFg;
@ -154,8 +170,16 @@
} }
} }
mct-representation:not(.s-status-editing) .l-inspect {
.split-pane-component.pane.top {
bottom: 0 !important;
}
}
.s-status-editing .l-inspect { .s-status-editing .l-inspect {
.location-item { pointer-events: none; } .location-item {
pointer-events: none;
}
.splitter-inspect-panel, .splitter-inspect-panel,
.split-pane-component.pane.bottom { .split-pane-component.pane.bottom {
opacity: 1; opacity: 1;

View File

@ -0,0 +1,64 @@
/*****************************************************************************
* 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.
*****************************************************************************/
.l-splash,
.l-splash:before,
.l-splash:after {
background-position: center;
background-repeat: no-repeat;
position: absolute;
}
.l-splash {
background-size: cover;
top: 0;
right: 0;
bottom: 0;
left: 0;
&:before,
&:after {
background-size: contain;
content: '';
}
&:before {
// NASA logo, dude
$w: 5%;
$m: 10px;
background-image: url('../images/logo-nasa.svg');
top: $m;
right: auto;
bottom: auto;
left: $m;
height: auto;
width: $w * 2;
padding-bottom: $w;
padding-top: $w;
}
&:after {
// App logo
top: 0;
right: 15%;
bottom: 0;
left: 15%;
}
}

View File

@ -83,7 +83,6 @@
.l-control-group { .l-control-group {
// Buttons that have a conceptual grouping - internal space between, and a divider between groups. // Buttons that have a conceptual grouping - internal space between, and a divider between groups.
// @include test();
box-sizing: border-box; box-sizing: border-box;
border-left: 1px solid $colorInteriorBorder; border-left: 1px solid $colorInteriorBorder;
display: inline-block; display: inline-block;
@ -109,31 +108,29 @@
font-size: 0.7rem; font-size: 0.7rem;
} }
label.checkbox.custom { label.checkbox.custom,
label.radio.custom {
$bg: pullForward($colorBodyBg, 10%); $bg: pullForward($colorBodyBg, 10%);
$d: $formRowCtrlsH; $d: $formRowCtrlsH;
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
line-height: $d;
margin-right: $interiorMargin * 4; margin-right: $interiorMargin * 4;
padding-left: $d + $interiorMargin; padding-left: $d + $interiorMargin;
position: relative; position: relative;
vertical-align: middle; // was top
em { em {
color: $colorBodyFg; color: $colorBodyFg;
display: inline-block; display: inline-block;
height: $d; height: $d;
min-width: $d; width: $d;
&:before { &:before {
border-radius: $basicCr * .75; border-radius: $basicCr * .75;
background: $bg; background: $bg;
box-shadow: inset rgba(black, 0.4) 0 1px 2px; box-shadow: inset rgba(black, 0.4) 0 1px 2px;
box-sizing: border-box; box-sizing: border-box;
content: " "; content: "";
font-family: 'symbolsfont'; font-family: 'symbolsfont';
font-size: 0.8em; font-size: 0.7em;
display: inline-block; display: inline-block;
margin-right: $interiorMargin;
height: $d; height: $d;
width: $d; width: $d;
left: 0; left: 0;
@ -157,11 +154,13 @@ label.checkbox.custom {
&:checked ~ em:before { &:checked ~ em:before {
background: $colorCheck; background: $colorCheck;
color: lighten($colorCheck, 50%); color: lighten($colorCheck, 50%);
content: "2";
} }
} }
} }
label.checkbox.custom input:checked ~ em:before { content: "\32"; }
label.radio.custom input:checked ~ em:before { content: "\e619"; }
.input-labeled { .input-labeled {
margin-left: $interiorMargin; margin-left: $interiorMargin;
label { label {
@ -333,7 +332,7 @@ body.desktop .object-header {
/******************************************************** SLIDERS */ /******************************************************** SLIDERS */
.slider { .slider {
$knobH: 100%; //14px; $knobH: 100%;
.slot { .slot {
width: auto; width: auto;
position: absolute; position: absolute;
@ -369,7 +368,7 @@ body.desktop .object-header {
background-color: $sliderColorRange; background-color: $sliderColorRange;
cursor: ew-resize; cursor: ew-resize;
position: absolute; position: absolute;
top: 0; //$tbOffset; top: 0;
right: auto; right: auto;
bottom: 0; bottom: 0;
left: auto; left: auto;

View File

@ -36,43 +36,49 @@
} }
} }
mct-include.status-block-holder { // Status coloring
// mct-include that wraps status.block .ok, .info {
// Must use display: inline-block to fix white space problems .status-indicator {
display: inline-block; color: $colorStatusInfo;
}
} }
.status.block { .alert, .caution, .warning {
.status-indicator, .count {
color: $colorStatusAlert;
}
}
.error, .err {
.status-indicator, .count {
color: $colorStatusError;
}
}
.available {
.status-indicator, .count {
color: $colorStatusAvailable;
}
}
.status-block-holder {
// Applied to mct-include element
// Contains status.block elements
$transDelay: 1.5s; $transDelay: 1.5s;
$transSpeed: .25s; $transSpeed: .25s;
color: $colorStatusDefault; display: inline-block;
display: inline-block;
margin-right: $interiorMargin;
.status-indicator,
.label,
.count {
display: inline-block;
vertical-align: top;
}
&.clickable { cursor: pointer; } &.clickable { cursor: pointer; }
&:not(.clickable) { cursor: default; } &:not(.clickable) { cursor: default; }
&.no-icon .status.block {
&.no-icon {
.status-indicator { .status-indicator {
display: none; display: none;
} }
} }
&.float-right { &.float-right {
float: right; float: right;
} }
&:not(.no-collapse) .status.block {
.status-indicator {
margin-right: $interiorMarginSm;
}
&:not(.no-collapse) {
.label { .label {
// Max-width silliness is necessary for width transition // Max-width silliness is necessary for width transition
@include trans-prop-nice(max-width, $transSpeed, $transDelay); @include trans-prop-nice(max-width, $transSpeed, $transDelay);
@ -92,21 +98,25 @@ mct-include.status-block-holder {
} }
} }
&.ok .status-indicator, }
&.info .status-indicator {
color: $colorStatusInfo; .status.block {
$transDelay: 1.5s;
$transSpeed: .25s;
color: $colorStatusDefault;
display: inline-block;
margin-right: $interiorMargin;
.status-indicator,
.label,
.count {
display: inline-block;
vertical-align: top;
} }
&.alert .status-indicator,
&.warning .status-indicator, .status-indicator {
&.caution .status-indicator { margin-right: $interiorMarginSm;
color: $colorStatusAlert;
} }
&.error .status-indicator {
color: $colorStatusError;
}
&.available .status-indicator {
color: $colorStatusAvailable;
}
.count { .count {
@include trans-prop-nice(opacity, $transSpeed, $transDelay); @include trans-prop-nice(opacity, $transSpeed, $transDelay);
font-weight: bold; font-weight: bold;
@ -191,12 +201,6 @@ mct-include.status-block-holder {
z-index: 10; z-index: 10;
} }
.s-message-banner {
//@include transition-property(left, opacity);
//@include transition-duration(0.35s);
//@include transition-timing-function(ease-in-out);
}
.s-message-banner { .s-message-banner {
border-radius: $controlCr; border-radius: $controlCr;
@include statusBannerColors($colorStatusDefault, $colorStatusFg); @include statusBannerColors($colorStatusDefault, $colorStatusFg);

View File

@ -23,7 +23,6 @@
border-radius: $basicCr; border-radius: $basicCr;
background: $colorFormSectionHeader; background: $colorFormSectionHeader;
$c: lighten($colorBodyFg, 20%); $c: lighten($colorBodyFg, 20%);
//border-bottom: 1px solid rgba(#fff, 0.3);
color: $c; color: $c;
font-size: 0.8em; font-size: 0.8em;
padding: $formTBPad $formLRPad; padding: $formTBPad $formLRPad;
@ -32,6 +31,7 @@
.form { .form {
color: $colorFormText; color: $colorFormText;
width: 100%;
.form-section { .form-section {
position: relative; position: relative;
margin-bottom: $interiorMarginLg * 2; margin-bottom: $interiorMarginLg * 2;
@ -60,28 +60,24 @@
>.label { >.label {
// Only style this way for immediate children of .form-row; prevents problems when .label is used in .controls section of a form // Only style this way for immediate children of .form-row; prevents problems when .label is used in .controls section of a form
//@include test(orange, 0.05);
float: left;
min-width: 120px; min-width: 120px;
order: 1;
position: relative; position: relative;
white-space: nowrap; white-space: nowrap;
width: $formLabelW; width: $formLabelW;
} }
.value { .value {
color: $colorInputFg; //lighten($colorBodyFg, 20%); color: $colorInputFg;
} }
.controls { .controls {
float: left; order: 2;
position: relative; position: relative;
width: 99.9% - $formLabelW; // Start with less than 100% for Firefox @include flex(1 1 auto);
.l-composite-control { .l-composite-control {
// display: inline-block;
&.l-checkbox { &.l-checkbox {
// @include test();
// height: $formRowCtrlsH;
display: inline-block; display: inline-block;
line-height: $formRowCtrlsH; line-height: $formRowCtrlsH;
margin-right: 5px; margin-right: 5px;
@ -115,7 +111,6 @@
$h: 150px; $h: 150px;
position: relative; position: relative;
height: $h; height: $h;
// max-width: 50%;
>.wrapper { >.wrapper {
$p: $interiorMargin; $p: $interiorMargin;
overflow: auto; overflow: auto;
@ -129,6 +124,37 @@
} }
} }
.l-controls-first {
.form .form-row {
margin-top: $interiorMarginSm;
>.label,
>.controls {
line-height: inherit;
min-height: inherit;;
}
>.label {
@include flex(1 1 auto);
min-width: 0;
width: auto;
order: 2;
}
>.controls {
@include flex(0 0 auto);
margin-right: $interiorMargin;
order: 1;
}
}
}
.no-validate {
.form .form-row >.label {
padding-right: 0;
&:after {
display: none;
}
}
}
label.form-control.checkbox { label.form-control.checkbox {
input { input {
margin-right: $interiorMargin; margin-right: $interiorMargin;

View File

@ -0,0 +1,39 @@
/*****************************************************************************
* 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.
*****************************************************************************/
.app-logo {
background: url('../images/logo-app.svg') no-repeat center center;
}
.l-splash-holder {
background: #333;
.s-splash {
border-radius: 10px;
box-shadow: 0 5px 50px 25px rgba(255, 255, 255, 0.1);
}
}
.s-splash {
background-image: url('../images/bg-splash.jpg');
&:after {
background-image: url('../images/logo-app-shdw.svg');
}
}

View File

@ -0,0 +1,70 @@
/*****************************************************************************
* 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.
*****************************************************************************/
@import "bourbon";
@import "logo-and-bg";
@mixin splashElem($m: 20%) {
top: $m; right: $m * 1.25; bottom: $m; left: $m * 1.25;
}
.l-splash-holder {
// Main outer holder.
@include transition-property(opacity);
@include transition-duration(500ms);
@include transition-timing-function(ease-in-out);
@include transition-delay(1s);
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10000;
opacity: 1;
&.fadeout {
opacity: 0;
pointer-events: none;
}
.l-splash {
// The splash element.
@include splashElem();
}
}
@media only screen and (max-device-width: 767px) {
.l-splash-holder .l-splash {
@include splashElem(0);
border-radius: 0;
box-shadow: none;
}
}
@media only screen and (max-device-width: 767px) and (orientation: portrait) {
.l-splash-holder .l-splash {
&:before {
// Make the NASA logo a bit bigger when we're in portrait mode.
$w: 12%;
width: $w * 2;
padding-bottom: $w;
padding-top: $w;
}
}
}

View File

@ -94,15 +94,13 @@
z-index: 1; z-index: 1;
} }
.app-logo { .app-logo {
background-position: right center;
box-sizing: border-box; box-sizing: border-box;
@include absPosDefault($interiorMargin); @include absPosDefault($interiorMargin - 1);
cursor: pointer; cursor: pointer;
left: auto; left: auto; right: $interiorMargin;
width: $ueAppLogoW; width: $ueAppLogoW;
z-index: 2; z-index: 2;
&.logo-openmctweb {
background: url($dirImgs + 'logo-openmctweb.svg') no-repeat center center;
}
} }
} }
} }

View File

@ -24,7 +24,8 @@
<mct-include ng-repeat="indicator in bar.getIndicators()" <mct-include ng-repeat="indicator in bar.getIndicators()"
ng-model="indicator.ngModel" ng-model="indicator.ngModel"
key="indicator.template" key="indicator.template"
class="status-block-holder"> class="status-block-holder"
ng-class='indicator.ngModel.getGlyphClass()'>
</mct-include> </mct-include>
</div> </div>
<mct-include key="'message-banner'"></mct-include> <mct-include key="'message-banner'"></mct-include>

View File

@ -23,7 +23,6 @@
<div class='status block' <div class='status block'
title="{{ngModel.getDescription()}}" title="{{ngModel.getDescription()}}"
ng-click='ngModel.configure()' ng-click='ngModel.configure()'
ng-class='ngModel.getGlyphClass()'
ng-show="ngModel.getText().length > 0"> ng-show="ngModel.getText().length > 0">
<span class="ui-symbol status-indicator"> <span class="ui-symbol status-indicator">
{{ngModel.getGlyph()}} {{ngModel.getGlyph()}}
@ -32,6 +31,5 @@
{{ngModel.getText()}} {{ngModel.getText()}}
<a class="s-btn ui-symbol" ng-if="ngModel.configure">G</a> <a class="s-btn ui-symbol" ng-if="ngModel.configure">G</a>
</span><span class="count"> </span><span class="count">
<!-- Add int count value here if this type of indicator has one or more messages associated with it -->
</span> </span>
</div> </div>

View File

@ -19,55 +19,24 @@
this source code distribution or the Licensing information page available this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<span class="l-inspect" ng-controller="ObjectInspectorController as controller"> <span class="l-inspect">
<div ng-controller="PaneController as modelPaneEdit"> <div ng-controller="PaneController as modelPaneEdit">
<mct-split-pane class='abs contents split-layout' anchor='bottom'> <mct-split-pane class='abs contents split-layout' anchor='bottom'>
<div class="split-pane-component pane top"> <div class="split-pane-component pane top">
<div class="abs holder holder-inspector l-flex-col"> <div class="abs holder holder-inspector l-flex-col">
<div class="pane-header flex-elem">Inspection</div> <div class="pane-header flex-elem">Inspection</div>
<ul class="flex-elem grows vscroll"> <mct-representation
<li> key="'inspector-region'"
<em>Properties</em> mct-object="domainObject"
<div class="inspector-properties" ng-model="ngModel"
ng-repeat="data in metadata" class="flex-elem grows vscroll l-flex-col">
ng-class="{ first:$index === 0 }"> </mct-representation>
<div class="label">{{ data.name }}</div>
<div class="value">{{ data.value }}</div>
</div>
</li>
<li ng-if="contextutalParents.length > 0">
<em title="The location of this linked object.">Location</em>
<span class="inspector-location"
ng-repeat="parent in contextutalParents"
ng-class="{ last:($index + 1) === contextualParents.length }">
<mct-representation key="'label'"
mct-object="parent"
ng-model="ngModel"
ng-click="ngModel.selectedObject = parent"
class="location-item">
</mct-representation>
</span>
</li>
<li ng-if="primaryParents.length > 0">
<em title="The location of the original object that this was linked from.">Original Location</em>
<span class="inspector-location"
ng-repeat="parent in primaryParents"
ng-class="{ last:($index + 1) === primaryParents.length }">
<mct-representation key="'label'"
mct-object="parent"
ng-model="ngModel"
ng-click="ngModel.selectedObject = parent"
class="location-item">
</mct-representation>
</span>
</li>
</ul>
</div><!--/ holder-inspector --> </div><!--/ holder-inspector -->
</div><!--/ split-pane-component --> </div><!--/ split-pane-component -->
<mct-splitter class="splitter-inspect-panel mobile-hide"></mct-splitter> <mct-splitter class="splitter-inspect-panel mobile-hide"></mct-splitter>
<div class="split-pane-component pane bottom"> <div class="split-pane-component pane bottom">
<div class="abs holder holder-elements l-flex-col"> <div class="abs holder holder-elements l-flex-col">
<em class="flex-elem">Elements</em> <em class="flex-elem t-inspector-part-header">Elements</em>
<mct-representation <mct-representation
key="'edit-elements'" key="'edit-elements'"
mct-object="domainObject" mct-object="domainObject"

View File

@ -0,0 +1,46 @@
/*****************************************************************************
* 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 (
) {
'use strict';
function SplashScreenManager($document) {
var splash;
$document = $document[0];
splash = $document.querySelectorAll('.l-splash-holder')[0];
if (!splash) {
return;
}
splash.className += ' fadeout';
splash.addEventListener('transitionend', function () {
splash.parentNode.removeChild(splash);
});
}
return SplashScreenManager;
});

View File

@ -47,13 +47,7 @@ define(
// Initialize container map from extensions // Initialize container map from extensions
containers.forEach(function (container) { containers.forEach(function (container) {
var key = container.key; containerMap[container.key] = container;
containerMap[key] = Object.create(container);
containerMap[key].templateUrl = [
container.bundle.path,
container.bundle.resources,
container.templateUrl
].join("/");
}); });
return { return {
@ -85,13 +79,11 @@ define(
scope[alias] = copiedAttributes; scope[alias] = copiedAttributes;
}, },
// Get the template URL for this container, based template: function (element, attrs) {
// on its attributes. var key = attrs.key,
templateUrl: function (element, attrs) { container = containerMap[key];
var key = attrs.key; return container ? container.template : "";
return containerMap[key].templateUrl;
} }
}; };
} }

View File

@ -0,0 +1,91 @@
/*****************************************************************************
* 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,describe,beforeEach,jasmine,it,expect*/
define([
'../src/SplashScreenManager'
], function (SplashScreenManager) {
'use strict';
describe('SplashScreenManager', function () {
var $document,
splashElement;
beforeEach(function () {
$document = jasmine.createSpyObj(
'$document',
['querySelectorAll']
);
splashElement = jasmine.createSpyObj(
'splashElement',
['addEventListener']
);
splashElement.parentNode = jasmine.createSpyObj(
'splashParent',
['removeChild']
);
splashElement.className = 'some-class-name';
$document.querySelectorAll.andReturn([splashElement]);
});
describe('when element exists', function () {
beforeEach(function () {
$document.querySelectorAll.andReturn([splashElement]);
new SplashScreenManager([$document]);
});
it('adds fade out class', function () {
expect(splashElement.className).toBe('some-class-name fadeout');
});
it('removes the element when the transition ends', function () {
expect(splashElement.addEventListener)
.toHaveBeenCalledWith(
'transitionend',
jasmine.any(Function)
);
expect(splashElement.parentNode.removeChild)
.not
.toHaveBeenCalled();
splashElement.addEventListener.mostRecentCall.args[1]();
expect(splashElement.parentNode.removeChild)
.toHaveBeenCalledWith(splashElement);
});
});
it('does not error when element doesn\'t exist', function () {
$document.querySelectorAll.andReturn([]);
function run() {
new SplashScreenManager([$document]);
}
expect(run).not.toThrow();
});
});
});

View File

@ -30,12 +30,12 @@ define(
var testContainers = [ var testContainers = [
{ {
bundle: { path: "a", resources: "b" }, bundle: { path: "a", resources: "b" },
templateUrl: "c/template.html", template: "<div>foo</div>",
key: "abc" key: "abc"
}, },
{ {
bundle: { path: "x", resources: "y" }, bundle: { path: "x", resources: "y" },
templateUrl: "z/template.html", template: "<span>bar</span>",
key: "xyz", key: "xyz",
attributes: [ "someAttr", "someOtherAttr" ] attributes: [ "someAttr", "someOtherAttr" ]
} }
@ -55,15 +55,15 @@ define(
}); });
it("chooses a template based on key", function () { it("chooses a template based on key", function () {
expect(mctContainer.templateUrl( expect(mctContainer.template(
undefined, undefined,
{ key: "abc" } { key: "abc" }
)).toEqual("a/b/c/template.html"); )).toEqual(testContainers[0].template);
expect(mctContainer.templateUrl( expect(mctContainer.template(
undefined, undefined,
{ key: "xyz" } { key: "xyz" }
)).toEqual("x/y/z/template.html"); )).toEqual(testContainers[1].template);
}); });
it("copies attributes needed by the container", function () { it("copies attributes needed by the container", function () {

View File

@ -25,11 +25,19 @@ define([
"./src/gestures/InfoGesture", "./src/gestures/InfoGesture",
"./src/gestures/InfoButtonGesture", "./src/gestures/InfoButtonGesture",
"./src/services/InfoService", "./src/services/InfoService",
"text!./res/info-table.html",
"text!./res/info-bubble.html",
"text!./res/bubble.html",
"text!./res/templates/info-button.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
InfoGesture, InfoGesture,
InfoButtonGesture, InfoButtonGesture,
InfoService, InfoService,
infoTableTemplate,
infoBubbleTemplate,
bubbleTemplate,
infoButtonTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -39,17 +47,17 @@ define([
"templates": [ "templates": [
{ {
"key": "info-table", "key": "info-table",
"templateUrl": "info-table.html" "template": infoTableTemplate
}, },
{ {
"key": "info-bubble", "key": "info-bubble",
"templateUrl": "info-bubble.html" "template": infoBubbleTemplate
} }
], ],
"containers": [ "containers": [
{ {
"key": "bubble", "key": "bubble",
"templateUrl": "bubble.html", "template": bubbleTemplate,
"attributes": [ "attributes": [
"bubbleTitle", "bubbleTitle",
"bubbleLayout" "bubbleLayout"
@ -99,7 +107,7 @@ define([
"representations": [ "representations": [
{ {
"key": "info-button", "key": "info-button",
"templateUrl": "templates/info-button.html", "template": infoButtonTemplate,
"gestures": [ "gestures": [
"infobutton" "infobutton"
] ]

View File

@ -25,11 +25,13 @@ define([
"./src/NotificationIndicatorController", "./src/NotificationIndicatorController",
"./src/NotificationIndicator", "./src/NotificationIndicator",
"./src/NotificationService", "./src/NotificationService",
"text!./res/notification-indicator.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
NotificationIndicatorController, NotificationIndicatorController,
NotificationIndicator, NotificationIndicator,
NotificationService, NotificationService,
notificationIndicatorTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -53,7 +55,7 @@ define([
"templates": [ "templates": [
{ {
"key": "notificationIndicatorTemplate", "key": "notificationIndicatorTemplate",
"templateUrl": "notification-indicator.html" "template": notificationIndicatorTemplate
} }
], ],
"controllers": [ "controllers": [

View File

@ -1,10 +1,9 @@
<!-- DO NOT ADD SPACES BETWEEN THE SPANS - IT ADDS WHITE SPACE!! -->
<span ng-show="notifications.length > 0" class="status block" <span ng-show="notifications.length > 0" class="status block"
ng-class="highest.severity" ng-class="highest.severity"
ng-controller="NotificationIndicatorController"> ng-controller="NotificationIndicatorController">
<span class="ui-symbol status-indicator">&#xe610;</span> <span class="ui-symbol status-indicator">&#xe610;</span><span class="label">
<span class="label">
<a ng-click="showNotificationsList()">{{notifications.length}} <a ng-click="showNotificationsList()">{{notifications.length}}
Notifications</a> Notifications</a>
</span> </span><span class="count">{{notifications.length}}</span>
<span class="count">{{notifications.length}}</span>
</span> </span>

View File

@ -0,0 +1,55 @@
/*****************************************************************************
* 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([
'./src/InspectorController',
'./src/EditableRegionPolicy',
'legacyRegistry'
], function (
InspectorController,
EditableRegionPolicy,
legacyRegistry
) {
"use strict";
legacyRegistry.register("platform/commonUI/regions", {
"extensions": {
"controllers": [
{
"key": "InspectorController",
"implementation": InspectorController,
"depends": [
"$scope",
"policyService"
]
}
],
"policies": [
{
"category": "region",
"implementation": EditableRegionPolicy
}
]
}
});
});

View File

@ -0,0 +1,57 @@
/*****************************************************************************
* 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 () {
"use strict";
/**
* A policy for determining whether a region part should be visible or
* not, based on its editability and the current state of the domain
* object .
* @constructor
* @implements {Policy}
* @memberof platform/commonUI/regions
*/
function EditableRegionPolicy() {
}
EditableRegionPolicy.prototype.allow = function (regionPart, domainObject) {
if (!regionPart.modes){
return true;
}
if (domainObject.getCapability('status').get('editing')){
//If the domain object is in edit mode, only include a part
// if it is marked editable
return regionPart.modes.indexOf('edit') !== -1;
} else {
//If the domain object is not in edit mode, return any parts
// that are not explicitly marked editable
return regionPart.modes.indexOf('browse') !== -1;
}
};
return EditableRegionPolicy;
}
);

View File

@ -0,0 +1,56 @@
/*****************************************************************************
* 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,Promise*/
define(
['../../browse/src/InspectorRegion'],
function (InspectorRegion) {
"use strict";
/**
* The InspectorController adds region data for a domain object's type
* to the scope.
*
* @constructor
*/
function InspectorController($scope, policyService) {
var domainObject = $scope.domainObject,
typeCapability = domainObject.getCapability('type');
/**
* Filters region parts to only those allowed by region policies
* @param regions
* @returns {{}}
*/
function filterRegions(inspector) {
//Dupe so we're not modifying the type definition.
return inspector.regions && inspector.regions.filter(function(region) {
return policyService.allow('region', region, domainObject);
});
}
$scope.regions = filterRegions(typeCapability.getDefinition().inspector || new InspectorRegion());
}
return InspectorController;
}
);

View File

@ -0,0 +1,101 @@
/*****************************************************************************
* 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,window*/
define(
[],
function () {
"use strict";
/**
* @typeDef {object} PartContents
* @property {string} key If the part is defined as a
* representation, the key corresponding to the representation.
* @memberOf platform/commonUI/regions
*/
/**
* @typeDef {object} RegionConfiguration
* @property {string} name A unique name for this region part
* @property {PartContents} [content] the details of the region being
* defined
* @property {Array<string>} [modes] the modes that this region
* should be included in. Options are 'edit' and 'browse'. By
* default, will be included in both. Inclusion of regions is
* determined by policies of category 'region'. By default, the
* {EditableRegionPolicy} will be applied.
* @memberOf platform/commonUI/regions
*/
/**
* Defines the interface for a screen region. A screen region is a
* section of the browse an edit screens for an object. Regions are
* declared in object type definitions.
* @memberOf platform/commonUI/regions
* @abstract
* @constructor
*/
function Region(configuration) {
configuration = configuration || {};
this.name = configuration.name;
this.content = configuration.content;
this.modes = configuration.modes;
this.regions = [];
}
/**
* Adds a sub-region to this region.
* @param {Region} region the part to add
* @param {number} [index] the position to insert the region. By default
* will add to the end
*/
Region.prototype.addRegion = function (region, index){
if (index) {
this.regions.splice(index, 0, region);
} else {
this.regions.push(region);
}
};
/**
* Removes a sub-region from this region.
* @param {Region | number | strnig} region The region to
* remove. If a number, will remove the region at that index. If a
* string, will remove the region with the matching name. If an
* object, will attempt to remove that object from the Region
*/
Region.prototype.removeRegion = function (region){
if (typeof region === 'number') {
this.regions.splice(region, 1);
} else if (typeof region === 'string'){
this.regions = this.regions.filter(function(thisRegion) {
return thisRegion.name !== region;
});
} else {
this.regions.splice(this.regions.indexOf(region), 1);
}
};
return Region;
}
);

View File

@ -0,0 +1,75 @@
/*****************************************************************************
* 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,describe,it,expect,beforeEach,waitsFor,jasmine */
define(
['../src/EditableRegionPolicy'],
function (EditableRegionPolicy) {
"use strict";
describe("The editable region policy ", function () {
var editableRegionPolicy,
mockDomainObject,
mockStatusCapability,
mockBrowseRegionPart = {
modes: 'browse'
},
mockEditRegionPart = {
modes: 'edit'
},
mockAllModesRegionPart = {};
beforeEach(function(){
editableRegionPolicy = new EditableRegionPolicy();
mockStatusCapability = jasmine.createSpyObj("statusCapability", [
"get"
]);
mockDomainObject = jasmine.createSpyObj("domainObject", [
"getCapability"
]);
mockDomainObject.getCapability.andReturn(mockStatusCapability);
});
it("includes only browse region parts for object not in edit mode", function() {
mockStatusCapability.get.andReturn(false);
expect(editableRegionPolicy.allow(mockBrowseRegionPart, mockDomainObject)).toBe(true);
expect(editableRegionPolicy.allow(mockEditRegionPart, mockDomainObject)).toBe(false);
});
it("includes only edit region parts for object in edit mode", function() {
mockStatusCapability.get.andReturn(true);
expect(editableRegionPolicy.allow(mockBrowseRegionPart, mockDomainObject)).toBe(false);
expect(editableRegionPolicy.allow(mockEditRegionPart, mockDomainObject)).toBe(true);
});
it("includes region parts with no mode specification", function() {
mockStatusCapability.get.andReturn(false);
expect(editableRegionPolicy.allow(mockAllModesRegionPart, mockDomainObject)).toBe(true);
mockStatusCapability.get.andReturn(true);
expect(editableRegionPolicy.allow(mockAllModesRegionPart, mockDomainObject)).toBe(true);
});
});
}
);

View File

@ -0,0 +1,80 @@
/*****************************************************************************
* 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,describe,it,expect,beforeEach,waitsFor,jasmine */
define(
['../src/InspectorController'],
function (InspectorController) {
"use strict";
describe("The inspector controller ", function () {
var mockScope,
mockDomainObject,
mockTypeCapability,
mockTypeDefinition,
mockPolicyService,
controller;
beforeEach(function(){
mockTypeDefinition = {
inspector:
{
'regions': [
{'name': 'Part One'},
{'name': 'Part Two'}
]
}
};
mockTypeCapability = jasmine.createSpyObj('typeCapability', [
'getDefinition'
]);
mockTypeCapability.getDefinition.andReturn(mockTypeDefinition);
mockDomainObject = jasmine.createSpyObj('domainObject', [
'getCapability'
]);
mockDomainObject.getCapability.andReturn(mockTypeCapability);
mockPolicyService = jasmine.createSpyObj('policyService', [
'allow'
]);
mockScope = {
domainObject: mockDomainObject
};
});
it("filters out regions disallowed by region policy", function() {
mockPolicyService.allow.andReturn(false);
controller = new InspectorController(mockScope, mockPolicyService);
expect(mockScope.regions.length).toBe(0);
});
it("does not filter out regions allowed by region policy", function() {
mockPolicyService.allow.andReturn(true);
controller = new InspectorController(mockScope, mockPolicyService);
expect(mockScope.regions.length).toBe(2);
});
});
}
);

View File

@ -0,0 +1,106 @@
/*****************************************************************************
* 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,describe,it,expect,beforeEach,waitsFor,jasmine */
define(
['../src/Region'],
function (Region) {
"use strict";
describe("The region class ", function () {
var region,
part2 = new Region({'name': 'part2'});
beforeEach(function(){
region = new Region();
region.regions = [
new Region({name: 'part1'}),
new Region({name: 'part3'}),
new Region({name: 'part4'})
];
});
it("adding a region at a specified index adds it in that" +
" position", function() {
region.addRegion(part2, 1);
expect(region.regions.length).toBe(4);
expect(region.regions[1]).toBe(part2);
});
it("adding a region without an index adds it at the end", function() {
var partN = new Region({'name': 'partN'});
region.addRegion(partN);
expect(region.regions.length).toBe(4);
expect(region.regions[region.regions.length-1]).toBe(partN);
});
describe("removing a region", function(){
var partName = "part2";
beforeEach(function(){
region.regions = [
new Region({name: 'part1'}),
part2,
new Region({name: 'part3'}),
new Region({name: 'part4'})
];
});
it("with a string matches on region name", function() {
expect(region.regions.length).toBe(4);
expect(region.regions.indexOf(part2)).toBe(1);
region.removeRegion(partName);
expect(region.regions.length).toBe(3);
expect(region.regions.indexOf(part2)).toBe(-1);
});
it("with a number removes by index", function() {
expect(region.regions.length).toBe(4);
expect(region.regions.indexOf(part2)).toBe(1);
region.removeRegion(1);
expect(region.regions.length).toBe(3);
expect(region.regions.indexOf(part2)).toBe(-1);
});
it("with object matches that object", function() {
expect(region.regions.length).toBe(4);
expect(region.regions.indexOf(part2)).toBe(1);
region.removeRegion(part2);
expect(region.regions.length).toBe(3);
expect(region.regions.indexOf(part2)).toBe(-1);
});
});
});
}
);

View File

@ -0,0 +1,80 @@
/*****************************************************************************
* 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,Blob*/
/**
* @namespace platform/exporters
*/
define(['csv'], function (CSV) {
/**
* Callback used to initiate saving files from the export service;
* typical implementation is
* [FileSaver.js](https://github.com/eligrey/FileSaver.js/).
* @callback platform/exporters.ExportService~saveAs
* @param {Blob} blob the contents of the file to export
* @param {string} filename the name of the file to export
*/
/**
* The `exportService` provides a means to initiate downloads of
* structured data in the CSV format.
* @param {platform/exporters.ExportService~saveAs} saveAs function
* used to initiate saving files
* @constructor
* @memberof platform/exporters
*/
function ExportService(saveAs) {
this.saveAs = saveAs;
}
/**
* Export a set of data as comma-separated values. Triggers a download
* using the function provided when the ExportService was instantiated.
*
* @param {Object[]} rows an array of objects containing key-value pairs,
* where keys are header names, and values are values
* @param {ExportOptions} [options] additional parameters for the file
* export
*/
ExportService.prototype.exportCSV = function (rows, options) {
var headers = (options && options.headers) ||
(Object.keys((rows[0] || {})).sort()),
filename = (options && options.filename) || "export.csv",
csvText = new CSV(rows, { header: headers }).encode(),
blob = new Blob([ csvText ] , { type: "text/csv" });
this.saveAs(blob, filename);
};
/**
* Additional parameters for file export.
* @typedef ExportOptions
* @property {string} filename the name of the file to write
* @property {string[]} headers column header names, both as they
* should appear in the output and as they should be
* used to look up values from the data set. Defaults
* to the keys in the first object in the data set.
*/
return ExportService;
});

View File

@ -0,0 +1,144 @@
/*****************************************************************************
* 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,describe,it,expect,beforeEach,waitsFor,jasmine,Blob,FileReader*/
define(
["./ExportService", "csv"],
function (ExportService, CSV) {
'use strict';
describe("ExportService", function () {
var mockSaveAs,
testRows,
csvContents,
exportService;
function finishedReadingCSV() {
return !!csvContents;
}
beforeEach(function () {
csvContents = undefined;
testRows = [
{ a: 1, b: 2, c: 3 },
{ a: 4, b: 5, c: 6 },
{ a: 7, b: 8, c: 9 }
];
mockSaveAs = jasmine.createSpy('saveAs');
mockSaveAs.andCallFake(function (blob) {
var reader = new FileReader();
reader.onloadend = function () {
csvContents = new CSV(reader.result).parse();
};
reader.readAsText(blob);
});
exportService = new ExportService(mockSaveAs);
});
describe("#exportCSV(rows)", function () {
beforeEach(function () {
exportService.exportCSV(testRows);
waitsFor(finishedReadingCSV);
});
it("triggers saving of a file", function () {
expect(mockSaveAs).toHaveBeenCalledWith(
jasmine.any(Blob),
jasmine.any(String)
);
});
it("includes headers from the data set", function () {
expect(csvContents[0])
.toEqual(Object.keys(testRows[0]).sort());
});
it("includes data from the data set", function () {
var headers = csvContents[0],
expectedData = testRows.map(function (row) {
return headers.map(function (key) {
return String(row[key]);
});
});
// Everything after header should be data
expect(csvContents.slice(1)).toEqual(expectedData);
});
});
describe("#exportCSV(rows, options.headers)", function () {
var testHeaders;
beforeEach(function () {
testHeaders = [ 'a', 'b' ];
exportService
.exportCSV(testRows, { headers: testHeaders });
waitsFor(finishedReadingCSV);
});
it("triggers saving of a file", function () {
expect(mockSaveAs).toHaveBeenCalledWith(
jasmine.any(Blob),
jasmine.any(String)
);
});
it("includes only the specified headers", function () {
expect(csvContents[0])
.toEqual(testHeaders);
expect(csvContents[0])
.not.toEqual(Object.keys(testRows[0]).sort());
});
it("includes a subset data from the data set", function () {
var headers = testHeaders,
expectedData = testRows.map(function (row) {
return headers.map(function (key) {
return String(row[key]);
});
});
expect(csvContents.slice(1)).toEqual(expectedData);
});
});
describe("#exportCSV(rows, options.filename)", function () {
var testFilename;
beforeEach(function () {
testFilename = "some-test-filename.csv";
exportService
.exportCSV(testRows, { filename: testFilename });
waitsFor(finishedReadingCSV);
});
it("saves a file with the specified name", function () {
expect(mockSaveAs).toHaveBeenCalledWith(
jasmine.any(Blob),
testFilename
);
});
});
});
}
);

View File

@ -0,0 +1,65 @@
/*****************************************************************************
* 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([
"./ExportService",
"saveAs",
"legacyRegistry"
], function (ExportService, saveAs, legacyRegistry) {
'use strict';
legacyRegistry.register("platform/exporters", {
extensions: {
services: [
{
key: "exportService",
implementation: function () {
return new ExportService(saveAs);
}
}
],
licenses: [
{
"name": "CSV.js",
"version": "3.6.4",
"author": "Kash Nouroozi",
"description": "Encoder for CSV (comma separated values) export",
"website": "https://github.com/knrz/CSV.js",
"copyright": "Copyright (c) 2014 Kash Nouroozi",
"license": "license-mit",
"link": "https://github.com/knrz/CSV.js/blob/3.6.4/LICENSE"
},
{
"name": "FileSaver.js",
"version": "0.0.2",
"author": "Eli Grey",
"description": "File download initiator (for file exports)",
"website": "https://github.com/eligrey/FileSaver.js/",
"copyright": "Copyright © 2015 Eli Grey.",
"license": "license-mit",
"link": "https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md"
}
]
}
});
});

View File

@ -29,6 +29,8 @@ define([
"./src/controllers/RefreshingController", "./src/controllers/RefreshingController",
"./src/actions/StartTimerAction", "./src/actions/StartTimerAction",
"./src/actions/RestartTimerAction", "./src/actions/RestartTimerAction",
"text!./res/templates/clock.html",
"text!./res/templates/timer.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
ClockIndicator, ClockIndicator,
@ -38,6 +40,8 @@ define([
RefreshingController, RefreshingController,
StartTimerAction, StartTimerAction,
RestartTimerAction, RestartTimerAction,
clockTemplate,
timerTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -116,13 +120,13 @@ define([
"key": "clock", "key": "clock",
"type": "clock", "type": "clock",
"editable": false, "editable": false,
"templateUrl": "templates/clock.html" "template": clockTemplate
}, },
{ {
"key": "timer", "key": "timer",
"type": "timer", "type": "timer",
"editable": false, "editable": false,
"templateUrl": "templates/timer.html" "template": timerTemplate
} }
], ],
"actions": [ "actions": [

View File

@ -25,11 +25,13 @@ define([
"./src/ConductorRepresenter", "./src/ConductorRepresenter",
"./src/ConductorTelemetryDecorator", "./src/ConductorTelemetryDecorator",
"./src/ConductorService", "./src/ConductorService",
"text!./res/templates/time-conductor.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
ConductorRepresenter, ConductorRepresenter,
ConductorTelemetryDecorator, ConductorTelemetryDecorator,
ConductorService, ConductorService,
timeConductorTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -70,7 +72,7 @@ define([
"templates": [ "templates": [
{ {
"key": "time-conductor", "key": "time-conductor",
"templateUrl": "templates/time-conductor.html" "template": timeConductorTemplate
} }
], ],
"constants": [ "constants": [

View File

@ -25,11 +25,13 @@ define([
"./src/EventListController", "./src/EventListController",
"./src/directives/MCTDataTable", "./src/directives/MCTDataTable",
"./src/policies/MessagesViewPolicy", "./src/policies/MessagesViewPolicy",
"text!./res/templates/messages.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
EventListController, EventListController,
MCTDataTable, MCTDataTable,
MessagesViewPolicy, MessagesViewPolicy,
messagesTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -44,7 +46,7 @@ define([
"name": "Messages", "name": "Messages",
"glyph": "5", "glyph": "5",
"description": "Scrolling list of messages.", "description": "Scrolling list of messages.",
"templateUrl": "templates/messages.html", "template": messagesTemplate,
"needs": [ "needs": [
"telemetry" "telemetry"
], ],

View File

@ -25,14 +25,14 @@
* Module defining MCTDataTable. Created by shale on 06/22/2015. * Module defining MCTDataTable. Created by shale on 06/22/2015.
*/ */
define( define(
[], ['text!../../res/templates/mct-data-table.html'],
function () { function (dataTableTemplate) {
"use strict"; "use strict";
function MCTDataTable($window) { function MCTDataTable($window) {
return { return {
restrict: "E", restrict: "E",
templateUrl: "platform/features/events/res/templates/mct-data-table.html", template: dataTableTemplate,
scope: { scope: {
headers: "=", headers: "=",
rows: "=", rows: "=",

View File

@ -25,11 +25,13 @@ define([
"./src/policies/ImageryViewPolicy", "./src/policies/ImageryViewPolicy",
"./src/controllers/ImageryController", "./src/controllers/ImageryController",
"./src/directives/MCTBackgroundImage", "./src/directives/MCTBackgroundImage",
"text!./res/templates/imagery.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
ImageryViewPolicy, ImageryViewPolicy,
ImageryController, ImageryController,
MCTBackgroundImage, MCTBackgroundImage,
imageryTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -42,7 +44,7 @@ define([
"name": "Imagery", "name": "Imagery",
"key": "imagery", "key": "imagery",
"glyph": "ã", "glyph": "ã",
"templateUrl": "templates/imagery.html", "template": imageryTemplate,
"priority": "preferred", "priority": "preferred",
"needs": [ "needs": [
"telemetry" "telemetry"

View File

@ -25,11 +25,27 @@ define([
"./src/LayoutController", "./src/LayoutController",
"./src/FixedController", "./src/FixedController",
"./src/LayoutCompositionPolicy", "./src/LayoutCompositionPolicy",
"text!./res/templates/layout.html",
"text!./res/templates/fixed.html",
"text!./res/templates/frame.html",
"text!./res/templates/elements/telemetry.html",
"text!./res/templates/elements/box.html",
"text!./res/templates/elements/line.html",
"text!./res/templates/elements/text.html",
"text!./res/templates/elements/image.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
LayoutController, LayoutController,
FixedController, FixedController,
LayoutCompositionPolicy, LayoutCompositionPolicy,
layoutTemplate,
fixedTemplate,
frameTemplate,
telemetryTemplate,
boxTemplate,
lineTemplate,
textTemplate,
imageTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -44,7 +60,7 @@ define([
"name": "Display Layout", "name": "Display Layout",
"glyph": "L", "glyph": "L",
"type": "layout", "type": "layout",
"templateUrl": "templates/layout.html", "template": layoutTemplate,
"editable": true, "editable": true,
"uses": [] "uses": []
}, },
@ -53,7 +69,7 @@ define([
"name": "Fixed Position", "name": "Fixed Position",
"glyph": "3", "glyph": "3",
"type": "telemetry.panel", "type": "telemetry.panel",
"templateUrl": "templates/fixed.html", "template": fixedTemplate,
"uses": [ "uses": [
"composition" "composition"
], ],
@ -191,7 +207,7 @@ define([
"representations": [ "representations": [
{ {
"key": "frame", "key": "frame",
"templateUrl": "templates/frame.html" "template": frameTemplate
} }
], ],
"controllers": [ "controllers": [
@ -218,23 +234,23 @@ define([
"templates": [ "templates": [
{ {
"key": "fixed.telemetry", "key": "fixed.telemetry",
"templateUrl": "templates/elements/telemetry.html" "template": telemetryTemplate
}, },
{ {
"key": "fixed.box", "key": "fixed.box",
"templateUrl": "templates/elements/box.html" "template": boxTemplate
}, },
{ {
"key": "fixed.line", "key": "fixed.line",
"templateUrl": "templates/elements/line.html" "template": lineTemplate
}, },
{ {
"key": "fixed.text", "key": "fixed.text",
"templateUrl": "templates/elements/text.html" "template": textTemplate
}, },
{ {
"key": "fixed.image", "key": "fixed.image",
"templateUrl": "templates/elements/image.html" "template": imageTemplate
} }
], ],
"policies": [ "policies": [

View File

@ -303,12 +303,16 @@ define(
this.generateDragHandles = generateDragHandles; this.generateDragHandles = generateDragHandles;
// Track current selection state // Track current selection state
this.selection = $scope.selection; $scope.$watch("selection", function (selection) {
this.selection = selection;
// Expose the view's selection proxy // Expose the view's selection proxy
if (this.selection) { if (this.selection) {
this.selection.proxy(new FixedProxy(addElement, $q, dialogService)); this.selection.proxy(
} new FixedProxy(addElement, $q, dialogService)
);
}
}.bind(this));
// Refresh list of elements whenever model changes // Refresh list of elements whenever model changes
$scope.$watch("model.modified", refreshElements); $scope.$watch("model.modified", refreshElements);

View File

@ -148,6 +148,8 @@ define(
mockHandler, mockHandler,
mockFormatter mockFormatter
); );
findWatch("selection")(mockScope.selection);
}); });
it("subscribes when a domain object is available", function () { it("subscribes when a domain object is available", function () {

View File

@ -23,9 +23,11 @@
define([ define([
"./src/EmbeddedPageController", "./src/EmbeddedPageController",
"text!./res/iframe.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
EmbeddedPageController, EmbeddedPageController,
iframeTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -54,7 +56,7 @@ define([
], ],
"views": [ "views": [
{ {
"templateUrl": "iframe.html", "template": iframeTemplate,
"name": "Page", "name": "Page",
"type": "example.page", "type": "example.page",
"key": "example.page", "key": "example.page",

View File

@ -25,11 +25,17 @@ define([
"./src/MCTChart", "./src/MCTChart",
"./src/PlotController", "./src/PlotController",
"./src/policies/PlotViewPolicy", "./src/policies/PlotViewPolicy",
"./src/PlotOptionsController",
"text!./res/templates/plot.html",
"text!./res/templates/plot-options-browse.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
MCTChart, MCTChart,
PlotController, PlotController,
PlotViewPolicy, PlotViewPolicy,
PlotOptionsController,
plotTemplate,
plotOptionsBrowseTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -42,7 +48,7 @@ define([
"name": "Plot", "name": "Plot",
"key": "plot", "key": "plot",
"glyph": "6", "glyph": "6",
"templateUrl": "templates/plot.html", "template": plotTemplate,
"needs": [ "needs": [
"telemetry" "telemetry"
], ],
@ -71,6 +77,13 @@ define([
"throttle", "throttle",
"PLOT_FIXED_DURATION" "PLOT_FIXED_DURATION"
] ]
},
{
"key": "PlotOptionsController",
"implementation": PlotOptionsController,
"depends": [
"$scope"
]
} }
], ],
"constants": [ "constants": [
@ -86,6 +99,12 @@ define([
"category": "view", "category": "view",
"implementation": PlotViewPolicy "implementation": PlotViewPolicy
} }
],
"representations": [
{
"key": "plot-options-browse",
"template": plotOptionsBrowseTemplate
}
] ]
} }
}); });

View File

@ -0,0 +1,76 @@
<!--
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.
-->
<style>
.l-inspect .l-inspector-part .no-margin .form {
margin-left: 0;
}
.reduced-min-width .form .form-row > .label {
min-width: 80px;
}
</style>
<div ng-controller="PlotOptionsController" class="flex-elem grows l-inspector-part">
<em class="t-inspector-part-header" title="Display properties for this object">Display</em>
<mct-form
ng-model="configuration.plot.xAxis"
structure="xAxisForm"
name="xAxisFormState"
class="flex-elem l-flex-row no-validate no-margin reduced-min-width">
</mct-form>
<mct-form
ng-model="configuration.plot.yAxis"
structure="yAxisForm"
name="yAxisFormState"
class="flex-elem l-flex-row no-validate no-margin reduced-min-width">
</mct-form>
<div class="section-header ng-binding ng-scope">
Plot Series
</div>
<ul class="first flex-elem grows vscroll">
<ul class="tree">
<li ng-repeat="child in children">
<span ng-controller="ToggleController as toggle">
<span ng-controller="TreeNodeController as treeNode">
<span class="tree-item menus-to-left">
<span
class='ui-symbol view-control flex-elem has-children'
ng-class="{ expanded: toggle.isActive() }"
ng-click="toggle.toggle(); treeNode.trackExpansion()">
</span>
<mct-representation
class="rep-object-label"
key="'label'"
mct-object="child">
</mct-representation>
</span>
</span>
<mct-form
ng-class="{hidden: !toggle.isActive()}"
ng-model="configuration.plot.series[$index]"
structure="plotSeriesForm"
name="plotOptionsState"
class="flex-elem l-flex-row l-controls-first no-validate">
</mct-form>
</span>
</li>
</ul>
</ul>
</div>

View File

@ -0,0 +1,197 @@
/*****************************************************************************
* 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(
['./PlotOptionsForm'],
function (PlotOptionsForm) {
"use strict";
/**
* Notes on implementation of plot options
*
* Multiple y-axes will have to be handled with multiple forms as
* they will need to be stored on distinct model object
*
* Likewise plot series options per-child will need to be separate
* forms.
*/
/**
* The LayoutController is responsible for supporting the
* Layout view. It arranges frames according to saved configuration
* and provides methods for updating these based on mouse
* movement.
* @memberof platform/features/plot
* @constructor
* @param {Scope} $scope the controller's Angular scope
*/
function PlotOptionsController($scope) {
var self = this;
this.$scope = $scope;
this.domainObject = $scope.domainObject;
this.configuration = this.domainObject.getModel().configuration || {};
this.plotOptionsForm = new PlotOptionsForm();
this.composition = [];
this.watches = [];
/*
Listen for changes to the domain object and update the object's
children.
*/
this.mutationListener = this.domainObject.getCapability('mutation').listen(function(model) {
if (self.hasCompositionChanged(self.composition, model.composition)) {
self.updateChildren();
}
});
/*
Set form structures on scope
*/
$scope.plotSeriesForm = this.plotOptionsForm.plotSeriesForm;
$scope.xAxisForm = this.plotOptionsForm.xAxisForm;
$scope.yAxisForm = this.plotOptionsForm.yAxisForm;
$scope.$on("$destroy", function() {
//Clean up any listeners on destruction of controller
self.mutationListener();
});
this.defaultConfiguration();
this.updateChildren();
/*
* Setup a number of watches for changes to form values. On
* change, update the model configuration via mutation
*/
$scope.$watchCollection('configuration.plot.yAxis', function(newValue, oldValue){
self.updateConfiguration(newValue, oldValue);
});
$scope.$watchCollection('configuration.plot.xAxis', function(newValue, oldValue){
self.updateConfiguration(newValue, oldValue);
});
this.watchSeries();
}
/**
* Unregister all watches for series data (ie. the configuration for
* child objects)
* @private
*/
PlotOptionsController.prototype.clearSeriesWatches = function() {
this.watches.forEach(function(watch) {
watch();
});
this.watches = [];
};
/**
* Attach watches for each object in the plot's composition
* @private
*/
PlotOptionsController.prototype.watchSeries = function() {
var self = this;
this.clearSeriesWatches();
(self.$scope.children || []).forEach(function(child, index){
self.watches.push(
self.$scope.$watchCollection(
'configuration.plot.series[' + index + ']',
function(newValue, oldValue){
self.updateConfiguration(newValue, oldValue);
}
)
);
});
};
/**
* Determine whether the changes to the model that triggered a
* mutation event were purely compositional.
*
* @private
*/
PlotOptionsController.prototype.hasCompositionChanged = function(oldComposition, newComposition){
// Framed slightly strangely, but the boolean logic is
// easier to follow for the unchanged case.
var isUnchanged = oldComposition === newComposition ||
(
oldComposition.length === newComposition.length &&
oldComposition.every( function (currentValue, index) {
return newComposition[index] && currentValue === newComposition[index];
})
);
return !isUnchanged;
};
/**
* Default the plot options model
*
* @private
*/
PlotOptionsController.prototype.defaultConfiguration = function () {
this.configuration.plot = this.configuration.plot || {};
this.configuration.plot.xAxis = this.configuration.plot.xAxis || {};
this.configuration.plot.yAxis = this.configuration.plot.yAxis || {}; // y-axes will be associative array keyed on axis key
this.configuration.plot.series = this.configuration.plot.series || []; // series will be associative array keyed on sub-object id
this.$scope.configuration = this.configuration;
};
/**
* When a child is added to, or removed from a plot, update the
* plot options model
* @private
*/
PlotOptionsController.prototype.updateChildren = function() {
var self = this;
this.domainObject.useCapability('composition').then(function(children){
self.$scope.children = children;
self.composition = self.domainObject.getModel().composition;
children.forEach(function(child, index){
self.configuration.plot.series[index] =
self.configuration.plot.series[index] || {'id': child.getId()};
});
self.watchSeries();
});
};
/**
* On changes to the form, update the configuration on the domain
* object
* @private
*/
PlotOptionsController.prototype.updateConfiguration = function() {
var self = this;
this.domainObject.useCapability('mutation', function(model){
model.configuration = model.configuration || {};
model.configuration.plot = self.configuration.plot;
});
};
return PlotOptionsController;
}
);

View File

@ -0,0 +1,146 @@
/*****************************************************************************
* 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 () {
"use strict";
/**
* A class for encapsulating structure and behaviour of the plot
* options form
* @memberOf platform/features/plot
* @param topic
* @constructor
*/
function PlotOptionsForm() {
/*
Defined below are the form structures for the plot options.
*/
this.xAxisForm = {
'name':'x-axis',
'sections': [{
'name': 'x-axis',
'rows': [
{
'name': 'Domain',
'control': 'select',
'key': 'key',
'options': [
{'name':'scet', 'value': 'scet'},
{'name':'sclk', 'value': 'sclk'},
{'name':'lst', 'value': 'lst'}
]
}
]
}]};
this.yAxisForm = {
'name':'y-axis',
'sections': [{
// Will need to be repeated for each y-axis, with a
// distinct name for each. Ideally the name of the axis
// itself.
'name': 'y-axis',
'rows': [
{
'name': 'Autoscale',
'control': 'checkbox',
'key': 'autoscale'
},
{
'name': 'Min',
'control': 'textfield',
'key': 'min',
'pattern': '[0-9]'
},
{
'name': 'Max',
'control': 'textfield',
'key': 'max',
'pattern': '[0-9]'
},
{
'name': 'Range',
'control': 'select',
'key': 'key',
'options': [
{'name':'eu', 'value': 'eu'},
{'name':'dn', 'value': 'dn'},
{'name':'status', 'value': 'status'}
]
}
]
}]
};
this.plotSeriesForm = {
'name':'Series Options',
'sections': [
{
rows: [
{
'name': 'Color',
'control': 'color',
'key': 'color'
}]
},
{
'rows':[
{
'name': 'Markers',
'control': 'checkbox',
'key': 'markers'
}
]
},
{
'rows':[
{
'name': 'No Line',
'control': 'radio',
'key': 'lineType',
'value': 'noLine'
},
{
'name': 'Step Line',
'control': 'radio',
'key': 'lineType',
'value': 'stepLine'
},
{
'name': 'Linear Line',
'control': 'radio',
'key': 'lineType',
'value': 'linearLine'
}
]
}
]
};
}
return PlotOptionsForm;
}
);

View File

@ -0,0 +1,150 @@
/*****************************************************************************
* 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,describe,it,expect,beforeEach,jasmine,xit*/
define(
['../src/PlotOptionsController'],
function (PlotOptionsController) {
"use strict";
describe("The Plot Options controller", function () {
var plotOptionsController,
mockDomainObject,
mockMutationCapability,
mockUseCapabilities,
mockCompositionCapability,
mockComposition,
mockUnlisten,
mockFormUnlisten,
mockChildOne,
mockChildTwo,
model,
mockScope;
beforeEach(function () {
model = {
composition: ['childOne']
};
mockChildOne = jasmine.createSpyObj('domainObject', [
'getId'
]);
mockChildOne.getId.andReturn('childOne');
mockChildTwo = jasmine.createSpyObj('childTwo', [
'getId'
]);
mockChildOne.getId.andReturn('childTwo');
mockCompositionCapability = jasmine.createSpyObj('compositionCapability', [
'then'
]);
mockComposition = [
mockChildOne
];
mockCompositionCapability.then.andCallFake(function (callback){
callback(mockComposition);
});
mockUseCapabilities = jasmine.createSpyObj('useCapabilities', [
'composition',
'mutation'
]);
mockUseCapabilities.composition.andReturn(mockCompositionCapability);
mockMutationCapability = jasmine.createSpyObj('mutationCapability', [
'listen'
]);
mockUnlisten = jasmine.createSpy('unlisten');
mockMutationCapability.listen.andReturn(mockUnlisten);
mockDomainObject = jasmine.createSpyObj('domainObject', [
'getModel',
'useCapability',
'getCapability'
]);
mockDomainObject.useCapability.andCallFake(function(capability){
return mockUseCapabilities[capability]();
});
mockDomainObject.getCapability.andReturn(mockMutationCapability);
mockDomainObject.getModel.andReturn(model);
mockScope = jasmine.createSpyObj('scope', [
'$on',
'$watchCollection'
]);
mockScope.domainObject = mockDomainObject;
function noop() {}
mockScope.$watchCollection.andReturn(noop);
plotOptionsController = new PlotOptionsController(mockScope);
});
it("sets form definitions on scope", function () {
expect(mockScope.xAxisForm).toBeDefined();
expect(mockScope.yAxisForm).toBeDefined();
expect(mockScope.plotSeriesForm).toBeDefined();
});
it("sets object children on scope", function () {
expect(mockScope.children).toBe(mockComposition);
});
it("on changes in object composition, updates the form", function () {
expect(mockMutationCapability.listen).toHaveBeenCalled();
expect(mockScope.children).toBe(mockComposition);
expect(mockScope.children.length).toBe(1);
mockComposition.push(mockChildTwo);
model.composition.push('childTwo');
mockMutationCapability.listen.mostRecentCall.args[0](model);
expect(mockScope.children).toBe(mockComposition);
expect(mockScope.children.length).toBe(2);
});
it("on changes in form values, updates the object model", function () {
var scopeConfiguration = mockScope.configuration,
model = mockDomainObject.getModel();
scopeConfiguration.plot.yAxis.autoScale = true;
scopeConfiguration.plot.yAxis.key = 'eu';
scopeConfiguration.plot.xAxis.key = 'lst';
expect(mockScope.$watchCollection).toHaveBeenCalled();
mockScope.$watchCollection.calls[0].args[1]();
expect(mockDomainObject.useCapability).toHaveBeenCalledWith('mutation', jasmine.any(Function));
mockDomainObject.useCapability.mostRecentCall.args[1](model);
expect(model.configuration.plot.yAxis.autoScale).toBe(true);
expect(model.configuration.plot.yAxis.key).toBe('eu');
expect(model.configuration.plot.xAxis.key).toBe('lst');
});
it("cleans up listeners on destruction of the controller", function () {
mockScope.$on.mostRecentCall.args[1]();
expect(mockUnlisten).toHaveBeenCalled();
});
});
}
);

View File

@ -0,0 +1,50 @@
/*****************************************************************************
* 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,describe,it,expect,beforeEach,jasmine,xit*/
define(
['../src/PlotOptionsForm'],
function (PlotOptionsForm) {
"use strict";
describe("The Plot Options form", function () {
var plotOptionsForm,
listener;
beforeEach(function () {
plotOptionsForm = new PlotOptionsForm();
});
it("defines form specs for x-axis, y-axis, and series data", function () {
expect(plotOptionsForm.xAxisForm).toBeDefined();
expect(plotOptionsForm.xAxisForm.sections).toBeDefined();
expect(plotOptionsForm.xAxisForm.sections[0].rows).toBeDefined();
expect(plotOptionsForm.xAxisForm.sections[0].rows.length).toBeGreaterThan(0);
expect(plotOptionsForm.yAxisForm).toBeDefined();
expect(plotOptionsForm.plotSeriesForm).toBeDefined();
});
});
}
);

View File

@ -25,11 +25,13 @@ define([
"./src/RTEventListController", "./src/RTEventListController",
"./src/directives/MCTRTDataTable", "./src/directives/MCTRTDataTable",
"./src/policies/RTMessagesViewPolicy", "./src/policies/RTMessagesViewPolicy",
"text!./res/templates/rtmessages.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
RTEventListController, RTEventListController,
MCTRTDataTable, MCTRTDataTable,
RTMessagesViewPolicy, RTMessagesViewPolicy,
rtmessagesTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -44,7 +46,7 @@ define([
"name": "RT Messages", "name": "RT Messages",
"glyph": "5", "glyph": "5",
"description": "Scrolling list of real time messages.", "description": "Scrolling list of real time messages.",
"templateUrl": "templates/rtmessages.html", "template": rtmessagesTemplate,
"needs": [ "needs": [
"telemetry" "telemetry"
], ],

View File

@ -25,14 +25,14 @@
* Module defining MCTRTDataTable. Created by shale on 06/25/2015. * Module defining MCTRTDataTable. Created by shale on 06/25/2015.
*/ */
define( define(
[], ['text!../../res/templates/mct-rt-data-table.html'],
function () { function (dataTableTemplate) {
"use strict"; "use strict";
function MCTRTDataTable($window) { function MCTRTDataTable($window) {
return { return {
restrict: "E", restrict: "E",
templateUrl: "platform/features/rtevents/res/templates/mct-rt-data-table.html", template: dataTableTemplate,
scope: { scope: {
headers: "=", headers: "=",
rows: "=", rows: "=",

View File

@ -23,9 +23,11 @@
define([ define([
"./src/RTScrollingListController", "./src/RTScrollingListController",
"text!./res/templates/rtscrolling.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
RTScrollingListController, RTScrollingListController,
rtscrollingTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -40,7 +42,7 @@ define([
"name": "Scrolling", "name": "Scrolling",
"glyph": "5", "glyph": "5",
"description": "Scrolling list of data values.", "description": "Scrolling list of data values.",
"templateUrl": "templates/rtscrolling.html", "template": rtscrollingTemplate,
"needs": [ "needs": [
"telemetry" "telemetry"
], ],

View File

@ -23,9 +23,11 @@
define([ define([
"./src/ScrollingListController", "./src/ScrollingListController",
"text!./res/templates/scrolling.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
ScrollingListController, ScrollingListController,
scrollingTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -40,7 +42,7 @@ define([
"name": "Scrolling", "name": "Scrolling",
"glyph": "5", "glyph": "5",
"description": "Scrolling list of data values.", "description": "Scrolling list of data values.",
"templateUrl": "templates/scrolling.html", "template": scrollingTemplate,
"needs": [ "needs": [
"telemetry" "telemetry"
], ],

View File

@ -23,9 +23,11 @@
define([ define([
"text!./res/markup.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
markupTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -45,7 +47,7 @@ define([
], ],
"views": [ "views": [
{ {
"templateUrl": "markup.html", "template": markupTemplate,
"name": "Static Markup", "name": "Static Markup",
"type": "static.markup", "type": "static.markup",
"key": "static.markup" "key": "static.markup"

View File

@ -38,6 +38,16 @@ define([
"./src/directives/MCTSwimlaneDrop", "./src/directives/MCTSwimlaneDrop",
"./src/directives/MCTSwimlaneDrag", "./src/directives/MCTSwimlaneDrag",
"./src/services/ObjectLoader", "./src/services/ObjectLoader",
"text!./res/templates/values.html",
"text!./res/templates/timeline.html",
"text!./res/templates/activity-gantt.html",
"text!./res/templates/tabular-swimlane-cols-tree.html",
"text!./res/templates/tabular-swimlane-cols-data.html",
"text!./res/templates/resource-graphs.html",
"text!./res/templates/resource-graph-labels.html",
"text!./res/templates/legend-item.html",
"text!./res/templates/ticks.html",
"text!./res/templates/controls/datetime.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
TimelineController, TimelineController,
@ -56,6 +66,16 @@ define([
MCTSwimlaneDrop, MCTSwimlaneDrop,
MCTSwimlaneDrag, MCTSwimlaneDrag,
ObjectLoader, ObjectLoader,
valuesTemplate,
timelineTemplate,
activityGanttTemplate,
tabularSwimlaneColsTreeTemplate,
tabularSwimlaneColsDataTemplate,
resourceGraphsTemplate,
resourceGraphLabelsTemplate,
legendItemTemplate,
ticksTemplate,
datetimeTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -226,7 +246,7 @@ define([
"key": "values", "key": "values",
"name": "Values", "name": "Values",
"glyph": "A", "glyph": "A",
"templateUrl": "templates/values.html", "template": valuesTemplate,
"type": "mode", "type": "mode",
"uses": [ "uses": [
"cost" "cost"
@ -239,7 +259,7 @@ define([
"glyph": "S", "glyph": "S",
"type": "timeline", "type": "timeline",
"description": "A timeline view of Timelines and Activities.", "description": "A timeline view of Timelines and Activities.",
"templateUrl": "templates/timeline.html", "template": timelineTemplate,
"editable": true, "editable": true,
"toolbar": { "toolbar": {
"sections": [ "sections": [
@ -335,7 +355,7 @@ define([
"representations": [ "representations": [
{ {
"key": "gantt", "key": "gantt",
"templateUrl": "templates/activity-gantt.html", "template": activityGanttTemplate,
"uses": [ "uses": [
"timespan", "timespan",
"type" "type"
@ -346,42 +366,42 @@ define([
{ {
"key": "timeline-tabular-swimlane-cols-tree", "key": "timeline-tabular-swimlane-cols-tree",
"priority": "mandatory", "priority": "mandatory",
"templateUrl": "templates/tabular-swimlane-cols-tree.html" "template": tabularSwimlaneColsTreeTemplate
}, },
{ {
"key": "timeline-tabular-swimlane-cols-data", "key": "timeline-tabular-swimlane-cols-data",
"priority": "mandatory", "priority": "mandatory",
"templateUrl": "templates/tabular-swimlane-cols-data.html" "template": tabularSwimlaneColsDataTemplate
}, },
{ {
"key": "timeline-resource-graphs", "key": "timeline-resource-graphs",
"priority": "mandatory", "priority": "mandatory",
"templateUrl": "templates/resource-graphs.html" "template": resourceGraphsTemplate
}, },
{ {
"key": "timeline-resource-graph-labels", "key": "timeline-resource-graph-labels",
"priority": "mandatory", "priority": "mandatory",
"templateUrl": "templates/resource-graph-labels.html" "template": resourceGraphLabelsTemplate
}, },
{ {
"key": "timeline-legend-item", "key": "timeline-legend-item",
"priority": "mandatory", "priority": "mandatory",
"templateUrl": "templates/legend-item.html" "template": legendItemTemplate
}, },
{ {
"key": "timeline-ticks", "key": "timeline-ticks",
"priority": "mandatory", "priority": "mandatory",
"templateUrl": "templates/ticks.html" "template": ticksTemplate
} }
], ],
"controls": [ "controls": [
{ {
"key": "timeline-datetime", "key": "timeline-datetime",
"templateUrl": "templates/controls/datetime.html" "template": datetimeTemplate
}, },
{ {
"key": "duration", "key": "duration",
"templateUrl": "templates/controls/datetime.html" "template": datetimeTemplate
} }
], ],
"controllers": [ "controllers": [

View File

@ -22,10 +22,10 @@
<div class="t-timeline-gantt l-timeline-gantt s-timeline-gantt" <div class="t-timeline-gantt l-timeline-gantt s-timeline-gantt"
title="{{model.name}}" title="{{model.name}}"
ng-controller="TimelineGanttController as gantt" ng-controller="TimelineGanttController as gantt"
ng-style="{ ng-style="timespan ? {
left: gantt.left(timespan, parameters.scroll, parameters.toPixels) + 'px', left: gantt.left(timespan, parameters.scroll, parameters.toPixels) + 'px',
width: gantt.width(timespan, parameters.scroll, parameters.toPixels) + 'px' width: gantt.width(timespan, parameters.scroll, parameters.toPixels) + 'px'
}"> } : {}">
<div class="bar"> <div class="bar">
<span class="s-activity-type ui-symbol"> <span class="s-activity-type ui-symbol">

View File

@ -98,7 +98,7 @@ define(
}); });
} }
} }
// Recalculate swimlane state on changes // Recalculate swimlane state on changes
$scope.$watch("domainObject", swimlanePopulator.populate); $scope.$watch("domainObject", swimlanePopulator.populate);
@ -108,6 +108,9 @@ define(
// Carry over changes in swimlane set to changes in graphs // Carry over changes in swimlane set to changes in graphs
$scope.$watch(graphMask, repopulateGraphs); $scope.$watch(graphMask, repopulateGraphs);
// Pass selection object into swimlane populator
$scope.$watch("selection", swimlanePopulator.selection);
// Convey current selection to drag handle populator // Convey current selection to drag handle populator
$scope.$watch("selection.get()", dragPopulator.select); $scope.$watch("selection.get()", dragPopulator.select);

View File

@ -46,7 +46,8 @@ define(
start = Number.POSITIVE_INFINITY, start = Number.POSITIVE_INFINITY,
end = Number.NEGATIVE_INFINITY, end = Number.NEGATIVE_INFINITY,
colors = (configuration.colors || {}), colors = (configuration.colors || {}),
assigner = new TimelineColorAssigner(colors); assigner = new TimelineColorAssigner(colors),
lastDomainObject;
// Track extremes of start/end times // Track extremes of start/end times
function trackStartEnd(timespan) { function trackStartEnd(timespan) {
@ -144,12 +145,25 @@ define(
domainObject && new TimelineProxy(domainObject, selection) domainObject && new TimelineProxy(domainObject, selection)
); );
} }
lastDomainObject = domainObject;
}
function setSelectionObject(s) {
selection = s;
recalculateSwimlanes(lastDomainObject);
} }
// Ensure colors are exposed in configuration // Ensure colors are exposed in configuration
configuration.colors = colors; configuration.colors = colors;
return { return {
/**
* Set the selection object associated with this timeline view.
* @param {Object} selection the selection object
*/
selection: setSelectionObject,
/** /**
* Update list of swimlanes to match those reachable from this * Update list of swimlanes to match those reachable from this
* object. * object.

View File

@ -150,6 +150,15 @@ define(
expect(mockSelection.proxy).toHaveBeenCalled(); expect(mockSelection.proxy).toHaveBeenCalled();
}); });
it("allows selection object to be changed", function () {
var mockNewSelectionObject = jasmine.createSpyObj(
'new-selection',
['get', 'select', 'proxy']
);
populator.selection(mockNewSelectionObject);
expect(mockNewSelectionObject.proxy)
.toHaveBeenCalled();
});
}); });
} }

View File

@ -29,6 +29,16 @@ define([
"./src/controllers/CompositeController", "./src/controllers/CompositeController",
"./src/controllers/ColorController", "./src/controllers/ColorController",
"./src/controllers/DialogButtonController", "./src/controllers/DialogButtonController",
"text!./res/templates/controls/checkbox.html",
"text!./res/templates/controls/datetime.html",
"text!./res/templates/controls/select.html",
"text!./res/templates/controls/textfield.html",
"text!./res/templates/controls/button.html",
"text!./res/templates/controls/color.html",
"text!./res/templates/controls/composite.html",
"text!./res/templates/controls/menu-button.html",
"text!./res/templates/controls/dialog.html",
"text!./res/templates/controls/radio.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
MCTForm, MCTForm,
@ -38,6 +48,16 @@ define([
CompositeController, CompositeController,
ColorController, ColorController,
DialogButtonController, DialogButtonController,
checkboxTemplate,
datetimeTemplate,
selectTemplate,
textfieldTemplate,
buttonTemplate,
colorTemplate,
compositeTemplate,
menuButtonTemplate,
dialogTemplate,
radioTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -59,6 +79,7 @@ define([
"key": "mctControl", "key": "mctControl",
"implementation": MCTControl, "implementation": MCTControl,
"depends": [ "depends": [
"templateLinker",
"controls[]" "controls[]"
] ]
} }
@ -66,39 +87,43 @@ define([
"controls": [ "controls": [
{ {
"key": "checkbox", "key": "checkbox",
"templateUrl": "templates/controls/checkbox.html" "template": checkboxTemplate
},
{
"key": "radio",
"template": radioTemplate
}, },
{ {
"key": "datetime", "key": "datetime",
"templateUrl": "templates/controls/datetime.html" "template": datetimeTemplate
}, },
{ {
"key": "select", "key": "select",
"templateUrl": "templates/controls/select.html" "template": selectTemplate
}, },
{ {
"key": "textfield", "key": "textfield",
"templateUrl": "templates/controls/textfield.html" "template": textfieldTemplate
}, },
{ {
"key": "button", "key": "button",
"templateUrl": "templates/controls/button.html" "template": buttonTemplate
}, },
{ {
"key": "color", "key": "color",
"templateUrl": "templates/controls/color.html" "template": colorTemplate
}, },
{ {
"key": "composite", "key": "composite",
"templateUrl": "templates/controls/composite.html" "template": compositeTemplate
}, },
{ {
"key": "menu-button", "key": "menu-button",
"templateUrl": "templates/controls/menu-button.html" "template": menuButtonTemplate
}, },
{ {
"key": "dialog-button", "key": "dialog-button",
"templateUrl": "templates/controls/dialog.html" "template": dialogTemplate
} }
], ],
"controllers": [ "controllers": [

View File

@ -0,0 +1,29 @@
<!--
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.
-->
<label class="radio custom no-text">
<input type="radio"
name="mctControl"
ng-model="ngModel[field]"
ng-disabled="ngDisabled"
ng-value="structure.value">
<em></em>
</label>

View File

@ -19,31 +19,24 @@
this source code distribution or the Licensing information page available this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<form name="mctForm" novalidate> <form name="mctForm" novalidate class="form">
<div class="form">
<span ng-repeat="section in structure.sections"> <span ng-repeat="section in structure.sections">
<div class="section-header" ng-if="section.name"> <div class="section-header" ng-if="section.name">
{{section.name}} {{section.name}}
</div> </div>
<div class="form-section"> <div class="form-section" ng-class="{ first:$index < 1 }">
<ng-form name="mctFormInner" ng-repeat="row in section.rows"> <ng-form name="mctFormInner" ng-repeat="row in section.rows">
<div class="form-row validates" <div class="form-row validates l-flex-row"
ng-class="{ ng-class="{
req: row.required, req: row.required,
valid: mctFormInner.$dirty && mctFormInner.$valid, valid: mctFormInner.$dirty && mctFormInner.$valid,
invalid: mctFormInner.$dirty && !mctFormInner.$valid, invalid: mctFormInner.$dirty && !mctFormInner.$valid,
first: $index < 1 first: $index < 1
}"> }">
<div class='label flex-elem' title="{{row.description}}">
<div class='label' title="{{row.description}}">
{{row.name}} {{row.name}}
<span ng-if="row.description"
class="ui-symbol">
i
</span>
</div> </div>
<div class='controls'> <div class='controls flex-elem'>
<div class="wrapper" ng-if="row.control"> <div class="wrapper" ng-if="row.control">
<mct-control key="row.control" <mct-control key="row.control"
ng-model="ngModel" ng-model="ngModel"
@ -59,6 +52,4 @@
</ng-form> </ng-form>
</div> </div>
</span> </span>
</div>
</form> </form>

View File

@ -36,23 +36,18 @@ define(
* @constructor * @constructor
* @memberof platform/forms * @memberof platform/forms
*/ */
function MCTControl(controls) { function MCTControl(templateLinker, controls) {
var controlMap = {}; var controlMap = {};
// Prepopulate controlMap for easy look up by key // Prepopulate controlMap for easy look up by key
controls.forEach(function (control) { controls.forEach(function (control) {
var path = [ controlMap[control.key] = control;
control.bundle.path,
control.bundle.resources,
control.templateUrl
].join("/");
controlMap[control.key] = path;
}); });
function link(scope, element, attrs, ngModelController) { function link(scope, element, attrs, ngModelController) {
var changeTemplate = templateLinker.link(scope, element);
scope.$watch("key", function (key) { scope.$watch("key", function (key) {
// Pass the template URL to ng-include via scope. changeTemplate(controlMap[key]);
scope.inclusion = controlMap[key];
}); });
scope.ngModelController = ngModelController; scope.ngModelController = ngModelController;
} }
@ -61,10 +56,6 @@ define(
// Only show at the element level // Only show at the element level
restrict: "E", restrict: "E",
// Use ng-include as a template; "inclusion" will be the real
// template path
template: '<ng-include src="inclusion"></ng-include>',
// ngOptions is terminal, so we need to be higher priority // ngOptions is terminal, so we need to be higher priority
priority: 1000, priority: 1000,

View File

@ -27,8 +27,8 @@
* @namespace platform/forms * @namespace platform/forms
*/ */
define( define(
["./controllers/FormController"], ["./controllers/FormController", "text!../res/templates/form.html"],
function (FormController) { function (FormController, formTemplate) {
"use strict"; "use strict";
/** /**
@ -52,18 +52,12 @@ define(
* @constructor * @constructor
*/ */
function MCTForm() { function MCTForm() {
var templatePath = [
"platform/forms", //MCTForm.bundle.path,
"res", //MCTForm.bundle.resources,
"templates/form.html"
].join("/");
return { return {
// Only show at the element level // Only show at the element level
restrict: "E", restrict: "E",
// Load the forms template // Load the forms template
templateUrl: templatePath, template: formTemplate,
// Use FormController to populate/respond to changes in scope // Use FormController to populate/respond to changes in scope
controller: [ '$scope', FormController ], controller: [ '$scope', FormController ],

View File

@ -25,8 +25,8 @@
* Module defining MCTForm. Created by vwoeltje on 11/10/14. * Module defining MCTForm. Created by vwoeltje on 11/10/14.
*/ */
define( define(
["./controllers/FormController"], ["./MCTForm", "text!../res/templates/toolbar.html"],
function (FormController) { function (MCTForm, toolbarTemplate) {
"use strict"; "use strict";
/** /**
@ -49,38 +49,14 @@ define(
* @memberof platform/forms * @memberof platform/forms
* @constructor * @constructor
*/ */
function MCTForm() { function MCTToolbar() {
var templatePath = [ // Use Directive Definition Object from mct-form,
"platform/forms", //MCTForm.bundle.path, // but use the toolbar's template instead.
"res", //MCTForm.bundle.resources, var ddo = new MCTForm();
"templates/toolbar.html" ddo.template = toolbarTemplate;
].join("/"); return ddo;
return {
// Only show at the element level
restrict: "E",
// Load the forms template
templateUrl: templatePath,
// Use FormController to populate/respond to changes in scope
controller: [ '$scope', FormController ],
// Initial an isolate scope
scope: {
// The model: Where form input will actually go
ngModel: "=",
// Form structure; what sections/rows to show
structure: "=",
// Name under which to publish the form
name: "@"
}
};
} }
return MCTForm; return MCTToolbar;
} }
); );

View File

@ -29,6 +29,8 @@ define(
describe("The mct-control directive", function () { describe("The mct-control directive", function () {
var testControls, var testControls,
mockScope, mockScope,
mockLinker,
mockChangeTemplate,
mctControl; mctControl;
beforeEach(function () { beforeEach(function () {
@ -46,8 +48,11 @@ define(
]; ];
mockScope = jasmine.createSpyObj("$scope", [ "$watch" ]); mockScope = jasmine.createSpyObj("$scope", [ "$watch" ]);
mockLinker = jasmine.createSpyObj("templateLinker", ["link"]);
mockChangeTemplate = jasmine.createSpy('changeTemplate');
mockLinker.link.andReturn(mockChangeTemplate);
mctControl = new MCTControl(testControls); mctControl = new MCTControl(mockLinker, testControls);
}); });
it("is restricted to the element level", function () { it("is restricted to the element level", function () {
@ -66,14 +71,16 @@ define(
it("changes its template dynamically", function () { it("changes its template dynamically", function () {
mctControl.link(mockScope); mctControl.link(mockScope);
expect(mockChangeTemplate)
.not.toHaveBeenCalledWith(testControls[1]);
mockScope.key = "xyz"; mockScope.key = "xyz";
mockScope.$watch.mostRecentCall.args[1]("xyz"); mockScope.$watch.mostRecentCall.args[1]("xyz");
// Should have communicated the template path to // Should have communicated the template path to
// ng-include via the "inclusion" field in scope // ng-include via the "inclusion" field in scope
expect(mockScope.inclusion).toEqual( expect(mockChangeTemplate)
"x/y/z/template.html" .toHaveBeenCalledWith(testControls[1]);
);
}); });
}); });

View File

@ -25,11 +25,13 @@ define([
"./src/QueuingPersistenceCapabilityDecorator", "./src/QueuingPersistenceCapabilityDecorator",
"./src/PersistenceQueue", "./src/PersistenceQueue",
"./src/PersistenceFailureController", "./src/PersistenceFailureController",
"text!./res/templates/persistence-failure-dialog.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
QueuingPersistenceCapabilityDecorator, QueuingPersistenceCapabilityDecorator,
PersistenceQueue, PersistenceQueue,
PersistenceFailureController, PersistenceFailureController,
persistenceFailureDialogTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -67,7 +69,7 @@ define([
"templates": [ "templates": [
{ {
"key": "persistence-failure-dialog", "key": "persistence-failure-dialog",
"templateUrl": "templates/persistence-failure-dialog.html" "template": persistenceFailureDialogTemplate
} }
], ],
"controllers": [ "controllers": [

View File

@ -27,6 +27,9 @@ define([
"./src/controllers/ClickAwayController", "./src/controllers/ClickAwayController",
"./src/services/GenericSearchProvider", "./src/services/GenericSearchProvider",
"./src/services/SearchAggregator", "./src/services/SearchAggregator",
"text!./res/templates/search-item.html",
"text!./res/templates/search.html",
"text!./res/templates/search-menu.html",
'legacyRegistry' 'legacyRegistry'
], function ( ], function (
SearchController, SearchController,
@ -34,6 +37,9 @@ define([
ClickAwayController, ClickAwayController,
GenericSearchProvider, GenericSearchProvider,
SearchAggregator, SearchAggregator,
searchItemTemplate,
searchTemplate,
searchMenuTemplate,
legacyRegistry legacyRegistry
) { ) {
"use strict"; "use strict";
@ -80,17 +86,17 @@ define([
"representations": [ "representations": [
{ {
"key": "search-item", "key": "search-item",
"templateUrl": "templates/search-item.html" "template": searchItemTemplate
} }
], ],
"templates": [ "templates": [
{ {
"key": "search", "key": "search",
"templateUrl": "templates/search.html" "template": searchTemplate
}, },
{ {
"key": "search-menu", "key": "search-menu",
"templateUrl": "templates/search-menu.html" "template": searchMenuTemplate
} }
], ],
"components": [ "components": [

View File

@ -0,0 +1,106 @@
/*****************************************************************************
* 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.
*****************************************************************************/
// Converts all templateUrl references in bundle.js files to
// plain template references, loading said templates with the
// RequireJS text plugin.
var glob = require('glob'),
fs = require('fs'),
path = require('path'),
_ = require('lodash');
function toTemplateName(templateUrl) {
var parts = templateUrl.split('/');
return _.camelCase(parts[parts.length - 1].replace(".html", "")) +
"Template";
}
function getTemplateUrl(sourceLine) {
return _.trim(sourceLine.split(":")[1], "\", ");
}
function hasTemplateUrl(sourceLine) {
return sourceLine.indexOf("templateUrl") !== -1;
}
function findTemplateURLs(sourceCode) {
return sourceCode.split('\n')
.map(_.trim)
.filter(hasTemplateUrl)
.map(getTemplateUrl);
}
function injectRequireArgument(sourceCode, templateUrls) {
var lines = sourceCode.split('\n'),
index;
templateUrls = _.uniq(templateUrls);
// Add arguments for source paths...
index = lines.map(_.trim).indexOf("'legacyRegistry'");
lines = lines.slice(0, index).concat(templateUrls.map(function (url) {
return " \"text!./res/" + url + "\",";
}).concat(lines.slice(index)));
/// ...and for arguments
index = lines.map(_.trim).indexOf("legacyRegistry");
lines = lines.slice(0, index).concat(templateUrls.map(function (url) {
return " " + toTemplateName(url) + ",";
}).concat(lines.slice(index)));
return lines.join('\n');
}
function rewriteUrl(sourceLine) {
return [
sourceLine.substring(0, sourceLine.indexOf(sourceLine.trim())),
"\"template\": " + toTemplateName(getTemplateUrl(sourceLine)),
_.endsWith(sourceLine, ",") ? "," : ""
].join('');
}
function rewriteLine(sourceLine) {
return hasTemplateUrl(sourceLine) ?
rewriteUrl(sourceLine.replace("templateUrl", "template")) :
sourceLine;
}
function rewriteTemplateUrls(sourceCode) {
return sourceCode.split('\n').map(rewriteLine).join('\n');
}
function migrate(file) {
var sourceCode = fs.readFileSync(file, 'utf8');
fs.writeFileSync(file, rewriteTemplateUrls(
injectRequireArgument(sourceCode, findTemplateURLs(sourceCode))
), 'utf8');
}
glob('platform/**/bundle.js', {}, function (err, files) {
if (err) {
console.log(err);
return;
}
files.forEach(migrate);
});

Some files were not shown because too many files have changed in this diff Show More