Compare commits
193 Commits
live_demo
...
api-tutori
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d475d767d5 | ||
|
|
a63e053399 | ||
|
|
5de7a96ccc | ||
|
|
09a833f524 | ||
|
|
9c4e17bfab | ||
|
|
d3e5d95d6b | ||
|
|
c70793ac2d | ||
|
|
a6ef1d3423 | ||
|
|
c4fec1af6a | ||
|
|
a6996df3df | ||
|
|
0c660238f2 | ||
|
|
b73b824e55 | ||
|
|
1954d98628 | ||
|
|
7aa034ce23 | ||
|
|
385dc5d298 | ||
|
|
a88b4b31a1 | ||
|
|
04112956cf | ||
|
|
f1113fda24 | ||
|
|
33c208d8fe | ||
|
|
c557fb6cd5 | ||
|
|
bde2bc7709 | ||
|
|
5fe759aa91 | ||
|
|
a5b7badb95 | ||
|
|
eefd4c8669 | ||
|
|
7c11f2db4f | ||
|
|
7501f679f7 | ||
|
|
52e087d8f8 | ||
|
|
c5cd495fce | ||
|
|
37a417051d | ||
|
|
97d819739c | ||
|
|
3935378b0c | ||
|
|
952f95aa4c | ||
|
|
0a75a5be1f | ||
|
|
70b593e28a | ||
|
|
ed69a65f9b | ||
|
|
05b4f5401e | ||
|
|
2ff0c7b06a | ||
|
|
2330f1d135 | ||
|
|
ff92d3acab | ||
|
|
32d7187db6 | ||
|
|
00534f8af7 | ||
|
|
3795570938 | ||
|
|
362248a02e | ||
|
|
16d20eabd2 | ||
|
|
eb5566f041 | ||
|
|
757da1dff4 | ||
|
|
85432af187 | ||
|
|
f0ab817e87 | ||
|
|
96af931c0b | ||
|
|
9a5209f7c2 | ||
|
|
0818a7cda0 | ||
|
|
f35947361c | ||
|
|
9a8bcc0550 | ||
|
|
eff46b076c | ||
|
|
ab64b682c3 | ||
|
|
1c007ea256 | ||
|
|
6c1412784b | ||
|
|
6e7f4df5e3 | ||
|
|
5b6ea600ba | ||
|
|
fd9d766913 | ||
|
|
b6502e9ea1 | ||
|
|
25a2321578 | ||
|
|
6fb36374f6 | ||
|
|
9861e63589 | ||
|
|
bce5643994 | ||
|
|
ad5691142e | ||
|
|
e468080373 | ||
|
|
c98c36753c | ||
|
|
1419ff86e8 | ||
|
|
601bc03ba2 | ||
|
|
ea454d65bb | ||
|
|
776586ae25 | ||
|
|
78bf804e02 | ||
|
|
2a4004fd5b | ||
|
|
b5229d7786 | ||
|
|
20ecf168f2 | ||
|
|
dc348f33c5 | ||
|
|
b7cfaf6b63 | ||
|
|
34d5bc4f28 | ||
|
|
e4b192001f | ||
|
|
516b8c9e38 | ||
|
|
f9631ff4c5 | ||
|
|
fa77139077 | ||
|
|
f12b9704d9 | ||
|
|
edb158f2d3 | ||
|
|
b2c6db6207 | ||
|
|
bcdd835275 | ||
|
|
5b4952d4c6 | ||
|
|
de43aa81be | ||
|
|
5eff4e45c9 | ||
|
|
70a13a75d5 | ||
|
|
dcf26d3863 | ||
|
|
a729edd399 | ||
|
|
69cc1086df | ||
|
|
18fa9aeaf6 | ||
|
|
96892722a4 | ||
|
|
54a0de4a08 | ||
|
|
a11dba88b2 | ||
|
|
d08cdfba49 | ||
|
|
031a46aa8e | ||
|
|
ffacf6e1ae | ||
|
|
69c4c3a2c8 | ||
|
|
c305fba0a7 | ||
|
|
44f4a82fa1 | ||
|
|
5bf750c90c | ||
|
|
836b5db8cf | ||
|
|
1753a5473c | ||
|
|
d00e13e4ee | ||
|
|
4b786d3536 | ||
|
|
e6bbc3442b | ||
|
|
433dd87e51 | ||
|
|
cf9eb3f602 | ||
|
|
bd686790dc | ||
|
|
e5ef7c0c22 | ||
|
|
3d891073da | ||
|
|
116c6e57ed | ||
|
|
a39ce566d1 | ||
|
|
671ba66354 | ||
|
|
a5ba72582c | ||
|
|
73c2c01def | ||
|
|
7c82e31b66 | ||
|
|
a58fe1f81c | ||
|
|
2829b8d495 | ||
|
|
3727b287a1 | ||
|
|
c448753bab | ||
|
|
7ade873365 | ||
|
|
8788523c25 | ||
|
|
c301523156 | ||
|
|
46e1347dc8 | ||
|
|
f5539ec678 | ||
|
|
2e8604e18d | ||
|
|
9ed28a4a37 | ||
|
|
3ca9d21bbd | ||
|
|
61683800cc | ||
|
|
4c74391137 | ||
|
|
f3b265bdd5 | ||
|
|
cae85f3e30 | ||
|
|
ab6ef22363 | ||
|
|
09d1c2cd4b | ||
|
|
d6aa31e4aa | ||
|
|
3efaa3b1cb | ||
|
|
2fe9698ea8 | ||
|
|
7fad4e9ea1 | ||
|
|
0390f46460 | ||
|
|
11cfb6e1b8 | ||
|
|
934eb13813 | ||
|
|
a224711dce | ||
|
|
c1ae68b565 | ||
|
|
9351285182 | ||
|
|
aa45e53440 | ||
|
|
f6a9c90cef | ||
|
|
0b11ddbcfd | ||
|
|
5088453712 | ||
|
|
5e44bfc6c7 | ||
|
|
22be6bc860 | ||
|
|
134452582c | ||
|
|
fb56b3ad56 | ||
|
|
8b5a425da6 | ||
|
|
d6ec7e9ab8 | ||
|
|
e470451718 | ||
|
|
5920533637 | ||
|
|
7eb7027b67 | ||
|
|
c7f199a59e | ||
|
|
43176cfbb8 | ||
|
|
f34ef8c4c8 | ||
|
|
1cdbc11894 | ||
|
|
2be6b3f051 | ||
|
|
4f85616632 | ||
|
|
65095d18f2 | ||
|
|
a1a7b2b8ce | ||
|
|
bf232d0593 | ||
|
|
19c9fcd369 | ||
|
|
9526207af8 | ||
|
|
6aeb156a58 | ||
|
|
f380e43219 | ||
|
|
6289fe333b | ||
|
|
c00d77dcb1 | ||
|
|
56a91dfbaf | ||
|
|
f6898d16c9 | ||
|
|
72ef134750 | ||
|
|
a8f7bc01c3 | ||
|
|
2dabe0d3c4 | ||
|
|
dda0628621 | ||
|
|
91bf98b38d | ||
|
|
ac5ac8d34e | ||
|
|
9f840aa0fd | ||
|
|
377786caf9 | ||
|
|
bc8aafbb1f | ||
|
|
02b806ebe0 | ||
|
|
f092bfe653 | ||
|
|
28ae62b4ac | ||
|
|
91fb82d212 | ||
|
|
4a609943f9 |
4
.jscsrc
4
.jscsrc
@@ -1,3 +1,5 @@
|
||||
{
|
||||
"preset": "crockford"
|
||||
"preset": "crockford",
|
||||
"requireMultipleVarDecl": false,
|
||||
"requireVarDeclFirst": false
|
||||
}
|
||||
|
||||
23
.jshintrc
23
.jshintrc
@@ -1,4 +1,23 @@
|
||||
{
|
||||
"validthis": true,
|
||||
"laxbreak": true
|
||||
"bitwise": true,
|
||||
"browser": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"forin": true,
|
||||
"freeze": true,
|
||||
"funcscope": false,
|
||||
"futurehostile": true,
|
||||
"latedef": true,
|
||||
"noarg": true,
|
||||
"nocomma": true,
|
||||
"nonbsp": true,
|
||||
"nonew": true,
|
||||
"predef": [
|
||||
"define",
|
||||
"Promise"
|
||||
],
|
||||
"shadow": "outer",
|
||||
"strict": "implied",
|
||||
"undef": true,
|
||||
"unused": "vars"
|
||||
}
|
||||
|
||||
2
Procfile
2
Procfile
@@ -1 +1 @@
|
||||
web: node app.js --port $PORT --directory dist
|
||||
web: node app.js --port $PORT
|
||||
|
||||
21
app.js
21
app.js
@@ -17,10 +17,6 @@
|
||||
fs = require('fs'),
|
||||
request = require('request');
|
||||
|
||||
var proxyUrls = [
|
||||
'http://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php'
|
||||
];
|
||||
|
||||
// Defaults
|
||||
options.port = options.port || options.p || 8080;
|
||||
options.directory = options.directory || options.D || '.';
|
||||
@@ -69,18 +65,11 @@
|
||||
});
|
||||
|
||||
app.use('/proxyUrl', function proxyRequest(req, res, next) {
|
||||
if (proxyUrls.indexOf(req.query.url) !== -1) {
|
||||
res.header("Access-Control-Allow-Origin", "https://nasa.github.io");
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||
|
||||
console.log('Proxying request to: ', req.query.url);
|
||||
req.pipe(request({
|
||||
url: req.query.url,
|
||||
strictSSL: false
|
||||
}).on('error', next)).pipe(res);
|
||||
} else {
|
||||
res.status(400).send();
|
||||
}
|
||||
console.log('Proxying request to: ', req.query.url);
|
||||
req.pipe(request({
|
||||
url: req.query.url,
|
||||
strictSSL: false
|
||||
}).on('error', next)).pipe(res);
|
||||
});
|
||||
|
||||
// Expose everything else as static files
|
||||
|
||||
@@ -13,11 +13,13 @@
|
||||
"moment-duration-format": "^1.3.0",
|
||||
"requirejs": "~2.1.22",
|
||||
"text": "requirejs-text#^2.0.14",
|
||||
"es6-promise": "^3.3.0",
|
||||
"es6-promise": "^3.0.2",
|
||||
"screenfull": "^3.0.0",
|
||||
"node-uuid": "^1.4.7",
|
||||
"comma-separated-values": "^3.6.4",
|
||||
"FileSaver.js": "^0.0.2",
|
||||
"zepto": "^1.1.6"
|
||||
"zepto": "^1.1.6",
|
||||
"eventemitter3": "^1.2.0",
|
||||
"lodash": "3.10.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#*****************************************************************************
|
||||
#* Open MCT, Copyright (c) 2014-2016, United States Government
|
||||
#* as represented by the Administrator of the National Aeronautics and Space
|
||||
#* Administration. All rights reserved.
|
||||
#*
|
||||
#* Open MCT 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 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.
|
||||
#*****************************************************************************
|
||||
|
||||
# Script to build and deploy docs.
|
||||
|
||||
OUTPUT_DIRECTORY="dist"
|
||||
# Docs, once built, are pushed to the private website repo
|
||||
REPOSITORY_URL="git@github.com:nasa/openmct-website.git"
|
||||
WEBSITE_DIRECTORY="website"
|
||||
LIVE_DEMO_DIRECTORY="assets/live-demo"
|
||||
|
||||
BUILD_SHA=`git rev-parse HEAD`
|
||||
|
||||
# A remote will be created for the git repository we are pushing to.
|
||||
# Don't worry, as this entire directory will get trashed in between builds.
|
||||
REMOTE_NAME="website"
|
||||
WEBSITE_BRANCH="master"
|
||||
|
||||
echo "git clone $REPOSITORY_URL website"
|
||||
git clone $REPOSITORY_URL $WEBSITE_DIRECTORY || exit 1
|
||||
echo "cp -r $OUTPUT_DIRECTORY/** $WEBSITE_DIRECTORY/$LIVE_DEMO_DIRECTORY"
|
||||
cp -r $OUTPUT_DIRECTORY/** $WEBSITE_DIRECTORY/$LIVE_DEMO_DIRECTORY
|
||||
echo "cd $WEBSITE_DIRECTORY"
|
||||
cd $WEBSITE_DIRECTORY || exit 1
|
||||
|
||||
# Configure github for CircleCI user.
|
||||
git config user.email "buildbot@circleci.com"
|
||||
git config user.name "BuildBot"
|
||||
|
||||
echo "git add ."
|
||||
git add .
|
||||
echo "git commit -m \"Live demo updated from build $BUILD_SHA\""
|
||||
git commit -m "Live demo updated from build $BUILD_SHA"
|
||||
# Push to the website repo
|
||||
git push
|
||||
@@ -22,17 +22,19 @@
|
||||
#* at runtime from the About dialog for additional information.
|
||||
#*****************************************************************************
|
||||
|
||||
# Script to build and deploy docs to github pages.
|
||||
# Script to build and deploy docs.
|
||||
|
||||
OUTPUT_DIRECTORY="target/docs"
|
||||
REPOSITORY_URL="git@github.com:nasa/openmctweb.git"
|
||||
# Docs, once built, are pushed to the private website repo
|
||||
REPOSITORY_URL="git@github.com:nasa/openmct-website.git"
|
||||
WEBSITE_DIRECTORY="website"
|
||||
|
||||
BUILD_SHA=`git rev-parse head`
|
||||
BUILD_SHA=`git rev-parse HEAD`
|
||||
|
||||
# A remote will be created for the git repository we are pushing to.
|
||||
# Don't worry, as this entire directory will get trashed inbetween builds.
|
||||
REMOTE_NAME="documentation"
|
||||
WEBSITE_BRANCH="gh-pages"
|
||||
WEBSITE_BRANCH="master"
|
||||
|
||||
# Clean output directory, JSDOC will recreate
|
||||
if [ -d $OUTPUT_DIRECTORY ]; then
|
||||
@@ -40,23 +42,21 @@ if [ -d $OUTPUT_DIRECTORY ]; then
|
||||
fi
|
||||
|
||||
npm run docs
|
||||
cd $OUTPUT_DIRECTORY || exit 1
|
||||
|
||||
echo "git init"
|
||||
git init
|
||||
echo "git clone $REPOSITORY_URL website"
|
||||
git clone $REPOSITORY_URL website || exit 1
|
||||
echo "cp -r $OUTPUT_DIRECTORY $WEBSITE_DIRECTORY/docs"
|
||||
cp -r $OUTPUT_DIRECTORY $WEBSITE_DIRECTORY/docs
|
||||
echo "cd $WEBSITE_DIRECTORY"
|
||||
cd $WEBSITE_DIRECTORY || exit 1
|
||||
|
||||
# Configure github for CircleCI user.
|
||||
git config user.email "buildbot@circleci.com"
|
||||
git config user.name "BuildBot"
|
||||
|
||||
echo "git remote add $REMOTE_NAME $REPOSITORY_URL"
|
||||
git remote add $REMOTE_NAME $REPOSITORY_URL
|
||||
echo "git add ."
|
||||
git add .
|
||||
echo "git commit -m \"Generate docs from build $BUILD_SHA\""
|
||||
git commit -m "Generate docs from build $BUILD_SHA"
|
||||
|
||||
echo "git push $REMOTE_NAME HEAD:$WEBSITE_BRANCH -f"
|
||||
git push $REMOTE_NAME HEAD:$WEBSITE_BRANCH -f
|
||||
|
||||
echo "Documentation pushed to gh-pages branch."
|
||||
echo "git commit -m \"Docs updated from build $BUILD_SHA\""
|
||||
git commit -m "Docs updated from build $BUILD_SHA"
|
||||
# Push to the website repo
|
||||
git push
|
||||
|
||||
20
circle.yml
20
circle.yml
@@ -2,14 +2,24 @@ deployment:
|
||||
production:
|
||||
branch: master
|
||||
commands:
|
||||
- npm install canvas nomnoml
|
||||
- ./build-docs.sh
|
||||
- git push git@heroku.com:openmctweb-demo.git $CIRCLE_SHA1:refs/heads/master
|
||||
|
||||
- npm install canvas nomnoml
|
||||
- ./build-docs.sh
|
||||
- git fetch --unshallow
|
||||
- git push git@heroku.com:openmctweb-demo.git $CIRCLE_SHA1:refs/heads/master
|
||||
openmct-demo:
|
||||
branch: live_demo
|
||||
heroku:
|
||||
appname: openmct-demo
|
||||
openmctweb-staging-deux:
|
||||
branch: mobile
|
||||
heroku:
|
||||
appname: openmctweb-staging-deux
|
||||
test:
|
||||
post:
|
||||
- npm run jshint --silent
|
||||
- gulp lint
|
||||
- gulp checkstyle
|
||||
|
||||
general:
|
||||
branches:
|
||||
ignore:
|
||||
- gh-pages
|
||||
|
||||
244
demo/bundle.js
244
demo/bundle.js
@@ -1,244 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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/conductor/DemoConductorRepresenter",
|
||||
"./src/DemoInitializer",
|
||||
"./src/conductor/ConductorServiceDecorator",
|
||||
"./src/telemetry/DemoTelemetryProvider",
|
||||
"./src/DemoModelProvider",
|
||||
"./src/policies/CollectionViewPolicy",
|
||||
'text!./res/image-template.html',
|
||||
"text!../platform/commonUI/browse/res/templates/items/items.html",
|
||||
'legacyRegistry'
|
||||
], function (
|
||||
DemoConductorRepresenter,
|
||||
DemoInitializer,
|
||||
ConductorServiceDecorator,
|
||||
DemoTelemetryProvider,
|
||||
DemoModelProvider,
|
||||
CollectionViewPolicy,
|
||||
ImageTemplate,
|
||||
ItemsTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("demo", {
|
||||
"name": "Live Demo configuration",
|
||||
"description": "Adds demo data types, and demo-specific behavior",
|
||||
"extensions": {
|
||||
"representers": [
|
||||
{
|
||||
"implementation": DemoConductorRepresenter,
|
||||
"depends": ["$q", "$compile", "conductorService", "views[]", "throttle", "navigationService"]
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"implementation": ConductorServiceDecorator,
|
||||
"provides": "conductorService",
|
||||
"type": "decorator"
|
||||
},
|
||||
{
|
||||
"implementation": DemoTelemetryProvider,
|
||||
"type": "provider",
|
||||
"provides": "telemetryService",
|
||||
"depends": ["$q", "$timeout"]
|
||||
},
|
||||
{
|
||||
"implementation": DemoModelProvider,
|
||||
"provides": "modelService",
|
||||
"type": "provider",
|
||||
"priority": "fallback"
|
||||
},
|
||||
],
|
||||
"runs": [
|
||||
{
|
||||
"implementation": DemoInitializer,
|
||||
"depends": [
|
||||
"$timeout",
|
||||
"representers[]",
|
||||
"objectService",
|
||||
"$location",
|
||||
"agentService"
|
||||
]
|
||||
}
|
||||
],
|
||||
"roots": [
|
||||
{
|
||||
"id":"demo:realtime",
|
||||
"model": {
|
||||
"type":"collection",
|
||||
"name": "Real-time Telemetry",
|
||||
"composition": [
|
||||
"be3d5df3-cc6e-4b8b-9865-fcd844e55b94",
|
||||
"930dd0b9-9d98-4908-b19c-c1c887117d42"
|
||||
]
|
||||
},
|
||||
"priority": "preferred"
|
||||
}
|
||||
],
|
||||
"types": [
|
||||
{
|
||||
"key": "demo-telemetry",
|
||||
"name": "Spacecraft Telemetry Generator",
|
||||
"glyph": "T",
|
||||
"description": "Mock realtime spacecraft telemetry",
|
||||
"model": {
|
||||
"telemetry": {
|
||||
"period": 1000,
|
||||
"multiplier": 10
|
||||
}
|
||||
},
|
||||
"telemetry": {
|
||||
"source": "demo-telemetry",
|
||||
"domains": [
|
||||
{
|
||||
"key": "time",
|
||||
"name": "Time"
|
||||
}
|
||||
],
|
||||
"ranges": [
|
||||
{
|
||||
"key": "value",
|
||||
"name": "value"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "image-include",
|
||||
"name": "Image include",
|
||||
"glyph": "ã",
|
||||
"description": "An image include that is resized to fit" +
|
||||
" its container",
|
||||
"views": [
|
||||
"image-view"
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"key": "url",
|
||||
"name": "URL",
|
||||
"control": "textfield",
|
||||
"pattern": "^(ftp|https?)\\:\\/\\/\\w+(\\.\\w+)*(\\:\\d+)?(\\/\\S*)*$",
|
||||
"required": true,
|
||||
"cssclass": "l-input-lg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "demo.plot",
|
||||
"name": "Telemetry Plot",
|
||||
"glyph": "t",
|
||||
"description": "A view that will plot telemetry in a" +
|
||||
" chart.",
|
||||
"priority": 899,
|
||||
"delegates": [
|
||||
"telemetry"
|
||||
],
|
||||
"views": [
|
||||
"plot"
|
||||
],
|
||||
"features": "creation",
|
||||
"contains": [
|
||||
{
|
||||
"has": "telemetry"
|
||||
}
|
||||
],
|
||||
"model": {
|
||||
"composition": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Collection",
|
||||
"key": "collection",
|
||||
"glyph": "o",
|
||||
"views": [
|
||||
"collection-view"
|
||||
],
|
||||
"model": {"composition": []}
|
||||
}
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Hopscotch",
|
||||
"version": "0.2.5",
|
||||
"author": "linkedin",
|
||||
"description": "Hopscotch is a framework to make it easy" +
|
||||
" for developers to add product tours to their pages.",
|
||||
"license": "license-apache",
|
||||
"website": "http://linkedin.github.io/hopscotch/",
|
||||
"link": "https://raw.githubusercontent.com/linkedin/hopscotch/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"stylesheets": [
|
||||
{
|
||||
"stylesheetUrl": "css/hopscotch.css",
|
||||
priority: "fallback"
|
||||
|
||||
},
|
||||
{
|
||||
"stylesheetUrl": "css/tour.css"
|
||||
},
|
||||
{
|
||||
"stylesheetUrl": "css/image.css"
|
||||
}
|
||||
],
|
||||
"constants": [
|
||||
{
|
||||
"key": "PLOT_FIXED_DURATION",
|
||||
"value": 60000,
|
||||
"comment": "1 minute."
|
||||
}
|
||||
],
|
||||
"policies": [
|
||||
{
|
||||
"category": "view",
|
||||
"implementation": CollectionViewPolicy
|
||||
}
|
||||
],
|
||||
"views": [
|
||||
{
|
||||
"template": ImageTemplate,
|
||||
"name": "ImageInclude",
|
||||
"type": "image-include",
|
||||
"key": "image-view",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": "collection-view",
|
||||
"name": "collection",
|
||||
"glyph": "9",
|
||||
"description": "Grid of available items",
|
||||
"template": ItemsTemplate,
|
||||
"uses": [
|
||||
"composition"
|
||||
],
|
||||
"editable": false
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
17
demo/lib/hopscotch/hopscotch.min.js
vendored
17
demo/lib/hopscotch/hopscotch.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,521 +0,0 @@
|
||||
/**! hopscotch - v0.2.5
|
||||
*
|
||||
* Copyright 2015 LinkedIn Corp. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
/**
|
||||
* This fade animation is based on Dan Eden's animate.css (http://daneden.me/animate/), under the terms of the MIT license.
|
||||
*
|
||||
* Copyright 2013 Dan Eden.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
.animated {
|
||||
-webkit-animation-fill-mode: both;
|
||||
-moz-animation-fill-mode: both;
|
||||
-ms-animation-fill-mode: both;
|
||||
-o-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
-webkit-animation-duration: 1s;
|
||||
-moz-animation-duration: 1s;
|
||||
-ms-animation-duration: 1s;
|
||||
-o-animation-duration: 1s;
|
||||
animation-duration: 1s;
|
||||
}
|
||||
@-webkit-keyframes fadeInUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes fadeInUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateY(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@-o-keyframes fadeInUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-o-transform: translateY(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-o-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@keyframes fadeInUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
.fade-in-up {
|
||||
-webkit-animation-name: fadeInUp;
|
||||
-moz-animation-name: fadeInUp;
|
||||
-o-animation-name: fadeInUp;
|
||||
animation-name: fadeInUp;
|
||||
}
|
||||
@-webkit-keyframes fadeInDown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes fadeInDown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateY(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@-o-keyframes fadeInDown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-ms-transform: translateY(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-ms-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@keyframes fadeInDown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
.fade-in-down {
|
||||
-webkit-animation-name: fadeInDown;
|
||||
-moz-animation-name: fadeInDown;
|
||||
-o-animation-name: fadeInDown;
|
||||
animation-name: fadeInDown;
|
||||
}
|
||||
@-webkit-keyframes fadeInRight {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateX(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes fadeInRight {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateX(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@-o-keyframes fadeInRight {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-o-transform: translateX(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-o-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@keyframes fadeInRight {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
.fade-in-right {
|
||||
-webkit-animation-name: fadeInRight;
|
||||
-moz-animation-name: fadeInRight;
|
||||
-o-animation-name: fadeInRight;
|
||||
animation-name: fadeInRight;
|
||||
}
|
||||
@-webkit-keyframes fadeInLeft {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateX(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes fadeInLeft {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateX(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@-o-keyframes fadeInLeft {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-o-transform: translateX(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-o-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@keyframes fadeInLeft {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
.fade-in-left {
|
||||
-webkit-animation-name: fadeInLeft;
|
||||
-moz-animation-name: fadeInLeft;
|
||||
-o-animation-name: fadeInLeft;
|
||||
animation-name: fadeInLeft;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button {
|
||||
/* borrowed from katy styles */
|
||||
font-weight: bold;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
text-decoration: none !important;
|
||||
width: auto;
|
||||
padding: 0 10px;
|
||||
height: 26px;
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
*zoom: 1;
|
||||
white-space: nowrap;
|
||||
display: -moz-inline-stack;
|
||||
display: inline-block;
|
||||
*vertical-align: auto;
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
vertical-align: middle;
|
||||
-moz-border-radius: 3px;
|
||||
-ms-border-radius: 3px;
|
||||
-o-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button:hover {
|
||||
*zoom: 1;
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
|
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button:active {
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) inset;
|
||||
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) inset;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) inset;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button.next {
|
||||
border-color: #1b5480;
|
||||
color: #fff;
|
||||
margin: 0 0 0 10px;
|
||||
/* HS specific*/
|
||||
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
|
||||
background-color: #287bbc;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#287bbc', endColorstr='#23639a');
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #287bbc), color-stop(100%, #23639a));
|
||||
background-image: -webkit-linear-gradient(top, #287bbc 0%, #23639a 100%);
|
||||
background-image: -moz-linear-gradient(top, #287bbc 0%, #23639a 100%);
|
||||
background-image: -o-linear-gradient(top, #287bbc 0%, #23639a 100%);
|
||||
background-image: linear-gradient(top, #287bbc 0%, #23639a 100%);
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button.next:hover {
|
||||
background-color: #2672ae;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#2672ae', endColorstr='#1e4f7e');
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #2672ae), color-stop(100%, #1e4f7e));
|
||||
background-image: -webkit-linear-gradient(top, #2672ae 0%, #1e4f7e 100%);
|
||||
background-image: -moz-linear-gradient(top, #2672ae 0%, #1e4f7e 100%);
|
||||
background-image: -o-linear-gradient(top, #2672ae 0%, #1e4f7e 100%);
|
||||
background-image: linear-gradient(top, #2672ae 0%, #1e4f7e 100%);
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button.prev {
|
||||
border-color: #a7a7a7;
|
||||
color: #444;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
||||
background-color: #f2f2f2;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#f2f2f2', endColorstr='#e9e9e9');
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f2f2f2), color-stop(100%, #e9e9e9));
|
||||
background-image: -webkit-linear-gradient(top, #f2f2f2 0%, #e9e9e9 100%);
|
||||
background-image: -moz-linear-gradient(top, #f2f2f2 0%, #e9e9e9 100%);
|
||||
background-image: -o-linear-gradient(top, #f2f2f2 0%, #e9e9e9 100%);
|
||||
background-image: linear-gradient(top, #f2f2f2 0%, #e9e9e9 100%);
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button.prev:hover {
|
||||
background-color: #e8e8e8;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFE8E8E8', endColorstr='#FFA9A9A9');
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e8e8e8), color-stop(13%, #e3e3e3), color-stop(32%, #d7d7d7), color-stop(71%, #b9b9b9), color-stop(100%, #a9a9a9));
|
||||
background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #e3e3e3 13%, #d7d7d7 32%, #b9b9b9 71%, #a9a9a9 100%);
|
||||
background-image: -moz-linear-gradient(top, #e8e8e8 0%, #e3e3e3 13%, #d7d7d7 32%, #b9b9b9 71%, #a9a9a9 100%);
|
||||
background-image: -o-linear-gradient(top, #e8e8e8 0%, #e3e3e3 13%, #d7d7d7 32%, #b9b9b9 71%, #a9a9a9 100%);
|
||||
background-image: linear-gradient(top, #e8e8e8 0%, #e3e3e3 13%, #d7d7d7 32%, #b9b9b9 71%, #a9a9a9 100%);
|
||||
}
|
||||
div.hopscotch-bubble {
|
||||
background-color: #ffffff;
|
||||
border: 5px solid #000000;
|
||||
border-radius: 10px;
|
||||
/* default */
|
||||
border: 5px solid rgba(0, 0, 0, 0.3);
|
||||
/* transparent, if supported */
|
||||
color: #333;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial;
|
||||
font-size: 13px;
|
||||
position: absolute;
|
||||
z-index: 999999;
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
-moz-background-clip: padding;
|
||||
/* for Mozilla browsers*/
|
||||
-webkit-background-clip: padding;
|
||||
/* Webkit */
|
||||
background-clip: padding-box;
|
||||
/* browsers with full support */
|
||||
}
|
||||
div.hopscotch-bubble * {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
div.hopscotch-bubble.animate {
|
||||
-moz-transition-property: top, left;
|
||||
-moz-transition-duration: 1s;
|
||||
-moz-transition-timing-function: ease-in-out;
|
||||
-ms-transition-property: top, left;
|
||||
-ms-transition-duration: 1s;
|
||||
-ms-transition-timing-function: ease-in-out;
|
||||
-o-transition-property: top, left;
|
||||
-o-transition-duration: 1s;
|
||||
-o-transition-timing-function: ease-in-out;
|
||||
-webkit-transition-property: top, left;
|
||||
-webkit-transition-duration: 1s;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-property: top, left;
|
||||
transition-duration: 1s;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
div.hopscotch-bubble.invisible {
|
||||
opacity: 0;
|
||||
}
|
||||
div.hopscotch-bubble.hide,
|
||||
div.hopscotch-bubble .hide,
|
||||
div.hopscotch-bubble .hide-all {
|
||||
display: none;
|
||||
}
|
||||
div.hopscotch-bubble h3 {
|
||||
color: #000;
|
||||
font-family: Helvetica, Arial;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
line-height: 19px;
|
||||
margin: -1px 15px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-container {
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
/* to fix text flickering */
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-content {
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial;
|
||||
font-weight: normal;
|
||||
line-height: 17px;
|
||||
margin: -5px 0 11px;
|
||||
padding-top: 8px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-content {
|
||||
margin: 0;
|
||||
}
|
||||
div.hopscotch-bubble.no-number .hopscotch-bubble-content {
|
||||
margin: 0;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-close {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
border: 0;
|
||||
color: #000;
|
||||
background: transparent url(../img/sprite-green.png) -192px -92px no-repeat;
|
||||
display: block;
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
text-decoration: none;
|
||||
text-indent: -9999px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-close.hide,
|
||||
div.hopscotch-bubble .hopscotch-bubble-close.hide-all {
|
||||
display: none;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-number {
|
||||
display: none;
|
||||
/* background: transparent url(../img/sprite-green.png) 0 0 no-repeat;
|
||||
color: #fff;
|
||||
display: block;
|
||||
float: left;
|
||||
font-size: 17px;
|
||||
font-weight: bold;
|
||||
line-height: 31px;
|
||||
padding: 0 10px 0 0;
|
||||
text-align: center;
|
||||
width: 30px;
|
||||
height: 30px; */
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container {
|
||||
position: absolute;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container .hopscotch-bubble-arrow,
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container .hopscotch-bubble-arrow-border {
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.up {
|
||||
top: -22px;
|
||||
left: 10px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.up .hopscotch-bubble-arrow {
|
||||
border-bottom: 17px solid #ffffff;
|
||||
border-left: 17px solid transparent;
|
||||
border-right: 17px solid transparent;
|
||||
position: relative;
|
||||
top: -10px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.up .hopscotch-bubble-arrow-border {
|
||||
border-bottom: 17px solid #000000;
|
||||
border-bottom: 17px solid rgba(0, 0, 0, 0.5);
|
||||
border-left: 17px solid transparent;
|
||||
border-right: 17px solid transparent;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.down {
|
||||
bottom: -39px;
|
||||
left: 10px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.down .hopscotch-bubble-arrow {
|
||||
border-top: 17px solid #ffffff;
|
||||
border-left: 17px solid transparent;
|
||||
border-right: 17px solid transparent;
|
||||
position: relative;
|
||||
top: -24px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.down .hopscotch-bubble-arrow-border {
|
||||
border-top: 17px solid #000000;
|
||||
border-top: 17px solid rgba(0, 0, 0, 0.5);
|
||||
border-left: 17px solid transparent;
|
||||
border-right: 17px solid transparent;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.left {
|
||||
top: 10px;
|
||||
left: -22px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.left .hopscotch-bubble-arrow {
|
||||
border-bottom: 17px solid transparent;
|
||||
border-right: 17px solid #ffffff;
|
||||
border-top: 17px solid transparent;
|
||||
position: relative;
|
||||
left: 7px;
|
||||
top: -34px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.left .hopscotch-bubble-arrow-border {
|
||||
border-right: 17px solid #000000;
|
||||
border-right: 17px solid rgba(0, 0, 0, 0.5);
|
||||
border-bottom: 17px solid transparent;
|
||||
border-top: 17px solid transparent;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.right {
|
||||
top: 10px;
|
||||
right: -39px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.right .hopscotch-bubble-arrow {
|
||||
border-bottom: 17px solid transparent;
|
||||
border-left: 17px solid #ffffff;
|
||||
border-top: 17px solid transparent;
|
||||
position: relative;
|
||||
left: -7px;
|
||||
top: -34px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.right .hopscotch-bubble-arrow-border {
|
||||
border-left: 17px solid #000000;
|
||||
border-left: 17px solid rgba(0, 0, 0, 0.5);
|
||||
border-bottom: 17px solid transparent;
|
||||
border-top: 17px solid transparent;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-actions {
|
||||
margin: 10px 0 0;
|
||||
text-align: right;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
.mct-tour {
|
||||
z-index: 100;
|
||||
}
|
||||
.hopscotch-content a {
|
||||
color: #999;
|
||||
}
|
||||
.hopscotch-content a {
|
||||
color: #999;
|
||||
}
|
||||
.hopscotch-content a:hover {
|
||||
color: #0099cc;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<!--
|
||||
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>
|
||||
<img class="scaled" ng-src="{{model.url}}">
|
||||
</div>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB |
@@ -1,4 +0,0 @@
|
||||
.scaled {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
[
|
||||
"../../platform/features/conductor/src/ConductorRepresenter",
|
||||
"../lib/hopscotch/hopscotch.min",
|
||||
"./Tour.js",
|
||||
"zepto"
|
||||
],
|
||||
function (ConductorRepresenter, hopscotch, tour, $) {
|
||||
"use strict";
|
||||
|
||||
function DemoInitializer($timeout, representers, objectService, $location, agentService) {
|
||||
|
||||
function indexOf(array, callback) {
|
||||
return array.reduce(function (previous, element, index) {
|
||||
if (previous === -1 && callback(element)) {
|
||||
return index;
|
||||
} else {
|
||||
return previous;
|
||||
}
|
||||
}, -1);
|
||||
}
|
||||
|
||||
function removeRepresenter(type) {
|
||||
var index = indexOf(representers, function (representer) {
|
||||
return representer.implementation === type;
|
||||
});
|
||||
if (index !== -1) {
|
||||
representers.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
removeRepresenter(ConductorRepresenter);
|
||||
|
||||
objectService.getObjects([
|
||||
"mine"
|
||||
]).then(function (objects) {
|
||||
[
|
||||
"88a26104-8bd5-445d-8b57-10b567d2823d",
|
||||
"f3744144-8842-4b7a-bddc-4abbf21315d9",
|
||||
"a32079d0-676b-4e9f-ade7-86d5d2f152fc",
|
||||
"a330490d-59ba-4c0c-b046-e5450f29f39b",
|
||||
"934b199f-917e-46a2-9935-3117a9e29218",
|
||||
"b171cc31-2cc5-4ae9-ba40-baf1163f22c4"
|
||||
].forEach(function (id, index) {
|
||||
objects['mine'].getCapability('composition').add(id, index);
|
||||
});
|
||||
//For default route, redirect user to layout
|
||||
if ($location.path().length == 0 || $location.path() === "/") {
|
||||
$location.url("browse/mine/88a26104-8bd5-445d-8b57-10b567d2823d?view=layout");
|
||||
}
|
||||
});
|
||||
|
||||
if (!agentService.isMobile() &&
|
||||
!window.opener) {
|
||||
$timeout(function () {
|
||||
hopscotch.endTour(true);
|
||||
hopscotch.startTour(tour);
|
||||
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
return DemoInitializer;
|
||||
}
|
||||
);
|
||||
175
demo/src/Tour.js
175
demo/src/Tour.js
@@ -1,175 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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";
|
||||
|
||||
return {
|
||||
id: "hello-hopscotch",
|
||||
steps: [
|
||||
{
|
||||
title: "Welcome to Open MCT",
|
||||
content: "This brief tour will introduce you" +
|
||||
" to the main elements and concepts of the application. To cancel at any time, click the 'x' in the top right of this box, or click 'Next' to continue.",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px"
|
||||
},
|
||||
{
|
||||
title: "Object Tree",
|
||||
content: "This contains all the objects you have access to, both telemetry objects and user-created objects. ",
|
||||
target: "mct-tree ul.tree",
|
||||
placement: "right"
|
||||
},
|
||||
{
|
||||
title: "View Area",
|
||||
content: "This area shows the contents of a selected item. Different types of items provide different views of their contents.",
|
||||
target: ".object-holder-main",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "200px",
|
||||
arrowOffset: "center"
|
||||
},
|
||||
{
|
||||
title: "Create Button",
|
||||
content: "Many objects in the application are created via this button. <b>Click it now</b> to view the Create menu, and rollover each item in the menu to see more information about it. Or, click 'Next' to continue.",
|
||||
target: ".create-btn",
|
||||
placement: "right",
|
||||
yOffset: "-10px",
|
||||
nextOnTargetClick: true
|
||||
},
|
||||
{
|
||||
title: "Inspection Pane",
|
||||
content: "This pane shows useful information about the currently selected item.",
|
||||
target: ".split-pane-component.t-inspect",
|
||||
placement: "left"
|
||||
},
|
||||
{
|
||||
title: "Search",
|
||||
content: "Search filters items in the Object Tree by their name. You can also filter by object type by clicking the 'down' arrow in the right side of the input.",
|
||||
target: ".search-bar",
|
||||
placement: "right",
|
||||
yOffset: "-20px"
|
||||
},
|
||||
{
|
||||
title: "Editing",
|
||||
content: "This part of the tour will step you through editing an object. Click 'Next' to continue.",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px"
|
||||
},
|
||||
{
|
||||
title: "Select Object to Edit",
|
||||
content: "Expand the 'My Items' folder and click on the 'Edit Display Layout Example' object to select it. Click 'Next' when you're ready to continue.",
|
||||
target: "mct-tree ul.tree",
|
||||
placement: "right",
|
||||
yOffset: "20px"
|
||||
},
|
||||
{
|
||||
title: "Edit Button",
|
||||
content: "<b>Click this button now</b> to begin editing the current object.",
|
||||
target: ".object-browse-bar .btn-bar",
|
||||
placement: "bottom",
|
||||
arrowOffset: "170px",
|
||||
width: "200px",
|
||||
xOffset: "-180px",
|
||||
nextOnTargetClick: true
|
||||
},
|
||||
{
|
||||
title: "Editing",
|
||||
content: "Each type of object can be edited in different ways. This Display Layout allows you to add, position, size and remove many different types of objects. ",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px",
|
||||
nextOnTargetClick: true
|
||||
},
|
||||
{
|
||||
title: "Adding an Object",
|
||||
content: "Let’s add a telemetry element into our layout. Expand 'Real-time Telemetry', then 'Rover Subsystems', then 'Thermal'. Drag 'Wheel RL Temp' into the empty space in the example layout, then click 'Next' to continue.",
|
||||
target: "mct-tree ul.tree",
|
||||
yOffset: "50px",
|
||||
placement: "right"
|
||||
},
|
||||
{
|
||||
title: "Positioning and Resizing",
|
||||
content: "Any object in a layout can be positioned and resized. Mouse over the object, and grab a corner and drag it to make it fit in the empty spot. When you’re done, click 'Next' to continue.",
|
||||
target: ".user-environ",
|
||||
placement: "left",
|
||||
xOffset: "center",
|
||||
yOffset: "200px"
|
||||
},
|
||||
{
|
||||
title: "Elements Pool",
|
||||
content: "When the Object Inspector is expanded, this " +
|
||||
"area lists all objects in the current object. " +
|
||||
"To remove an object, right-click it and choose 'Remove' " +
|
||||
"from the context menu.",
|
||||
target: ".holder-elements",
|
||||
placement: "left"
|
||||
},
|
||||
{
|
||||
title: "Saving",
|
||||
content: "When you are done editing, click 'Save' to save and exit editing. To exit without saving any changes, click the 'X' button.",
|
||||
target: ".t-save",
|
||||
width: "200px",
|
||||
placement: "bottom",
|
||||
nextOnTargetClick: true
|
||||
},
|
||||
{
|
||||
title: "Object Types",
|
||||
content: "Try experimenting by creating" +
|
||||
" different object types, and adding objects to them by dragging them from the tree. Only certain types of objects can be dragged into a given object type - if a type of object can’t be added, it simply won’t. ",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px"
|
||||
},
|
||||
{
|
||||
title: "Thank You",
|
||||
content: "<p>That’s the end of the tour." +
|
||||
" Thanks" +
|
||||
" for your time, and we hope you enjoy using" +
|
||||
" and contributing to Open MCT!</p> " +
|
||||
" <p>To find out more about Open MCT," +
|
||||
" please visit our website -<p>" +
|
||||
"<a target=\"_blank\"" +
|
||||
" href=\"https://nasa.github.io/openmct/\">" +
|
||||
"<strong>https://nasa.github.io/openmct</strong></a>",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -1,87 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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 that will test whether a given object OR all of its
|
||||
* support historical telemetry
|
||||
*/
|
||||
function ConductorPolicy($q) {
|
||||
this.$q = $q;
|
||||
}
|
||||
|
||||
function fastPromise(value) {
|
||||
return {
|
||||
then: function (callback) {
|
||||
return fastPromise(callback(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function and(array) {
|
||||
return array.reduce(function (previous, next) {
|
||||
return previous && next;
|
||||
}, true);
|
||||
}
|
||||
|
||||
function or(array) {
|
||||
return array.reduce(function (previous, next) {
|
||||
return previous || next;
|
||||
}, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {DomainObject} candidate
|
||||
* @returns {Promise} a promise resolved with true if the object
|
||||
* supports historical telemetry
|
||||
*/
|
||||
ConductorPolicy.prototype.allow = function (candidate) {
|
||||
var self = this;
|
||||
|
||||
//Does the object itself allow the time conductor?
|
||||
if (candidate.hasCapability('telemetry') && candidate.getCapability('telemetry').getMetadata().historical) {
|
||||
return fastPromise(true);
|
||||
} else {
|
||||
//If not, do all of its constituents allow time conductor?
|
||||
if (candidate.hasCapability('composition')) {
|
||||
return candidate.useCapability('composition').then(function (composition) {
|
||||
if (composition.length === 0 ) {
|
||||
return fastPromise(false);
|
||||
} else {
|
||||
return self.$q.all(composition.map(self.allow.bind(self))).then(or);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//if no, hide time conductor
|
||||
return fastPromise(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return ConductorPolicy;
|
||||
}
|
||||
);
|
||||
@@ -1,40 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
function ConductorServiceDecorator(conductorService) {
|
||||
this.conductorService = conductorService;
|
||||
conductorService.getConductor().displayStart(Date.UTC(2012,8,7));
|
||||
}
|
||||
|
||||
ConductorServiceDecorator.prototype.getConductor = function () {
|
||||
return this.conductorService.getConductor();
|
||||
};
|
||||
|
||||
return ConductorServiceDecorator;
|
||||
}
|
||||
);
|
||||
@@ -1,73 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
[
|
||||
"zepto",
|
||||
"./ConductorPolicy",
|
||||
"../../../platform/features/conductor/src/ConductorRepresenter"
|
||||
],
|
||||
function ($, ConductorPolicy, ConductorRepresenter) {
|
||||
"use strict";
|
||||
|
||||
function DemoConductorRepresenter(
|
||||
$q,
|
||||
$compile,
|
||||
conductorService,
|
||||
views,
|
||||
throttle,
|
||||
navigationService,
|
||||
scope,
|
||||
element
|
||||
) {
|
||||
this.scope = scope;
|
||||
this.element = element;
|
||||
this.views = views;
|
||||
this.conductorPolicy = new ConductorPolicy($q);
|
||||
this.navigationService = navigationService;
|
||||
|
||||
ConductorRepresenter.call(this,
|
||||
throttle,
|
||||
conductorService,
|
||||
$compile,
|
||||
views,
|
||||
scope,
|
||||
element);
|
||||
}
|
||||
|
||||
DemoConductorRepresenter.prototype = Object.create(ConductorRepresenter.prototype);
|
||||
|
||||
DemoConductorRepresenter.prototype.represent = function (representation, representedObject) {
|
||||
var self = this;
|
||||
if (this.views.indexOf(representation) !== -1 && representedObject.getId() === this.navigationService.getNavigation().getId()) {
|
||||
|
||||
this.conductorPolicy.allow(representedObject).then(function (show) {
|
||||
if (show && representation.type !== 'folder') {
|
||||
ConductorRepresenter.prototype.represent.call(self, representation, representedObject);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return DemoConductorRepresenter;
|
||||
});
|
||||
@@ -1,162 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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*/
|
||||
|
||||
/**
|
||||
* Module defining SinewaveTelemetryProvider.
|
||||
* Created by vwoeltje on 11/12/14.
|
||||
*
|
||||
* @memberof example/generator
|
||||
*/
|
||||
define(
|
||||
["./DemoTelemetrySeries"],
|
||||
function (DemoTelemetrySeries) {
|
||||
"use strict";
|
||||
|
||||
var SOURCE = 'demo-telemetry',
|
||||
series = {};
|
||||
|
||||
/**
|
||||
* A telemetry provider that generates sine wave data for testing
|
||||
* and telemetry purposes.
|
||||
* @constructor
|
||||
*/
|
||||
function DemoTelemetryProvider($q, $timeout) {
|
||||
this.$q = $q;
|
||||
this.$timeout = $timeout;
|
||||
this.subscriptions = [];
|
||||
this.generating = false;
|
||||
}
|
||||
|
||||
DemoTelemetryProvider.prototype.matchesSource = function (request) {
|
||||
return request.source === SOURCE;
|
||||
};
|
||||
|
||||
DemoTelemetryProvider.prototype.doPackage = function (results) {
|
||||
var packaged = {},
|
||||
result = {};
|
||||
results.forEach(function (result) {
|
||||
packaged[result.key] = result.telemetry;
|
||||
});
|
||||
result[SOURCE] = packaged;
|
||||
// Format as expected (sources -> keys -> telemetry)
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce some data to be passed to registered subscription callbacks
|
||||
* @param request
|
||||
* @returns {{key: string, telemetry: DemoTelemetrySeries}}
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.generateData = function (request) {
|
||||
if (!series[request.id]){
|
||||
series[request.id] = {
|
||||
phaseShift: Math.random() * 2 * Math.PI,
|
||||
rangeOffset: 1 + Math.random()
|
||||
};
|
||||
}
|
||||
return {
|
||||
key: request.key,
|
||||
telemetry: new DemoTelemetrySeries(request, series[request.id])
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Invoke callbacks on all registered subscriptions when data is
|
||||
* available.
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.handleSubscriptions = function () {
|
||||
var self = this;
|
||||
self.subscriptions.forEach(function (subscription) {
|
||||
var requests = subscription.requests;
|
||||
subscription.callback(self.doPackage(
|
||||
requests.filter(self.matchesSource).map(self.generateData)
|
||||
));
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Will start producing telemetry @ 1hz
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.startGenerating = function () {
|
||||
var self = this;
|
||||
self.generating = true;
|
||||
self.$timeout(function () {
|
||||
self.handleSubscriptions();
|
||||
if (self.generating && self.subscriptions.length > 0) {
|
||||
self.startGenerating();
|
||||
} else {
|
||||
self.generating = false;
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
/**
|
||||
* Request historical telemetry from this source.
|
||||
* @param requests
|
||||
* @returns {object} an object with the request key as the key, and
|
||||
* a SinewaveTelemetrySeries as its value
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.requestTelemetry = function (requests) {
|
||||
var self = this;
|
||||
return this.$timeout(function () {
|
||||
return self.doPackage(requests.filter(self.matchesSource).map(self.generateData));
|
||||
}, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Subscribe to realtime telemetry
|
||||
* @param callback a function to call when data is available
|
||||
* @param requests all current telemetry requests (will be tested to
|
||||
* see if they match this source)
|
||||
* @returns {function} a function to call to unsubscribe from this
|
||||
* telemetry source
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.subscribe = function (callback, requests) {
|
||||
var self = this,
|
||||
subscription = {
|
||||
callback: callback,
|
||||
requests: requests
|
||||
};
|
||||
|
||||
function unsubscribe() {
|
||||
self.subscriptions = self.subscriptions.filter(function (s) {
|
||||
return s !== subscription;
|
||||
});
|
||||
//Also delete series object
|
||||
subscription.requests.forEach(function (request) {
|
||||
delete series[request.id];
|
||||
});
|
||||
}
|
||||
|
||||
self.subscriptions.push(subscription);
|
||||
|
||||
if (!this.generating) {
|
||||
this.startGenerating();
|
||||
}
|
||||
|
||||
return unsubscribe;
|
||||
};
|
||||
|
||||
return DemoTelemetryProvider;
|
||||
}
|
||||
);
|
||||
@@ -1,72 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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*/
|
||||
|
||||
/**
|
||||
* Module defining SinewaveTelemetry. Created by vwoeltje on 11/12/14.
|
||||
*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
var ONE_DAY = 60 * 60 * 24,
|
||||
START_TIME = Date.now(), // Now minus a day.
|
||||
firstObservedTime = Math.floor(START_TIME / 1000);
|
||||
|
||||
/**
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function DemoTelemetrySeries(request, options) {
|
||||
var latestTime = Math.floor(Date.now() / 1000),
|
||||
count = latestTime - firstObservedTime,
|
||||
period = +request.period || 30,
|
||||
generatorData = {};
|
||||
|
||||
generatorData.getPointCount = function () {
|
||||
return count;
|
||||
};
|
||||
|
||||
generatorData.getDomainValue = function (i, domain) {
|
||||
// delta uses the same numeric values as the default domain,
|
||||
// so it's not checked for here, just formatted for display
|
||||
// differently.
|
||||
return (i) * 1000 + firstObservedTime * 1000 -
|
||||
(domain === 'yesterday' ? (ONE_DAY * 1000) : 0);
|
||||
};
|
||||
|
||||
generatorData.getRangeValue = function (i, range) {
|
||||
var rangeValue = Math.sin((i) * options.phaseShift / period),
|
||||
damper = 0.05,
|
||||
noise = Math.random() * damper;
|
||||
rangeValue += options.rangeOffset;
|
||||
rangeValue += noise;
|
||||
return rangeValue;
|
||||
};
|
||||
|
||||
return generatorData;
|
||||
}
|
||||
|
||||
return DemoTelemetrySeries;
|
||||
}
|
||||
);
|
||||
@@ -1,9 +1,3 @@
|
||||
<hr>
|
||||
<cite>
|
||||
This document is styled using
|
||||
<a href="https://github.com/jasonm23/markdown-css-themes">
|
||||
https://github.com/jasonm23/markdown-css-themes
|
||||
</a>.
|
||||
</cite>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet"
|
||||
href="http://jasonm23.github.io/markdown-css-themes/avenir-white.css">
|
||||
href="//nasa.github.io/openmct/static/res/css/styles.css">
|
||||
<link rel="stylesheet"
|
||||
href="//nasa.github.io/openmct/static/res/css/documentation.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,10 +22,7 @@
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining SinewaveTelemetryProvider.
|
||||
* Created by vwoeltje on 11/12/14.
|
||||
*
|
||||
* @memberof example/generator
|
||||
* Module defining SinewaveTelemetryProvider. Created by vwoeltje on 11/12/14.
|
||||
*/
|
||||
define(
|
||||
["./SinewaveTelemetrySeries"],
|
||||
@@ -33,114 +30,89 @@ define(
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A telemetry provider that generates sine wave data for testing
|
||||
* and telemetry purposes.
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function SinewaveTelemetryProvider($q, $timeout) {
|
||||
this.$q = $q;
|
||||
this.$timeout = $timeout;
|
||||
this.subscriptions = [];
|
||||
this.generating = false;
|
||||
}
|
||||
var subscriptions = [],
|
||||
generating = false;
|
||||
|
||||
SinewaveTelemetryProvider.prototype.doPackage = function (results) {
|
||||
var packaged = {};
|
||||
results.forEach(function (result) {
|
||||
packaged[result.key] = result.telemetry;
|
||||
});
|
||||
// Format as expected (sources -> keys -> telemetry)
|
||||
return { generator: packaged };
|
||||
};
|
||||
//
|
||||
function matchesSource(request) {
|
||||
return request.source === "generator";
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce some data to be passed to registered subscription callbacks
|
||||
* @param request
|
||||
* @returns {{key: string, telemetry: SinewaveTelemetrySeries}}
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.generateData = function (request) {
|
||||
return {
|
||||
key: request.key,
|
||||
telemetry: new SinewaveTelemetrySeries(request)
|
||||
};
|
||||
};
|
||||
// Used internally; this will be repacked by doPackage
|
||||
function generateData(request) {
|
||||
return {
|
||||
key: request.key,
|
||||
telemetry: new SinewaveTelemetrySeries(request)
|
||||
};
|
||||
}
|
||||
|
||||
SinewaveTelemetryProvider.prototype.matchesSource = function (request) {
|
||||
return request.source === "generator";
|
||||
};
|
||||
//
|
||||
function doPackage(results) {
|
||||
var packaged = {};
|
||||
results.forEach(function (result) {
|
||||
packaged[result.key] = result.telemetry;
|
||||
});
|
||||
// Format as expected (sources -> keys -> telemetry)
|
||||
return { generator: packaged };
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke callbacks on all registered subscriptions when data is
|
||||
* available.
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.handleSubscriptions = function () {
|
||||
var self = this;
|
||||
self.subscriptions.forEach(function (subscription) {
|
||||
var requests = subscription.requests;
|
||||
subscription.callback(self.doPackage(
|
||||
requests.filter(self.matchesSource).map(self.generateData)
|
||||
));
|
||||
});
|
||||
};
|
||||
function requestTelemetry(requests) {
|
||||
return $timeout(function () {
|
||||
return doPackage(requests.filter(matchesSource).map(generateData));
|
||||
}, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will start producing telemetry every second
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.startGenerating = function () {
|
||||
var self = this;
|
||||
self.generating = true;
|
||||
self.$timeout(function () {
|
||||
self.handleSubscriptions();
|
||||
if (self.generating && self.subscriptions.length > 0) {
|
||||
self.startGenerating();
|
||||
} else {
|
||||
self.generating = false;
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
function handleSubscriptions() {
|
||||
subscriptions.forEach(function (subscription) {
|
||||
var requests = subscription.requests;
|
||||
subscription.callback(doPackage(
|
||||
requests.filter(matchesSource).map(generateData)
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Request historical telemetry from this source.
|
||||
* @param requests
|
||||
* @returns {object} an object with the request key as the key, and
|
||||
* a SinewaveTelemetrySeries as its value
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.requestTelemetry = function (requests) {
|
||||
var self = this;
|
||||
return this.$timeout(function () {
|
||||
return self.doPackage(requests.filter(self.matchesSource).map(self.generateData));
|
||||
}, 0);
|
||||
};
|
||||
function startGenerating() {
|
||||
generating = true;
|
||||
$timeout(function () {
|
||||
handleSubscriptions();
|
||||
if (generating && subscriptions.length > 0) {
|
||||
startGenerating();
|
||||
} else {
|
||||
generating = false;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to realtime telemetry
|
||||
* @param callback a function to call when data is available
|
||||
* @param requests all current telemetry requests (will be tested to
|
||||
* see if they match this source)
|
||||
* @returns {function} a function to call to unsubscribe from this
|
||||
* telemetry source
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.subscribe = function (callback, requests) {
|
||||
var self = this,
|
||||
subscription = {
|
||||
function subscribe(callback, requests) {
|
||||
var subscription = {
|
||||
callback: callback,
|
||||
requests: requests
|
||||
};
|
||||
|
||||
function unsubscribe() {
|
||||
self.subscriptions = self.subscriptions.filter(function (s) {
|
||||
return s !== subscription;
|
||||
});
|
||||
function unsubscribe() {
|
||||
subscriptions = subscriptions.filter(function (s) {
|
||||
return s !== subscription;
|
||||
});
|
||||
}
|
||||
|
||||
subscriptions.push(subscription);
|
||||
|
||||
if (!generating) {
|
||||
startGenerating();
|
||||
}
|
||||
|
||||
return unsubscribe;
|
||||
}
|
||||
|
||||
self.subscriptions.push(subscription);
|
||||
|
||||
if (!this.generating) {
|
||||
this.startGenerating();
|
||||
}
|
||||
|
||||
return unsubscribe;
|
||||
};
|
||||
return {
|
||||
requestTelemetry: requestTelemetry,
|
||||
subscribe: subscribe
|
||||
};
|
||||
}
|
||||
|
||||
return SinewaveTelemetryProvider;
|
||||
}
|
||||
|
||||
@@ -30,31 +30,11 @@ define(
|
||||
"use strict";
|
||||
|
||||
var firstObservedTime = Date.now(),
|
||||
/*images = [
|
||||
images = [
|
||||
"http://www.nasa.gov/393811main_Palomar_ao_bouchez_10s_after_impact_4x3_946-710.png",
|
||||
"http://www.nasa.gov/393821main_Palomar_ao_bouchez_15s_after_impact_4x3_946-710.png",
|
||||
"http://www.nasa.gov/images/content/393801main_CfhtVeillet2_4x3_516-387.jpg",
|
||||
"http://www.nasa.gov/images/content/392790main_1024_768_GeminiNorth_NightBeforeImpact_946-710.jpg"*/
|
||||
images = [
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18731.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18732.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18733.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18734.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18735.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18736.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18737.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18738.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18739.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18740.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18741.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18742.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18743.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18744.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18745.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18746.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18747.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18748.jpg"
|
||||
|
||||
"http://www.nasa.gov/images/content/392790main_1024_768_GeminiNorth_NightBeforeImpact_946-710.jpg"
|
||||
].map(function (url, index) {
|
||||
return {
|
||||
timestamp: firstObservedTime + 1000 * index,
|
||||
|
||||
@@ -71,7 +71,7 @@ define([
|
||||
"constants": [
|
||||
{
|
||||
"key": "REMS_WS_URL",
|
||||
"value": "https://openmct-demo.herokuapp.com/proxyUrl?url=http://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php"
|
||||
"value": "/proxyUrl?url=http://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php"
|
||||
}
|
||||
],
|
||||
"roots": [
|
||||
|
||||
@@ -44,31 +44,31 @@ define(
|
||||
{
|
||||
"name": "Min. Air Temperature",
|
||||
"identifier": "min_temp",
|
||||
"units": "Degrees (C)",
|
||||
"units": "degrees",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "Max. Air Temperature",
|
||||
"identifier": "max_temp",
|
||||
"units": "Degrees (C)",
|
||||
"units": "degrees",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "Atmospheric Pressure",
|
||||
"identifier": "pressure",
|
||||
"units": "Millibars",
|
||||
"units": "pascals",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "Min. Ground Temperature",
|
||||
"identifier": "min_gts_temp",
|
||||
"units": "Degrees (C)",
|
||||
"units": "degrees",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "Max. Ground Temperature",
|
||||
"identifier": "max_gts_temp",
|
||||
"units": "Degrees (C)",
|
||||
"units": "degrees",
|
||||
"type": "float"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -45,14 +45,14 @@ define(
|
||||
function buildTaxonomy(dictionary){
|
||||
var models = {};
|
||||
|
||||
function addMeasurement(measurement){
|
||||
function addMeasurement(measurement, parent){
|
||||
var format = FORMAT_MAPPINGS[measurement.type];
|
||||
models[makeId(measurement)] = {
|
||||
type: "msl.measurement",
|
||||
name: measurement.name,
|
||||
location: parent,
|
||||
telemetry: {
|
||||
key: measurement.identifier,
|
||||
historical: true,
|
||||
ranges: [{
|
||||
key: "value",
|
||||
name: measurement.units,
|
||||
@@ -63,17 +63,24 @@ define(
|
||||
};
|
||||
}
|
||||
|
||||
function addInstrument(subsystem) {
|
||||
var measurements = (subsystem.measurements || []);
|
||||
models[makeId(subsystem)] = {
|
||||
function addInstrument(subsystem, spacecraftId) {
|
||||
var measurements = (subsystem.measurements || []),
|
||||
instrumentId = makeId(subsystem);
|
||||
|
||||
models[instrumentId] = {
|
||||
type: "msl.instrument",
|
||||
name: subsystem.name,
|
||||
location: spacecraftId,
|
||||
composition: measurements.map(makeId)
|
||||
};
|
||||
measurements.forEach(addMeasurement);
|
||||
measurements.forEach(function(measurement) {
|
||||
addMeasurement(measurement, instrumentId);
|
||||
});
|
||||
}
|
||||
|
||||
(dictionary.instruments || []).forEach(addInstrument);
|
||||
(dictionary.instruments || []).forEach(function(instrument) {
|
||||
addInstrument(instrument, "msl:curiosity");
|
||||
});
|
||||
return models;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2016, United States Government
|
||||
* 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 is licensed under the Apache License, Version 2.0 (the
|
||||
* 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT includes source code licensed under additional open source
|
||||
* 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.
|
||||
@@ -44,18 +44,12 @@ define(
|
||||
*/
|
||||
function RemsTelemetryServerAdapter($q, $http, $log, REMS_WS_URL) {
|
||||
this.localDataURI = module.uri.substring(0, module.uri.lastIndexOf('/') + 1) + LOCAL_DATA;
|
||||
this.deferreds = {};
|
||||
this.REMS_WS_URL = REMS_WS_URL;
|
||||
this.$q = $q;
|
||||
this.$http = $http;
|
||||
this.$log = $log;
|
||||
this.cache = undefined;
|
||||
|
||||
this.dataTransforms = {
|
||||
//Convert from pascals to millibars
|
||||
'pressure': function pascalsToMillibars(pascals) {
|
||||
return pascals / 100;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,12 +64,16 @@ define(
|
||||
* @private
|
||||
*/
|
||||
RemsTelemetryServerAdapter.prototype.requestHistory = function(request) {
|
||||
var self = this;
|
||||
var id = request.key;
|
||||
var dataTransforms = this.dataTransforms;
|
||||
var self = this,
|
||||
id = request.key,
|
||||
deferred = this.$q.defer();
|
||||
|
||||
function processResponse(response){
|
||||
var data = [];
|
||||
/*
|
||||
* Currently all data is returned for entire history of the mission. Cache response to avoid unnecessary re-queries.
|
||||
*/
|
||||
self.cache = response;
|
||||
/*
|
||||
* History data is organised by Sol. Iterate over sols...
|
||||
*/
|
||||
@@ -84,14 +82,13 @@ define(
|
||||
* Check that valid data exists
|
||||
*/
|
||||
if (!isNaN(solData[id])) {
|
||||
var dataTransform = dataTransforms[id];
|
||||
/*
|
||||
* Append each data point to the array of values
|
||||
* for this data point property (min. temp, etc).
|
||||
*/
|
||||
data.unshift({
|
||||
date: Date.parse(solData[TERRESTRIAL_DATE]),
|
||||
value: dataTransform ? dataTransform(solData[id]) : solData[id]
|
||||
value: solData[id]
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -112,40 +109,18 @@ define(
|
||||
});
|
||||
}
|
||||
|
||||
function packageResults(results){
|
||||
return {id: id, values: results};
|
||||
function packageAndResolve(results){
|
||||
deferred.resolve({id: id, values: results});
|
||||
}
|
||||
|
||||
return this.request()
|
||||
|
||||
this.$q.when(this.cache || this.$http.get(this.REMS_WS_URL))
|
||||
.catch(fallbackToLocal)
|
||||
.then(processResponse)
|
||||
.then(filterResults)
|
||||
.then(packageResults);
|
||||
};
|
||||
.then(packageAndResolve);
|
||||
|
||||
/**
|
||||
* Sends a request for data, or uses local cache (if available).
|
||||
* Allows only one HTTP request at a time.
|
||||
* @private
|
||||
* @returns {Function|promise}
|
||||
*/
|
||||
RemsTelemetryServerAdapter.prototype.request = function () {
|
||||
var self = this;
|
||||
|
||||
if (this.requestDeferred) {
|
||||
return this.requestDeferred.promise;
|
||||
} else {
|
||||
this.requestDeferred = this.$q.defer();
|
||||
this.$q.when(this.cache || this.$http.get(this.REMS_WS_URL))
|
||||
.then(function(response){
|
||||
self.cache = response;
|
||||
self.requestDeferred.resolve(response);
|
||||
self.requestDeferred = undefined;
|
||||
return response;
|
||||
})
|
||||
.catch(this.requestDeferred.reject);
|
||||
return this.requestDeferred.promise;
|
||||
}
|
||||
return deferred.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
19
gulpfile.js
19
gulpfile.js
@@ -35,18 +35,20 @@ var gulp = require('gulp'),
|
||||
fs = require('fs'),
|
||||
git = require('git-rev-sync'),
|
||||
moment = require('moment'),
|
||||
merge = require('merge-stream'),
|
||||
project = require('./package.json'),
|
||||
_ = require('lodash'),
|
||||
paths = {
|
||||
main: 'main.js',
|
||||
dist: 'dist',
|
||||
assets: 'dist/assets',
|
||||
scss: ['./platform/**/*.scss', './example/**/*.scss', './demo/**/*.scss'],
|
||||
scss: ['./platform/**/*.scss', './example/**/*.scss'],
|
||||
scripts: [ 'main.js', 'platform/**/*.js', 'src/**/*.js' ],
|
||||
specs: [ 'platform/**/*Spec.js', 'src/**/*Spec.js' ],
|
||||
static: [
|
||||
'index.html',
|
||||
'platform/**/*',
|
||||
'example/**/*',
|
||||
'demo/**/*',
|
||||
'bower_components/**/*'
|
||||
]
|
||||
},
|
||||
@@ -101,8 +103,15 @@ gulp.task('stylesheets', function () {
|
||||
});
|
||||
|
||||
gulp.task('lint', function () {
|
||||
return gulp.src(paths.scripts)
|
||||
.pipe(jshint())
|
||||
var nonspecs = paths.specs.map(function (glob) {
|
||||
return "!" + glob;
|
||||
}),
|
||||
scriptLint = gulp.src(paths.scripts.concat(nonspecs))
|
||||
.pipe(jshint()),
|
||||
specLint = gulp.src(paths.specs)
|
||||
.pipe(jshint({ jasmine: true }));
|
||||
|
||||
return merge(scriptLint, specLint)
|
||||
.pipe(jshint.reporter('default'))
|
||||
.pipe(jshint.reporter('fail'));
|
||||
});
|
||||
@@ -138,6 +147,6 @@ gulp.task('develop', ['serve', 'stylesheets', 'watch']);
|
||||
|
||||
gulp.task('install', [ 'static', 'scripts' ]);
|
||||
|
||||
gulp.task('verify', [ 'lint', 'test' ]);
|
||||
gulp.task('verify', [ 'lint', 'test', 'checkstyle' ]);
|
||||
|
||||
gulp.task('build', [ 'verify', 'install' ]);
|
||||
|
||||
24
index.html
24
index.html
@@ -31,27 +31,19 @@
|
||||
<script type="text/javascript">
|
||||
require(['main'], function (mct) {
|
||||
require([
|
||||
'./tutorials/grootprovider/groots',
|
||||
'./tutorials/todo/todo',
|
||||
'./tutorials/todo/bundle',
|
||||
'./example/imagery/bundle',
|
||||
'./example/eventGenerator/bundle',
|
||||
'./example/generator/bundle',
|
||||
'./example/msl/bundle',
|
||||
'./demo/bundle',
|
||||
], mct.run.bind(mct));
|
||||
], function (grootify, todoPlugin) {
|
||||
grootify(mct);
|
||||
todoPlugin(mct);
|
||||
mct.start();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-76951009-1', 'auto');
|
||||
ga('send', 'pageview', '/live_demo');
|
||||
window.addEventListener('hashchange', function () {
|
||||
ga('send', 'pageview', '/live_demo' + window.location.hash.slice(1));
|
||||
});
|
||||
|
||||
</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">
|
||||
|
||||
36
main.js
36
main.js
@@ -1,9 +1,9 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2016, United States Government
|
||||
* 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 is licensed under the Apache License, Version 2.0 (the
|
||||
* 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT includes source code licensed under additional open source
|
||||
* 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.
|
||||
@@ -27,21 +27,26 @@ requirejs.config({
|
||||
"angular": "bower_components/angular/angular.min",
|
||||
"angular-route": "bower_components/angular-route/angular-route.min",
|
||||
"csv": "bower_components/comma-separated-values/csv.min",
|
||||
"es6-promise": "bower_components/es6-promise/es6-promise.min",
|
||||
"es6-promise": "bower_components/es6-promise/promise.min",
|
||||
"EventEmitter": "bower_components/eventemitter3/index",
|
||||
"moment": "bower_components/moment/moment",
|
||||
"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",
|
||||
"text": "bower_components/text/text",
|
||||
"uuid": "bower_components/node-uuid/uuid",
|
||||
"zepto": "bower_components/zepto/zepto.min"
|
||||
"zepto": "bower_components/zepto/zepto.min",
|
||||
"lodash": "bower_components/lodash/lodash"
|
||||
},
|
||||
"shim": {
|
||||
"angular": {
|
||||
"exports": "angular"
|
||||
},
|
||||
"angular-route": {
|
||||
"deps": [ "angular" ]
|
||||
"deps": ["angular"]
|
||||
},
|
||||
"EventEmitter": {
|
||||
"exports": "EventEmitter"
|
||||
},
|
||||
"moment-duration-format": {
|
||||
"deps": ["moment"]
|
||||
@@ -58,6 +63,7 @@ requirejs.config({
|
||||
define([
|
||||
'./platform/framework/src/Main',
|
||||
'legacyRegistry',
|
||||
'./src/MCT',
|
||||
|
||||
'./platform/framework/bundle',
|
||||
'./platform/core/bundle',
|
||||
@@ -83,7 +89,6 @@ define([
|
||||
'./platform/features/plot/bundle',
|
||||
'./platform/features/timeline/bundle',
|
||||
'./platform/features/table/bundle',
|
||||
'./platform/features/conductor/bundle',
|
||||
'./platform/forms/bundle',
|
||||
'./platform/identity/bundle',
|
||||
'./platform/persistence/aggregator/bundle',
|
||||
@@ -94,11 +99,14 @@ define([
|
||||
'./platform/search/bundle',
|
||||
'./platform/status/bundle',
|
||||
'./platform/commonUI/regions/bundle'
|
||||
], function (Main, legacyRegistry) {
|
||||
return {
|
||||
legacyRegistry: legacyRegistry,
|
||||
run: function () {
|
||||
return new Main().run(legacyRegistry);
|
||||
}
|
||||
};
|
||||
], function (Main, legacyRegistry, MCT) {
|
||||
var mct = new MCT();
|
||||
|
||||
mct.legacyRegistry = legacyRegistry;
|
||||
mct.run = mct.start;
|
||||
mct.on('start', function () {
|
||||
return new Main().run(legacyRegistry);
|
||||
});
|
||||
|
||||
return mct;
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openmct",
|
||||
"version": "0.10.1-SNAPSHOT",
|
||||
"version": "0.10.2-SNAPSHOT",
|
||||
"description": "The Open MCT core platform",
|
||||
"dependencies": {
|
||||
"express": "^4.13.1",
|
||||
@@ -34,6 +34,7 @@
|
||||
"lodash": "^3.10.1",
|
||||
"markdown-toc": "^0.11.7",
|
||||
"marked": "^0.3.5",
|
||||
"merge-stream": "^1.0.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"moment": "^2.11.1",
|
||||
"node-bourbon": "^4.2.3",
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"text!./res/templates/about-dialog.html",
|
||||
@@ -48,7 +47,6 @@ define([
|
||||
licensesExportMdTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/commonUI/about", {
|
||||
"name": "About Open MCT Web",
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
|
||||
/**
|
||||
@@ -29,7 +28,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* The AboutController provides information to populate the
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* 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";
|
||||
|
||||
/**
|
||||
* Provides extension-introduced licenses information to the
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* 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";
|
||||
|
||||
/**
|
||||
* The LogoController provides functionality to the application
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* 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*/
|
||||
|
||||
define(
|
||||
['../src/AboutController'],
|
||||
function (AboutController) {
|
||||
"use strict";
|
||||
|
||||
describe("The About controller", function () {
|
||||
var testVersions,
|
||||
@@ -57,4 +55,4 @@ define(
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* 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*/
|
||||
|
||||
define(
|
||||
['../src/LicenseController'],
|
||||
function (LicenseController) {
|
||||
"use strict";
|
||||
|
||||
describe("The License controller", function () {
|
||||
var testLicenses,
|
||||
@@ -48,4 +46,4 @@ define(
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* 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*/
|
||||
|
||||
define(
|
||||
['../src/LogoController'],
|
||||
function (LogoController) {
|
||||
"use strict";
|
||||
|
||||
describe("The About controller", function () {
|
||||
var mockOverlayService,
|
||||
@@ -50,4 +48,4 @@ define(
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,29 +19,19 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/BrowseController",
|
||||
"./src/PaneController",
|
||||
"./src/BrowseObjectController",
|
||||
"./src/creation/CreateMenuController",
|
||||
"./src/creation/LocatorController",
|
||||
"./src/MenuArrowController",
|
||||
"./src/navigation/NavigationService",
|
||||
"./src/creation/CreationPolicy",
|
||||
"./src/navigation/NavigateAction",
|
||||
"./src/windowing/NewTabAction",
|
||||
"./src/windowing/FullscreenAction",
|
||||
"./src/creation/CreateActionProvider",
|
||||
"./src/creation/AddActionProvider",
|
||||
"./src/creation/CreationService",
|
||||
"./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",
|
||||
@@ -54,23 +44,14 @@ define([
|
||||
BrowseController,
|
||||
PaneController,
|
||||
BrowseObjectController,
|
||||
CreateMenuController,
|
||||
LocatorController,
|
||||
MenuArrowController,
|
||||
NavigationService,
|
||||
CreationPolicy,
|
||||
NavigateAction,
|
||||
NewTabAction,
|
||||
FullscreenAction,
|
||||
CreateActionProvider,
|
||||
AddActionProvider,
|
||||
CreationService,
|
||||
WindowTitler,
|
||||
browseTemplate,
|
||||
locatorTemplate,
|
||||
browseObjectTemplate,
|
||||
createButtonTemplate,
|
||||
createMenuTemplate,
|
||||
gridItemTemplate,
|
||||
objectHeaderTemplate,
|
||||
menuArrowTemplate,
|
||||
@@ -80,7 +61,6 @@ define([
|
||||
inspectorRegionTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/commonUI/browse", {
|
||||
"extensions": {
|
||||
@@ -138,22 +118,6 @@ define([
|
||||
"$route"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "CreateMenuController",
|
||||
"implementation": CreateMenuController,
|
||||
"depends": [
|
||||
"$scope"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "LocatorController",
|
||||
"implementation": LocatorController,
|
||||
"depends": [
|
||||
"$scope",
|
||||
"$timeout",
|
||||
"objectService"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "MenuArrowController",
|
||||
"implementation": MenuArrowController,
|
||||
@@ -162,12 +126,6 @@ define([
|
||||
]
|
||||
}
|
||||
],
|
||||
"controls": [
|
||||
{
|
||||
"key": "locator",
|
||||
"template": locatorTemplate
|
||||
}
|
||||
],
|
||||
"representations": [
|
||||
{
|
||||
"key": "view-object",
|
||||
@@ -183,17 +141,6 @@ define([
|
||||
"view"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "create-button",
|
||||
"template": createButtonTemplate
|
||||
},
|
||||
{
|
||||
"key": "create-menu",
|
||||
"template": createMenuTemplate,
|
||||
"uses": [
|
||||
"action"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "grid-item",
|
||||
"template": gridItemTemplate,
|
||||
@@ -246,12 +193,6 @@ define([
|
||||
"implementation": NavigationService
|
||||
}
|
||||
],
|
||||
"policies": [
|
||||
{
|
||||
"implementation": CreationPolicy,
|
||||
"category": "creation"
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
{
|
||||
"key": "navigate",
|
||||
@@ -304,42 +245,6 @@ define([
|
||||
"editable": false
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"key": "CreateActionProvider",
|
||||
"provides": "actionService",
|
||||
"type": "provider",
|
||||
"implementation": CreateActionProvider,
|
||||
"depends": [
|
||||
"$q",
|
||||
"typeService",
|
||||
"navigationService",
|
||||
"policyService"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "AddActionProvider",
|
||||
"provides": "actionService",
|
||||
"type": "provider",
|
||||
"implementation": AddActionProvider,
|
||||
"depends": [
|
||||
"$q",
|
||||
"typeService",
|
||||
"dialogService",
|
||||
"policyService"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "CreationService",
|
||||
"provides": "creationService",
|
||||
"type": "provider",
|
||||
"implementation": CreationService,
|
||||
"depends": [
|
||||
"$q",
|
||||
"$log"
|
||||
]
|
||||
}
|
||||
],
|
||||
"runs": [
|
||||
{
|
||||
"implementation": WindowTitler,
|
||||
|
||||
@@ -26,5 +26,5 @@
|
||||
<mct-representation
|
||||
key="'menu-arrow'"
|
||||
mct-object='domainObject'
|
||||
class="flex-elem"></mct-representation>
|
||||
class="flex-elem context-available-w"></mct-representation>
|
||||
</span>
|
||||
@@ -19,18 +19,14 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise, confirm*/
|
||||
|
||||
/**
|
||||
* This bundle implements Browse mode.
|
||||
* @namespace platform/commonUI/browse
|
||||
*/
|
||||
define(
|
||||
[
|
||||
'../../../representation/src/gestures/GestureConstants'
|
||||
],
|
||||
function (GestureConstants) {
|
||||
"use strict";
|
||||
[],
|
||||
function () {
|
||||
|
||||
var ROOT_ID = "ROOT";
|
||||
|
||||
@@ -45,13 +41,13 @@ define(
|
||||
* @constructor
|
||||
*/
|
||||
function BrowseController(
|
||||
$scope,
|
||||
$route,
|
||||
$location,
|
||||
$window,
|
||||
objectService,
|
||||
navigationService,
|
||||
urlService,
|
||||
$scope,
|
||||
$route,
|
||||
$location,
|
||||
$window,
|
||||
objectService,
|
||||
navigationService,
|
||||
urlService,
|
||||
policyService,
|
||||
defaultPath
|
||||
) {
|
||||
@@ -84,12 +80,12 @@ define(
|
||||
function setNavigation(domainObject) {
|
||||
var navigationAllowed = true;
|
||||
|
||||
if (domainObject === $scope.navigatedObject){
|
||||
if (domainObject === $scope.navigatedObject) {
|
||||
//do nothing;
|
||||
return;
|
||||
}
|
||||
|
||||
policyService.allow("navigation", $scope.navigatedObject, domainObject, function(message){
|
||||
policyService.allow("navigation", $scope.navigatedObject, domainObject, function (message) {
|
||||
navigationAllowed = $window.confirm(message + "\r\n\r\n" +
|
||||
" Are you sure you want to continue?");
|
||||
});
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Controller for the `browse-object` representation of a domain
|
||||
@@ -35,7 +33,7 @@ define(
|
||||
function BrowseObjectController($scope, $location, $route) {
|
||||
var navigatedObject;
|
||||
function setViewForDomainObject(domainObject) {
|
||||
|
||||
|
||||
var locationViewKey = $location.search().view;
|
||||
|
||||
function selectViewIfMatching(view) {
|
||||
@@ -72,7 +70,7 @@ define(
|
||||
$scope.$watch('domainObject', setViewForDomainObject);
|
||||
$scope.$watch('representation.selected.key', updateQueryParam);
|
||||
|
||||
$scope.doAction = function (action){
|
||||
$scope.doAction = function (action) {
|
||||
return $scope[action] && $scope[action]();
|
||||
};
|
||||
|
||||
|
||||
@@ -19,14 +19,12 @@
|
||||
* 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
|
||||
@@ -47,7 +45,7 @@ define(
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
InspectorRegion.prototype.buildRegion = function() {
|
||||
InspectorRegion.prototype.buildRegion = function () {
|
||||
var metadataRegion = {
|
||||
name: 'metadata',
|
||||
title: 'Metadata Region',
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* Module defining MenuArrowController. Created by shale on 06/30/2015.
|
||||
@@ -27,12 +26,11 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
|
||||
/**
|
||||
* A left-click on the menu arrow should display a
|
||||
* context menu. This controller launches the context
|
||||
* menu.
|
||||
* A left-click on the menu arrow should display a
|
||||
* context menu. This controller launches the context
|
||||
* menu.
|
||||
* @memberof platform/commonUI/browse
|
||||
* @constructor
|
||||
*/
|
||||
|
||||
@@ -19,13 +19,11 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Controller to provide the ability to show/hide the tree in
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining NavigateAction. Created by vwoeltje on 11/10/14.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* The navigate action navigates to a specific domain object.
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining NavigationService. Created by vwoeltje on 11/10/14.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* The navigation service maintains the application's current
|
||||
|
||||
@@ -19,15 +19,13 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,screenfull,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining FullscreenAction. Created by vwoeltje on 11/18/14.
|
||||
*/
|
||||
define(
|
||||
["screenfull"],
|
||||
function () {
|
||||
"use strict";
|
||||
function (screenfull) {
|
||||
|
||||
var ENTER_FULLSCREEN = "Enter full screen mode",
|
||||
EXIT_FULLSCREEN = "Exit full screen mode";
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining NewTabAction (Originally NewWindowAction). Created by vwoeltje on 11/18/14.
|
||||
@@ -27,9 +26,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
var ROOT_ID = "ROOT",
|
||||
DEFAULT_PATH = "/mine";
|
||||
/**
|
||||
* The new tab action allows a domain object to be opened
|
||||
* into a new browser tab.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Updates the title of the current window to reflect the name
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* 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,xit,xdescribe*/
|
||||
|
||||
/**
|
||||
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
["../src/BrowseController"],
|
||||
function (BrowseController) {
|
||||
"use strict";
|
||||
|
||||
describe("The browse controller", function () {
|
||||
var mockScope,
|
||||
@@ -80,12 +78,12 @@ define(
|
||||
|
||||
mockScope = jasmine.createSpyObj(
|
||||
"$scope",
|
||||
[ "$on", "$watch" ]
|
||||
["$on", "$watch"]
|
||||
);
|
||||
mockRoute = { current: { params: {} } };
|
||||
mockLocation = jasmine.createSpyObj(
|
||||
"$location",
|
||||
[ "path" ]
|
||||
["path"]
|
||||
);
|
||||
mockUrlService = jasmine.createSpyObj(
|
||||
"urlService",
|
||||
@@ -93,7 +91,7 @@ define(
|
||||
);
|
||||
mockObjectService = jasmine.createSpyObj(
|
||||
"objectService",
|
||||
[ "getObjects" ]
|
||||
["getObjects"]
|
||||
);
|
||||
mockNavigationService = jasmine.createSpyObj(
|
||||
"navigationService",
|
||||
@@ -106,15 +104,15 @@ define(
|
||||
);
|
||||
mockRootObject = jasmine.createSpyObj(
|
||||
"domainObject",
|
||||
[ "getId", "getCapability", "getModel", "useCapability" ]
|
||||
["getId", "getCapability", "getModel", "useCapability"]
|
||||
);
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
"domainObject",
|
||||
[ "getId", "getCapability", "getModel", "useCapability" ]
|
||||
["getId", "getCapability", "getModel", "useCapability"]
|
||||
);
|
||||
mockNextObject = jasmine.createSpyObj(
|
||||
"nextObject",
|
||||
[ "getId", "getCapability", "getModel", "useCapability" ]
|
||||
["getId", "getCapability", "getModel", "useCapability"]
|
||||
);
|
||||
|
||||
mockObjectService.getObjects.andReturn(mockPromise({
|
||||
@@ -257,7 +255,7 @@ define(
|
||||
" object", function () {
|
||||
mockScope.navigatedObject = mockDomainObject;
|
||||
mockWindow.confirm.andReturn(false);
|
||||
mockPolicyService.allow.andCallFake(function(category, object, context, callback){
|
||||
mockPolicyService.allow.andCallFake(function (category, object, context, callback) {
|
||||
callback("unsaved changes");
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -19,13 +19,11 @@
|
||||
* 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*/
|
||||
|
||||
|
||||
define(
|
||||
["../src/BrowseObjectController"],
|
||||
function (BrowseObjectController) {
|
||||
"use strict";
|
||||
|
||||
describe("The browse object controller", function () {
|
||||
var mockScope,
|
||||
@@ -46,12 +44,12 @@ define(
|
||||
beforeEach(function () {
|
||||
mockScope = jasmine.createSpyObj(
|
||||
"$scope",
|
||||
[ "$on", "$watch" ]
|
||||
["$on", "$watch"]
|
||||
);
|
||||
mockRoute = { current: { params: {} } };
|
||||
mockLocation = jasmine.createSpyObj(
|
||||
"$location",
|
||||
[ "path", "search" ]
|
||||
["path", "search"]
|
||||
);
|
||||
mockUnlisten = jasmine.createSpy("unlisten");
|
||||
|
||||
@@ -71,7 +69,7 @@ define(
|
||||
// Allows the path index to be checked
|
||||
// prior to setting $route.current
|
||||
mockLocation.path.andReturn("/browse/");
|
||||
|
||||
|
||||
// Exercise the Angular workaround
|
||||
mockScope.$on.mostRecentCall.args[1]();
|
||||
expect(mockUnlisten).toHaveBeenCalled();
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* 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.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
["../src/InspectorRegion"],
|
||||
function (InspectorRegion) {
|
||||
"use strict";
|
||||
|
||||
describe("The inspector region", function () {
|
||||
var inspectorRegion;
|
||||
@@ -42,4 +40,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* 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*/
|
||||
|
||||
/**
|
||||
* MenuArrowControllerSpec. Created by shale on 07/02/2015.
|
||||
@@ -27,8 +26,7 @@
|
||||
define(
|
||||
["../src/MenuArrowController"],
|
||||
function (MenuArrowController) {
|
||||
"use strict";
|
||||
|
||||
|
||||
describe("The menu arrow controller ", function () {
|
||||
var mockScope,
|
||||
mockDomainObject,
|
||||
@@ -36,43 +34,43 @@ define(
|
||||
mockContextMenuAction,
|
||||
mockActionContext,
|
||||
controller;
|
||||
|
||||
|
||||
beforeEach(function () {
|
||||
mockScope = jasmine.createSpyObj(
|
||||
"$scope",
|
||||
[ "" ]
|
||||
[""]
|
||||
);
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
"domainObject",
|
||||
[ "getCapability" ]
|
||||
["getCapability"]
|
||||
);
|
||||
mockEvent = jasmine.createSpyObj(
|
||||
"event",
|
||||
[ "preventDefault" ]
|
||||
["preventDefault"]
|
||||
);
|
||||
mockContextMenuAction = jasmine.createSpyObj(
|
||||
"action",
|
||||
[ "perform", "getActions" ]
|
||||
["perform", "getActions"]
|
||||
);
|
||||
mockActionContext = jasmine.createSpyObj(
|
||||
"actionContext",
|
||||
[ "" ]
|
||||
[""]
|
||||
);
|
||||
|
||||
|
||||
mockActionContext.domainObject = mockDomainObject;
|
||||
mockActionContext.event = mockEvent;
|
||||
mockScope.domainObject = mockDomainObject;
|
||||
mockDomainObject.getCapability.andReturn(mockContextMenuAction);
|
||||
mockContextMenuAction.perform.andReturn(jasmine.any(Function));
|
||||
|
||||
|
||||
controller = new MenuArrowController(mockScope);
|
||||
});
|
||||
|
||||
|
||||
it("calls the context menu action when clicked", function () {
|
||||
// Simulate a click on the menu arrow
|
||||
controller.showMenu(mockEvent);
|
||||
|
||||
// Expect the menu action to be performed
|
||||
|
||||
// Expect the menu action to be performed
|
||||
expect(mockDomainObject.getCapability).toHaveBeenCalledWith('action');
|
||||
expect(mockContextMenuAction.perform).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* 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*/
|
||||
|
||||
define(
|
||||
["../src/PaneController"],
|
||||
function (PaneController) {
|
||||
'use strict';
|
||||
|
||||
describe("The PaneController", function () {
|
||||
var mockScope,
|
||||
@@ -44,11 +42,11 @@ define(
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
mockScope = jasmine.createSpyObj("$scope", [ "$on" ]);
|
||||
mockScope = jasmine.createSpyObj("$scope", ["$on"]);
|
||||
mockDomainObjects = ['a', 'b'].map(function (id) {
|
||||
var mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject-' + id,
|
||||
[ 'getId', 'getModel', 'getCapability' ]
|
||||
['getId', 'getModel', 'getCapability']
|
||||
);
|
||||
|
||||
mockDomainObject.getId.andReturn(id);
|
||||
@@ -58,7 +56,7 @@ define(
|
||||
});
|
||||
mockAgentService = jasmine.createSpyObj(
|
||||
"agentService",
|
||||
[ "isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape" ]
|
||||
["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"]
|
||||
);
|
||||
mockWindow = jasmine.createSpyObj("$window", ["open"]);
|
||||
});
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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,xit,xdescribe*/
|
||||
|
||||
/**
|
||||
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
|
||||
*/
|
||||
define(
|
||||
["../../src/creation/CreateAction"],
|
||||
function (CreateAction) {
|
||||
"use strict";
|
||||
|
||||
describe("The create action", function () {
|
||||
var mockType,
|
||||
mockParent,
|
||||
mockContext,
|
||||
mockDialogService,
|
||||
mockCreationService,
|
||||
action;
|
||||
|
||||
function mockPromise(value) {
|
||||
return {
|
||||
then: function (callback) {
|
||||
return mockPromise(callback(value));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
mockType = jasmine.createSpyObj(
|
||||
"type",
|
||||
[
|
||||
"getKey",
|
||||
"getGlyph",
|
||||
"getName",
|
||||
"getDescription",
|
||||
"getProperties",
|
||||
"getInitialModel"
|
||||
]
|
||||
);
|
||||
mockParent = jasmine.createSpyObj(
|
||||
"domainObject",
|
||||
[
|
||||
"getId",
|
||||
"getModel",
|
||||
"getCapability"
|
||||
]
|
||||
);
|
||||
mockContext = {
|
||||
domainObject: mockParent
|
||||
};
|
||||
mockDialogService = jasmine.createSpyObj(
|
||||
"dialogService",
|
||||
[ "getUserInput" ]
|
||||
);
|
||||
mockCreationService = jasmine.createSpyObj(
|
||||
"creationService",
|
||||
[ "createObject" ]
|
||||
);
|
||||
|
||||
mockType.getKey.andReturn("test");
|
||||
mockType.getGlyph.andReturn("T");
|
||||
mockType.getDescription.andReturn("a test type");
|
||||
mockType.getName.andReturn("Test");
|
||||
mockType.getProperties.andReturn([]);
|
||||
mockType.getInitialModel.andReturn({});
|
||||
|
||||
mockDialogService.getUserInput.andReturn(mockPromise({}));
|
||||
|
||||
action = new CreateAction(
|
||||
mockType,
|
||||
mockParent,
|
||||
mockContext,
|
||||
mockDialogService,
|
||||
mockCreationService
|
||||
);
|
||||
});
|
||||
|
||||
it("exposes type-appropriate metadata", function () {
|
||||
var metadata = action.getMetadata();
|
||||
|
||||
expect(metadata.name).toEqual("Test");
|
||||
expect(metadata.description).toEqual("a test type");
|
||||
expect(metadata.glyph).toEqual("T");
|
||||
});
|
||||
|
||||
//TODO: Disabled for NEM Beta
|
||||
xit("invokes the creation service when performed", function () {
|
||||
action.perform();
|
||||
expect(mockCreationService.createObject).toHaveBeenCalledWith(
|
||||
{ type: "test" },
|
||||
mockParent
|
||||
);
|
||||
});
|
||||
|
||||
//TODO: Disabled for NEM Beta
|
||||
xit("does not create an object if the user cancels", function () {
|
||||
mockDialogService.getUserInput.andReturn({
|
||||
then: function (callback, fail) {
|
||||
fail();
|
||||
}
|
||||
});
|
||||
|
||||
action.perform();
|
||||
|
||||
expect(mockCreationService.createObject)
|
||||
.not.toHaveBeenCalled();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -19,7 +19,6 @@
|
||||
* 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*/
|
||||
|
||||
/**
|
||||
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
|
||||
@@ -27,12 +26,10 @@
|
||||
define(
|
||||
["../../src/navigation/NavigateAction"],
|
||||
function (NavigateAction) {
|
||||
"use strict";
|
||||
|
||||
describe("The navigate action", function () {
|
||||
var mockNavigationService,
|
||||
mockQ,
|
||||
actionContext,
|
||||
mockDomainObject,
|
||||
action;
|
||||
|
||||
@@ -47,12 +44,12 @@ define(
|
||||
beforeEach(function () {
|
||||
mockNavigationService = jasmine.createSpyObj(
|
||||
"navigationService",
|
||||
[ "setNavigation" ]
|
||||
["setNavigation"]
|
||||
);
|
||||
mockQ = { when: mockPromise };
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
"domainObject",
|
||||
[ "getId", "getModel", "getCapability" ]
|
||||
["getId", "getModel", "getCapability"]
|
||||
);
|
||||
|
||||
action = new NavigateAction(
|
||||
@@ -77,4 +74,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* 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*/
|
||||
|
||||
/**
|
||||
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
["../../src/navigation/NavigationService"],
|
||||
function (NavigationService) {
|
||||
"use strict";
|
||||
|
||||
describe("The navigation service", function () {
|
||||
var navigationService;
|
||||
|
||||
@@ -19,33 +19,30 @@
|
||||
* 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,afterEach,window*/
|
||||
|
||||
/**
|
||||
* MCTRepresentationSpec. Created by vwoeltje on 11/6/14.
|
||||
*/
|
||||
define(
|
||||
["../../src/windowing/FullscreenAction"],
|
||||
function (FullscreenAction) {
|
||||
"use strict";
|
||||
["../../src/windowing/FullscreenAction", "screenfull"],
|
||||
function (FullscreenAction, screenfull) {
|
||||
|
||||
describe("The fullscreen action", function () {
|
||||
var action,
|
||||
oldScreenfull;
|
||||
oldToggle;
|
||||
|
||||
beforeEach(function () {
|
||||
// Screenfull is not shimmed or injected, so
|
||||
// we need to spy on it in the global scope.
|
||||
oldScreenfull = window.screenfull;
|
||||
oldToggle = screenfull.toggle;
|
||||
|
||||
window.screenfull = {};
|
||||
window.screenfull.toggle = jasmine.createSpy("toggle");
|
||||
screenfull.toggle = jasmine.createSpy("toggle");
|
||||
|
||||
action = new FullscreenAction({});
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
window.screenfull = oldScreenfull;
|
||||
screenfull.toggle = oldToggle;
|
||||
});
|
||||
|
||||
it("toggles fullscreen mode when performed", function () {
|
||||
@@ -59,4 +56,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,18 +19,15 @@
|
||||
* 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,afterEach,window*/
|
||||
|
||||
define(
|
||||
["../../src/windowing/NewTabAction"],
|
||||
function (NewTabAction) {
|
||||
"use strict";
|
||||
|
||||
|
||||
describe("The new tab action", function () {
|
||||
var actionSelected,
|
||||
actionCurrent,
|
||||
mockWindow,
|
||||
mockDomainObject,
|
||||
mockContextCurrent,
|
||||
mockContextSelected,
|
||||
mockUrlService;
|
||||
@@ -40,39 +37,39 @@ define(
|
||||
|
||||
// Context if the current object is selected
|
||||
// For example, when the top right new tab
|
||||
// button is clicked, the user is using the
|
||||
// button is clicked, the user is using the
|
||||
// current domainObject
|
||||
mockContextCurrent = jasmine.createSpyObj("context", ["domainObject"]);
|
||||
|
||||
|
||||
// Context if the selected object is selected
|
||||
// For example, when an object in the left
|
||||
// tree is opened in a new tab using the
|
||||
// context menu
|
||||
mockContextSelected = jasmine.createSpyObj("context", ["selectedObject",
|
||||
"domainObject"]);
|
||||
|
||||
|
||||
// Mocks the urlService used to make the new tab's url from a
|
||||
// domainObject and mode
|
||||
mockUrlService = jasmine.createSpyObj("urlService", ["urlForNewTab"]);
|
||||
|
||||
|
||||
// Action done using the current context or mockContextCurrent
|
||||
actionCurrent = new NewTabAction(mockUrlService, mockWindow,
|
||||
mockContextCurrent);
|
||||
|
||||
|
||||
// Action done using the selected context or mockContextSelected
|
||||
actionSelected = new NewTabAction(mockUrlService, mockWindow,
|
||||
mockContextSelected);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
it("new tab with current url is opened", function () {
|
||||
actionCurrent.perform();
|
||||
});
|
||||
|
||||
|
||||
it("new tab with a selected url is opened", function () {
|
||||
actionSelected.perform();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* 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*/
|
||||
|
||||
/**
|
||||
* WindowTitlerSpec. Created by vwoeltje on 11/6/14.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
["../../src/windowing/WindowTitler"],
|
||||
function (WindowTitler) {
|
||||
"use strict";
|
||||
|
||||
describe("The window titler", function () {
|
||||
var mockNavigationService,
|
||||
@@ -39,11 +37,11 @@ define(
|
||||
beforeEach(function () {
|
||||
mockNavigationService = jasmine.createSpyObj(
|
||||
'navigationService',
|
||||
[ 'getNavigation' ]
|
||||
['getNavigation']
|
||||
);
|
||||
mockRootScope = jasmine.createSpyObj(
|
||||
'$rootScope',
|
||||
[ '$watch' ]
|
||||
['$watch']
|
||||
);
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject',
|
||||
@@ -77,4 +75,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/DialogService",
|
||||
@@ -44,7 +43,6 @@ define([
|
||||
overlayTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/commonUI/dialog", {
|
||||
"extensions": {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* This bundle implements the dialog service, which can be used to
|
||||
@@ -29,7 +28,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
/**
|
||||
* The dialog service is responsible for handling window-modal
|
||||
* communication with the user, such as displaying forms for user
|
||||
@@ -157,8 +155,8 @@ define(
|
||||
* @returns {boolean} true if dialog is currently visible, false
|
||||
* otherwise
|
||||
*/
|
||||
DialogService.prototype.canShowDialog = function(dialogModel){
|
||||
if (this.dialogVisible){
|
||||
DialogService.prototype.canShowDialog = function (dialogModel) {
|
||||
if (this.dialogVisible) {
|
||||
// Only one dialog should be shown at a time.
|
||||
// The application design should be such that
|
||||
// we never even try to do this.
|
||||
@@ -226,7 +224,7 @@ define(
|
||||
* @param {typeClass} string tells overlayService that this overlay should use appropriate CSS class
|
||||
* @returns {boolean}
|
||||
*/
|
||||
DialogService.prototype.showBlockingMessage = function(dialogModel) {
|
||||
DialogService.prototype.showBlockingMessage = function (dialogModel) {
|
||||
if (this.canShowDialog(dialogModel)) {
|
||||
// Add the overlay using the OverlayService, which
|
||||
// will handle actual insertion into the DOM
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* 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";
|
||||
|
||||
// Template to inject into the DOM to show the dialog; really just points to
|
||||
// the a specific template that can be included via mct-include
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* 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.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
["../src/DialogService"],
|
||||
function (DialogService) {
|
||||
"use strict";
|
||||
|
||||
describe("The dialog service", function () {
|
||||
var mockOverlayService,
|
||||
@@ -40,23 +38,23 @@ define(
|
||||
beforeEach(function () {
|
||||
mockOverlayService = jasmine.createSpyObj(
|
||||
"overlayService",
|
||||
[ "createOverlay" ]
|
||||
["createOverlay"]
|
||||
);
|
||||
mockQ = jasmine.createSpyObj(
|
||||
"$q",
|
||||
[ "defer" ]
|
||||
["defer"]
|
||||
);
|
||||
mockLog = jasmine.createSpyObj(
|
||||
"$log",
|
||||
[ "warn", "info", "debug" ]
|
||||
["warn", "info", "debug"]
|
||||
);
|
||||
mockOverlay = jasmine.createSpyObj(
|
||||
"overlay",
|
||||
[ "dismiss" ]
|
||||
["dismiss"]
|
||||
);
|
||||
mockDeferred = jasmine.createSpyObj(
|
||||
"deferred",
|
||||
[ "resolve", "reject"]
|
||||
["resolve", "reject"]
|
||||
);
|
||||
mockDeferred.promise = "mock promise";
|
||||
|
||||
@@ -122,7 +120,7 @@ define(
|
||||
});
|
||||
|
||||
it("invokes the overlay service with the correct parameters when" +
|
||||
" a blocking dialog is requested", function() {
|
||||
" a blocking dialog is requested", function () {
|
||||
var dialogModel = {};
|
||||
expect(dialogService.showBlockingMessage(dialogModel)).toBe(true);
|
||||
expect(mockOverlayService.createOverlay).toHaveBeenCalledWith(
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* 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.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
["../src/OverlayService"],
|
||||
function (OverlayService) {
|
||||
"use strict";
|
||||
|
||||
describe("The overlay service", function () {
|
||||
var mockDocument,
|
||||
@@ -40,13 +38,13 @@ define(
|
||||
overlayService;
|
||||
|
||||
beforeEach(function () {
|
||||
mockDocument = jasmine.createSpyObj("$document", [ "find" ]);
|
||||
mockDocument = jasmine.createSpyObj("$document", ["find"]);
|
||||
mockCompile = jasmine.createSpy("$compile");
|
||||
mockRootScope = jasmine.createSpyObj("$rootScope", [ "$new" ]);
|
||||
mockBody = jasmine.createSpyObj("body", [ "prepend" ]);
|
||||
mockRootScope = jasmine.createSpyObj("$rootScope", ["$new"]);
|
||||
mockBody = jasmine.createSpyObj("body", ["prepend"]);
|
||||
mockTemplate = jasmine.createSpy("template");
|
||||
mockElement = jasmine.createSpyObj("element", [ "remove" ]);
|
||||
mockScope = jasmine.createSpyObj("scope", [ "$destroy" ]);
|
||||
mockElement = jasmine.createSpyObj("element", ["remove"]);
|
||||
mockScope = jasmine.createSpyObj("scope", ["$destroy"]);
|
||||
|
||||
mockDocument.find.andReturn(mockBody);
|
||||
mockCompile.andReturn(mockTemplate);
|
||||
@@ -98,4 +96,4 @@ define(
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/controllers/EditActionController",
|
||||
@@ -27,7 +26,7 @@ define([
|
||||
"./src/controllers/ElementsController",
|
||||
"./src/controllers/EditObjectController",
|
||||
"./src/directives/MCTBeforeUnload",
|
||||
"./src/actions/LinkAction",
|
||||
"./src/actions/EditAndComposeAction",
|
||||
"./src/actions/EditAction",
|
||||
"./src/actions/PropertiesAction",
|
||||
"./src/actions/RemoveAction",
|
||||
@@ -41,6 +40,18 @@ define([
|
||||
"./src/policies/EditContextualActionPolicy",
|
||||
"./src/representers/EditRepresenter",
|
||||
"./src/representers/EditToolbarRepresenter",
|
||||
"./src/capabilities/EditorCapability",
|
||||
"./src/capabilities/TransactionCapabilityDecorator",
|
||||
"./src/services/TransactionService",
|
||||
"./src/creation/CreateMenuController",
|
||||
"./src/creation/LocatorController",
|
||||
"./src/creation/CreationPolicy",
|
||||
"./src/creation/CreateActionProvider",
|
||||
"./src/creation/AddActionProvider",
|
||||
"./src/creation/CreationService",
|
||||
"text!./res/templates/create/locator.html",
|
||||
"text!./res/templates/create/create-button.html",
|
||||
"text!./res/templates/create/create-menu.html",
|
||||
"text!./res/templates/library.html",
|
||||
"text!./res/templates/edit-object.html",
|
||||
"text!./res/templates/edit-action-buttons.html",
|
||||
@@ -53,7 +64,7 @@ define([
|
||||
ElementsController,
|
||||
EditObjectController,
|
||||
MCTBeforeUnload,
|
||||
LinkAction,
|
||||
EditAndComposeAction,
|
||||
EditAction,
|
||||
PropertiesAction,
|
||||
RemoveAction,
|
||||
@@ -67,6 +78,18 @@ define([
|
||||
EditContextualActionPolicy,
|
||||
EditRepresenter,
|
||||
EditToolbarRepresenter,
|
||||
EditorCapability,
|
||||
TransactionCapabilityDecorator,
|
||||
TransactionService,
|
||||
CreateMenuController,
|
||||
LocatorController,
|
||||
CreationPolicy,
|
||||
CreateActionProvider,
|
||||
AddActionProvider,
|
||||
CreationService,
|
||||
locatorTemplate,
|
||||
createButtonTemplate,
|
||||
createMenuTemplate,
|
||||
libraryTemplate,
|
||||
editObjectTemplate,
|
||||
editActionButtonsTemplate,
|
||||
@@ -74,7 +97,6 @@ define([
|
||||
topbarEditTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("platform/commonUI/edit", {
|
||||
"extensions": {
|
||||
@@ -108,6 +130,22 @@ define([
|
||||
"$location",
|
||||
"policyService"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "CreateMenuController",
|
||||
"implementation": CreateMenuController,
|
||||
"depends": [
|
||||
"$scope"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "LocatorController",
|
||||
"implementation": LocatorController,
|
||||
"depends": [
|
||||
"$scope",
|
||||
"$timeout",
|
||||
"objectService"
|
||||
]
|
||||
}
|
||||
],
|
||||
"directives": [
|
||||
@@ -122,7 +160,7 @@ define([
|
||||
"actions": [
|
||||
{
|
||||
"key": "compose",
|
||||
"implementation": LinkAction
|
||||
"implementation": EditAndComposeAction
|
||||
},
|
||||
{
|
||||
"key": "edit",
|
||||
@@ -130,8 +168,7 @@ define([
|
||||
"depends": [
|
||||
"$location",
|
||||
"navigationService",
|
||||
"$log",
|
||||
"$q"
|
||||
"$log"
|
||||
],
|
||||
"description": "Edit this object.",
|
||||
"category": "view-control",
|
||||
@@ -193,10 +230,7 @@ define([
|
||||
"implementation": CancelAction,
|
||||
"name": "Cancel",
|
||||
"description": "Discard changes made to these objects.",
|
||||
"depends": [
|
||||
"$injector",
|
||||
"navigationService"
|
||||
]
|
||||
"depends": []
|
||||
}
|
||||
],
|
||||
"policies": [
|
||||
@@ -219,10 +253,13 @@ define([
|
||||
},
|
||||
{
|
||||
"category": "navigation",
|
||||
"message": "There are unsaved changes.",
|
||||
"message": "Continuing will cause the loss of any unsaved changes.",
|
||||
"implementation": EditNavigationPolicy
|
||||
},
|
||||
{
|
||||
"implementation": CreationPolicy,
|
||||
"category": "creation"
|
||||
}
|
||||
|
||||
],
|
||||
"templates": [
|
||||
{
|
||||
@@ -261,8 +298,73 @@ define([
|
||||
{
|
||||
"key": "topbar-edit",
|
||||
"template": topbarEditTemplate
|
||||
},
|
||||
{
|
||||
"key": "create-button",
|
||||
"template": createButtonTemplate
|
||||
},
|
||||
{
|
||||
"key": "create-menu",
|
||||
"template": createMenuTemplate,
|
||||
"uses": [
|
||||
"action"
|
||||
]
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"type": "decorator",
|
||||
"provides": "capabilityService",
|
||||
"implementation": TransactionCapabilityDecorator,
|
||||
"depends": [
|
||||
"$q",
|
||||
"transactionService"
|
||||
],
|
||||
"priority": "fallback"
|
||||
},
|
||||
{
|
||||
"type": "provider",
|
||||
"provides": "transactionService",
|
||||
"implementation": TransactionService,
|
||||
"depends": [
|
||||
"$q",
|
||||
"$log"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "CreateActionProvider",
|
||||
"provides": "actionService",
|
||||
"type": "provider",
|
||||
"implementation": CreateActionProvider,
|
||||
"depends": [
|
||||
"typeService",
|
||||
"policyService"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "AddActionProvider",
|
||||
"provides": "actionService",
|
||||
"type": "provider",
|
||||
"implementation": AddActionProvider,
|
||||
"depends": [
|
||||
"$q",
|
||||
"typeService",
|
||||
"dialogService",
|
||||
"policyService"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "CreationService",
|
||||
"provides": "creationService",
|
||||
"type": "provider",
|
||||
"implementation": CreationService,
|
||||
"depends": [
|
||||
"$q",
|
||||
"$log"
|
||||
]
|
||||
}
|
||||
|
||||
],
|
||||
"representers": [
|
||||
{
|
||||
"implementation": EditRepresenter,
|
||||
@@ -277,13 +379,30 @@ define([
|
||||
],
|
||||
"constants": [
|
||||
{
|
||||
"key":"editModeBlacklist",
|
||||
"key": "editModeBlacklist",
|
||||
"value": ["copy", "follow", "window", "link", "locate"]
|
||||
},
|
||||
{
|
||||
"key": "nonEditContextBlacklist",
|
||||
"value": ["copy", "follow", "properties", "move", "link", "remove", "locate"]
|
||||
}
|
||||
],
|
||||
"capabilities": [
|
||||
{
|
||||
"key": "editor",
|
||||
"name": "Editor Capability",
|
||||
"description": "Provides transactional editing capabilities",
|
||||
"implementation": EditorCapability,
|
||||
"depends": [
|
||||
"transactionService"
|
||||
]
|
||||
}
|
||||
],
|
||||
"controls": [
|
||||
{
|
||||
"key": "locator",
|
||||
"template": locatorTemplate
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</mct-include>
|
||||
<div class="flex-elem grows vscroll">
|
||||
<ul class="tree">
|
||||
<li ng-repeat="containedObject in composition | filter:searchText">
|
||||
<li ng-repeat="containedObject in composition | filter:searchElements">
|
||||
<span class="tree-item">
|
||||
<mct-representation
|
||||
class="rep-object-label"
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
* 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';
|
||||
|
||||
/**
|
||||
* The "Cancel" action; the action triggered by clicking Cancel from
|
||||
@@ -33,10 +31,8 @@ define(
|
||||
* @memberof platform/commonUI/edit
|
||||
* @implements {Action}
|
||||
*/
|
||||
function CancelAction($injector, navigationService, context) {
|
||||
function CancelAction(context) {
|
||||
this.domainObject = context.domainObject;
|
||||
this.navigationService = navigationService;
|
||||
this.objectService = $injector.get('objectService');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,30 +42,25 @@ define(
|
||||
* cancellation has completed
|
||||
*/
|
||||
CancelAction.prototype.perform = function () {
|
||||
var domainObject = this.domainObject,
|
||||
self = this;
|
||||
var domainObject = this.domainObject;
|
||||
|
||||
// Look up the object's "editor.completion" capability;
|
||||
// this is introduced by EditableDomainObject which is
|
||||
// used to insulate underlying objects from changes made
|
||||
// during editing.
|
||||
function getEditorCapability() {
|
||||
return domainObject.getCapability("editor");
|
||||
}
|
||||
|
||||
// Invoke any save behavior introduced by the editor.completion
|
||||
// capability.
|
||||
function doCancel(editor) {
|
||||
return editor.cancel();
|
||||
}
|
||||
|
||||
//Discard current 'editable' object, and retrieve original
|
||||
// un-edited object.
|
||||
function returnToBrowse() {
|
||||
return self.navigationService.setNavigation(self.domainObject.getOriginalObject());
|
||||
}
|
||||
var parent;
|
||||
|
||||
return doCancel(getEditorCapability())
|
||||
//If the object existed already, navigate to refresh view
|
||||
// with previous object state.
|
||||
if (domainObject.getModel().persisted) {
|
||||
domainObject.getCapability("action").perform("navigate");
|
||||
} else {
|
||||
//If the object was new, and user has cancelled, then
|
||||
//navigate back to parent because nothing to show.
|
||||
domainObject.getCapability("location").getOriginal().then(function (original) {
|
||||
parent = original.getCapability("context").getParent();
|
||||
parent.getCapability("action").perform("navigate");
|
||||
});
|
||||
}
|
||||
}
|
||||
return this.domainObject.getCapability("editor").cancel()
|
||||
.then(returnToBrowse);
|
||||
};
|
||||
|
||||
@@ -82,7 +73,8 @@ define(
|
||||
CancelAction.appliesTo = function (context) {
|
||||
var domainObject = (context || {}).domainObject;
|
||||
return domainObject !== undefined &&
|
||||
domainObject.hasCapability("editor");
|
||||
domainObject.hasCapability('editor') &&
|
||||
domainObject.getCapability('editor').isEditContextRoot();
|
||||
};
|
||||
|
||||
return CancelAction;
|
||||
|
||||
@@ -19,15 +19,13 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining EditAction. Created by vwoeltje on 11/14/14.
|
||||
*/
|
||||
define(
|
||||
['../objects/EditableDomainObject'],
|
||||
function (EditableDomainObject) {
|
||||
"use strict";
|
||||
[],
|
||||
function () {
|
||||
|
||||
// A no-op action to return in the event that the action cannot
|
||||
// be completed.
|
||||
@@ -46,7 +44,7 @@ define(
|
||||
* @constructor
|
||||
* @implements {Action}
|
||||
*/
|
||||
function EditAction($location, navigationService, $log, $q, context) {
|
||||
function EditAction($location, navigationService, $log, context) {
|
||||
var domainObject = (context || {}).domainObject;
|
||||
|
||||
// We cannot enter Edit mode if we have no domain object to
|
||||
@@ -65,7 +63,6 @@ define(
|
||||
this.domainObject = domainObject;
|
||||
this.$location = $location;
|
||||
this.navigationService = navigationService;
|
||||
this.$q = $q;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,25 +70,18 @@ define(
|
||||
*/
|
||||
EditAction.prototype.perform = function () {
|
||||
var self = this;
|
||||
if (!this.domainObject.hasCapability("editor")) {
|
||||
//TODO: This is only necessary because the drop gesture is
|
||||
// wrapping the object itself, need to refactor this later.
|
||||
// All responsibility for switching into edit mode should be
|
||||
// in the edit action, and not duplicated in the gesture
|
||||
this.domainObject = new EditableDomainObject(this.domainObject, this.$q);
|
||||
function cancelEditing() {
|
||||
self.domainObject.getCapability('editor').cancel();
|
||||
self.navigationService.removeListener(cancelEditing);
|
||||
}
|
||||
//If this is not the currently navigated object, then navigate
|
||||
// to it.
|
||||
if (this.navigationService.getNavigation() !== this.domainObject) {
|
||||
this.navigationService.setNavigation(this.domainObject);
|
||||
}
|
||||
this.navigationService.setNavigation(this.domainObject);
|
||||
this.domainObject.getCapability('status').set('editing', true);
|
||||
|
||||
//Register a listener to automatically cancel this edit action
|
||||
//if the user navigates away from this object.
|
||||
function cancelEditing(navigatedTo){
|
||||
if (!navigatedTo || navigatedTo.getId() !== self.domainObject.getId()) {
|
||||
self.domainObject.getCapability('editor').cancel();
|
||||
self.navigationService.removeListener(cancelEditing);
|
||||
}
|
||||
}
|
||||
this.navigationService.addListener(cancelEditing);
|
||||
this.domainObject.useCapability("editor");
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -102,11 +92,13 @@ define(
|
||||
*/
|
||||
EditAction.appliesTo = function (context) {
|
||||
var domainObject = (context || {}).domainObject,
|
||||
type = domainObject && domainObject.getCapability('type'),
|
||||
isEditMode = domainObject && domainObject.getDomainObject ? true : false;
|
||||
type = domainObject && domainObject.getCapability('type');
|
||||
|
||||
// Only allow creatable types to be edited
|
||||
return type && type.hasFeature('creation') && !isEditMode;
|
||||
// Only allow editing of types that support it and are not already
|
||||
// being edited
|
||||
return type && type.hasFeature('creation') &&
|
||||
domainObject.hasCapability('editor') &&
|
||||
!domainObject.getCapability('editor').isEditContextRoot();
|
||||
};
|
||||
|
||||
return EditAction;
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* 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";
|
||||
|
||||
|
||||
/**
|
||||
@@ -33,13 +31,14 @@ define(
|
||||
* @memberof platform/commonUI/edit
|
||||
* @implements {Action}
|
||||
*/
|
||||
function LinkAction(context) {
|
||||
function EditAndComposeAction(context) {
|
||||
this.domainObject = (context || {}).domainObject;
|
||||
this.selectedObject = (context || {}).selectedObject;
|
||||
}
|
||||
|
||||
LinkAction.prototype.perform = function () {
|
||||
var self = this;
|
||||
EditAndComposeAction.prototype.perform = function () {
|
||||
var self = this,
|
||||
editAction = this.domainObject.getCapability('action').getActions("edit")[0];
|
||||
|
||||
// Persist changes to the domain object
|
||||
function doPersist() {
|
||||
@@ -56,9 +55,13 @@ define(
|
||||
.then(doPersist);
|
||||
}
|
||||
|
||||
if (editAction) {
|
||||
editAction.perform();
|
||||
}
|
||||
|
||||
return this.selectedObject && doLink();
|
||||
};
|
||||
|
||||
return LinkAction;
|
||||
return EditAndComposeAction;
|
||||
}
|
||||
);
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* Edit the properties of a domain object. Shows a dialog
|
||||
@@ -29,7 +28,6 @@
|
||||
define(
|
||||
['./PropertiesDialog'],
|
||||
function (PropertiesDialog) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Implements the "Edit Properties" action, which prompts the user
|
||||
@@ -65,10 +63,10 @@ define(
|
||||
});
|
||||
}
|
||||
|
||||
function showDialog(type) {
|
||||
function showDialog(objType) {
|
||||
// Create a dialog object to generate the form structure, etc.
|
||||
var dialog =
|
||||
new PropertiesDialog(type, domainObject.getModel());
|
||||
new PropertiesDialog(objType, domainObject.getModel());
|
||||
|
||||
// Show the dialog
|
||||
return dialogService.getUserInput(
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
* 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';
|
||||
|
||||
/**
|
||||
* Construct a new Properties dialog.
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* Module defining RemoveAction. Created by vwoeltje on 11/17/14.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Construct an action which will remove the provided object manifestation.
|
||||
@@ -77,8 +75,8 @@ define(
|
||||
* Invoke persistence on a domain object. This will be called upon
|
||||
* the removed object's parent (as its composition will have changed.)
|
||||
*/
|
||||
function doPersist(domainObject) {
|
||||
var persistence = domainObject.getCapability('persistence');
|
||||
function doPersist(domainObj) {
|
||||
var persistence = domainObj.getCapability('persistence');
|
||||
return persistence && persistence.persist();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
/*jslint es5: true */
|
||||
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* The "Save" action; the action triggered by clicking Save from
|
||||
@@ -52,7 +48,7 @@ define(
|
||||
SaveAction.prototype.perform = function () {
|
||||
var domainObject = this.domainObject;
|
||||
|
||||
function resolveWith(object){
|
||||
function resolveWith(object) {
|
||||
return function () {
|
||||
return object;
|
||||
};
|
||||
@@ -64,7 +60,7 @@ define(
|
||||
// during editing.
|
||||
function doSave() {
|
||||
return domainObject.getCapability("editor").save()
|
||||
.then(resolveWith(domainObject.getOriginalObject()));
|
||||
.then(resolveWith(domainObject));
|
||||
}
|
||||
|
||||
// Discard the current root view (which will be the editing
|
||||
@@ -89,7 +85,8 @@ define(
|
||||
SaveAction.appliesTo = function (context) {
|
||||
var domainObject = (context || {}).domainObject;
|
||||
return domainObject !== undefined &&
|
||||
domainObject.hasCapability("editor") &&
|
||||
domainObject.hasCapability('editor') &&
|
||||
domainObject.getCapability('editor').isEditContextRoot() &&
|
||||
domainObject.getModel().persisted !== undefined;
|
||||
};
|
||||
|
||||
|
||||
@@ -19,14 +19,11 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
/*jslint es5: true */
|
||||
|
||||
|
||||
define(
|
||||
['../../../browse/src/creation/CreateWizard'],
|
||||
['../creation/CreateWizard'],
|
||||
function (CreateWizard) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* The "Save" action; the action triggered by clicking Save from
|
||||
@@ -45,7 +42,7 @@ define(
|
||||
context
|
||||
) {
|
||||
this.domainObject = (context || {}).domainObject;
|
||||
this.injectObjectService = function(){
|
||||
this.injectObjectService = function () {
|
||||
this.objectService = $injector.get("objectService");
|
||||
};
|
||||
this.policyService = policyService;
|
||||
@@ -68,7 +65,7 @@ define(
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
SaveAsAction.prototype.getObjectService = function(){
|
||||
SaveAsAction.prototype.getObjectService = function () {
|
||||
// Lazily acquire object service (avoids cyclical dependency)
|
||||
if (!this.objectService) {
|
||||
this.injectObjectService();
|
||||
@@ -76,7 +73,7 @@ define(
|
||||
return this.objectService;
|
||||
};
|
||||
|
||||
function resolveWith(object){
|
||||
function resolveWith(object) {
|
||||
return function () {
|
||||
return object;
|
||||
};
|
||||
@@ -119,13 +116,13 @@ define(
|
||||
).then(wizard.populateObjectFromInput.bind(wizard));
|
||||
}
|
||||
|
||||
function fetchObject(objectId){
|
||||
return self.getObjectService().getObjects([objectId]).then(function(objects){
|
||||
function fetchObject(objectId) {
|
||||
return self.getObjectService().getObjects([objectId]).then(function (objects) {
|
||||
return objects[objectId];
|
||||
});
|
||||
}
|
||||
|
||||
function getParent(object){
|
||||
function getParent(object) {
|
||||
return fetchObject(object.getModel().location);
|
||||
}
|
||||
|
||||
@@ -138,8 +135,8 @@ define(
|
||||
return copyService.perform(domainObject, parent, allowClone);
|
||||
}
|
||||
|
||||
function cancelEditingAfterClone(clonedObject) {
|
||||
return domainObject.getCapability("editor").cancel()
|
||||
function commitEditingAfterClone(clonedObject) {
|
||||
return domainObject.getCapability("editor").save()
|
||||
.then(resolveWith(clonedObject));
|
||||
}
|
||||
|
||||
@@ -147,7 +144,7 @@ define(
|
||||
.then(doWizardSave)
|
||||
.then(getParent)
|
||||
.then(cloneIntoParent)
|
||||
.then(cancelEditingAfterClone)
|
||||
.then(commitEditingAfterClone)
|
||||
.catch(resolveWith(false));
|
||||
};
|
||||
|
||||
@@ -160,7 +157,8 @@ define(
|
||||
SaveAsAction.appliesTo = function (context) {
|
||||
var domainObject = (context || {}).domainObject;
|
||||
return domainObject !== undefined &&
|
||||
domainObject.hasCapability("editor") &&
|
||||
domainObject.hasCapability('editor') &&
|
||||
domainObject.getCapability('editor').isEditContextRoot() &&
|
||||
domainObject.getModel().persisted === undefined;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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';
|
||||
var DISALLOWED_ACTIONS = ["move", "copy", "link", "window", "follow"];
|
||||
/**
|
||||
* Editable Action Capability. Overrides the action capability
|
||||
* normally exhibited by a domain object and filters out certain
|
||||
* actions not applicable when an object is in edit mode.
|
||||
*
|
||||
* Meant specifically for use by EditableDomainObject and the
|
||||
* associated cache; the constructor signature is particular
|
||||
* to a pattern used there and may contain unused arguments.
|
||||
* @constructor
|
||||
* @memberof platform/commonUI/edit
|
||||
* @implements {PersistenceCapability}
|
||||
*/
|
||||
function EditableActionCapability(
|
||||
actionCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache
|
||||
) {
|
||||
var action = Object.create(actionCapability);
|
||||
|
||||
action.getActions = function(domainObject) {
|
||||
return actionCapability.getActions(domainObject).filter(function(action){
|
||||
return DISALLOWED_ACTIONS.indexOf(action.getMetadata().key) === -1;
|
||||
});
|
||||
};
|
||||
|
||||
return action;
|
||||
}
|
||||
|
||||
return EditableActionCapability;
|
||||
}
|
||||
);
|
||||
@@ -1,60 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
['./EditableLookupCapability'],
|
||||
function (EditableLookupCapability) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Wrapper for the "composition" capability;
|
||||
* ensures that any domain objects reachable in Edit mode
|
||||
* are also wrapped as EditableDomainObjects.
|
||||
*
|
||||
* Meant specifically for use by EditableDomainObject and the
|
||||
* associated cache; the constructor signature is particular
|
||||
* to a pattern used there and may contain unused arguments.
|
||||
* @constructor
|
||||
* @memberof platform/commonUI/edit
|
||||
* @implements {CompositionCapability}
|
||||
*/
|
||||
return function EditableCompositionCapability(
|
||||
contextCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache
|
||||
) {
|
||||
// This is a "lookup" style capability (it looks up other
|
||||
// domain objects), but we do not want to return the same
|
||||
// specific value every time (composition may change)
|
||||
return new EditableLookupCapability(
|
||||
contextCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache,
|
||||
false // Not idempotent
|
||||
);
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -1,78 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
['./EditableLookupCapability'],
|
||||
function (EditableLookupCapability) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Wrapper for the "context" capability;
|
||||
* ensures that any domain objects reachable in Edit mode
|
||||
* are also wrapped as EditableDomainObjects.
|
||||
*
|
||||
* Meant specifically for use by EditableDomainObject and the
|
||||
* associated cache; the constructor signature is particular
|
||||
* to a pattern used there and may contain unused arguments.
|
||||
* @constructor
|
||||
* @memberof platform/commonUI/edit
|
||||
* @implements {ContextCapability}
|
||||
*/
|
||||
return function EditableContextCapability(
|
||||
contextCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache
|
||||
) {
|
||||
// This is a "lookup" style capability (it looks up other
|
||||
// domain objects), and it should be idempotent
|
||||
var capability = new EditableLookupCapability(
|
||||
contextCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache,
|
||||
true // Idempotent
|
||||
),
|
||||
// Track the real root object for the Elements pane
|
||||
trueRoot = capability.getRoot();
|
||||
|
||||
// Provide access to the real root, for the Elements pane.
|
||||
capability.getTrueRoot = function () {
|
||||
return trueRoot;
|
||||
};
|
||||
|
||||
// Hide ancestry after the root of this subgraph
|
||||
if (cache.isRoot(domainObject)) {
|
||||
capability.getRoot = function () {
|
||||
return editableObject;
|
||||
};
|
||||
capability.getPath = function () {
|
||||
return [editableObject];
|
||||
};
|
||||
}
|
||||
|
||||
return capability;
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -1,60 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
['./EditableLookupCapability'],
|
||||
function (EditableLookupCapability) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Wrapper for the "instantiation" capability;
|
||||
* ensures that any domain objects instantiated in Edit mode
|
||||
* are also wrapped as EditableDomainObjects.
|
||||
*
|
||||
* Meant specifically for use by EditableDomainObject and the
|
||||
* associated cache; the constructor signature is particular
|
||||
* to a pattern used there and may contain unused arguments.
|
||||
* @constructor
|
||||
* @memberof platform/commonUI/edit
|
||||
* @implements {CompositionCapability}
|
||||
*/
|
||||
return function EditableInstantiationCapability(
|
||||
contextCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache
|
||||
) {
|
||||
// This is a "lookup" style capability (it looks up other
|
||||
// domain objects), but we do not want to return the same
|
||||
// specific value every time (composition may change)
|
||||
return new EditableLookupCapability(
|
||||
contextCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache,
|
||||
false // Not idempotent
|
||||
);
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -1,125 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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';
|
||||
|
||||
/**
|
||||
* Wrapper for both "context" and "composition" capabilities;
|
||||
* ensures that any domain objects reachable in Edit mode
|
||||
* are also wrapped as EditableDomainObjects.
|
||||
*
|
||||
* Meant specifically for use by EditableDomainObject and the
|
||||
* associated cache; the constructor signature is particular
|
||||
* to a pattern used there and may contain unused arguments.
|
||||
* @constructor
|
||||
* @memberof platform/commonUI/edit
|
||||
*/
|
||||
return function EditableLookupCapability(
|
||||
contextCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache,
|
||||
idempotent
|
||||
) {
|
||||
var capability = Object.create(contextCapability),
|
||||
method;
|
||||
|
||||
// Check for domain object interface. If something has these
|
||||
// three methods, we assume it's a domain object.
|
||||
function isDomainObject(obj) {
|
||||
return obj !== undefined &&
|
||||
typeof obj.getId === 'function' &&
|
||||
typeof obj.getModel === 'function' &&
|
||||
typeof obj.getCapability === 'function';
|
||||
}
|
||||
|
||||
// Check an object returned by the wrapped capability; if it
|
||||
// is a domain object, we want to make it editable and/or get
|
||||
// it from the cache of editable domain objects. This will
|
||||
// prevent changes made in edit mode from modifying the actual
|
||||
// underlying domain object.
|
||||
function makeEditableObject(obj) {
|
||||
return isDomainObject(obj) ?
|
||||
cache.getEditableObject(obj) :
|
||||
obj;
|
||||
}
|
||||
|
||||
// Wrap a returned value (see above); if it's an array, wrap
|
||||
// all elements.
|
||||
function makeEditable(returnValue) {
|
||||
return Array.isArray(returnValue) ?
|
||||
returnValue.map(makeEditableObject) :
|
||||
makeEditableObject(returnValue);
|
||||
}
|
||||
|
||||
// Wrap a returned value (see above); if it's a promise, wrap
|
||||
// the resolved value.
|
||||
function wrapResult(result) {
|
||||
return (result && result.then) ? // promise-like
|
||||
result.then(makeEditable) :
|
||||
makeEditable(result);
|
||||
}
|
||||
|
||||
// Return a wrapped version of a function, which ensures
|
||||
// all results are editable domain objects.
|
||||
function wrapFunction(fn) {
|
||||
return function () {
|
||||
return wrapResult(contextCapability[fn].apply(
|
||||
capability,
|
||||
arguments
|
||||
));
|
||||
};
|
||||
}
|
||||
|
||||
// Wrap a method such that it only delegates once.
|
||||
function oneTimeFunction(fn) {
|
||||
return function () {
|
||||
var result = wrapFunction(fn).apply(this, arguments);
|
||||
capability[fn] = function () {
|
||||
return result;
|
||||
};
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
// Wrap a method of this capability
|
||||
function wrapMethod(fn) {
|
||||
if (typeof capability[fn] === 'function') {
|
||||
capability[fn] =
|
||||
(idempotent ? oneTimeFunction : wrapFunction)(fn);
|
||||
}
|
||||
}
|
||||
|
||||
// Wrap all methods; return only editable domain objects.
|
||||
for (method in contextCapability) {
|
||||
wrapMethod(method);
|
||||
}
|
||||
|
||||
return capability;
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -1,68 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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';
|
||||
|
||||
/**
|
||||
* Editable Persistence Capability. Overrides the persistence capability
|
||||
* normally exhibited by a domain object to ensure that changes made
|
||||
* during edit mode are not immediately stored to the database or other
|
||||
* backing storage.
|
||||
*
|
||||
* Meant specifically for use by EditableDomainObject and the
|
||||
* associated cache; the constructor signature is particular
|
||||
* to a pattern used there and may contain unused arguments.
|
||||
* @constructor
|
||||
* @memberof platform/commonUI/edit
|
||||
* @implements {PersistenceCapability}
|
||||
*/
|
||||
function EditablePersistenceCapability(
|
||||
persistenceCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache
|
||||
) {
|
||||
var persistence = Object.create(persistenceCapability);
|
||||
|
||||
// Simply trigger refresh of in-view objects; do not
|
||||
// write anything to database.
|
||||
persistence.persist = function () {
|
||||
return cache.markDirty(editableObject);
|
||||
};
|
||||
|
||||
// Delegate refresh to the original object; this avoids refreshing
|
||||
// the editable instance of the object, and ensures that refresh
|
||||
// correctly targets the "real" version of the object.
|
||||
persistence.refresh = function () {
|
||||
return domainObject.getCapability('persistence').refresh();
|
||||
};
|
||||
|
||||
return persistence;
|
||||
}
|
||||
|
||||
return EditablePersistenceCapability;
|
||||
}
|
||||
);
|
||||
@@ -1,60 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
['./EditableLookupCapability'],
|
||||
function (EditableLookupCapability) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Wrapper for the "relationship" capability;
|
||||
* ensures that any domain objects reachable in Edit mode
|
||||
* are also wrapped as EditableDomainObjects.
|
||||
*
|
||||
* Meant specifically for use by EditableDomainObject and the
|
||||
* associated cache; the constructor signature is particular
|
||||
* to a pattern used there and may contain unused arguments.
|
||||
* @constructor
|
||||
* @memberof platform/commonUI/edit
|
||||
* @implements {RelationshipCapability}
|
||||
*/
|
||||
return function EditableRelationshipCapability(
|
||||
relationshipCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache
|
||||
) {
|
||||
// This is a "lookup" style capability (it looks up other
|
||||
// domain objects), but we do not want to return the same
|
||||
// specific value every time (composition may change)
|
||||
return new EditableLookupCapability(
|
||||
relationshipCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache,
|
||||
false // Not idempotent
|
||||
);
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -19,122 +19,100 @@
|
||||
* 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';
|
||||
|
||||
|
||||
/**
|
||||
* Implements "save" and "cancel" as capabilities of
|
||||
* the object. In editing mode, user is seeing/using
|
||||
* a copy of the object (an EditableDomainObject)
|
||||
* which is disconnected from persistence; the Save
|
||||
* and Cancel actions can use this capability to
|
||||
* propagate changes from edit mode to the underlying
|
||||
* actual persistable object.
|
||||
*
|
||||
* Meant specifically for use by EditableDomainObject and the
|
||||
* associated cache; the constructor signature is particular
|
||||
* to a pattern used there and may contain unused arguments.
|
||||
* A capability that implements an editing 'session' for a domain
|
||||
* object. An editing session is initiated via a call to .edit().
|
||||
* Once initiated, any persist operations will be queued pending a
|
||||
* subsequent call to [.save()](@link #save) or [.cancel()](@link
|
||||
* #cancel).
|
||||
* @param transactionService
|
||||
* @param domainObject
|
||||
* @constructor
|
||||
* @memberof platform/commonUI/edit
|
||||
*/
|
||||
function EditorCapability(
|
||||
persistenceCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache
|
||||
transactionService,
|
||||
domainObject
|
||||
) {
|
||||
this.editableObject = editableObject;
|
||||
this.transactionService = transactionService;
|
||||
this.domainObject = domainObject;
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
// Simulate Promise.resolve (or $q.when); the former
|
||||
// causes a delayed reaction from Angular (since it
|
||||
// does not trigger a digest) and the latter is not
|
||||
// readily accessible, since we're a few classes
|
||||
// removed from the layer which gets dependency
|
||||
// injection.
|
||||
function resolvePromise(value) {
|
||||
return (value && value.then) ? value : {
|
||||
then: function (callback) {
|
||||
return resolvePromise(callback(value));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Save any changes that have been made to this domain object
|
||||
* (as well as to others that might have been retrieved and
|
||||
* modified during the editing session)
|
||||
* @param {boolean} nonrecursive if true, save only this
|
||||
* object (and not other objects with associated changes)
|
||||
* @returns {Promise} a promise that will be fulfilled after
|
||||
* persistence has completed.
|
||||
* @memberof platform/commonUI/edit.EditorCapability#
|
||||
* Initiate an editing session. This will start a transaction during
|
||||
* which any persist operations will be deferred until either save()
|
||||
* or cancel() are called.
|
||||
*/
|
||||
EditorCapability.prototype.save = function (nonrecursive) {
|
||||
var domainObject = this.domainObject,
|
||||
editableObject = this.editableObject,
|
||||
self = this,
|
||||
cache = this.cache,
|
||||
returnPromise;
|
||||
EditorCapability.prototype.edit = function () {
|
||||
this.transactionService.startTransaction();
|
||||
this.domainObject.getCapability('status').set('editing', true);
|
||||
};
|
||||
|
||||
// Update the underlying, "real" domain object's model
|
||||
// with changes made to the copy used for editing.
|
||||
function doMutate() {
|
||||
return domainObject.useCapability('mutation', function () {
|
||||
return editableObject.getModel();
|
||||
});
|
||||
}
|
||||
function isEditContextRoot(domainObject) {
|
||||
return domainObject.getCapability('status').get('editing');
|
||||
}
|
||||
|
||||
// Persist the underlying domain object
|
||||
function doPersist() {
|
||||
return domainObject.getCapability('persistence').persist();
|
||||
}
|
||||
function isEditing(domainObject) {
|
||||
return isEditContextRoot(domainObject) ||
|
||||
domainObject.hasCapability('context') &&
|
||||
isEditing(domainObject.getCapability('context').getParent());
|
||||
}
|
||||
|
||||
editableObject.getCapability("status").set("editing", false);
|
||||
/**
|
||||
* Determines whether this object, or any of its ancestors are
|
||||
* currently being edited.
|
||||
* @returns boolean
|
||||
*/
|
||||
EditorCapability.prototype.inEditContext = function () {
|
||||
return isEditing(this.domainObject);
|
||||
};
|
||||
|
||||
if (nonrecursive) {
|
||||
returnPromise = resolvePromise(doMutate())
|
||||
.then(doPersist)
|
||||
.then(function(){
|
||||
self.cancel();
|
||||
});
|
||||
} else {
|
||||
returnPromise = resolvePromise(cache.saveAll());
|
||||
}
|
||||
//Return the original (non-editable) object
|
||||
return returnPromise.then(function() {
|
||||
return domainObject.getOriginalObject ? domainObject.getOriginalObject() : domainObject;
|
||||
/**
|
||||
* Is this the root editing object (ie. the object that the user
|
||||
* clicked 'edit' on)?
|
||||
* @returns {*}
|
||||
*/
|
||||
EditorCapability.prototype.isEditContextRoot = function () {
|
||||
return isEditContextRoot(this.domainObject);
|
||||
};
|
||||
|
||||
/**
|
||||
* Save any changes from this editing session. This will flush all
|
||||
* pending persists and end the current transaction
|
||||
* @returns {*}
|
||||
*/
|
||||
EditorCapability.prototype.save = function () {
|
||||
var domainObject = this.domainObject;
|
||||
return this.transactionService.commit().then(function () {
|
||||
domainObject.getCapability('status').set('editing', false);
|
||||
});
|
||||
};
|
||||
|
||||
EditorCapability.prototype.invoke = EditorCapability.prototype.edit;
|
||||
|
||||
/**
|
||||
* Cancel the current editing session. This will discard any pending
|
||||
* persist operations
|
||||
* @returns {*}
|
||||
*/
|
||||
EditorCapability.prototype.cancel = function () {
|
||||
var domainObject = this.domainObject;
|
||||
return this.transactionService.cancel().then(function () {
|
||||
domainObject.getCapability("status").set("editing", false);
|
||||
return domainObject;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel editing; Discard any changes that have been made to
|
||||
* this domain object (as well as to others that might have
|
||||
* been retrieved and modified during the editing session)
|
||||
* @returns {Promise} a promise that will be fulfilled after
|
||||
* cancellation has completed.
|
||||
* @memberof platform/commonUI/edit.EditorCapability#
|
||||
*/
|
||||
EditorCapability.prototype.cancel = function () {
|
||||
this.editableObject.getCapability("status").set("editing", false);
|
||||
this.cache.markClean();
|
||||
return resolvePromise(undefined);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if there are any unsaved changes.
|
||||
* @returns {boolean} true if there are unsaved changes
|
||||
* @memberof platform/commonUI/edit.EditorCapability#
|
||||
* @returns {boolean} true if there have been any domain model
|
||||
* modifications since the last persist, false otherwise.
|
||||
*/
|
||||
EditorCapability.prototype.dirty = function () {
|
||||
return this.cache.dirty();
|
||||
return this.transactionService.size() > 0;
|
||||
};
|
||||
|
||||
return EditorCapability;
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
['./TransactionalPersistenceCapability'],
|
||||
function (TransactionalPersistenceCapability) {
|
||||
|
||||
/**
|
||||
* Wraps the [PersistenceCapability]{@link PersistenceCapability} with
|
||||
* transactional capabilities.
|
||||
* @param $q
|
||||
* @param transactionService
|
||||
* @param capabilityService
|
||||
* @see TransactionalPersistenceCapability
|
||||
* @constructor
|
||||
*/
|
||||
function TransactionCapabilityDecorator(
|
||||
$q,
|
||||
transactionService,
|
||||
capabilityService
|
||||
) {
|
||||
this.capabilityService = capabilityService;
|
||||
this.transactionService = transactionService;
|
||||
this.$q = $q;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorate PersistenceCapability to queue persistence calls when a
|
||||
* transaction is in progress.
|
||||
*/
|
||||
TransactionCapabilityDecorator.prototype.getCapabilities = function (model) {
|
||||
var self = this,
|
||||
capabilities = this.capabilityService.getCapabilities(model),
|
||||
persistenceCapability = capabilities.persistence;
|
||||
|
||||
capabilities.persistence = function (domainObject) {
|
||||
var original =
|
||||
(typeof persistenceCapability === 'function') ?
|
||||
persistenceCapability(domainObject) :
|
||||
persistenceCapability;
|
||||
return new TransactionalPersistenceCapability(
|
||||
self.$q,
|
||||
self.transactionService,
|
||||
original,
|
||||
domainObject
|
||||
);
|
||||
};
|
||||
return capabilities;
|
||||
};
|
||||
|
||||
return TransactionCapabilityDecorator;
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,98 @@
|
||||
/*****************************************************************************
|
||||
* 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 () {
|
||||
|
||||
/**
|
||||
* Wraps persistence capability to enable transactions. Transactions
|
||||
* will cause persist calls not to be invoked immediately, but
|
||||
* rather queued until [EditorCapability.save()]{@link EditorCapability#save}
|
||||
* or [EditorCapability.cancel()]{@link EditorCapability#cancel} are
|
||||
* called.
|
||||
* @memberof platform/commonUI/edit/capabilities
|
||||
* @param $q
|
||||
* @param transactionService
|
||||
* @param persistenceCapability
|
||||
* @param domainObject
|
||||
* @constructor
|
||||
*/
|
||||
function TransactionalPersistenceCapability(
|
||||
$q,
|
||||
transactionService,
|
||||
persistenceCapability,
|
||||
domainObject
|
||||
) {
|
||||
this.transactionService = transactionService;
|
||||
this.persistenceCapability = persistenceCapability;
|
||||
this.domainObject = domainObject;
|
||||
this.$q = $q;
|
||||
this.persistPending = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The wrapped persist function. If a transaction is active, persist
|
||||
* will be queued until the transaction is committed or cancelled.
|
||||
* @returns {*}
|
||||
*/
|
||||
TransactionalPersistenceCapability.prototype.persist = function () {
|
||||
var self = this;
|
||||
|
||||
function onCommit() {
|
||||
return self.persistenceCapability.persist().then(function (result) {
|
||||
self.persistPending = false;
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
return self.persistenceCapability.refresh().then(function (result) {
|
||||
self.persistPending = false;
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
if (this.transactionService.isActive()) {
|
||||
if (!this.persistPending) {
|
||||
this.transactionService.addToTransaction(onCommit, onCancel);
|
||||
this.persistPending = true;
|
||||
}
|
||||
//Need to return a promise from this function
|
||||
return this.$q.when(true);
|
||||
} else {
|
||||
return this.persistenceCapability.persist();
|
||||
}
|
||||
};
|
||||
|
||||
TransactionalPersistenceCapability.prototype.refresh = function () {
|
||||
return this.persistenceCapability.refresh();
|
||||
};
|
||||
|
||||
TransactionalPersistenceCapability.prototype.getSpace = function () {
|
||||
return this.persistenceCapability.getSpace();
|
||||
};
|
||||
|
||||
return TransactionalPersistenceCapability;
|
||||
}
|
||||
);
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining EditActionController. Created by vwoeltje on 11/17/14.
|
||||
@@ -27,7 +26,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
var ACTION_CONTEXT = { category: 'conclude-editing' };
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* This bundle implements Edit mode.
|
||||
@@ -28,7 +27,6 @@
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Controller which is responsible for populating the scope for
|
||||
@@ -61,7 +59,7 @@ define(
|
||||
|
||||
$scope.$watch('domainObject', setViewForDomainObject);
|
||||
|
||||
$scope.doAction = function (action){
|
||||
$scope.doAction = function (action) {
|
||||
return $scope[action] && $scope[action]();
|
||||
};
|
||||
}
|
||||
@@ -76,8 +74,8 @@ define(
|
||||
var navigatedObject = this.scope.domainObject,
|
||||
policyMessage;
|
||||
|
||||
this.policyService.allow("navigation", navigatedObject, undefined, function(message) {
|
||||
policyMessage = message;
|
||||
this.policyService.allow("navigation", navigatedObject, undefined, function (message) {
|
||||
policyMessage = message;
|
||||
});
|
||||
|
||||
return policyMessage;
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* 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";
|
||||
|
||||
/**
|
||||
* Supports the Library and Elements panes in Edit mode.
|
||||
|
||||
@@ -19,12 +19,10 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* The ElementsController prepares the elements view for display
|
||||
@@ -32,16 +30,27 @@ define(
|
||||
* @constructor
|
||||
*/
|
||||
function ElementsController($scope) {
|
||||
function filterBy(text){
|
||||
function filterBy(text) {
|
||||
if (typeof text === 'undefined') {
|
||||
return $scope.searchText;
|
||||
} else {
|
||||
$scope.searchText = text;
|
||||
}
|
||||
}
|
||||
|
||||
function searchElements(value) {
|
||||
if ($scope.searchText) {
|
||||
return value.getModel().name.toLowerCase().search(
|
||||
$scope.searchText.toLowerCase()) !== -1;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.filterBy = filterBy;
|
||||
$scope.searchElements = searchElements;
|
||||
}
|
||||
|
||||
return ElementsController;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining AddAction. Created by ahenry on 01/21/16.
|
||||
@@ -29,7 +28,6 @@ define(
|
||||
'./CreateWizard'
|
||||
],
|
||||
function (CreateWizard) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* The Add Action is performed to create new instances of
|
||||
@@ -83,13 +81,13 @@ define(
|
||||
|
||||
newModel.type = this.type.getKey();
|
||||
newObject = parentObject.getCapability('instantiation').instantiate(newModel);
|
||||
newObject.useCapability('mutation', function(model){
|
||||
newObject.useCapability('mutation', function (model) {
|
||||
model.location = parentObject.getId();
|
||||
});
|
||||
|
||||
wizard = new CreateWizard(newObject, this.parent, this.policyService);
|
||||
|
||||
function populateObjectFromInput (formValue) {
|
||||
function populateObjectFromInput(formValue) {
|
||||
return wizard.populateObjectFromInput(formValue, newObject);
|
||||
}
|
||||
|
||||
@@ -101,7 +99,7 @@ define(
|
||||
});
|
||||
}
|
||||
|
||||
function addToParent (populatedObject) {
|
||||
function addToParent(populatedObject) {
|
||||
parentObject.getCapability('composition').add(populatedObject);
|
||||
return persistAndReturn(parentObject);
|
||||
}
|
||||
@@ -127,7 +125,7 @@ define(
|
||||
* @returns {AddActionMetadata} metadata about this action
|
||||
*/
|
||||
AddAction.prototype.getMetadata = function () {
|
||||
return this.metadata;
|
||||
return this.metadata;
|
||||
};
|
||||
|
||||
return AddAction;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user