Compare commits
261 Commits
open1233b
...
pause-butt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42ddb38629 | ||
|
|
fe60d7abbc | ||
|
|
54b975f242 | ||
|
|
7f75e089e8 | ||
|
|
8e8c66280f | ||
|
|
d3d874e209 | ||
|
|
ce561e1598 | ||
|
|
7290601a37 | ||
|
|
ea5a85ffd1 | ||
|
|
eb196ea521 | ||
|
|
b6a8078634 | ||
|
|
e53b34ed60 | ||
|
|
13ffa3e3c4 | ||
|
|
0e3b629d90 | ||
|
|
23216e5aee | ||
|
|
5b366e91c1 | ||
|
|
aa336dfd57 | ||
|
|
556296096d | ||
|
|
e4aaa860a3 | ||
|
|
2079a74ab2 | ||
|
|
4b86439b8a | ||
|
|
a4d8e8ff90 | ||
|
|
3674808a13 | ||
|
|
10c0c29f64 | ||
|
|
fa1a942184 | ||
|
|
e205bf1fa4 | ||
|
|
cecd708dd1 | ||
|
|
aa36417590 | ||
|
|
e6c78f6d8b | ||
|
|
747afa6200 | ||
|
|
019cdde1c6 | ||
|
|
c7e26a231a | ||
|
|
f3b519d47b | ||
|
|
c472ab044b | ||
|
|
008f1387ed | ||
|
|
6ed76708ec | ||
|
|
c2ff81bad1 | ||
|
|
a6c3d98ddd | ||
|
|
603e990755 | ||
|
|
586901aee7 | ||
|
|
449923feae | ||
|
|
ae461f71b4 | ||
|
|
5243b3748d | ||
|
|
82a661b884 | ||
|
|
f5a92f66db | ||
|
|
0417b7e32d | ||
|
|
7c9a6bd817 | ||
|
|
a58c484d71 | ||
|
|
43b92647fb | ||
|
|
e8eb34f5c3 | ||
|
|
fa57688709 | ||
|
|
5ac377ec6a | ||
|
|
c523480b48 | ||
|
|
4dc09975d0 | ||
|
|
29a472ae5d | ||
|
|
3e2fd8967a | ||
|
|
9e429802c2 | ||
|
|
6cfee100d7 | ||
|
|
eeb214204d | ||
|
|
b41ceab51e | ||
|
|
10b0f43fc1 | ||
|
|
593c1adf56 | ||
|
|
2d1ee80322 | ||
|
|
7555eab1e3 | ||
|
|
4923bcbd85 | ||
|
|
5a7fdf82ac | ||
|
|
a5f6940d67 | ||
|
|
4571205871 | ||
|
|
34c3763421 | ||
|
|
e45a686c5a | ||
|
|
1c33157fb8 | ||
|
|
ed6ae23dc0 | ||
|
|
23839b05b0 | ||
|
|
6aed3bb0b5 | ||
|
|
1ae62cde05 | ||
|
|
4e7e5bb783 | ||
|
|
efc46613bb | ||
|
|
218ef16160 | ||
|
|
fb0a577d16 | ||
|
|
19b5e7c781 | ||
|
|
0794c0edf7 | ||
|
|
89515bb896 | ||
|
|
318aecb7bc | ||
|
|
a4b857a034 | ||
|
|
d82230dea4 | ||
|
|
cb242d8efb | ||
|
|
aa8f780e4e | ||
|
|
3ed0880c6e | ||
|
|
40c68e6399 | ||
|
|
65500736da | ||
|
|
b9ab97eb7f | ||
|
|
34ef98e0cd | ||
|
|
825f50262c | ||
|
|
a6079936e8 | ||
|
|
542b7a6f20 | ||
|
|
2a8c3977a4 | ||
|
|
515ea7caf8 | ||
|
|
65993bd77f | ||
|
|
54e07ccfdd | ||
|
|
2e6fcec1c3 | ||
|
|
f992fcebe1 | ||
|
|
280c838735 | ||
|
|
445dfb3d91 | ||
|
|
bc616ecdee | ||
|
|
895c9b12e6 | ||
|
|
95e68fce57 | ||
|
|
9f4f771774 | ||
|
|
05290593e9 | ||
|
|
2aa2d9d4bb | ||
|
|
7b690d0785 | ||
|
|
39fe2fd7b6 | ||
|
|
b661b4737e | ||
|
|
9ca8975baf | ||
|
|
5f7eeeae30 | ||
|
|
537656303a | ||
|
|
e7ba13f844 | ||
|
|
64bf63c18a | ||
|
|
ac3f638b35 | ||
|
|
a3520ba51e | ||
|
|
8e0b7fce7f | ||
|
|
52f5bea215 | ||
|
|
26b4e5498f | ||
|
|
ce733628b2 | ||
|
|
307320b3ff | ||
|
|
504b2e1ecf | ||
|
|
73e452edc0 | ||
|
|
bbeb97e93c | ||
|
|
e6d65f3549 | ||
|
|
1ab4cf68d7 | ||
|
|
f20c8b7d99 | ||
|
|
17a067752f | ||
|
|
7fcaf6510e | ||
|
|
0713941812 | ||
|
|
1d7d56d5e7 | ||
|
|
ba9941891d | ||
|
|
d3b313d8aa | ||
|
|
e2f0f61862 | ||
|
|
ecdcebce0c | ||
|
|
5fbf71264e | ||
|
|
8519e7660f | ||
|
|
e75d1f62ec | ||
|
|
1c9a9baf77 | ||
|
|
44246e6973 | ||
|
|
61f59a94e4 | ||
|
|
a8a689f69a | ||
|
|
e3bd22de8c | ||
|
|
c7787aa1f0 | ||
|
|
3870266131 | ||
|
|
98cc19c637 | ||
|
|
c1128c3156 | ||
|
|
485944a782 | ||
|
|
beb24adf7a | ||
|
|
6de5f73d78 | ||
|
|
35b51d151d | ||
|
|
b2333d83d2 | ||
|
|
7513f24ff3 | ||
|
|
cb9231f453 | ||
|
|
1c9230029d | ||
|
|
e300b49c95 | ||
|
|
f6cd35a631 | ||
|
|
53cecb8909 | ||
|
|
95188f6ce6 | ||
|
|
8c7e8dab8e | ||
|
|
305d2f60d0 | ||
|
|
7cdb8db775 | ||
|
|
7f14397262 | ||
|
|
893e24ff98 | ||
|
|
b60eb6d6ae | ||
|
|
26a7fee869 | ||
|
|
1bdc0497c7 | ||
|
|
04c2eac9ef | ||
|
|
5daaae36bc | ||
|
|
3dea30b1e1 | ||
|
|
9f8578d79e | ||
|
|
0fa5609396 | ||
|
|
9956ce31e5 | ||
|
|
25ff430368 | ||
|
|
cc9a2cbf4f | ||
|
|
cd8c0fa72f | ||
|
|
fff75d111e | ||
|
|
f4df84bfa1 | ||
|
|
0dc65f5dfb | ||
|
|
6e4abcfed8 | ||
|
|
e2f9a0c9cd | ||
|
|
749a2ba088 | ||
|
|
b70501a7ed | ||
|
|
b8ae741969 | ||
|
|
9f32b4b9cd | ||
|
|
fbf736aaf7 | ||
|
|
344a325cb5 | ||
|
|
eb7f78799d | ||
|
|
57d3965fa6 | ||
|
|
2df999ef75 | ||
|
|
c2cd0db9a3 | ||
|
|
04305b7fe5 | ||
|
|
d2f13354a7 | ||
|
|
a9067892f4 | ||
|
|
88223f5e6d | ||
|
|
6310be623a | ||
|
|
6481ddbd7f | ||
|
|
258020624c | ||
|
|
29d65e9cef | ||
|
|
31a605c153 | ||
|
|
08a8207f64 | ||
|
|
5a9ca08984 | ||
|
|
0a3d51c6b5 | ||
|
|
81208d617f | ||
|
|
7ba83b639a | ||
|
|
6c093160c2 | ||
|
|
7706109c81 | ||
|
|
00bebbc66f | ||
|
|
3df7e30d2c | ||
|
|
c674627ebd | ||
|
|
c5161887e2 | ||
|
|
f8a04d0fc2 | ||
|
|
6e1a43130d | ||
|
|
906646704e | ||
|
|
4e15d8fa1f | ||
|
|
1f250dd8e7 | ||
|
|
95202611ea | ||
|
|
d88e905c65 | ||
|
|
abb7230231 | ||
|
|
92d2ec7cf4 | ||
|
|
46a51bd8db | ||
|
|
6680db0b31 | ||
|
|
9ff602a655 | ||
|
|
37c9c6dfaf | ||
|
|
0981e99256 | ||
|
|
0793442518 | ||
|
|
31897ec520 | ||
|
|
6628f93823 | ||
|
|
8fb9306272 | ||
|
|
52b6815687 | ||
|
|
f17417a541 | ||
|
|
69b06364eb | ||
|
|
1d7d963a4f | ||
|
|
910d746002 | ||
|
|
f02f1d47f1 | ||
|
|
beaf8af2e8 | ||
|
|
fce8f13984 | ||
|
|
bcdad3f19c | ||
|
|
058dfb0c87 | ||
|
|
2b41321c03 | ||
|
|
5db03bb1bd | ||
|
|
26e13a6cd0 | ||
|
|
00f3b6ce5c | ||
|
|
11677b97ab | ||
|
|
281559e84b | ||
|
|
222f852af4 | ||
|
|
5aa93ba50c | ||
|
|
0434928f55 | ||
|
|
26db493b0d | ||
|
|
6459f410e7 | ||
|
|
4072b91808 | ||
|
|
8750bdd778 | ||
|
|
60a8ee657a | ||
|
|
ecf1bac5c7 | ||
|
|
d04bdd2685 | ||
|
|
165bd4f638 | ||
|
|
9df59522d9 | ||
|
|
7fc66e2de8 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -36,3 +36,5 @@ protractor/logs
|
||||
|
||||
# npm-debug log
|
||||
npm-debug.log
|
||||
|
||||
package-lock.json
|
||||
|
||||
743
API.md
743
API.md
@@ -3,42 +3,45 @@
|
||||
## Scope and purpose of this document
|
||||
|
||||
This document is intended to serve as a reference for developing an application
|
||||
based on Open MCT. It will provide details of the API functions necessary to extend the
|
||||
Open MCT platform meet common use cases such as integrating with a telemetry source.
|
||||
based on Open MCT. It will provide details of the API functions necessary to
|
||||
extend the Open MCT platform meet common use cases such as integrating with a telemetry source.
|
||||
|
||||
The best place to start is with the [Open MCT Tutorials](https://github.com/nasa/openmct-tutorial).
|
||||
These will walk you through the process of getting up and running with Open MCT,
|
||||
as well as addressing some common developer use cases.
|
||||
These will walk you through the process of getting up and running with Open
|
||||
MCT, as well as addressing some common developer use cases.
|
||||
|
||||
## Building From Source
|
||||
|
||||
The latest version of Open MCT is available from [our GitHub repository](https://github.com/nasa/openmct).
|
||||
If you have `git`, and `node` installed, you can build Open MCT with the commands
|
||||
```
|
||||
If you have `git`, and `node` installed, you can build Open MCT with the
|
||||
commands
|
||||
|
||||
```bash
|
||||
git clone https://github.com/nasa/openmct.git
|
||||
cd openmct
|
||||
npm install
|
||||
```
|
||||
|
||||
These commands will fetch the Open MCT source from our GitHub repository, and build
|
||||
a minified version that can be included in your application. The output of the
|
||||
build process is placed in a `dist` folder under the openmct source directory,
|
||||
which can be copied out to another location as needed. The contents of this
|
||||
folder will include a minified javascript file named `openmct.js` as well as
|
||||
assets such as html, css, and images necessary for the UI.
|
||||
These commands will fetch the Open MCT source from our GitHub repository, and
|
||||
build a minified version that can be included in your application. The output
|
||||
of the build process is placed in a `dist` folder under the openmct source
|
||||
directory, which can be copied out to another location as needed. The contents
|
||||
of this folder will include a minified javascript file named `openmct.js` as
|
||||
well as assets such as html, css, and images necessary for the UI.
|
||||
|
||||
## Starting an Open MCT application
|
||||
|
||||
To start a minimally functional Open MCT application, it is necessary to include
|
||||
the Open MCT distributable, enable some basic plugins, and bootstrap the application.
|
||||
The tutorials walk through the process of getting Open MCT up and running from scratch,
|
||||
but provided below is a minimal HTML template that includes Open MCT, installs
|
||||
some basic plugins, and bootstraps the application. It assumes that Open MCT is
|
||||
installed under an `openmct` subdirectory, as described in [Building From Source](#building-from-source).
|
||||
To start a minimally functional Open MCT application, it is necessary to
|
||||
include the Open MCT distributable, enable some basic plugins, and bootstrap
|
||||
the application. The tutorials walk through the process of getting Open MCT up
|
||||
and running from scratch, but provided below is a minimal HTML template that
|
||||
includes Open MCT, installs some basic plugins, and bootstraps the application.
|
||||
It assumes that Open MCT is installed under an `openmct` subdirectory, as
|
||||
described in [Building From Source](#building-from-source).
|
||||
|
||||
This approach includes openmct using a simple script tag, resulting in a global
|
||||
variable named `openmct`. This `openmct` object is used subsequently to make API
|
||||
calls.
|
||||
variable named `openmct`. This `openmct` object is used subsequently to make
|
||||
API calls.
|
||||
|
||||
Open MCT is packaged as a UMD (Universal Module Definition) module, so common
|
||||
script loaders are also supported.
|
||||
@@ -63,18 +66,19 @@ script loaders are also supported.
|
||||
</html>
|
||||
```
|
||||
|
||||
The Open MCT library included above requires certain assets such as html templates,
|
||||
images, and css. If you installed Open MCT from GitHub as described in the section
|
||||
on [Building from Source](#building-from-source) then these assets will have been
|
||||
downloaded along with the Open MCT javascript library. You can specify the
|
||||
location of these assets by calling `openmct.setAssetPath()`. Typically this will
|
||||
be the same location as the `openmct.js` library is included from.
|
||||
The Open MCT library included above requires certain assets such as html
|
||||
templates, images, and css. If you installed Open MCT from GitHub as described
|
||||
in the section on [Building from Source](#building-from-source) then these
|
||||
assets will have been downloaded along with the Open MCT javascript library.
|
||||
You can specify the location of these assets by calling `openmct.setAssetPath()`.
|
||||
Typically this will be the same location as the `openmct.js` library is
|
||||
included from.
|
||||
|
||||
There are some plugins bundled with the application that provide UI, persistence,
|
||||
and other default configuration which are necessary to be able to do anything with
|
||||
the application initially. Any of these plugins can, in principle, be replaced with a custom
|
||||
plugin. The included plugins are documented in the [Included Plugins](#included-plugins)
|
||||
section.
|
||||
There are some plugins bundled with the application that provide UI,
|
||||
persistence, and other default configuration which are necessary to be able to
|
||||
do anything with the application initially. Any of these plugins can, in
|
||||
principle, be replaced with a custom plugin. The included plugins are
|
||||
documented in the [Included Plugins](#included-plugins) section.
|
||||
|
||||
## Plugins
|
||||
|
||||
@@ -87,25 +91,28 @@ openmct.install(function install(openmctAPI) {
|
||||
});
|
||||
```
|
||||
|
||||
New plugins are installed in Open MCT by calling `openmct.install`, and providing
|
||||
a plugin installation function. This function will be invoked on application
|
||||
startup with one parameter - the openmct API object. A common approach used in
|
||||
the Open MCT codebase is to define a plugin as a function that returns this
|
||||
installation function. This allows configuration to be specified when the plugin is included.
|
||||
New plugins are installed in Open MCT by calling `openmct.install`, and
|
||||
providing a plugin installation function. This function will be invoked on
|
||||
application startup with one parameter - the openmct API object. A common
|
||||
approach used in the Open MCT codebase is to define a plugin as a function that
|
||||
returns this installation function. This allows configuration to be specified
|
||||
when the plugin is included.
|
||||
|
||||
eg.
|
||||
|
||||
```javascript
|
||||
openmct.install(openmct.plugins.Elasticsearch("http://localhost:8002/openmct"));
|
||||
```
|
||||
|
||||
This approach can be seen in all of the [plugins provided with Open MCT](https://github.com/nasa/openmct/blob/master/src/plugins/plugins.js).
|
||||
|
||||
## Domain Objects and Identifiers
|
||||
|
||||
_Domain Objects_ are the basic entities that represent domain knowledge in Open MCT.
|
||||
The temperature sensor on a solar panel, an overlay plot comparing
|
||||
the results of all temperature sensors, the command dictionary for a spacecraft,
|
||||
the individual commands in that dictionary, the "My Items" folder:
|
||||
All of these things are domain objects.
|
||||
_Domain Objects_ are the basic entities that represent domain knowledge in Open
|
||||
MCT. The temperature sensor on a solar panel, an overlay plot comparing the
|
||||
results of all temperature sensors, the command dictionary for a spacecraft,
|
||||
the individual commands in that dictionary, the "My Items" folder: All of these
|
||||
things are domain objects.
|
||||
|
||||
A _Domain Object_ is simply a javascript object with some standard attributes.
|
||||
An example of a _Domain Object_ is the "My Items" object which is a folder in
|
||||
@@ -128,25 +135,27 @@ looks like this:
|
||||
### Object Attributes
|
||||
|
||||
The main attributes to note are the `identifier`, and `type` attributes.
|
||||
* `identifier`: A composite key that provides a universally unique identifier for
|
||||
this object. The `namespace` and `key` are used to identify the object. The `key`
|
||||
must be unique within the namespace.
|
||||
|
||||
* `identifier`: A composite key that provides a universally unique identifier
|
||||
for this object. The `namespace` and `key` are used to identify the object.
|
||||
The `key` must be unique within the namespace.
|
||||
* `type`: All objects in Open MCT have a type. Types allow you to form an
|
||||
ontology of knowledge and provide an abstraction for grouping, visualizing, and
|
||||
interpreting data. Details on how to define a new object type are provided below.
|
||||
ontology of knowledge and provide an abstraction for grouping, visualizing,
|
||||
and interpreting data. Details on how to define a new object type are
|
||||
provided below.
|
||||
|
||||
Open MCT uses a number of builtin types. Typically you are going to want to
|
||||
define your own if extending Open MCT.
|
||||
define your own when extending Open MCT.
|
||||
|
||||
### Domain Object Types
|
||||
|
||||
Custom types may be registered via the `addType` function on the opencmt Type
|
||||
Custom types may be registered via the `addType` function on the Open MCT Type
|
||||
registry.
|
||||
|
||||
eg.
|
||||
```javascript
|
||||
openmct.types.addType('my-type', {
|
||||
label: "My Type",
|
||||
name: "My Type",
|
||||
description: "This is a type that I added!",
|
||||
creatable: true
|
||||
});
|
||||
@@ -157,7 +166,7 @@ The `addType` function accepts two arguments:
|
||||
for an object.
|
||||
* An object type specification. An object type definition supports the following
|
||||
attributes
|
||||
* `label`: a `string` naming this object type
|
||||
* `name`: a `string` naming this object type
|
||||
* `description`: a `string` specifying a longer-form description of this type
|
||||
* `initialize`: a `function` which initializes the model for new domain objects
|
||||
of this type. This can be used for setting default values on an object when
|
||||
@@ -284,116 +293,576 @@ var domainObject = {
|
||||
};
|
||||
```
|
||||
|
||||
## Telemetry Providers
|
||||
## Telemetry API
|
||||
|
||||
When connecting to a new telemetry source, you will need to register a new
|
||||
_Telemetry Provider_. A _Telemetry Provider_ retrieves telemetry data from some telemetry
|
||||
source, and exposes them in a way that can be used by Open MCT. A telemetry
|
||||
provider typically can support a one off __request__ for a batch of telemetry data,
|
||||
or it can provide the ability to __subscribe__ to receive new telemetry data when
|
||||
it becomes available, or both.
|
||||
The Open MCT telemetry API provides two main sets of interfaces-- one for integrating telemetry data into Open MCT, and another for developing Open MCT visualization plugins utilizing telemetry API.
|
||||
|
||||
```javascript
|
||||
openmct.telemetry.addProvider({
|
||||
supportsRequest: function (domainObject) {
|
||||
//...
|
||||
},
|
||||
supportsSubscribe: function (domainObject) {
|
||||
//...
|
||||
},
|
||||
request: function (domainObject, options) {
|
||||
//...
|
||||
},
|
||||
subscribe: function (domainObject, callback, options) {
|
||||
//...
|
||||
}
|
||||
})
|
||||
```
|
||||
The APIs for visualization plugins are still a work in progress and docs may change at any time. However, the APIs for integrating telemetry metadata into Open MCT are stable and documentation is included below.
|
||||
|
||||
A telemetry provider is an object with the following functions defined:
|
||||
### Integrating Telemetry Sources
|
||||
|
||||
* `supportsRequest`: An __optional__ `function` that accepts a
|
||||
[Domain Object](#domain-objects-and-identifiers) and returns a `boolean` value
|
||||
indicating whether or not this provider supports telemetry requests for the
|
||||
given object. If this returns `true` then a `request` function must be defined.
|
||||
* `supportsSubscribe`: An __optional__ `function` that accepts a
|
||||
[Domain Object](#domain-objects-and-identifiers) and returns a `boolean` value
|
||||
indicating whether or not this provider supports telemetry subscriptions. If this
|
||||
returns `true` then a `subscribe` function must also be defined. As with `request`,
|
||||
the return value will typically be conditional, and based on attributes of
|
||||
`domainObject` such as its identifier.
|
||||
* `request`: A `function` that returns a `Promise` that will resolve with an `Array`
|
||||
of telemetry in a single query. This function accepts as arguments a
|
||||
[Domain Object](#domain-objects-and-identifiers) and an object containing some
|
||||
[request options](#telemetry-requests).
|
||||
* `subscribe`: A `function` that accepts a [Domain Object](#domain-objects-and-identifiers),
|
||||
a callback `function`, and a [telemetry request](#telemetry-requests). The
|
||||
callback is invoked whenever telemetry is available, and
|
||||
|
||||
|
||||
The implementations for `request` and `subscribe` can vary depending on the
|
||||
nature of the endpoint which will provide telemetry. In the example above,
|
||||
it is assumed that `myAdapter` contains the implementation details
|
||||
(such as HTTP requests, WebSocket connections, etc.) associated with some telemetry
|
||||
source.
|
||||
There are two main tasks for integrating telemetry sources-- describing telemetry objects with relevant metadata, and then providing telemetry data for those objects. You'll use an [Object Provider](#object-providers) to provide objects with the necessary [Telemetry Metadata](#telemetry-metadata), and then register a [Telemetry Provider](#telemetry-providers) to retrieve telemetry data for those objects.
|
||||
|
||||
For a step-by-step guide to building a telemetry adapter, please see the
|
||||
[Open MCT Tutorials](https://github.com/larkin/openmct-tutorial).
|
||||
[Open MCT Tutorials](https://github.com/nasa/openmct-tutorial).
|
||||
|
||||
### Telemetry Requests
|
||||
Telemetry requests support time bounded queries. A call to a _Telemetry Provider_'s
|
||||
`request` function will include an `options` argument. These are simply javascript
|
||||
objects with attributes for the request parameters. An example of a telemetry
|
||||
request object with a start and end time is included below:
|
||||
```javascript
|
||||
#### Telemetry Metadata
|
||||
|
||||
A telemetry object is a domain object with a telemetry property. To take an example from the tutorial, here is the telemetry object for the "fuel" measurement of the spacecraft:
|
||||
|
||||
```json
|
||||
{
|
||||
start: 1487981997240,
|
||||
end: 1487982897240
|
||||
"identifier": {
|
||||
"namespace": "example.taxonomy",
|
||||
"key": "prop.fuel"
|
||||
},
|
||||
"name": "Fuel",
|
||||
"type": "example.telemetry",
|
||||
"telemetry": {
|
||||
"values": [
|
||||
{
|
||||
"key": "value",
|
||||
"name": "Value",
|
||||
"units": "kilograms",
|
||||
"format": "float",
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"hints": {
|
||||
"range": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "utc",
|
||||
"source": "timestamp",
|
||||
"name": "Timestamp",
|
||||
"format": "utc",
|
||||
"hints": {
|
||||
"domain": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Telemetry Data
|
||||
The most important part of the telemetry metadata is the `values` property-- this describes the attributes of telemetry datums (objects) that a telemetry provider returns. These descriptions must be provided for telemetry views to work properly.
|
||||
|
||||
Telemetry data is provided to Open MCT by _[Telemetry Providers](#telemetry-providers)_
|
||||
in the form of javascript objects. A collection of telemetry values (for example,
|
||||
retrieved in response to a `request`) is represented by an `Array` of javascript
|
||||
objects. These telemetry javascript objects are simply key value pairs.
|
||||
##### Values
|
||||
|
||||
Typically a telemetry datum will have some timestamp associated with it. This
|
||||
time stamp should have a key that corresponds to some time system supported by
|
||||
Open MCT. If the `UTCTimeSystem` plugin is installed, then the key `utc` can be used.
|
||||
|
||||
An example of a telemetry provider request function that returns a collection of
|
||||
mock telemtry data is below:
|
||||
`telemetry.values` is an array of value description objects, which have the following fields:
|
||||
|
||||
attribute | type | flags | notes
|
||||
--- | --- | --- | ---
|
||||
`key` | string | required | unique identifier for this field.
|
||||
`hints` | object | required | Hints allow views to intelligently select relevant attributes for display, and are required for most views to function. See section on "Value Hints" below.
|
||||
`name` | string | optional | a human readible label for this field. If omitted, defaults to `key`.
|
||||
`source` | string | optional | identifies the property of a datum where this value is stored. If omitted, defaults to `key`.
|
||||
`format` | string | optional | a specific format identifier, mapping to a formatter. If omitted, uses a default formatter. For enumerations, use `enum`. For timestamps, use `utc` if you are using utc dates, otherwise use a key mapping to your custom date format.
|
||||
`units` | string | optional | the units of this value, e.g. `km`, `seconds`, `parsecs`
|
||||
`min` | number | optional | the minimum possible value of this measurement. Will be used by plots, gauges, etc to automatically set a min value.
|
||||
`max` | number | optional | the maximum possible value of this measurement. Will be used by plots, gauges, etc to automatically set a max value.
|
||||
`enumerations` | array | optional | for objects where `format` is `"enum"`, this array tracks all possible enumerations of the value. Each entry in this array is an object, with a `value` property that is the numerical value of the enumeration, and a `string` property that is the text value of the enumeration. ex: `{"value": 0, "string": "OFF"}`. If you use an enumerations array, `min` and `max` will be set automatically for you.
|
||||
|
||||
|
||||
###### Value Hints
|
||||
|
||||
Each telemetry value description has an object defining hints. Keys in this this object represent the hint itself, and the value represents the weight of that hint. A lower weight means the hint has a higher priority. For example, multiple values could be hinted for use as the y axis of a plot (raw, engineering), but the highest priority would be the default choice. Likewise, a table will use hints to determine the default order of columns.
|
||||
|
||||
Known hints:
|
||||
|
||||
* `domain`: Indicates that the value represents the "input" of a datum. Values with a `domain` hint will be used for the x-axis of a plot, and tables will render columns for these values first.
|
||||
* `range`: Indicates that the value is the "output" of a datum. Values with a `range` hint will be used as the y-axis on a plot, and tables will render columns for these values after the `domain` values.
|
||||
* `image`: Indicates that the value may be interpreted as the URL to an image file, in which case appropriate views will be made available.
|
||||
|
||||
##### The Time Conductor and Telemetry
|
||||
|
||||
Open MCT provides a number of ways to pivot through data and link data via time. The Time Conductor helps synchronize multiple views around the same time.
|
||||
|
||||
In order for the time conductor to work, there will always be an active "time system". All telemetry metadata *must* have a telemetry value with a `key` that matches the `key` of the active time system. You can use the `source` attribute on the value metadata to remap this to a different field in the telemetry datum-- especially useful if you are working with disparate datasources that have different field mappings.
|
||||
|
||||
|
||||
#### Telemetry Providers
|
||||
|
||||
Telemetry providers are responsible for providing historical and real time telemetry data for telemetry objects. Each telemetry provider determines which objects it can provide telemetry for, and then must implement methods to provide telemetry for those objects.
|
||||
|
||||
A telemetry provider is a javascript object with up to four methods:
|
||||
|
||||
* `supportsSubscribe(domainObject, callback, options)` optional. Must be implemented to provide realtime telemetry. Should return `true` if the provider supports subscriptions for the given domain object (and request options).
|
||||
* `subscribe(domainObject, callback, options)` required if `supportsSubscribe` is implemented. Establish a subscription for realtime data for the given domain object. Should invoke `callback` with a single telemetry datum every time data is received. Must return an unsubscribe function. Multiple views can subscribe to the same telemetry object, so it should always return a new unsubscribe function.
|
||||
* `supportsRequest(domainObject, options)` optional. Must be implemented to provide historical telemetry. Should return `true` if the provider supports historical requests for the given domain object.
|
||||
* `request(domainObject, options)` required if `supportsRequest` is implemented. Must return a promise for an array of telemetry datums that fulfills the request. The `options` argument will include a `start`, `end`, and `domain` attribute representing the query bounds. For more request properties, see Request Properties below.
|
||||
|
||||
Telemetry providers are registered by calling `openmct.telemetry.addProvider(provider)`, e.g.
|
||||
|
||||
```javascript
|
||||
openmct.telemetry.addProvider({
|
||||
supportsRequest: function (domainObject) {
|
||||
return true
|
||||
},
|
||||
request: function (domainObject, options) {
|
||||
return Promise.resolve([
|
||||
{
|
||||
'utc': Date.now() - 2000,
|
||||
'value': 1,
|
||||
},
|
||||
{
|
||||
'utc': Date.now() - 1000,
|
||||
'value': 2,
|
||||
},
|
||||
{
|
||||
'utc': Date.now(),
|
||||
'value': 3,
|
||||
}
|
||||
]);
|
||||
}
|
||||
supportsRequest: function (domainObject, options) { /*...*/ },
|
||||
request: function (domainObject, options) { /*...*/ },
|
||||
supportsSubscribe: function (domainObject, callback, options) { /*...*/ },
|
||||
subscribe: function (domainObject, callback, options) { /*...*/ }
|
||||
})
|
||||
```
|
||||
|
||||
#### Telemetry Requests
|
||||
|
||||
Telemetry requests support time bounded queries. A call to a _Telemetry Provider_'s `request` function will include an `options` argument. These are simply javascript objects with attributes for the request parameters. An example of a telemetry request object with a start and end time is included below:
|
||||
```javascript
|
||||
{
|
||||
start: 1487981997240,
|
||||
end: 1487982897240,
|
||||
domain: 'utc'
|
||||
}
|
||||
```
|
||||
|
||||
#### Telemetry Formats
|
||||
|
||||
Telemetry format objects define how to interpret and display telemetry data.
|
||||
They have a simple structure:
|
||||
|
||||
* `key`: A `string` that uniquely identifies this formatter.
|
||||
* `format`: A `function` that takes a raw telemetry value, and returns a
|
||||
human-readable `string` representation of that value. It has one required
|
||||
argument, and three optional arguments that provide context and can be used
|
||||
for returning scaled representations of a value. An example of this is
|
||||
representing time values in a scale such as the time conductor scale. There
|
||||
are multiple ways of representing a point in time, and by providing a minimum
|
||||
scale value, maximum scale value, and a count, it's possible to provide more
|
||||
useful representations of time given the provided limitations.
|
||||
* `value`: The raw telemetry value in its native type.
|
||||
* `minValue`: An __optional__ argument specifying the minimum displayed
|
||||
value.
|
||||
* `maxValue`: An __optional__ argument specifying the maximum displayed
|
||||
value.
|
||||
* `count`: An __optional__ argument specifying the number of displayed
|
||||
values.
|
||||
* `parse`: A `function` that takes a `string` representation of a telemetry
|
||||
value, and returns the value in its native type. **Note** parse might receive an already-parsed value. This function should be idempotent.
|
||||
* `validate`: A `function` that takes a `string` representation of a telemetry
|
||||
value, and returns a `boolean` value indicating whether the provided string
|
||||
can be parsed.
|
||||
|
||||
##### Registering Formats
|
||||
|
||||
Formats are registered with the Telemetry API using the `addFormat` function. eg.
|
||||
|
||||
``` javascript
|
||||
openmct.telemetry.addFormat({
|
||||
key: 'number-to-string',
|
||||
format: function (number) {
|
||||
return number + '';
|
||||
},
|
||||
parse: function (text) {
|
||||
return Number(text);
|
||||
},
|
||||
validate: function (text) {
|
||||
return !isNaN(text);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
#### Telemetry Data
|
||||
|
||||
A single telemetry point is considered a Datum, and is represented by a standard
|
||||
javascript object. Realtime subscriptions (obtained via __subscribe__) will
|
||||
invoke the supplied callback once for each telemetry datum recieved. Telemetry
|
||||
requests (obtained via __request__) will return a promise for an array of
|
||||
telemetry datums.
|
||||
|
||||
##### Telemetry Datums
|
||||
|
||||
A telemetry datum is a simple javascript object, e.g.:
|
||||
|
||||
```json
|
||||
{
|
||||
"timestamp": 1491267051538,
|
||||
"value": 77,
|
||||
"id": "prop.fuel"
|
||||
}
|
||||
```
|
||||
|
||||
The key-value pairs of this object are described by the telemetry metadata of
|
||||
a domain object, as discussed in the [Telemetry Metadata](#telemetry-metadata)
|
||||
section.
|
||||
|
||||
## Time API
|
||||
|
||||
Open MCT provides API for managing the temporal state of the application.
|
||||
Central to this is the concept of "time bounds". Views in Open MCT will
|
||||
typically show telemetry data for some prescribed date range, and the Time API
|
||||
provides a way to centrally manage these bounds.
|
||||
|
||||
The Time API exposes a number of methods for querying and setting the temporal
|
||||
state of the application, and emits events to inform listeners when the state changes.
|
||||
|
||||
Because the data displayed tends to be time domain data, Open MCT must always
|
||||
have at least one time system installed and activated. When you download Open
|
||||
MCT, it will be pre-configured to use the UTC time system, which is installed and activated, along with other default plugins, in `index.html`. Installing and activating a time system is simple, and is covered
|
||||
[in the next section](#defining-and-registering-time-systems).
|
||||
|
||||
### Time Systems and Bounds
|
||||
|
||||
#### Defining and Registering Time Systems
|
||||
|
||||
The time bounds of an Open MCT application are defined as numbers, and a Time
|
||||
System gives meaning and context to these numbers so that they can be correctly
|
||||
interpreted. Time Systems are JavaScript objects that provide some information
|
||||
about the current time reference frame. An example of defining and registering
|
||||
a new time system is given below:
|
||||
|
||||
``` javascript
|
||||
openmct.time.addTimeSystem({
|
||||
key: 'utc',
|
||||
name: 'UTC Time',
|
||||
cssClass = 'icon-clock',
|
||||
timeFormat = 'utc',
|
||||
durationFormat = 'duration',
|
||||
isUTCBased = true
|
||||
});
|
||||
```
|
||||
|
||||
The example above defines a new utc based time system. In fact, this time system
|
||||
is configured and activated by default from `index.html` in the default
|
||||
installation of Open MCT if you download the source from GitHub. Some details of
|
||||
each of the required properties is provided below.
|
||||
|
||||
* `key`: A `string` that uniquely identifies this time system.
|
||||
* `name`: A `string` providing a brief human readable label. If the [Time Conductor](#the-time-conductor)
|
||||
plugin is enabled, this name will identify the time system in a dropdown menu.
|
||||
* `cssClass`: A class name `string` that will be applied to the time system when
|
||||
it appears in the UI. This will be used to represent the time system with an icon.
|
||||
There are a number of built-in icon classes [available in Open MCT](https://github.com/nasa/openmct/blob/master/platform/commonUI/general/res/sass/_glyphs.scss),
|
||||
or a custom class can be used here.
|
||||
* `timeFormat`: A `string` corresponding to the key of a registered
|
||||
[telemetry time format](#telemetry-formats). The format will be used for
|
||||
displaying discrete timestamps from telemetry streams when this time system is
|
||||
activated. If the [UTCTimeSystem](#included-plugins) is enabled, then the `utc`
|
||||
format can be used if this is a utc-based time system
|
||||
* `durationFormat`: A `string` corresponding to the key of a registered
|
||||
[telemetry time format](#telemetry-formats). The format will be used for
|
||||
displaying time ranges, for example `00:15:00` might be used to represent a time
|
||||
period of fifteen minutes. These are used by the Time Conductor plugin to specify
|
||||
relative time offsets. If the [UTCTimeSystem](#included-plugins) is enabled,
|
||||
then the `duration` format can be used if this is a utc-based time system
|
||||
* `isUTCBased`: A `boolean` that defines whether this time system represents
|
||||
numbers in UTC terrestrial time.
|
||||
|
||||
#### Getting and Setting the Active Time System
|
||||
|
||||
Once registered, a time system can be activated by calling `timeSystem` with
|
||||
the timeSystem `key` or an instance of the time system. If you are not using a
|
||||
[clock](#clocks), you must also specify valid [bounds](#time-bounds) for the
|
||||
timeSystem.
|
||||
|
||||
```javascript
|
||||
openmct.time.timeSystem('utc', bounds);
|
||||
```
|
||||
|
||||
A time system can be immediately activated after registration:
|
||||
|
||||
```javascript
|
||||
openmct.time.addTimeSystem(utcTimeSystem);
|
||||
openmct.time.timeSystem(utcTimeSystem, bounds);
|
||||
```
|
||||
|
||||
Setting the active time system will trigger a [`'timeSystem'`](#time-events)
|
||||
event. If you supplied bounds, a [`'bounds'`](#time-events) event will be triggered afterwards with your newly supplied bounds.
|
||||
|
||||
### Time Bounds
|
||||
|
||||
The TimeAPI provides a getter/setter for querying and setting time bounds. Time
|
||||
bounds are simply an object with a `start` and an end `end` attribute.
|
||||
|
||||
* `start`: A `number` representing a moment in time in the active [Time System](#defining-and-registering-time-systems).
|
||||
This will be used as the beginning of the time period displayed by time-responsive
|
||||
telemetry views.
|
||||
* `end`: A `number` representing a moment in time in the active [Time System](#defining-and-registering-time-systems).
|
||||
This will be used as the end of the time period displayed by time-responsive
|
||||
telemetry views.
|
||||
|
||||
If invoked with bounds, it will set the new time bounds system-wide. If invoked
|
||||
without any parameters, it will return the current application-wide time bounds.
|
||||
|
||||
``` javascript
|
||||
const ONE_HOUR = 60 * 60 * 1000;
|
||||
let now = Date.now();
|
||||
openmct.time.bounds({start: now - ONE_HOUR, now);
|
||||
```
|
||||
|
||||
To respond to bounds change events, listen for the [`'bounds'`](#time-events)
|
||||
event.
|
||||
|
||||
## Clocks
|
||||
|
||||
The Time API can be set to follow a clock source which will cause the bounds
|
||||
to be updated automatically whenever the clock source "ticks". A clock is simply
|
||||
an object that supports registration of listeners and periodically invokes its
|
||||
listeners with a number. Open MCT supports registration of new clock sources that
|
||||
tick on almost anything. A tick occurs when the clock invokes callback functions
|
||||
registered by its listeners with a new time value.
|
||||
|
||||
An example of a clock source is the [LocalClock](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/LocalClock.js)
|
||||
which emits the current time in UTC every 100ms. Clocks can tick on anything. For
|
||||
example, a clock could be defined to provide the timestamp of any new data
|
||||
received via a telemetry subscription. This would have the effect of advancing
|
||||
the bounds of views automatically whenever data is received. A clock could also
|
||||
be defined to tick on some remote timing source.
|
||||
|
||||
The values provided by clocks are simple `number`s, which are interpreted in the
|
||||
context of the active [Time System](#defining-and-registering-time-systems).
|
||||
|
||||
### Defining and registering clocks
|
||||
|
||||
A clock is an object that defines certain required metadata and functions:
|
||||
|
||||
* `key`: A `string` uniquely identifying this clock. This can be used later to
|
||||
reference the clock in places such as the [Time Conductor configuration](#time-conductor-configuration)
|
||||
* `cssClass`: A `string` identifying a CSS class to apply to this clock when it's
|
||||
displayed in the UI. This will be used to represent the time system with an icon.
|
||||
There are a number of built-in icon classes [available in Open MCT](https://github.com/nasa/openmct/blob/master/platform/commonUI/general/res/sass/_glyphs.scss),
|
||||
or a custom class can be used here.
|
||||
* `name`: A `string` providing a human-readable identifier for the clock source.
|
||||
This will be displayed in the clock selector menu in the Time Conductor UI
|
||||
component, if active.
|
||||
* `description`: An __optional__ `string` providing a longer description of the
|
||||
clock. The description will be visible in the clock selection menu in the Time
|
||||
Conductor plugin.
|
||||
* `on`: A `function` supporting registration of a new callback that will be
|
||||
invoked when the clock next ticks. It will be invoked with two arguments:
|
||||
* `eventName`: A `string` specifying the event to listen on. For now, clocks
|
||||
support one event - `tick`.
|
||||
* `callback`: A `function` that will be invoked when this clock ticks. The
|
||||
function must be invoked with one parameter - a `number` representing a valid
|
||||
time in the current time system.
|
||||
* `off`: A `function` that allows deregistration of a tick listener. It accepts
|
||||
the same arguments as `on`.
|
||||
* `currentValue`: A `function` that returns a `number` representing a point in
|
||||
time in the active time system. It should be the last value provided by a tick,
|
||||
or some default value if no ticking has yet occurred.
|
||||
|
||||
A new clock can be registered using the `addClock` function exposed by the Time
|
||||
API:
|
||||
|
||||
```javascript
|
||||
var someClock = {
|
||||
key: 'someClock',
|
||||
cssClass: 'icon-clock',
|
||||
name: 'Some clock',
|
||||
description: "Presumably does something useful",
|
||||
on: function (event, callback) {
|
||||
// Some function that registers listeners, and updates them on a tick
|
||||
},
|
||||
off: function (event, callback) {
|
||||
// Some function that unregisters listeners.
|
||||
},
|
||||
currentValue: function () {
|
||||
// A function that returns the last ticked value for the clock
|
||||
}
|
||||
}
|
||||
|
||||
openmct.time.addClock(someClock);
|
||||
```
|
||||
|
||||
An example clock implementation is provided in the form of the [LocalClock](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/LocalClock.js)
|
||||
|
||||
#### Getting and setting active clock
|
||||
|
||||
Once registered a clock can be activated by calling the `clock` function on the
|
||||
Time API passing in the key or instance of a registered clock. Only one clock
|
||||
may be active at once, so activating a clock will deactivate any currently
|
||||
active clock. [`clockOffsets`](#clock-offsets) must be specified when changing a clock.
|
||||
|
||||
Setting the clock triggers a [`'clock'`](#time-events) event, followed by a [`'clockOffsets'`](#time-events) event, and then a [`'bounds'`](#time-events) event as the offsets are applied to the clock's currentValue().
|
||||
|
||||
|
||||
```
|
||||
openmct.time.clock(someClock, clockOffsets);
|
||||
```
|
||||
|
||||
Upon being activated, the time API will listen for tick events on the clock by calling `clock.on`.
|
||||
|
||||
The currently active clock (if any) can be retrieved by calling the same
|
||||
function without any arguments.
|
||||
|
||||
#### Stopping an active clock
|
||||
|
||||
The `stopClock` method can be used to stop an active clock, and to clear it. It
|
||||
will stop the clock from ticking, and set the active clock to `undefined`.
|
||||
|
||||
``` javascript
|
||||
openmct.time.stopClock();
|
||||
```
|
||||
|
||||
#### Clock Offsets
|
||||
|
||||
When a clock is active, the time bounds of the application will be updated
|
||||
automatically each time the clock "ticks". The bounds are calculated based on
|
||||
the current value provided by the active clock (via its `tick` event, or its
|
||||
`currentValue()` method).
|
||||
|
||||
Unlike bounds, which represent absolute time values, clock offsets represent
|
||||
relative time spans. Offsets are defined as an object with two properties:
|
||||
|
||||
* `start`: A `number` that must be < 0 and which is used to calculate the start
|
||||
bounds on each clock tick. The start offset will be calculated relative to the
|
||||
value provided by a clock's tick callback, or its `currentValue()` function.
|
||||
* `end`: A `number` that must be >= 0 and which is used to calculate the end
|
||||
bounds on each clock tick.
|
||||
|
||||
The `clockOffsets` function can be used to get or set clock offsets. For example,
|
||||
to show the last fifteen minutes in a ms-based time system:
|
||||
|
||||
```javascript
|
||||
var FIFTEEN_MINUTES = 15 * 60 * 1000;
|
||||
|
||||
openmct.time.clockOffsets({
|
||||
start: -FIFTEEN_MINUTES,
|
||||
end: 0
|
||||
})
|
||||
```
|
||||
|
||||
__Note:__ Setting the clock offsets will trigger an immediate bounds change, as
|
||||
new bounds will be calculated based on the `currentValue()` of the active clock.
|
||||
Clock offsets are only relevant when a clock source is active.
|
||||
|
||||
## Time Events
|
||||
|
||||
The Time API is a standard event emitter; you can register callbacks for events using the `on` method and remove callbacks for events with the `off` method.
|
||||
|
||||
For example:
|
||||
|
||||
``` javascript
|
||||
openmct.time.on('bounds', function callback (newBounds, tick) {
|
||||
// Do something with new bounds
|
||||
});
|
||||
```
|
||||
|
||||
#### List of Time Events
|
||||
|
||||
The events emitted by the Time API are:
|
||||
|
||||
* `bounds`: emitted whenever the bounds change. The callback will be invoked
|
||||
with two arguments:
|
||||
* `bounds`: A [bounds](#getting-and-setting-bounds) bounds object
|
||||
representing a new time period bound by the specified start and send times.
|
||||
* `tick`: A `boolean` indicating whether or not this bounds change is due to
|
||||
a "tick" from a [clock source](#clocks). This information can be useful
|
||||
when determining a strategy for fetching telemetry data in response to a
|
||||
bounds change event. For example, if the bounds change was automatic, and
|
||||
is due to a tick then it's unlikely that you would need to perform a
|
||||
historical data query. It should be sufficient to just show any new
|
||||
telemetry received via subscription since the last tick, and optionally to
|
||||
discard any older data that now falls outside of the currently set bounds.
|
||||
If `tick` is false,then the bounds change was not due to an automatic tick,
|
||||
and a query for historical data may be necessary, depending on your data
|
||||
caching strategy, and how significantly the start bound has changed.
|
||||
* `timeSystem`: emitted whenever the active time system changes. The callback will be invoked with a single argument:
|
||||
* `timeSystem`: The newly active [time system](#defining-and-registering-time-systems).
|
||||
* `clock`: emitted whenever the clock changes. The callback will be invoked
|
||||
with a single argument:
|
||||
* `clock`: The newly active [clock](#clocks), or `undefined` if an active
|
||||
clock has been deactivated.
|
||||
* `clockOffsets`: emitted whenever the active clock offsets change. The
|
||||
callback will be invoked with a single argument:
|
||||
* `clockOffsets`: The new [clock offsets](#clock-offsets).
|
||||
|
||||
|
||||
## The Time Conductor
|
||||
|
||||
The Time Conductor provides a user interface for managing time bounds in Open
|
||||
MCT. It allows a user to select from configured time systems and clocks, and to set bounds and clock offsets.
|
||||
|
||||
If activated, the time conductor must be provided with configuration options,
|
||||
detailed below.
|
||||
|
||||
#### Time Conductor Configuration
|
||||
|
||||
The time conductor is configured by specifying the options that will be
|
||||
available to the user from the menus in the time conductor. These will determine
|
||||
the clocks available from the conductor, the time systems available for each
|
||||
clock, and some default bounds and clock offsets for each combination of clock
|
||||
and time system. By default, the conductor always supports a `fixed` mode where
|
||||
no clock is active. To specify configuration for fixed mode, simply leave out a
|
||||
`clock` attribute in the configuration entry object.
|
||||
|
||||
Configuration is provided as an `array` of menu options. Each entry of the
|
||||
array is an object with some properties specifying configuration. The configuration
|
||||
options specified are slightly different depending on whether or not it is for
|
||||
an active clock mode.
|
||||
|
||||
__Configuration for Fixed Time Mode (no active clock)__
|
||||
|
||||
* `timeSystem`: A `string`, the key for the time system that this configuration
|
||||
relates to.
|
||||
* `bounds`: A [`Time Bounds`](#time-bounds) object. These bounds will be applied
|
||||
when the user selects the time system specified in the previous `timeSystem`
|
||||
property.
|
||||
* `zoomOutLimit`: An __optional__ `number` specifying the longest period of time
|
||||
that can be represented by the conductor when zooming. If a `zoomOutLimit` is
|
||||
provided, then a `zoomInLimit` must also be provided. If provided, the zoom
|
||||
slider will automatically become available in the Time Conductor UI.
|
||||
* `zoomInLimit`: An __optional__ `number` specifying the shortest period of time
|
||||
that can be represented by the conductor when zooming. If a `zoomInLimit` is
|
||||
provided, then a `zoomOutLimit` must also be provided. If provided, the zoom
|
||||
slider will automatically become available in the Time Conductor UI.
|
||||
|
||||
__Configuration for Active Clock__
|
||||
|
||||
* `clock`: A `string`, the `key` of the clock that this configuration applies to.
|
||||
* `timeSystem`: A `string`, the key for the time system that this configuration
|
||||
relates to. Separate configuration must be provided for each time system that you
|
||||
wish to be available to users when they select the specified clock.
|
||||
* `clockOffsets`: A [`clockOffsets`](#clock-offsets) object that will be
|
||||
automatically applied when the combination of clock and time system specified in
|
||||
this configuration is selected from the UI.
|
||||
|
||||
#### Example conductor configuration
|
||||
|
||||
An example time conductor configuration is provided below. It sets up some
|
||||
default options for the [UTCTimeSystem](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/UTCTimeSystem.js)
|
||||
and [LocalTimeSystem](https://github.com/nasa/openmct/blob/master/src/plugins/localTimeSystem/LocalTimeSystem.js),
|
||||
in both fixed mode, and for the [LocalClock](https://github.com/nasa/openmct/blob/master/src/plugins/utcTimeSystem/LocalClock.js)
|
||||
source. In this configutation, the local clock supports both the UTCTimeSystem
|
||||
and LocalTimeSystem. Configuration for fixed bounds mode is specified by omitting
|
||||
a clock key.
|
||||
|
||||
``` javascript
|
||||
const ONE_YEAR = 365 * 24 * 60 * 60 * 1000;
|
||||
const ONE_MINUTE = 60 * 1000;
|
||||
|
||||
openmct.install(openmct.plugins.Conductor({
|
||||
menuOptions: [
|
||||
// 'Fixed' bounds mode configuation for the UTCTimeSystem
|
||||
{
|
||||
timeSystem: 'utc',
|
||||
bounds: {start: Date.now() - 30 * ONE_MINUTE, end: Date.now()},
|
||||
zoomOutLimit: ONE_YEAR,
|
||||
zoomInLimit: ONE_MINUTE
|
||||
},
|
||||
// Configuration for the LocalClock in the UTC time system
|
||||
{
|
||||
clock: 'local',
|
||||
timeSystem: 'utc',
|
||||
clockOffsets: {start: - 30 * ONE_MINUTE, end: 0},
|
||||
zoomOutLimit: ONE_YEAR,
|
||||
zoomInLimit: ONE_MINUTE
|
||||
},
|
||||
//Configuration for the LocaLClock in the Local time system
|
||||
{
|
||||
clock: 'local',
|
||||
timeSystem: 'local',
|
||||
clockOffsets: {start: - 15 * ONE_MINUTE, end: 0}
|
||||
}
|
||||
]
|
||||
}));
|
||||
```
|
||||
|
||||
## Included Plugins
|
||||
|
||||
Open MCT is packaged along with a few general-purpose plugins:
|
||||
|
||||
* `openmct.plugins.Conductor` provides a user interface for working with time
|
||||
within the application. If activated, configuration must be provided. This is
|
||||
detailed in the section on [Time Conductor Configuration](#time-conductor-configuration).
|
||||
* `openmct.plugins.CouchDB` is an adapter for using CouchDB for persistence
|
||||
of user-created objects. This is a constructor that takes the URL for the
|
||||
CouchDB database as a parameter, e.g.
|
||||
|
||||
14
README.md
14
README.md
@@ -137,20 +137,6 @@ naming convention is otherwise the same.)
|
||||
When `npm test` is run, test results will be written as HTML to
|
||||
`target/tests`. Code coverage information is written to `target/coverage`.
|
||||
|
||||
|
||||
### Functional Testing
|
||||
|
||||
The tests described above are all at the unit-level; an additional
|
||||
test suite using [Protractor](https://angular.github.io/protractor/)
|
||||
is under development, in the `protractor` folder.
|
||||
|
||||
To run:
|
||||
|
||||
* Install protractor following the instructions above.
|
||||
* `cd protractor`
|
||||
* `npm install`
|
||||
* `npm run all`
|
||||
|
||||
# Glossary
|
||||
|
||||
Certain terms are used throughout Open MCT with consistent meanings
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
"eventemitter3": "^1.2.0",
|
||||
"lodash": "3.10.1",
|
||||
"almond": "~0.3.2",
|
||||
"html2canvas": "^0.4.1"
|
||||
"html2canvas": "^0.4.1",
|
||||
"moment-timezone": "^0.5.13"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -933,9 +933,10 @@ Note that `templateUrl` is not supported for `containers`.
|
||||
|
||||
Controls provide options for the `mct-control` directive.
|
||||
|
||||
Ten standard control types are included in the forms bundle:
|
||||
These standard control types are included in the forms bundle:
|
||||
|
||||
* `textfield`: An area to enter plain text.
|
||||
* `textfield`: A text input to enter plain text.
|
||||
* `numberfield`: A text input to enter numbers.
|
||||
* `select`: A drop-down list of options.
|
||||
* `checkbox`: A box which may be checked/unchecked.
|
||||
* `color`: A color picker.
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./SinewaveConstants', 'moment'],
|
||||
function (SinewaveConstants, moment) {
|
||||
|
||||
var START_TIME = SinewaveConstants.START_TIME,
|
||||
FORMAT_REGEX = /^-?\d+:\d+:\d+$/,
|
||||
SECOND = 1000,
|
||||
MINUTE = SECOND * 60,
|
||||
HOUR = MINUTE * 60;
|
||||
|
||||
function SinewaveDeltaFormat() {
|
||||
}
|
||||
|
||||
function twoDigit(v) {
|
||||
return v >= 10 ? String(v) : ('0' + v);
|
||||
}
|
||||
|
||||
SinewaveDeltaFormat.prototype.format = function (value) {
|
||||
var delta = Math.abs(value - START_TIME),
|
||||
negative = value < START_TIME,
|
||||
seconds = Math.floor(delta / SECOND) % 60,
|
||||
minutes = Math.floor(delta / MINUTE) % 60,
|
||||
hours = Math.floor(delta / HOUR);
|
||||
return (negative ? "-" : "") +
|
||||
[ hours, minutes, seconds ].map(twoDigit).join(":");
|
||||
};
|
||||
|
||||
SinewaveDeltaFormat.prototype.validate = function (text) {
|
||||
return FORMAT_REGEX.test(text);
|
||||
};
|
||||
|
||||
SinewaveDeltaFormat.prototype.parse = function (text) {
|
||||
var negative = text[0] === "-",
|
||||
parts = text.replace("-", "").split(":");
|
||||
return [ HOUR, MINUTE, SECOND ].map(function (sz, i) {
|
||||
return parseInt(parts[i], 10) * sz;
|
||||
}).reduce(function (a, b) {
|
||||
return a + b;
|
||||
}, 0) * (negative ? -1 : 1) + START_TIME;
|
||||
};
|
||||
|
||||
return SinewaveDeltaFormat;
|
||||
}
|
||||
);
|
||||
@@ -1,70 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining SinewaveTelemetryProvider. Created by vwoeltje on 11/12/14.
|
||||
*/
|
||||
define([
|
||||
"./SinewaveTelemetrySeries",
|
||||
"./GeneratorProvider"
|
||||
], function (
|
||||
SinewaveTelemetrySeries,
|
||||
GeneratorProvider
|
||||
) {
|
||||
|
||||
function SinewaveTelemetryProvider() {
|
||||
this.provider = new GeneratorProvider();
|
||||
}
|
||||
|
||||
SinewaveTelemetryProvider.prototype.requestTelemetry = function (requests) {
|
||||
if (requests[0].source !== 'generator') {
|
||||
return Promise.resolve({});
|
||||
}
|
||||
return this.provider.request({}, requests[0])
|
||||
.then(function (data) {
|
||||
var res = {
|
||||
generator: {}
|
||||
};
|
||||
res.generator[requests[0].key] = new SinewaveTelemetrySeries(data);
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
||||
SinewaveTelemetryProvider.prototype.subscribe = function (callback, requests) {
|
||||
if (requests[0].source !== 'generator') {
|
||||
return function unsubscribe() {};
|
||||
}
|
||||
|
||||
function wrapper(data) {
|
||||
var res = {
|
||||
generator: {}
|
||||
};
|
||||
res.generator[requests[0].key] = new SinewaveTelemetrySeries(data);
|
||||
callback(res);
|
||||
}
|
||||
|
||||
return this.provider.subscribe({}, wrapper, requests[0]);
|
||||
};
|
||||
|
||||
return SinewaveTelemetryProvider;
|
||||
});
|
||||
@@ -1,75 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining SinewaveTelemetry. Created by vwoeltje on 11/12/14.
|
||||
*/
|
||||
define([
|
||||
|
||||
], function (
|
||||
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
function SinewaveTelemetrySeries(data) {
|
||||
if (!Array.isArray(data)) {
|
||||
data = [data];
|
||||
}
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
SinewaveTelemetrySeries.prototype.getPointCount = function () {
|
||||
return this.data.length;
|
||||
};
|
||||
|
||||
|
||||
SinewaveTelemetrySeries.prototype.getDomainValue = function (
|
||||
index,
|
||||
domain
|
||||
) {
|
||||
domain = domain || 'time';
|
||||
|
||||
return this.getDatum(index)[domain];
|
||||
};
|
||||
|
||||
SinewaveTelemetrySeries.prototype.getRangeValue = function (
|
||||
index,
|
||||
range
|
||||
) {
|
||||
range = range || 'sin';
|
||||
return this.getDatum(index)[range];
|
||||
};
|
||||
|
||||
SinewaveTelemetrySeries.prototype.getDatum = function (index) {
|
||||
if (index > this.data.length || index < 0) {
|
||||
throw new Error('IndexOutOfRange: index not available in series.');
|
||||
}
|
||||
return this.data[index];
|
||||
};
|
||||
|
||||
SinewaveTelemetrySeries.prototype.getData = function () {
|
||||
return this.data;
|
||||
};
|
||||
|
||||
return SinewaveTelemetrySeries;
|
||||
});
|
||||
@@ -64,7 +64,6 @@
|
||||
data: {
|
||||
utc: nextStep,
|
||||
yesterday: nextStep - 60*60*24*1000,
|
||||
delta: 60*60*24*1000,
|
||||
sin: sin(nextStep, data.period, data.amplitude, data.offset),
|
||||
cos: cos(nextStep, data.period, data.amplitude, data.offset)
|
||||
}
|
||||
@@ -104,11 +103,10 @@
|
||||
|
||||
var data = [];
|
||||
|
||||
for (; nextStep < end; nextStep += step) {
|
||||
for (; nextStep < end && data.length < 5000; nextStep += step) {
|
||||
data.push({
|
||||
utc: nextStep,
|
||||
yesterday: nextStep - 60*60*24*1000,
|
||||
delta: 60*60*24*1000,
|
||||
sin: sin(nextStep, period, amplitude, offset),
|
||||
cos: cos(nextStep, period, amplitude, offset)
|
||||
});
|
||||
|
||||
@@ -23,12 +23,10 @@
|
||||
|
||||
define([
|
||||
"./GeneratorProvider",
|
||||
"./SinewaveLimitCapability",
|
||||
"./SinewaveDeltaFormat"
|
||||
"./SinewaveLimitCapability"
|
||||
], function (
|
||||
GeneratorProvider,
|
||||
SinewaveLimitCapability,
|
||||
SinewaveDeltaFormat
|
||||
SinewaveLimitCapability
|
||||
) {
|
||||
|
||||
var legacyExtensions = {
|
||||
@@ -37,34 +35,8 @@ define([
|
||||
"key": "limit",
|
||||
"implementation": SinewaveLimitCapability
|
||||
}
|
||||
],
|
||||
"formats": [
|
||||
{
|
||||
"key": "example.delta",
|
||||
"implementation": SinewaveDeltaFormat
|
||||
}
|
||||
],
|
||||
"constants": [
|
||||
{
|
||||
"key": "TIME_CONDUCTOR_DOMAINS",
|
||||
"value": [
|
||||
{
|
||||
"key": "time",
|
||||
"name": "Time"
|
||||
},
|
||||
{
|
||||
"key": "yesterday",
|
||||
"name": "Yesterday"
|
||||
},
|
||||
{
|
||||
"key": "delta",
|
||||
"name": "Delta"
|
||||
}
|
||||
],
|
||||
"priority": -1
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
return function(openmct){
|
||||
//Register legacy extensions for things not yet supported by the new API
|
||||
@@ -75,7 +47,7 @@ define([
|
||||
})
|
||||
});
|
||||
openmct.types.addType("generator", {
|
||||
label: "Sine Wave Generator",
|
||||
name: "Sine Wave Generator",
|
||||
description: "For development use. Generates example streaming telemetry data using a simple sine wave algorithm.",
|
||||
cssClass: "icon-telemetry",
|
||||
creatable: true,
|
||||
@@ -135,31 +107,36 @@ define([
|
||||
amplitude: 1,
|
||||
offset: 0,
|
||||
dataRateInHz: 1,
|
||||
domains: [
|
||||
values: [
|
||||
{
|
||||
key: "utc",
|
||||
name: "Time",
|
||||
format: "utc"
|
||||
format: "utc",
|
||||
hints: {
|
||||
domain: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "yesterday",
|
||||
name: "Yesterday",
|
||||
format: "utc"
|
||||
format: "utc",
|
||||
hints: {
|
||||
domain: 2
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "delta",
|
||||
name: "Delta",
|
||||
format: "example.delta"
|
||||
}
|
||||
],
|
||||
ranges: [
|
||||
{
|
||||
key: "sin",
|
||||
name: "Sine"
|
||||
name: "Sine",
|
||||
hints: {
|
||||
range: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "cos",
|
||||
name: "Cosine"
|
||||
name: "Cosine",
|
||||
hints: {
|
||||
range: 2
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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.
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
define([
|
||||
"./src/ImageTelemetryProvider",
|
||||
'legacyRegistry'
|
||||
], function (
|
||||
ImageTelemetryProvider,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("example/imagery", {
|
||||
"name": "Imagery",
|
||||
"description": "Example of a component that produces image telemetry.",
|
||||
"extensions": {
|
||||
"components": [
|
||||
{
|
||||
"implementation": ImageTelemetryProvider,
|
||||
"type": "provider",
|
||||
"provides": "telemetryService",
|
||||
"depends": [
|
||||
"$q",
|
||||
"$timeout"
|
||||
]
|
||||
}
|
||||
],
|
||||
"types": [
|
||||
{
|
||||
"key": "imagery",
|
||||
"name": "Example Imagery",
|
||||
"cssClass": "icon-image",
|
||||
"features": "creation",
|
||||
"description": "For development use. Creates example imagery data that mimics a live imagery stream.",
|
||||
"priority": 10,
|
||||
"model": {
|
||||
"telemetry": {}
|
||||
},
|
||||
"telemetry": {
|
||||
"source": "imagery",
|
||||
"domains": [
|
||||
{
|
||||
"name": "Time",
|
||||
"key": "time",
|
||||
"format": "utc"
|
||||
}
|
||||
],
|
||||
"ranges": [
|
||||
{
|
||||
"name": "Image",
|
||||
"key": "url",
|
||||
"format": "imageUrl"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
140
example/imagery/plugin.js
Normal file
140
example/imagery/plugin.js
Normal file
@@ -0,0 +1,140 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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.
|
||||
*****************************************************************************/
|
||||
|
||||
define([
|
||||
|
||||
], function(
|
||||
|
||||
) {
|
||||
function ImageryPlugin() {
|
||||
|
||||
var IMAGE_SAMPLES = [
|
||||
"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"
|
||||
];
|
||||
|
||||
function pointForTimestamp(timestamp) {
|
||||
return {
|
||||
utc: Math.floor(timestamp / 5000) * 5000,
|
||||
url: IMAGE_SAMPLES[Math.floor(timestamp / 5000) % IMAGE_SAMPLES.length]
|
||||
};
|
||||
}
|
||||
|
||||
var realtimeProvider = {
|
||||
supportsSubscribe: function (domainObject) {
|
||||
return domainObject.type === 'example.imagery';
|
||||
},
|
||||
subscribe: function (domainObject, callback) {
|
||||
var interval = setInterval(function () {
|
||||
callback(pointForTimestamp(Date.now()));
|
||||
}, 5000);
|
||||
|
||||
return function (interval) {
|
||||
clearInterval(interval);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
var historicalProvider = {
|
||||
supportsRequest: function (domainObject, options) {
|
||||
return domainObject.type === 'example.imagery'
|
||||
&& options.strategy !== 'latest';
|
||||
},
|
||||
request: function (domainObject, options) {
|
||||
var start = options.start;
|
||||
var end = options.end;
|
||||
var data = [];
|
||||
while (start < end && data.length < 5000) {
|
||||
data.push(pointForTimestamp(start));
|
||||
start += 5000;
|
||||
}
|
||||
return Promise.resolve(data);
|
||||
}
|
||||
};
|
||||
|
||||
var ladProvider = {
|
||||
supportsRequest: function (domainObject, options) {
|
||||
return domainObject.type === 'example.imagery' &&
|
||||
options.strategy === 'latest';
|
||||
},
|
||||
request: function (domainObject, options) {
|
||||
return Promise.resolve([pointForTimestamp(Date.now())]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return function install(openmct) {
|
||||
openmct.types.addType('example.imagery', {
|
||||
key: 'example.imagery',
|
||||
name: 'Example Imagery',
|
||||
cssClass: 'icon-image',
|
||||
description: 'For development use. Creates example imagery ' +
|
||||
'data that mimics a live imagery stream.',
|
||||
creatable: true,
|
||||
initialize: function (object) {
|
||||
object.telemetry = {
|
||||
values: [
|
||||
{
|
||||
name: 'Time',
|
||||
key: 'utc',
|
||||
format: 'utc',
|
||||
hints: {
|
||||
domain: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Image',
|
||||
key: 'url',
|
||||
format: 'image',
|
||||
hints: {
|
||||
image: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
openmct.telemetry.addProvider(realtimeProvider);
|
||||
openmct.telemetry.addProvider(historicalProvider);
|
||||
openmct.telemetry.addProvider(ladProvider);
|
||||
};
|
||||
}
|
||||
|
||||
return ImageryPlugin;
|
||||
});
|
||||
@@ -1,81 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining ImageTelemetry. Created by vwoeltje on 06/22/15.
|
||||
*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
var firstObservedTime = Date.now(),
|
||||
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"
|
||||
|
||||
].map(function (url, index) {
|
||||
return {
|
||||
timestamp: firstObservedTime + 1000 * index,
|
||||
url: url
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function ImageTelemetry() {
|
||||
return {
|
||||
getPointCount: function () {
|
||||
return Math.floor((Date.now() - firstObservedTime) / 1000);
|
||||
},
|
||||
getDomainValue: function (i, domain) {
|
||||
return images[i % images.length].timestamp;
|
||||
},
|
||||
getRangeValue: function (i, range) {
|
||||
return images[i % images.length].url;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return ImageTelemetry;
|
||||
}
|
||||
);
|
||||
@@ -1,115 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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.
|
||||
*****************************************************************************/
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining ImageTelemetryProvider. Created by vwoeltje on 06/22/15.
|
||||
*/
|
||||
define(
|
||||
["./ImageTelemetry"],
|
||||
function (ImageTelemetry) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function ImageTelemetryProvider($q, $timeout) {
|
||||
var subscriptions = [];
|
||||
|
||||
//
|
||||
function matchesSource(request) {
|
||||
return request.source === "imagery";
|
||||
}
|
||||
|
||||
// Used internally; this will be repacked by doPackage
|
||||
function generateData(request) {
|
||||
return {
|
||||
key: request.key,
|
||||
telemetry: new ImageTelemetry()
|
||||
};
|
||||
}
|
||||
|
||||
//
|
||||
function doPackage(results) {
|
||||
var packaged = {};
|
||||
results.forEach(function (result) {
|
||||
packaged[result.key] = result.telemetry;
|
||||
});
|
||||
// Format as expected (sources -> keys -> telemetry)
|
||||
return { imagery: packaged };
|
||||
}
|
||||
|
||||
function requestTelemetry(requests) {
|
||||
return $timeout(function () {
|
||||
return doPackage(requests.filter(matchesSource).map(generateData));
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function handleSubscriptions() {
|
||||
subscriptions.forEach(function (subscription) {
|
||||
var requests = subscription.requests;
|
||||
subscription.callback(doPackage(
|
||||
requests.filter(matchesSource).map(generateData)
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
function startGenerating() {
|
||||
$timeout(function () {
|
||||
handleSubscriptions();
|
||||
if (subscriptions.length > 0) {
|
||||
startGenerating();
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function subscribe(callback, requests) {
|
||||
var subscription = {
|
||||
callback: callback,
|
||||
requests: requests
|
||||
};
|
||||
|
||||
function unsubscribe() {
|
||||
subscriptions = subscriptions.filter(function (s) {
|
||||
return s !== subscription;
|
||||
});
|
||||
}
|
||||
|
||||
subscriptions.push(subscription);
|
||||
|
||||
if (subscriptions.length === 1) {
|
||||
startGenerating();
|
||||
}
|
||||
|
||||
return unsubscribe;
|
||||
}
|
||||
|
||||
return {
|
||||
requestTelemetry: requestTelemetry,
|
||||
subscribe: subscribe
|
||||
};
|
||||
}
|
||||
|
||||
return ImageTelemetryProvider;
|
||||
}
|
||||
);
|
||||
@@ -1,79 +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.
|
||||
*****************************************************************************/
|
||||
|
||||
define([
|
||||
'../../../platform/features/conductor/core/src/timeSystems/TimeSystem',
|
||||
'../../../platform/features/conductor/core/src/timeSystems/LocalClock',
|
||||
'./LADTickSource'
|
||||
], function (TimeSystem, LocalClock, LADTickSource) {
|
||||
var THIRTY_MINUTES = 30 * 60 * 1000,
|
||||
DEFAULT_PERIOD = 1000;
|
||||
|
||||
/**
|
||||
* This time system supports UTC dates and provides a ticking clock source.
|
||||
* @implements TimeSystem
|
||||
* @constructor
|
||||
*/
|
||||
function LocalTimeSystem ($timeout) {
|
||||
TimeSystem.call(this);
|
||||
|
||||
/**
|
||||
* Some metadata, which will be used to identify the time system in
|
||||
* the UI
|
||||
* @type {{key: string, name: string, glyph: string}}
|
||||
*/
|
||||
this.metadata = {
|
||||
'key': 'local',
|
||||
'name': 'Local',
|
||||
'glyph': '\u0043'
|
||||
};
|
||||
|
||||
this.fmts = ['local-format'];
|
||||
this.sources = [new LocalClock($timeout, DEFAULT_PERIOD), new LADTickSource($timeout, DEFAULT_PERIOD)];
|
||||
}
|
||||
|
||||
LocalTimeSystem.prototype = Object.create(TimeSystem.prototype);
|
||||
|
||||
LocalTimeSystem.prototype.formats = function () {
|
||||
return this.fmts;
|
||||
};
|
||||
|
||||
LocalTimeSystem.prototype.deltaFormat = function () {
|
||||
return 'duration';
|
||||
};
|
||||
|
||||
LocalTimeSystem.prototype.tickSources = function () {
|
||||
return this.sources;
|
||||
};
|
||||
|
||||
LocalTimeSystem.prototype.defaults = function (key) {
|
||||
var now = Math.ceil(Date.now() / 1000) * 1000;
|
||||
return {
|
||||
key: 'local-default',
|
||||
name: 'Local 12 hour time system defaults',
|
||||
deltas: {start: THIRTY_MINUTES, end: 0},
|
||||
bounds: {start: now - THIRTY_MINUTES, end: now}
|
||||
};
|
||||
};
|
||||
|
||||
return LocalTimeSystem;
|
||||
});
|
||||
@@ -44,31 +44,31 @@ define(
|
||||
{
|
||||
"name": "Min. Air Temperature",
|
||||
"identifier": "min_temp",
|
||||
"units": "degrees",
|
||||
"units": "Degrees (C)",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "Max. Air Temperature",
|
||||
"identifier": "max_temp",
|
||||
"units": "degrees",
|
||||
"units": "Degrees (C)",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "Atmospheric Pressure",
|
||||
"identifier": "pressure",
|
||||
"units": "pascals",
|
||||
"units": "Millibars",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "Min. Ground Temperature",
|
||||
"identifier": "min_gts_temp",
|
||||
"units": "degrees",
|
||||
"units": "Degrees (C)",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "Max. Ground Temperature",
|
||||
"identifier": "max_gts_temp",
|
||||
"units": "degrees",
|
||||
"units": "Degrees (C)",
|
||||
"type": "float"
|
||||
}
|
||||
]
|
||||
@@ -76,4 +76,4 @@ define(
|
||||
]
|
||||
};
|
||||
}
|
||||
);
|
||||
);
|
||||
@@ -48,6 +48,13 @@ define(
|
||||
this.$http = $http;
|
||||
this.$log = $log;
|
||||
this.promise = undefined;
|
||||
|
||||
this.dataTransforms = {
|
||||
//Convert from pascals to millibars
|
||||
'pressure': function pascalsToMillibars(pascals) {
|
||||
return pascals / 100;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,6 +72,8 @@ define(
|
||||
var self = this,
|
||||
id = request.key;
|
||||
|
||||
var dataTransforms = this.dataTransforms;
|
||||
|
||||
function processResponse(response){
|
||||
var data = [];
|
||||
/*
|
||||
@@ -75,13 +84,14 @@ 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: solData[id]
|
||||
value: dataTransform ? dataTransform(solData[id]) : solData[id]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -16,6 +16,7 @@ define([
|
||||
{ "key": "styleguide.intro", "name": "Introduction", "cssClass": "icon-page", "description": "Introduction and overview to the style guide" },
|
||||
{ "key": "styleguide.standards", "name": "Standards", "cssClass": "icon-page", "description": "" },
|
||||
{ "key": "styleguide.colors", "name": "Colors", "cssClass": "icon-page", "description": "" },
|
||||
{ "key": "styleguide.status", "name": "status", "cssClass": "icon-page", "description": "Limits, telemetry paused, etc." },
|
||||
{ "key": "styleguide.glyphs", "name": "Glyphs", "cssClass": "icon-page", "description": "Glyphs overview" },
|
||||
{ "key": "styleguide.controls", "name": "Controls", "cssClass": "icon-page", "description": "Buttons, selects, HTML controls" },
|
||||
{ "key": "styleguide.input", "name": "Text Inputs", "cssClass": "icon-page", "description": "Various text inputs" },
|
||||
@@ -25,6 +26,7 @@ define([
|
||||
{ "key": "styleguide.intro", "type": "styleguide.intro", "templateUrl": "templates/intro.html", "editable": false },
|
||||
{ "key": "styleguide.standards", "type": "styleguide.standards", "templateUrl": "templates/standards.html", "editable": false },
|
||||
{ "key": "styleguide.colors", "type": "styleguide.colors", "templateUrl": "templates/colors.html", "editable": false },
|
||||
{ "key": "styleguide.status", "type": "styleguide.status", "templateUrl": "templates/status.html", "editable": false },
|
||||
{ "key": "styleguide.glyphs", "type": "styleguide.glyphs", "templateUrl": "templates/glyphs.html", "editable": false },
|
||||
{ "key": "styleguide.controls", "type": "styleguide.controls", "templateUrl": "templates/controls.html", "editable": false },
|
||||
{ "key": "styleguide.input", "type": "styleguide.input", "templateUrl": "templates/input.html", "editable": false },
|
||||
@@ -47,6 +49,7 @@ define([
|
||||
"intro",
|
||||
"standards",
|
||||
"colors",
|
||||
"status",
|
||||
"glyphs",
|
||||
"styleguide:ui-elements"
|
||||
]
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
color: $colorKey;
|
||||
}
|
||||
|
||||
h1, h2 {
|
||||
color: pullForward($colorBodyFg, 20%);
|
||||
h1, h2, strong, b {
|
||||
color: pullForward($colorBodyFg, 50%);
|
||||
}
|
||||
|
||||
h2 {
|
||||
@@ -45,6 +45,10 @@
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
strong, b {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.w-markup {
|
||||
//Wrap markup example "pre" element
|
||||
background-color: $colorCode;
|
||||
@@ -54,6 +58,12 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.w-mct-example {
|
||||
div {
|
||||
margin-bottom: $interiorMarginLg;
|
||||
}
|
||||
}
|
||||
|
||||
code,
|
||||
pre {
|
||||
font-size: 0.8rem;
|
||||
@@ -143,6 +153,17 @@
|
||||
|
||||
// Example grid of glyphs
|
||||
.items-holder.grid {
|
||||
table.details {
|
||||
width: 100%;
|
||||
td {
|
||||
font-size: inherit;
|
||||
&.label {
|
||||
color: pushBack($colorBodyFg, 10%);
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
.item.glyph-item,
|
||||
.item.swatch-item {
|
||||
margin-bottom: 50px;
|
||||
@@ -155,15 +176,6 @@
|
||||
margin: $interiorMarginLg 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.details td {
|
||||
font-size: inherit;
|
||||
&.label {
|
||||
color: pushBack($colorBodyFg, 10%);
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item.glyph-item {
|
||||
|
||||
@@ -48,7 +48,9 @@
|
||||
{ 'meaning': 'General usage plus symbol; used in timer object', 'cssClass': 'icon-plus', 'cssContent': 'e926', 'htmlEntity': '&#xe926' },
|
||||
{ 'meaning': 'Delete', 'cssClass': 'icon-trash', 'cssContent': 'e927', 'htmlEntity': '&#xe927' },
|
||||
{ 'meaning': 'Close, remove', 'cssClass': 'icon-x', 'cssContent': 'e928', 'htmlEntity': '&#xe928' },
|
||||
{ 'meaning': 'Enclosing, inclusive; used in Time Conductor', 'cssClass': 'icon-brackets', 'cssContent': 'e929', 'htmlEntity': '&#xe929' }
|
||||
{ 'meaning': 'Enclosing, inclusive; used in Time Conductor', 'cssClass': 'icon-brackets', 'cssContent': 'e929', 'htmlEntity': '&#xe929' },
|
||||
{ 'meaning': 'Something is targeted', 'cssClass': 'icon-crosshair', 'cssContent': 'e930', 'htmlEntity': '&#xe930' },
|
||||
{ 'meaning': 'Draggable', 'cssClass': 'icon-grippy', 'cssContent': 'e931', 'htmlEntity': '&#xe931' }
|
||||
]; controls= [{ 'meaning': 'Reset zoom/pam', 'cssClass': 'icon-arrows-out', 'cssContent': 'e1000', 'htmlEntity': '&#xe1000' },
|
||||
{ 'meaning': 'Expand vertically', 'cssClass': 'icon-arrows-right-left', 'cssContent': 'e1001', 'htmlEntity': '&#xe1001' },
|
||||
{ 'meaning': 'View scrolling', 'cssClass': 'icon-arrows-up-down', 'cssContent': 'e1002', 'htmlEntity': '&#xe1002' },
|
||||
@@ -84,10 +86,17 @@
|
||||
{ 'meaning': 'Image thumbs strip; view items grid', 'cssClass': 'icon-thumbs-strip', 'cssContent': 'e1033', 'htmlEntity': '&#xe1033' },
|
||||
{ 'meaning': 'Two part item, both parts', 'cssClass': 'icon-two-parts-both', 'cssContent': 'e1034', 'htmlEntity': '&#xe1034' },
|
||||
{ 'meaning': 'Two part item, one only', 'cssClass': 'icon-two-parts-one-only', 'cssContent': 'e1035', 'htmlEntity': '&#xe1035' },
|
||||
{ 'meaning': 'Resync', 'cssClass': 'icon-resync', 'cssContent': 'e1036', 'htmlEntity': '&#xe1036' },
|
||||
{ 'meaning': 'Reset', 'cssClass': 'icon-reset', 'cssContent': 'e1037', 'htmlEntity': '&#xe1037' },
|
||||
{ 'meaning': 'Clear', 'cssClass': 'icon-x-in-circle', 'cssContent': 'e1038', 'htmlEntity': '&#xe1038' },
|
||||
{ 'meaning': 'Brightness', 'cssClass': 'icon-brightness', 'cssContent': 'e1039', 'htmlEntity': '&#xe1039' },
|
||||
{ 'meaning': 'Contrast', 'cssClass': 'icon-contrast', 'cssContent': 'e1040', 'htmlEntity': '&#xe1040' },
|
||||
{ 'meaning': 'Expand', 'cssClass': 'icon-expand', 'cssContent': 'e1041', 'htmlEntity': '&#xe1041' }
|
||||
{ 'meaning': 'Expand', 'cssClass': 'icon-expand', 'cssContent': 'e1041', 'htmlEntity': '&#xe1041' },
|
||||
{ 'meaning': 'View items in a tabular list', 'cssClass': 'icon-list-view', 'cssContent': 'e1042', 'htmlEntity': '&#xe1042' },
|
||||
{ 'meaning': 'Snap an object corner to a grid', 'cssClass': 'icon-grid-snap-to', 'cssContent': 'e1043', 'htmlEntity': '&#xe1043' },
|
||||
{ 'meaning': 'Do not snap an object corner to a grid', 'cssClass': 'icon-grid-snap-no', 'cssContent': 'e1044', 'htmlEntity': '&#xe1044' },
|
||||
{ 'meaning': 'Show an object frame in a Display Layout', 'cssClass': 'icon-frame-show', 'cssContent': 'e1045', 'htmlEntity': '&#xe1045' },
|
||||
{ 'meaning': 'Do not show an object frame in a Display Layout', 'cssClass': 'icon-frame-hide', 'cssContent': 'e1046', 'htmlEntity': '&#xe1046' }
|
||||
]; objects= [{ 'meaning': 'Activity', 'cssClass': 'icon-activity', 'cssContent': 'e1100', 'htmlEntity': '&#xe1100' },
|
||||
{ 'meaning': 'Activity Mode', 'cssClass': 'icon-activity-mode', 'cssContent': 'e1101', 'htmlEntity': '&#xe1101' },
|
||||
{ 'meaning': 'Auto-flow Tabular view', 'cssClass': 'icon-autoflow-tabular', 'cssContent': 'e1102', 'htmlEntity': '&#xe1102' },
|
||||
@@ -117,7 +126,8 @@
|
||||
{ 'meaning': 'Timeline object', 'cssClass': 'icon-timeline', 'cssContent': 'e1126', 'htmlEntity': '&#xe1126' },
|
||||
{ 'meaning': 'Timer object', 'cssClass': 'icon-timer', 'cssContent': 'e1127', 'htmlEntity': '&#xe1127' },
|
||||
{ 'meaning': 'Data Topic', 'cssClass': 'icon-topic', 'cssContent': 'e1128', 'htmlEntity': '&#xe1128' },
|
||||
{ 'meaning': 'Fixed Position object', 'cssClass': 'icon-box-with-dashed-lines', 'cssContent': 'e1129', 'htmlEntity': '&#xe1129' }
|
||||
{ 'meaning': 'Fixed Position object', 'cssClass': 'icon-box-with-dashed-lines', 'cssContent': 'e1129', 'htmlEntity': '&#xe1129' },
|
||||
{ 'meaning': 'Summary Widget', 'cssClass': 'icon-summary-widget', 'cssContent': 'e1130', 'htmlEntity': '&#xe1130' }
|
||||
];
|
||||
"></div>
|
||||
|
||||
@@ -141,8 +151,8 @@
|
||||
<h2>How to Use Glyphs</h2>
|
||||
<div class="cols cols1-1">
|
||||
<div class="col">
|
||||
<p>The easiest way to use a glyph is to include its CSS class in element. The CSS adds a psuedo <code>:before</code> HTML element to whatever element it's attached to that makes proper use of the symbols font.</p>
|
||||
<p>Alternately, you can use the <code>.ui-symbol</code> class in an object that contains encoded HTML entities. This method is only recommended if you cannot use the aforementioned CSS class approach for some reason.</p>
|
||||
<p>The easiest way to use a glyph is to include its CSS class in an element. The CSS adds a psuedo <code>:before</code> HTML element to whatever element it's attached to that makes proper use of the symbols font.</p>
|
||||
<p>Alternately, you can use the <code>.ui-symbol</code> class in an object that contains encoded HTML entities. This method is only recommended if you cannot use the aforementioned CSS class approach.</p>
|
||||
</div>
|
||||
<mct-example><a class="s-button icon-gear" title="Settings"></a>
|
||||
<br /><br />
|
||||
@@ -160,8 +170,8 @@
|
||||
<div class="item glyph-item" ng-repeat="glyph in general">
|
||||
<div class="glyph" ng-class="glyph.cssClass"></div>
|
||||
<table class="details">
|
||||
<tr><td class="label">Meaning</td><td class="value">{{glyph.meaning}}</td></tr>
|
||||
<tr><td class="label">Class</td><td class="value">.{{glyph.cssClass}}</td></tr>
|
||||
<tr><td class="label">Meaning</td><td class="value">{{glyph.meaning}}</td></tr>
|
||||
<tr><td class="label">CSS Content</td><td class="value">\{{glyph.cssContent}}</td></tr>
|
||||
<tr><td class="label">HTML Entity</td><td class="value">{{glyph.htmlEntity}}</td></tr>
|
||||
</table>
|
||||
@@ -176,8 +186,8 @@
|
||||
<div class="item glyph-item" ng-repeat="glyph in controls">
|
||||
<div class="glyph" ng-class="glyph.cssClass"></div>
|
||||
<table class="details">
|
||||
<tr><td class="label">Meaning</td><td class="value">{{glyph.meaning}}</td></tr>
|
||||
<tr><td class="label">Class</td><td class="value">.{{glyph.cssClass}}</td></tr>
|
||||
<tr><td class="label">Meaning</td><td class="value">{{glyph.meaning}}</td></tr>
|
||||
<tr><td class="label">CSS Content</td><td class="value">\{{glyph.cssContent}}</td></tr>
|
||||
<tr><td class="label">HTML Entity</td><td class="value">{{glyph.htmlEntity}}</td></tr>
|
||||
</table>
|
||||
@@ -192,8 +202,8 @@
|
||||
<div class="item glyph-item" ng-repeat="glyph in objects">
|
||||
<div class="glyph" ng-class="glyph.cssClass"></div>
|
||||
<table class="details">
|
||||
<tr><td class="label">Meaning</td><td class="value">{{glyph.meaning}}</td></tr>
|
||||
<tr><td class="label">Class</td><td class="value">.{{glyph.cssClass}}</td></tr>
|
||||
<tr><td class="label">Meaning</td><td class="value">{{glyph.meaning}}</td></tr>
|
||||
<tr><td class="label">CSS Content</td><td class="value">\{{glyph.cssContent}}</td></tr>
|
||||
<tr><td class="label">HTML Entity</td><td class="value">{{glyph.htmlEntity}}</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
<pre></pre>
|
||||
</span>
|
||||
<h3>Example</h3>
|
||||
<div></div>
|
||||
<div class="w-mct-example"></div>
|
||||
</div>
|
||||
|
||||
142
example/styleguide/res/templates/status.html
Normal file
142
example/styleguide/res/templates/status.html
Normal file
@@ -0,0 +1,142 @@
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<style>
|
||||
.w-mct-example div[class*="s-limit"],
|
||||
.w-mct-example div[class*="s-status"],
|
||||
.w-mct-example div[class*="s-unsynced"],
|
||||
.w-mct-example span[class*="s-limit"] {
|
||||
border-radius: 4px;
|
||||
padding: 3px 7px;
|
||||
}
|
||||
.w-mct-example table {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<div class="l-style-guide s-text">
|
||||
<p class="doc-title">Open MCT Style Guide</p>
|
||||
<h1>Status Indication</h1>
|
||||
|
||||
<div class="l-section">
|
||||
<h2>Overview</h2>
|
||||
<p>Many elements in Open MCT need to articulate a dynamic status; Open MCT provides the following styles and conventions to handle this:</p>
|
||||
<ul>
|
||||
<li><strong>Limits</strong>: when telemetry values exceed minimum or maximum values, they can be violating limits. Limit styles include both color and iconography; color is used to indicate severity while icons are used to indicate direction, upper or lower.</li>
|
||||
<li><strong>Status</strong>: Open MCT also provides a number or built-in Status styles allowing telemetry or other displayed information to be visually classified by type. Common uses for these classes are to visually denote event records.</li>
|
||||
<li><strong>Synchronization</strong>: When the system is displaying real-time data, it is very important that displays clearly indicate when they are not doing so, such as when a plot if frozen while panning or zooming. Open MCT provides a style for this.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="l-section">
|
||||
<h2>Limits</h2>
|
||||
<div class="cols cols1-1">
|
||||
<div class="col">
|
||||
<p>Limit CSS classes can be applied to any block or inline element. Open MCT limit classes set color and optionally an icon, but don't effect other properties. Yellow and red limit classes can be used as is, or allow the application of any custom icon available in Open MCT's glyphs library. "Level" limit classes - upper and lower - always use an icon in addition to a color; Open MCT doesn't support level limits without color.</p>
|
||||
<ul>
|
||||
<li>Color only</li>
|
||||
<ul>
|
||||
<li><code>s-limit-yellow</code>: A yellow limit.</li>
|
||||
<li><code>s-limit-red</code>: A red limit.</li>
|
||||
</ul>
|
||||
<li>Color and icon</li>
|
||||
<ul>
|
||||
<li><code>s-limit-yellow-icon</code>: A yellow limit with icon.</li>
|
||||
<li><code>s-limit-red-icon</code>: A red limit with icon.</li>
|
||||
</ul>
|
||||
<li>Upper and lower limit indicators. Must be used with a color limit class to be visible.</li>
|
||||
<ul>
|
||||
<li><code>s-limit-upr</code>: Upper limit.
|
||||
</li>
|
||||
<li><code>s-limit-lwr</code>: Lower limit.
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<mct-example><div class="s-limit-yellow">Yellow limit</div>
|
||||
<div class="s-limit-red">Red limit</div>
|
||||
<div class="s-limit-yellow-icon">Yellow limit with icon</div>
|
||||
<div class="s-limit-red-icon">Red limit with icon</div>
|
||||
<div class="s-limit-yellow s-limit-lwr">Lower yellow limit</div>
|
||||
<div class="s-limit-red s-limit-upr">Upper red limit</div>
|
||||
<div class="s-limit-red icon-bell">Red Limit with a custom icon</div>
|
||||
<div>Some text with an <span class="s-limit-yellow-icon">inline element</span> showing a yellow limit.</div>
|
||||
|
||||
<!-- Limits applied in a table -->
|
||||
<table>
|
||||
<tr class='header'><td>Name</td><td>Value 1</td><td>Value 2</td></tr>
|
||||
<tr><td>ENG_PWR 4991</td><td>7.023</td><td class="s-limit-yellow s-limit-upr">70.23</td></tr>
|
||||
<tr><td>ENG_PWR 4992</td><td>49.784</td><td class="s-limit-red s-limit-lwr">-121.22</td></tr>
|
||||
<tr><td>ENG_PWR 4993</td><td class="s-limit-yellow icon-bell">0.451</td><td>1.007</td></tr>
|
||||
</table>
|
||||
</mct-example>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="l-section">
|
||||
<h2>Status</h2>
|
||||
<div class="cols cols1-1">
|
||||
<div class="col">
|
||||
<p>Classes here can be applied to elements as needed.</p>
|
||||
<ul>
|
||||
<li>Color only</li>
|
||||
<ul>
|
||||
<li><code>s-status-warning-hi</code></li>
|
||||
<li><code>s-status-warning-lo</code></li>
|
||||
<li><code>s-status-diagnostic</code></li>
|
||||
<li><code>s-status-info</code></li>
|
||||
<li><code>s-status-ok</code></li>
|
||||
</ul>
|
||||
<li>Color and icon</li>
|
||||
<ul>
|
||||
<li><code>s-status-warning-hi-icon</code></li>
|
||||
<li><code>s-status-warning-lo-icon</code></li>
|
||||
<li><code>s-status-diagnostic-icon</code></li>
|
||||
<li><code>s-status-info-icon</code></li>
|
||||
<li><code>s-status-ok-icon</code></li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<mct-example><div class="s-status-warning-hi">WARNING HI</div>
|
||||
<div class="s-status-warning-lo">WARNING LOW</div>
|
||||
<div class="s-status-diagnostic">DIAGNOSTIC</div>
|
||||
<div class="s-status-info">INFO</div>
|
||||
<div class="s-status-ok">OK</div>
|
||||
<div class="s-status-warning-hi-icon">WARNING HI with icon</div>
|
||||
<div class="s-status-warning-lo-icon">WARNING LOW with icon</div>
|
||||
<div class="s-status-diagnostic-icon">DIAGNOSTIC with icon</div>
|
||||
<div class="s-status-info-icon">INFO with icon</div>
|
||||
<div class="s-status-ok-icon">OK with icon</div>
|
||||
<div class="s-status-warning-hi icon-gear">WARNING HI with custom icon</div>
|
||||
</mct-example>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="l-section">
|
||||
<h2>Synchronization</h2>
|
||||
<div class="cols cols1-1">
|
||||
<div class="col">
|
||||
<p>When the system is operating in real-time streaming mode, it is important for views that display real-time data to clearly articulate when they are not, such as when a user zooms or pans a plot view, freezing that view. In that case, the CSS class <code>s-unsynced</code> should be applied to that view.</p>
|
||||
</div>
|
||||
<mct-example><div class="s-unsynced">This element is unsynced</div>
|
||||
</mct-example>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,6 +34,7 @@ define(
|
||||
pages['standards'] = { name: "Standards", type: "styleguide.standards", location: "styleguide:home" };
|
||||
pages['colors'] = { name: "Colors", type: "styleguide.colors", location: "styleguide:home" };
|
||||
pages['glyphs'] = { name: "Glyphs", type: "styleguide.glyphs", location: "styleguide:home" };
|
||||
pages['status'] = { name: "Status Indication", type: "styleguide.status", location: "styleguide:home" };
|
||||
pages['controls'] = { name: "Controls", type: "styleguide.controls", location: "styleguide:ui-elements" };
|
||||
pages['input'] = { name: "Text Inputs", type: "styleguide.input", location: "styleguide:ui-elements" };
|
||||
pages['menus'] = { name: "Menus", type: "styleguide.menus", location: "styleguide:ui-elements" };
|
||||
|
||||
@@ -77,11 +77,15 @@ if (process.env.NODE_ENV === 'development') {
|
||||
gulp.task('scripts', function () {
|
||||
var requirejsOptimize = require('gulp-requirejs-optimize');
|
||||
var replace = require('gulp-replace-task');
|
||||
var header = require('gulp-header');
|
||||
var comment = fs.readFileSync('src/about.frag');
|
||||
|
||||
return gulp.src(paths.main)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(requirejsOptimize(options.requirejsOptimize))
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(replace(options.replace))
|
||||
.pipe(header(comment, options.replace.variables))
|
||||
.pipe(gulp.dest(paths.dist));
|
||||
});
|
||||
|
||||
|
||||
28
index.html
28
index.html
@@ -28,9 +28,10 @@
|
||||
<script src="bower_components/requirejs/require.js">
|
||||
</script>
|
||||
<script>
|
||||
var THIRTY_MINUTES = 30 * 60 * 1000;
|
||||
|
||||
require(['openmct'], function (openmct) {
|
||||
[
|
||||
'example/imagery',
|
||||
'example/eventGenerator',
|
||||
'example/styleguide'
|
||||
].forEach(
|
||||
@@ -40,7 +41,32 @@
|
||||
openmct.install(openmct.plugins.LocalStorage());
|
||||
openmct.install(openmct.plugins.Espresso());
|
||||
openmct.install(openmct.plugins.Generator());
|
||||
openmct.install(openmct.plugins.ExampleImagery());
|
||||
openmct.install(openmct.plugins.UTCTimeSystem());
|
||||
openmct.install(openmct.plugins.ImportExport());
|
||||
openmct.install(openmct.plugins.Conductor({
|
||||
menuOptions: [
|
||||
{
|
||||
name: "Fixed",
|
||||
timeSystem: 'utc',
|
||||
bounds: {
|
||||
start: Date.now() - 30 * 60 * 1000,
|
||||
end: Date.now()
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Realtime",
|
||||
timeSystem: 'utc',
|
||||
clock: 'local',
|
||||
clockOffsets: {
|
||||
start: -25 * 60 * 1000,
|
||||
end: 5 * 60 * 1000
|
||||
}
|
||||
}
|
||||
]
|
||||
}));
|
||||
openmct.time.clock('local', {start: -THIRTY_MINUTES, end: 0});
|
||||
openmct.time.timeSystem('utc');
|
||||
openmct.start();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -37,6 +37,7 @@ module.exports = function(config) {
|
||||
{pattern: 'bower_components/**/*.js', included: false},
|
||||
{pattern: 'node_modules/d3-*/**/*.js', included: false},
|
||||
{pattern: 'src/**/*.js', included: false},
|
||||
{pattern: 'example/**/*.html', included: false},
|
||||
{pattern: 'example/**/*.js', included: false},
|
||||
{pattern: 'example/**/*.json', included: false},
|
||||
{pattern: 'platform/**/*.js', included: false},
|
||||
|
||||
@@ -32,6 +32,7 @@ requirejs.config({
|
||||
"html2canvas": "bower_components/html2canvas/build/html2canvas.min",
|
||||
"moment": "bower_components/moment/moment",
|
||||
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
|
||||
"moment-timezone": "bower_components/moment-timezone/builds/moment-timezone-with-data",
|
||||
"saveAs": "bower_components/FileSaver.js/FileSaver.min",
|
||||
"screenfull": "bower_components/screenfull/dist/screenfull.min",
|
||||
"text": "bower_components/text/text",
|
||||
@@ -100,11 +101,5 @@ define([
|
||||
return new Main().run(defaultRegistry);
|
||||
});
|
||||
|
||||
// For now, install conductor by default
|
||||
openmct.install(openmct.plugins.Conductor({
|
||||
showConductor: false
|
||||
}));
|
||||
|
||||
|
||||
return openmct;
|
||||
});
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
"bower": "^1.7.7",
|
||||
"git-rev-sync": "^1.4.0",
|
||||
"glob": ">= 3.0.0",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-header": "^1.8.8",
|
||||
"gulp-jscs": "^3.0.2",
|
||||
"gulp-jshint": "^2.0.0",
|
||||
"gulp-jshint-html-reporter": "^0.1.3",
|
||||
|
||||
@@ -107,7 +107,9 @@ define([
|
||||
"depends": [
|
||||
"$scope",
|
||||
"agentService",
|
||||
"$window"
|
||||
"$window",
|
||||
"$location",
|
||||
"$attrs"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -134,7 +136,9 @@ define([
|
||||
"$scope",
|
||||
"agentService",
|
||||
"$window",
|
||||
"navigationService"
|
||||
"navigationService",
|
||||
"$location",
|
||||
"$attrs"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -240,7 +244,7 @@ define([
|
||||
"views": [
|
||||
{
|
||||
"key": "items",
|
||||
"name": "Items",
|
||||
"name": "Grid",
|
||||
"cssClass": "icon-thumbs-strip",
|
||||
"description": "Grid of available items",
|
||||
"template": itemsTemplate,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
at runtime from the About dialog for additional information.
|
||||
-->
|
||||
<div ng-controller="BrowseObjectController" class="abs l-flex-col">
|
||||
<div class="holder flex-elem l-flex-row object-browse-bar ">
|
||||
<div class="holder flex-elem l-flex-row object-browse-bar t-primary">
|
||||
<div class="items-select left flex-elem l-flex-row grows">
|
||||
<mct-representation key="'back-arrow'"
|
||||
mct-object="domainObject"
|
||||
@@ -31,16 +31,18 @@
|
||||
</mct-representation>
|
||||
</div>
|
||||
<div class="btn-bar right l-flex-row flex-elem flex-justify-end flex-fixed">
|
||||
<mct-representation key="'switcher'"
|
||||
mct-object="domainObject"
|
||||
ng-model="representation">
|
||||
</mct-representation>
|
||||
<!-- Temporarily, on mobile, the action buttons are hidden-->
|
||||
<mct-representation key="'action-group'"
|
||||
mct-object="domainObject"
|
||||
parameters="{ category: 'view-control' }"
|
||||
class="mobile-hide">
|
||||
</mct-representation>
|
||||
<span class="l-object-action-buttons">
|
||||
<mct-representation key="'switcher'"
|
||||
mct-object="domainObject"
|
||||
ng-model="representation">
|
||||
</mct-representation>
|
||||
<!-- Temporarily, on mobile, the action buttons are hidden-->
|
||||
<mct-representation key="'action-group'"
|
||||
mct-object="domainObject"
|
||||
parameters="{ category: 'view-control' }"
|
||||
class="mobile-hide l-object-action-buttons">
|
||||
</mct-representation>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="holder l-flex-col flex-elem grows l-object-wrapper l-controls-visible l-time-controller-visible">
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
<mct-include key="'topbar-browse'"></mct-include>
|
||||
<div class="abs holder holder-main browse-area s-browse-area browse-wrapper"
|
||||
ng-controller="PaneController as modelPaneTree"
|
||||
ng-class="modelPaneTree.visible() ? 'pane-tree-showing' : 'pane-tree-hidden'">
|
||||
ng-class="modelPaneTree.visible() ? 'pane-tree-showing' : 'pane-tree-hidden'" hide-parameter="hideTree">
|
||||
<mct-split-pane class='abs contents'
|
||||
anchor='left'>
|
||||
anchor='left' alias="leftSide">
|
||||
<div class='split-pane-component treeview pane left'>
|
||||
<div class="abs holder l-flex-col holder-treeview-elements">
|
||||
<mct-representation key="'create-button'"
|
||||
@@ -58,9 +58,10 @@
|
||||
|
||||
<div class='holder holder-object-and-inspector abs' id='content-area'
|
||||
ng-controller="InspectorPaneController as modelPaneInspect"
|
||||
ng-class="modelPaneInspect.visible() ? 'pane-inspect-showing' : 'pane-inspect-hidden'">
|
||||
ng-class="modelPaneInspect.visible() ? 'pane-inspect-showing' : 'pane-inspect-hidden'"
|
||||
hide-parameter="hideInspector">
|
||||
|
||||
<mct-split-pane class='l-object-and-inspector contents abs' anchor='right'>
|
||||
<mct-split-pane class='l-object-and-inspector contents abs' anchor='right' alias="rightSide">
|
||||
<div class='split-pane-component t-object pane primary-pane left'>
|
||||
<mct-representation mct-object="navigatedObject"
|
||||
key="navigatedObject.getCapability('status').get('editing') ? 'edit-object' : 'browse-object'"
|
||||
@@ -87,4 +88,3 @@
|
||||
</div>
|
||||
<mct-include key="'bottombar'"></mct-include>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -28,4 +28,4 @@
|
||||
key="'menu-arrow'"
|
||||
mct-object='domainObject'
|
||||
class="flex-elem context-available-w"></mct-representation>
|
||||
</span>
|
||||
</span>
|
||||
@@ -25,8 +25,8 @@
|
||||
* @namespace platform/commonUI/browse
|
||||
*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
['lodash'],
|
||||
function (_) {
|
||||
|
||||
/**
|
||||
* The BrowseController is used to populate the initial scope in Browse
|
||||
@@ -113,11 +113,22 @@ define(
|
||||
$location.path('/browse/' + currentIds);
|
||||
}
|
||||
|
||||
function getLastChildIfRoot(object) {
|
||||
if (object.getId() !== 'ROOT') {
|
||||
return object;
|
||||
}
|
||||
return object.useCapability('composition')
|
||||
.then(function (composees) {
|
||||
return composees[composees.length - 1];
|
||||
});
|
||||
}
|
||||
|
||||
function navigateToPath(path) {
|
||||
return getObject('ROOT')
|
||||
.then(function (root) {
|
||||
return findViaComposition(root, path);
|
||||
})
|
||||
.then(getLastChildIfRoot)
|
||||
.then(function (object) {
|
||||
navigationService.setNavigation(object);
|
||||
});
|
||||
@@ -146,11 +157,31 @@ define(
|
||||
// (e.g. bookmarks to pages in OpenMCT) and prevent them. Instead,
|
||||
// navigate to the path ourselves, which results in it being
|
||||
// properly set.
|
||||
$scope.$on('$routeChangeStart', function (event, route) {
|
||||
if (route.$$route === $route.current.$$route &&
|
||||
route.pathParams.ids !== $route.current.pathParams.ids) {
|
||||
event.preventDefault();
|
||||
navigateToPath(route.pathParams.ids.split('/'));
|
||||
$scope.$on('$routeChangeStart', function (event, route, oldRoute) {
|
||||
if (route.$$route === $route.current.$$route) {
|
||||
if (route.pathParams.ids &&
|
||||
route.pathParams.ids !== $route.current.pathParams.ids) {
|
||||
|
||||
var otherParams = _.omit(route.params, 'ids');
|
||||
var oldOtherParams = _.omit(oldRoute.params, 'ids');
|
||||
var deletedParams = _.omit(oldOtherParams, _.keys(otherParams));
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
navigateToPath(route.pathParams.ids.split('/'))
|
||||
.then(function () {
|
||||
if (!_.isEqual(otherParams, oldOtherParams)) {
|
||||
_.forEach(otherParams, function (v, k) {
|
||||
$location.search(k, v);
|
||||
});
|
||||
_.forEach(deletedParams, function (k) {
|
||||
$location.search(k, null);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
navigateToPath([]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -35,9 +35,8 @@ define(
|
||||
* @param navigationService
|
||||
* @constructor
|
||||
*/
|
||||
function InspectorPaneController($scope, agentService, $window, navigationService) {
|
||||
PaneController.call(this, $scope, agentService, $window);
|
||||
|
||||
function InspectorPaneController($scope, agentService, $window, navigationService, $location, $attrs) {
|
||||
PaneController.call(this, $scope, agentService, $window, $location, $attrs);
|
||||
var statusListener,
|
||||
self = this;
|
||||
|
||||
|
||||
@@ -31,12 +31,17 @@ define(
|
||||
* @constructor
|
||||
* @memberof platform/commonUI/browse
|
||||
*/
|
||||
function PaneController($scope, agentService, $window) {
|
||||
function PaneController($scope, agentService, $window, $location, $attrs) {
|
||||
var self = this;
|
||||
this.agentService = agentService;
|
||||
var hideParameterPresent = $location.search().hasOwnProperty($attrs.hideParameter);
|
||||
|
||||
// Fast and cheap: if this has been opened in a new window, hide panes by default
|
||||
this.state = !$window.opener;
|
||||
if ($attrs.hideParameter && hideParameterPresent) {
|
||||
this.state = false;
|
||||
$location.search($attrs.hideParameter, undefined);
|
||||
} else {
|
||||
this.state = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to invoke when any selection occurs in the tree.
|
||||
@@ -70,7 +75,7 @@ define(
|
||||
* @returns {boolean} true when visible
|
||||
*/
|
||||
PaneController.prototype.visible = function () {
|
||||
return this.state;
|
||||
return !!this.state;
|
||||
};
|
||||
|
||||
return PaneController;
|
||||
|
||||
@@ -38,6 +38,7 @@ define(
|
||||
|
||||
this.urlService = urlService;
|
||||
this.open = function () {
|
||||
arguments[0] += "&hideTree=true&hideInspector=true";
|
||||
$window.open.apply($window, arguments);
|
||||
};
|
||||
|
||||
|
||||
@@ -33,7 +33,9 @@ define(
|
||||
mockNavigationService,
|
||||
mockNavigationUnlistener,
|
||||
mockStatusUnlistener,
|
||||
controller;
|
||||
controller,
|
||||
mockLocation,
|
||||
mockAttrs;
|
||||
|
||||
beforeEach(function () {
|
||||
mockScope = jasmine.createSpyObj("$scope", ["$on"]);
|
||||
@@ -71,7 +73,12 @@ define(
|
||||
mockDomainObject.hasCapability.andReturn(true);
|
||||
mockDomainObject.getCapability.andReturn(mockStatusCapability);
|
||||
|
||||
controller = new InspectorPaneController(mockScope, mockAgentService, mockWindow, mockNavigationService);
|
||||
mockLocation = jasmine.createSpyObj('location', ['search']);
|
||||
mockLocation.search.andReturn({});
|
||||
|
||||
mockAttrs = {};
|
||||
|
||||
controller = new InspectorPaneController(mockScope, mockAgentService, mockWindow, mockNavigationService, mockLocation, mockAttrs);
|
||||
});
|
||||
|
||||
it("listens for changes to navigation and attaches a status" +
|
||||
|
||||
@@ -29,7 +29,9 @@ define(
|
||||
mockAgentService,
|
||||
mockDomainObjects,
|
||||
mockWindow,
|
||||
controller;
|
||||
controller,
|
||||
mockLocation,
|
||||
mockAttrs;
|
||||
|
||||
// We want to reinstantiate for each test case
|
||||
// because device state can influence constructor-time behavior
|
||||
@@ -37,7 +39,9 @@ define(
|
||||
return new PaneController(
|
||||
mockScope,
|
||||
mockAgentService,
|
||||
mockWindow
|
||||
mockWindow,
|
||||
mockLocation,
|
||||
mockAttrs
|
||||
);
|
||||
}
|
||||
|
||||
@@ -59,6 +63,11 @@ define(
|
||||
["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"]
|
||||
);
|
||||
mockWindow = jasmine.createSpyObj("$window", ["open"]);
|
||||
|
||||
mockLocation = jasmine.createSpyObj('location', ['search']);
|
||||
mockLocation.search.andReturn({});
|
||||
|
||||
mockAttrs = {};
|
||||
});
|
||||
|
||||
it("is initially visible", function () {
|
||||
@@ -86,6 +95,24 @@ define(
|
||||
// Tree should have collapsed
|
||||
expect(controller.visible()).toBeFalsy();
|
||||
});
|
||||
|
||||
describe("specifying hideParameter", function () {
|
||||
beforeEach(function () {
|
||||
mockAttrs = {hideParameter: 'hideTree'};
|
||||
});
|
||||
|
||||
it("sets pane state to false when in location.search", function () {
|
||||
mockLocation.search.andReturn({'hideTree': true});
|
||||
expect(instantiateController().visible()).toBe(false);
|
||||
expect(mockLocation.search).toHaveBeenCalledWith('hideTree', undefined);
|
||||
});
|
||||
|
||||
it("sets state to true when not found in location.search", function () {
|
||||
mockLocation.search.andReturn({});
|
||||
expect(instantiateController().visible()).toBe(true);
|
||||
expect(mockLocation.search).not.toHaveBeenCalledWith('hideTree', undefined);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<div class="bottom-bar">
|
||||
<a ng-repeat="dialogOption in ngModel.options"
|
||||
class="s-button major"
|
||||
class="s-button"
|
||||
ng-click="dialogOption.callback()">
|
||||
{{dialogOption.label}}
|
||||
</a>
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
this source code distribution or the Licensing information page available
|
||||
at runtime from the About dialog for additional information.
|
||||
-->
|
||||
<div class="abs overlay" ng-class="{'delayEntry100ms' : ngModel.delay}">
|
||||
<div class="abs overlay l-dialog" ng-class="{'delayEntry100ms' : ngModel.delay}">
|
||||
<div class="abs blocker"></div>
|
||||
<div class="abs holder">
|
||||
<div class="abs outer-holder">
|
||||
<a ng-click="ngModel.cancel()"
|
||||
ng-if="ngModel.cancel"
|
||||
class="close icon-x"></a>
|
||||
<div class="abs contents" ng-transclude></div>
|
||||
class="close icon-x-in-circle"></a>
|
||||
<div class="abs inner-holder contents" ng-transclude></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,8 +33,8 @@ define([
|
||||
) {
|
||||
|
||||
legacyRegistry.register("platform/commonUI/formats", {
|
||||
"name": "Time services bundle",
|
||||
"description": "Defines interfaces and provides default implementations for handling different time systems.",
|
||||
"name": "Format Registry",
|
||||
"description": "Provides a registry for formats, which allow parsing and formatting of values.",
|
||||
"extensions": {
|
||||
"components": [
|
||||
{
|
||||
|
||||
@@ -44,6 +44,7 @@ define([
|
||||
* @memberof platform/commonUI/formats
|
||||
*/
|
||||
function DurationFormat() {
|
||||
this.key = "duration";
|
||||
}
|
||||
|
||||
DurationFormat.prototype.format = function (value) {
|
||||
|
||||
@@ -30,19 +30,23 @@ define([
|
||||
* An object used to convert between numeric values and text values,
|
||||
* typically used to display these values to the user and to convert
|
||||
* user input to a numeric format, particularly for time formats.
|
||||
* @interface {Format}
|
||||
* @interface Format
|
||||
*/
|
||||
|
||||
/**
|
||||
* Parse text (typically user input) to a numeric value.
|
||||
* Behavior is undefined when the text cannot be parsed;
|
||||
* `validate` should be called first if the text may be invalid.
|
||||
* @method parse
|
||||
* @method Format#parse
|
||||
* @memberof Format#
|
||||
* @param {string} text the text to parse
|
||||
* @returns {number} the parsed numeric value
|
||||
*/
|
||||
|
||||
/**
|
||||
* @property {string} key A unique identifier for this formatter.
|
||||
* @memberof Format#
|
||||
*/
|
||||
|
||||
/**
|
||||
* Determine whether or not some text (typically user input) can
|
||||
* be parsed to a numeric value by this format.
|
||||
@@ -58,10 +62,12 @@ define([
|
||||
* @method format
|
||||
* @memberof Format#
|
||||
* @param {number} value the numeric value to format
|
||||
* @param {number} [threshold] Optionally provides context to the
|
||||
* format request, allowing for scale-appropriate formatting. This value
|
||||
* should be the minimum unit to be represented by this format, in ms. For
|
||||
* example, to display seconds, a threshold of 1 * 1000 should be provided.
|
||||
* @param {number} [minValue] Contextual information for scaled formatting used in linear scales such as conductor
|
||||
* and plot axes. Specifies the smallest number on the scale.
|
||||
* @param {number} [maxValue] Contextual information for scaled formatting used in linear scales such as conductor
|
||||
* and plot axes. Specifies the largest number on the scale
|
||||
* @param {number} [count] Contextual information for scaled formatting used in linear scales such as conductor
|
||||
* and plot axes. The number of labels on the scale.
|
||||
* @returns {string} the text representation of the value
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, United States Government
|
||||
* Open MCT, Copyright (c) 2014-2016, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
@@ -49,6 +49,7 @@ define([
|
||||
* @memberof platform/commonUI/formats
|
||||
*/
|
||||
function UTCTimeFormat() {
|
||||
this.key = "utc";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,7 +65,7 @@ define([
|
||||
*
|
||||
* Licensed
|
||||
*/
|
||||
return [
|
||||
var format = [
|
||||
[".SSS", function (m) {
|
||||
return m.milliseconds();
|
||||
}],
|
||||
@@ -91,64 +92,32 @@ define([
|
||||
return true;
|
||||
}]
|
||||
].filter(function (row) {
|
||||
return row[1](momentified);
|
||||
})[0][0];
|
||||
return row[1](momentified);
|
||||
})[0][0];
|
||||
|
||||
if (format !== undefined) {
|
||||
return moment.utc(d).format(format);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a description of the current range of the time conductor's
|
||||
* bounds.
|
||||
* @param timeRange
|
||||
* @returns {*}
|
||||
* @param {number} value The value to format.
|
||||
* @param {number} [minValue] Contextual information for scaled formatting used in linear scales such as conductor
|
||||
* and plot axes. Specifies the smallest number on the scale.
|
||||
* @param {number} [maxValue] Contextual information for scaled formatting used in linear scales such as conductor
|
||||
* and plot axes. Specifies the largest number on the scale
|
||||
* @param {number} [count] Contextual information for scaled formatting used in linear scales such as conductor
|
||||
* and plot axes. The number of labels on the scale.
|
||||
* @returns {string} the formatted date(s). If multiple values were requested, then an array of
|
||||
* formatted values will be returned. Where a value could not be formatted, `undefined` will be returned at its position
|
||||
* in the array.
|
||||
*/
|
||||
UTCTimeFormat.prototype.timeUnits = function (timeRange) {
|
||||
var momentified = moment.duration(timeRange);
|
||||
|
||||
return [
|
||||
["Decades", function (r) {
|
||||
return r.years() > 15;
|
||||
}],
|
||||
["Years", function (r) {
|
||||
return r.years() > 1;
|
||||
}],
|
||||
["Months", function (r) {
|
||||
return r.years() === 1 || r.months() > 1;
|
||||
}],
|
||||
["Days", function (r) {
|
||||
return r.months() === 1 || r.days() > 1;
|
||||
}],
|
||||
["Hours", function (r) {
|
||||
return r.days() === 1 || r.hours() > 1;
|
||||
}],
|
||||
["Minutes", function (r) {
|
||||
return r.hours() === 1 || r.minutes() > 1;
|
||||
}],
|
||||
["Seconds", function (r) {
|
||||
return r.minutes() === 1 || r.seconds() > 1;
|
||||
}],
|
||||
["Milliseconds", function (r) {
|
||||
return true;
|
||||
}]
|
||||
].filter(function (row) {
|
||||
return row[1](momentified);
|
||||
})[0][0];
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param value
|
||||
* @param {Scale} [scale] Optionally provides context to the
|
||||
* format request, allowing for scale-appropriate formatting.
|
||||
* @returns {string} the formatted date
|
||||
*/
|
||||
UTCTimeFormat.prototype.format = function (value, scale) {
|
||||
if (scale !== undefined) {
|
||||
var scaledFormat = getScaledFormat(value, scale);
|
||||
if (scaledFormat) {
|
||||
return moment.utc(value).format(scaledFormat);
|
||||
}
|
||||
UTCTimeFormat.prototype.format = function (value) {
|
||||
if (arguments.length > 1) {
|
||||
return getScaledFormat(value);
|
||||
} else {
|
||||
return moment.utc(value).format(DATE_FORMAT) + "Z";
|
||||
}
|
||||
return moment.utc(value).format(DATE_FORMAT) + "Z";
|
||||
};
|
||||
|
||||
UTCTimeFormat.prototype.parse = function (text) {
|
||||
|
||||
@@ -1,83 +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.
|
||||
*****************************************************************************/
|
||||
|
||||
define([
|
||||
"./UTCTimeFormat",
|
||||
"moment"
|
||||
], function (
|
||||
UTCTimeFormat,
|
||||
moment
|
||||
) {
|
||||
describe("The UTCTimeFormat class", function () {
|
||||
var format;
|
||||
var scale;
|
||||
|
||||
beforeEach(function () {
|
||||
format = new UTCTimeFormat();
|
||||
scale = {min: 0, max: 0};
|
||||
});
|
||||
|
||||
it("Provides an appropriately scaled time format based on the input" +
|
||||
" time", function () {
|
||||
var TWO_HUNDRED_MS = 200;
|
||||
var THREE_SECONDS = 3000;
|
||||
var FIVE_MINUTES = 5 * 60 * 1000;
|
||||
var ONE_HOUR_TWENTY_MINS = (1 * 60 * 60 * 1000) + (20 * 60 * 1000);
|
||||
var TEN_HOURS = (10 * 60 * 60 * 1000);
|
||||
|
||||
var JUNE_THIRD = moment.utc("2016-06-03", "YYYY-MM-DD");
|
||||
var APRIL = moment.utc("2016-04", "YYYY-MM");
|
||||
var TWENTY_SIXTEEN = moment.utc("2016", "YYYY");
|
||||
|
||||
expect(format.format(TWO_HUNDRED_MS, scale)).toBe(".200");
|
||||
expect(format.format(THREE_SECONDS, scale)).toBe(":03");
|
||||
expect(format.format(FIVE_MINUTES, scale)).toBe("00:05");
|
||||
expect(format.format(ONE_HOUR_TWENTY_MINS, scale)).toBe("01:20");
|
||||
expect(format.format(TEN_HOURS, scale)).toBe("10");
|
||||
|
||||
expect(format.format(JUNE_THIRD, scale)).toBe("Fri 03");
|
||||
expect(format.format(APRIL, scale)).toBe("April");
|
||||
expect(format.format(TWENTY_SIXTEEN, scale)).toBe("2016");
|
||||
});
|
||||
|
||||
it("Returns appropriate time units for a given time span", function () {
|
||||
var ONE_DAY = 1000 * 60 * 60 * 24;
|
||||
var FIVE_DAYS = 5 * ONE_DAY;
|
||||
var FIVE_MONTHS = 60 * ONE_DAY;
|
||||
|
||||
var ONE_YEAR = 365 * ONE_DAY;
|
||||
var SEVEN_YEARS = 7 * ONE_YEAR;
|
||||
var TWO_DECADES = 20 * ONE_YEAR;
|
||||
|
||||
//A span of one day should show a zoom label of "Hours"
|
||||
expect(format.timeUnits(ONE_DAY)).toEqual("Hours");
|
||||
//Multiple days should display "Days"
|
||||
expect(format.timeUnits(FIVE_DAYS)).toEqual("Days");
|
||||
expect(format.timeUnits(FIVE_MONTHS)).toEqual("Days");
|
||||
//A span of one year should show a zoom level of "Months".
|
||||
// Multiple years will show "Years"
|
||||
expect(format.timeUnits(ONE_YEAR)).toEqual("Months");
|
||||
expect(format.timeUnits(SEVEN_YEARS)).toEqual("Years");
|
||||
expect(format.timeUnits(TWO_DECADES)).toEqual("Decades");
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,9 +1,9 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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,47 +14,49 @@
|
||||
* 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.
|
||||
*****************************************************************************/
|
||||
|
||||
define(
|
||||
['../src/UTCTimeFormat', 'moment'],
|
||||
function (UTCTimeFormat, moment) {
|
||||
define([
|
||||
"../src/UTCTimeFormat",
|
||||
"moment"
|
||||
], function (
|
||||
UTCTimeFormat,
|
||||
moment
|
||||
) {
|
||||
describe("The UTCTimeFormat class", function () {
|
||||
var format;
|
||||
var scale;
|
||||
|
||||
describe("The UTCTimeFormat", function () {
|
||||
var format;
|
||||
|
||||
beforeEach(function () {
|
||||
format = new UTCTimeFormat();
|
||||
});
|
||||
|
||||
it("formats UTC timestamps", function () {
|
||||
var timestamp = 12345670000,
|
||||
formatted = format.format(timestamp);
|
||||
expect(formatted).toEqual(jasmine.any(String));
|
||||
expect(moment.utc(formatted).valueOf()).toEqual(timestamp);
|
||||
});
|
||||
|
||||
it("displays with millisecond precision", function () {
|
||||
var timestamp = 12345670789,
|
||||
formatted = format.format(timestamp);
|
||||
expect(moment.utc(formatted).valueOf()).toEqual(timestamp);
|
||||
});
|
||||
|
||||
it("validates time inputs", function () {
|
||||
expect(format.validate("1977-05-25 11:21:22")).toBe(true);
|
||||
expect(format.validate("garbage text")).toBe(false);
|
||||
});
|
||||
|
||||
it("parses valid input", function () {
|
||||
var text = "1977-05-25 11:21:22",
|
||||
parsed = format.parse(text);
|
||||
expect(parsed).toEqual(jasmine.any(Number));
|
||||
expect(parsed).toEqual(moment.utc(text).valueOf());
|
||||
});
|
||||
beforeEach(function () {
|
||||
format = new UTCTimeFormat();
|
||||
scale = {min: 0, max: 0};
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
it("Provides an appropriately scaled time format based on the input" +
|
||||
" time", function () {
|
||||
var TWO_HUNDRED_MS = 200;
|
||||
var THREE_SECONDS = 3000;
|
||||
var FIVE_MINUTES = 5 * 60 * 1000;
|
||||
var ONE_HOUR_TWENTY_MINS = (1 * 60 * 60 * 1000) + (20 * 60 * 1000);
|
||||
var TEN_HOURS = (10 * 60 * 60 * 1000);
|
||||
|
||||
var JUNE_THIRD = moment.utc("2016-06-03", "YYYY-MM-DD");
|
||||
var APRIL = moment.utc("2016-04", "YYYY-MM");
|
||||
var TWENTY_SIXTEEN = moment.utc("2016", "YYYY");
|
||||
|
||||
expect(format.format(TWO_HUNDRED_MS, scale)).toBe(".200");
|
||||
expect(format.format(THREE_SECONDS, scale)).toBe(":03");
|
||||
expect(format.format(FIVE_MINUTES, scale)).toBe("00:05");
|
||||
expect(format.format(ONE_HOUR_TWENTY_MINS, scale)).toBe("01:20");
|
||||
expect(format.format(TEN_HOURS, scale)).toBe("10");
|
||||
|
||||
expect(format.format(JUNE_THIRD, scale)).toBe("Fri 03");
|
||||
expect(format.format(APRIL, scale)).toBe("April");
|
||||
expect(format.format(TWENTY_SIXTEEN, scale)).toBe("2016");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -374,7 +374,8 @@ define([
|
||||
"depends": [
|
||||
"$parse",
|
||||
"$log",
|
||||
"$interval"
|
||||
"$interval",
|
||||
"$window"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,207 +1,144 @@
|
||||
{
|
||||
"metadata": {
|
||||
"name": "openmct-symbols-12px",
|
||||
"lastOpened": 1467322505818,
|
||||
"created": 1467322503679
|
||||
},
|
||||
"iconSets": [
|
||||
{
|
||||
"selection": [
|
||||
{
|
||||
"order": 4,
|
||||
"id": 2,
|
||||
"prevSize": 12,
|
||||
"code": 59671,
|
||||
"name": "icon12-eye-open",
|
||||
"tempChar": ""
|
||||
},
|
||||
{
|
||||
"order": 7,
|
||||
"id": 5,
|
||||
"prevSize": 12,
|
||||
"code": 921607,
|
||||
"name": "icon12-pane-collapse-left",
|
||||
"tempChar": ""
|
||||
},
|
||||
{
|
||||
"order": 8,
|
||||
"id": 4,
|
||||
"prevSize": 12,
|
||||
"code": 921608,
|
||||
"name": "icon12-pane-collapse-right",
|
||||
"tempChar": ""
|
||||
},
|
||||
{
|
||||
"order": 6,
|
||||
"id": 3,
|
||||
"prevSize": 12,
|
||||
"code": 921865,
|
||||
"name": "icon12-folder",
|
||||
"tempChar": ""
|
||||
}
|
||||
],
|
||||
"id": 0,
|
||||
"metadata": {
|
||||
"name": "openmct-symbols-12px",
|
||||
"importSize": {
|
||||
"width": 320,
|
||||
"height": 384
|
||||
},
|
||||
"designer": "Charles Hacskaylo"
|
||||
},
|
||||
"height": 1024,
|
||||
"prevSize": 12,
|
||||
"icons": [
|
||||
{
|
||||
"id": 2,
|
||||
"paths": [
|
||||
"M512 86c-257.92 0-471.28 185.147-506.667 426 35.493 240.853 248.853 426 506.667 426s471.28-185.147 506.667-426c-35.387-240.853-248.747-426-506.667-426zM738.373 685.2c-131.048 109.517-321.699 109.517-452.747 0-53.328-44.749-90.832-105.477-106.96-173.2 16.101-67.707 53.565-128.435 106.853-173.2 131.048-109.517 321.699-109.517 452.747 0 53.368 44.733 90.909 105.464 107.067 173.2-16.128 67.723-53.632 128.451-106.96 173.2z",
|
||||
"M682.667 512c0 94.257-76.41 170.667-170.667 170.667s-170.667-76.41-170.667-170.667c0-94.257 76.41-170.667 170.667-170.667s170.667 76.41 170.667 170.667z"
|
||||
],
|
||||
"attrs": [],
|
||||
"isMulticolor": false,
|
||||
"grid": 0,
|
||||
"tags": [
|
||||
"icon12-eye-open"
|
||||
],
|
||||
"colorPermutations": {
|
||||
"1161751": [
|
||||
{
|
||||
"f": 0
|
||||
},
|
||||
{
|
||||
"f": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"paths": [
|
||||
"M0 0h170.667v1024h-170.667v-1024z",
|
||||
"M853.333 256h-256v-256l-341.333 426.667 341.333 426.667v-256h256v-341.333z"
|
||||
],
|
||||
"attrs": [
|
||||
{
|
||||
"opacity": 1
|
||||
},
|
||||
{
|
||||
"opacity": 1
|
||||
}
|
||||
],
|
||||
"isMulticolor": false,
|
||||
"width": 853,
|
||||
"grid": 0,
|
||||
"tags": [
|
||||
"icon12-pane-collapse-left"
|
||||
],
|
||||
"colorPermutations": {
|
||||
"1161751": [
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"paths": [
|
||||
"M682.667 0h170.667v1024h-170.667v-1024z",
|
||||
"M0 256h256v-256l341.333 426.667-341.333 426.667v-256h-256v-341.333z"
|
||||
],
|
||||
"attrs": [
|
||||
{
|
||||
"opacity": 1
|
||||
},
|
||||
{
|
||||
"opacity": 1
|
||||
}
|
||||
],
|
||||
"isMulticolor": false,
|
||||
"width": 853,
|
||||
"grid": 0,
|
||||
"tags": [
|
||||
"icon12-pane-collapse-right"
|
||||
],
|
||||
"colorPermutations": {
|
||||
"1161751": [
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"paths": [
|
||||
"M938.667 170.667h-341.333l-110.32-110.32c-33.2-33.2-98.667-60.347-145.68-60.347h-256c-47.073 0.136-85.197 38.26-85.333 85.32l-0 341.346c0.136-47.073 38.26-85.197 85.32-85.333l853.346-0c47.073 0.136 85.197 38.26 85.333 85.32l0-170.654c-0.136-47.073-38.26-85.197-85.32-85.333z",
|
||||
"M85.333 426.667h853.333c47.128 0 85.333 38.205 85.333 85.333v426.667c0 47.128-38.205 85.333-85.333 85.333h-853.333c-47.128 0-85.333-38.205-85.333-85.333v-426.667c0-47.128 38.205-85.333 85.333-85.333z"
|
||||
],
|
||||
"attrs": [],
|
||||
"isMulticolor": false,
|
||||
"grid": 0,
|
||||
"tags": [
|
||||
"icon12-folder"
|
||||
],
|
||||
"colorPermutations": {
|
||||
"1161751": [
|
||||
{
|
||||
"f": 0
|
||||
},
|
||||
{
|
||||
"f": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"invisible": false,
|
||||
"colorThemes": [
|
||||
[
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
[
|
||||
0,
|
||||
161,
|
||||
75,
|
||||
1
|
||||
]
|
||||
]
|
||||
],
|
||||
"colorThemeIdx": 0
|
||||
}
|
||||
],
|
||||
"preferences": {
|
||||
"showGlyphs": true,
|
||||
"showCodes": true,
|
||||
"showQuickUse": true,
|
||||
"showQuickUse2": true,
|
||||
"showSVGs": true,
|
||||
"fontPref": {
|
||||
"prefix": "icon-",
|
||||
"metadata": {
|
||||
"fontFamily": "openmct-symbols-12px",
|
||||
"majorVersion": 1,
|
||||
"minorVersion": 0
|
||||
},
|
||||
"metrics": {
|
||||
"emSize": 1024,
|
||||
"baseline": 6.25,
|
||||
"whitespace": 50
|
||||
},
|
||||
"embed": false
|
||||
},
|
||||
"imagePref": {
|
||||
"prefix": "icon-",
|
||||
"png": true,
|
||||
"useClassSelector": true,
|
||||
"color": 0,
|
||||
"bgColor": 16777215
|
||||
},
|
||||
"historySize": 100,
|
||||
"gridSize": 16
|
||||
},
|
||||
"uid": -1
|
||||
}
|
||||
"metadata": {
|
||||
"name": "openmct-symbols-12px",
|
||||
"lastOpened": 0,
|
||||
"created": 1502213994889
|
||||
},
|
||||
"iconSets": [
|
||||
{
|
||||
"selection": [
|
||||
{
|
||||
"order": 9,
|
||||
"id": 6,
|
||||
"name": "icon12-crosshair",
|
||||
"prevSize": 12,
|
||||
"code": 59696,
|
||||
"tempChar": ""
|
||||
},
|
||||
{
|
||||
"order": 6,
|
||||
"id": 3,
|
||||
"prevSize": 12,
|
||||
"code": 921865,
|
||||
"name": "icon12-folder",
|
||||
"tempChar": ""
|
||||
}
|
||||
],
|
||||
"id": 0,
|
||||
"metadata": {
|
||||
"name": "openmct-symbols-12px",
|
||||
"importSize": {
|
||||
"width": 384,
|
||||
"height": 384
|
||||
},
|
||||
"designer": "Charles Hacskaylo"
|
||||
},
|
||||
"height": 1024,
|
||||
"prevSize": 12,
|
||||
"icons": [
|
||||
{
|
||||
"id": 6,
|
||||
"paths": [
|
||||
"M597.333 0h-170.667v256h170.667v-256z",
|
||||
"M1024 426.667h-256v170.667h256v-170.667z",
|
||||
"M597.333 768h-170.667v256h170.667v-256z",
|
||||
"M256 426.667h-256v170.667h256v-170.667z"
|
||||
],
|
||||
"attrs": [
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{}
|
||||
],
|
||||
"isMulticolor": false,
|
||||
"isMulticolor2": false,
|
||||
"grid": 0,
|
||||
"tags": [
|
||||
"icon12-crosshair"
|
||||
],
|
||||
"colorPermutations": {
|
||||
"1161751": [
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
{}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"paths": [
|
||||
"M938.667 170.667h-341.333l-110.32-110.32c-33.2-33.2-98.667-60.347-145.68-60.347h-256c-47.073 0.136-85.197 38.26-85.333 85.32l-0 341.346c0.136-47.073 38.26-85.197 85.32-85.333l853.346-0c47.073 0.136 85.197 38.26 85.333 85.32l0-170.654c-0.136-47.073-38.26-85.197-85.32-85.333z",
|
||||
"M85.333 426.667h853.333c47.128 0 85.333 38.205 85.333 85.333v426.667c0 47.128-38.205 85.333-85.333 85.333h-853.333c-47.128 0-85.333-38.205-85.333-85.333v-426.667c0-47.128 38.205-85.333 85.333-85.333z"
|
||||
],
|
||||
"attrs": [],
|
||||
"isMulticolor": false,
|
||||
"grid": 0,
|
||||
"tags": [
|
||||
"icon12-folder"
|
||||
],
|
||||
"colorPermutations": {
|
||||
"1161751": [
|
||||
{
|
||||
"f": 0
|
||||
},
|
||||
{
|
||||
"f": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"invisible": false,
|
||||
"colorThemes": [
|
||||
[
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
[
|
||||
0,
|
||||
161,
|
||||
75,
|
||||
1
|
||||
]
|
||||
]
|
||||
],
|
||||
"colorThemeIdx": 0
|
||||
}
|
||||
],
|
||||
"preferences": {
|
||||
"showGlyphs": true,
|
||||
"showCodes": true,
|
||||
"showQuickUse": true,
|
||||
"showQuickUse2": true,
|
||||
"showSVGs": true,
|
||||
"fontPref": {
|
||||
"prefix": "icon-",
|
||||
"metadata": {
|
||||
"fontFamily": "openmct-symbols-12px",
|
||||
"majorVersion": 1,
|
||||
"minorVersion": 0
|
||||
},
|
||||
"metrics": {
|
||||
"emSize": 1024,
|
||||
"baseline": 6.25,
|
||||
"whitespace": 50
|
||||
},
|
||||
"embed": false
|
||||
},
|
||||
"imagePref": {
|
||||
"prefix": "icon-",
|
||||
"png": true,
|
||||
"useClassSelector": true,
|
||||
"color": 0,
|
||||
"bgColor": 16777215
|
||||
},
|
||||
"historySize": 100,
|
||||
"gridSize": 16
|
||||
},
|
||||
"uid": -1,
|
||||
"time": 1502216581486
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -7,8 +7,6 @@
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||
<glyph unicode="" glyph-name="icon12-eye-open" d="M512 852.667c-257.92 0-471.28-185.147-506.667-426 35.493-240.853 248.853-426 506.667-426s471.28 185.147 506.667 426c-35.387 240.853-248.747 426-506.667 426zM738.373 253.467c-131.048-109.517-321.699-109.517-452.747 0-53.328 44.749-90.832 105.477-106.96 173.2 16.101 67.707 53.565 128.435 106.853 173.2 131.048 109.517 321.699 109.517 452.747 0 53.368-44.733 90.909-105.464 107.067-173.2-16.128-67.723-53.632-128.451-106.96-173.2zM682.667 426.667c0-94.257-76.41-170.667-170.667-170.667s-170.667 76.41-170.667 170.667c0 94.257 76.41 170.667 170.667 170.667s170.667-76.41 170.667-170.667z" />
|
||||
<glyph unicode="󡀇" glyph-name="icon12-pane-collapse-left" horiz-adv-x="853" d="M0 938.667h170.667v-1024h-170.667v1024zM853.333 682.667h-256v256l-341.333-426.667 341.333-426.667v256h256v341.333z" />
|
||||
<glyph unicode="󡀈" glyph-name="icon12-pane-collapse-right" horiz-adv-x="853" d="M682.667 938.667h170.667v-1024h-170.667v1024zM0 682.667h256v256l341.333-426.667-341.333-426.667v256h-256v341.333z" />
|
||||
<glyph unicode="" glyph-name="icon12-crosshair" d="M597.333 938.667h-170.667v-256h170.667v256zM1024 512h-256v-170.667h256v170.667zM597.333 170.667h-170.667v-256h170.667v256zM256 512h-256v-170.667h256v170.667z" />
|
||||
<glyph unicode="󡄉" glyph-name="icon12-folder" d="M938.667 768h-341.333l-110.32 110.32c-33.2 33.2-98.667 60.347-145.68 60.347h-256c-47.073-0.136-85.197-38.26-85.333-85.32v-341.346c0.136 47.073 38.26 85.197 85.32 85.333h853.346c47.073-0.136 85.197-38.26 85.333-85.32v170.654c-0.136 47.073-38.26 85.197-85.32 85.333zM85.333 512h853.333c47.128 0 85.333-38.205 85.333-85.333v-426.667c0-47.128-38.205-85.333-85.333-85.333h-853.333c-47.128 0-85.333 38.205-85.333 85.333v426.667c0 47.128 38.205 85.333 85.333 85.333z" />
|
||||
</font></defs></svg>
|
||||
</font></defs></svg>
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -37,6 +37,8 @@
|
||||
<glyph unicode="" glyph-name="icon-trash" d="M832 832h-192.36v64c0 35.2-28.8 64-64 64h-128c-35.2 0-64-28.8-64-64v-64h-191.64c-105.6 0-192-72-192-160s0-160 0-160h64v-384c0-105.6 86.4-192 192-192h512c105.6 0 192 86.4 192 192v384h64c0 0 0 72 0 160s-86.4 160-192 160zM320 128h-128v384h128v-384zM576 128h-128v384h128v-384zM832 128h-128v384h128v-384z" />
|
||||
<glyph unicode="" glyph-name="icon-x" d="M384 448l-365.332-365.332c-24.89-24.89-24.89-65.62 0-90.51l37.49-37.49c24.89-24.89 65.62-24.89 90.51 0 0 0 365.332 365.332 365.332 365.332l365.332-365.332c24.89-24.89 65.62-24.89 90.51 0l37.49 37.49c24.89 24.89 24.89 65.62 0 90.51l-365.332 365.332c0 0 365.332 365.332 365.332 365.332 24.89 24.89 24.89 65.62 0 90.51l-37.49 37.49c-24.89 24.89-65.62 24.89-90.51 0 0 0-365.332-365.332-365.332-365.332l-365.332 365.332c-24.89 24.89-65.62 24.89-90.51 0l-37.49-37.49c-24.89-24.89-24.89-65.62 0-90.51 0 0 365.332-365.332 365.332-365.332z" />
|
||||
<glyph unicode="" glyph-name="icon-brackets" d="M832 960h-192v-192h191.66l0.34-0.34v-639.32l-0.34-0.34h-191.66v-192h192c105.6 0 192 86.4 192 192v640c0 105.6-86.4 192-192 192zM384 128h-191.66l-0.34 0.34v639.32l0.34 0.34h191.66v192h-192c-105.6 0-192-86.4-192-192v-640c0-105.6 86.4-192 192-192h192v192z" />
|
||||
<glyph unicode="" glyph-name="icon-crosshair" d="M574 962h-128v-320h128v320zM1022 514h-320v-128h320v128zM574 258h-128v-320h128v320zM318 514h-320v-128h320v128z" />
|
||||
<glyph unicode="" glyph-name="icon-grippy-v2" horiz-adv-x="586" d="M146.4 777.2c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM146.4 557.8c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM146.4 338.2c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM146.4 118.8c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM365.8 886.8c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM365.8 667.4c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM365.8 448c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM365.8 228.6c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM365.8 9.2c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM585.2 777.2c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM585.2 557.8c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM585.2 338.2c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2zM585.2 118.8c0-40.427-32.773-73.2-73.2-73.2s-73.2 32.773-73.2 73.2c0 40.427 32.773 73.2 73.2 73.2s73.2-32.773 73.2-73.2z" />
|
||||
<glyph unicode="󡀀" glyph-name="icon-arrows-out" d="M0 448l256-256v512zM512 960l-256-256h512zM512-64l256 256h-512zM768 704v-512l256 256z" />
|
||||
<glyph unicode="󡀁" glyph-name="icon-arrows-right-left" d="M1024 448l-448-512v1024zM448 960l-448-512 448-512z" />
|
||||
<glyph unicode="󡀂" glyph-name="icon-arrows-up-down" d="M512 960l512-448h-1024zM0 384l512-448 512 448z" />
|
||||
@@ -78,6 +80,13 @@
|
||||
<glyph unicode="󡀹" glyph-name="icon-brightness" d="M253.414 641.939l-155.172 116.384c-50.233-66.209-85.127-146.713-97.91-234.39l191.586-30.216c8.145 56.552 29.998 106.879 62.068 149.006zM191.98 402.283l-191.919-27.434c13.115-90.459 48.009-170.963 99.174-238.453l154.18 117.665c-31.476 41.347-53.309 91.675-61.231 146.504zM466.283 768.020l-27.434 191.919c-90.459-13.115-170.963-48.009-238.453-99.174l117.665-154.18c41.347 31.476 91.675 53.309 146.504 61.231zM822.323 861.758c-66.209 50.233-146.713 85.127-234.39 97.91l-30.216-191.586c56.552-8.145 106.879-29.998 149.006-62.068zM832.020 493.717l191.919 27.434c-13.115 90.459-48.009 170.963-99.174 238.453l-154.18-117.665c31.476-41.347 53.309-91.675 61.231-146.504zM201.677 34.242c66.209-50.233 146.713-85.127 234.39-97.91l30.216 191.586c-56.552 8.145-106.879 29.998-149.006 62.068zM770.586 254.061l155.131-116.343c50.233 66.209 85.127 146.713 97.91 234.39l-191.586 30.216c-8.125-56.564-29.966-106.906-62.028-149.049zM557.717 127.98l27.434-191.919c90.459 13.115 170.963 48.009 238.453 99.174l-117.665 154.18c-41.347-31.476-91.675-53.309-146.504-61.231zM770.586 448c0-142.813-115.773-258.586-258.586-258.586s-258.586 115.773-258.586 258.586c0 142.813 115.773 258.586 258.586 258.586s258.586-115.773 258.586-258.586z" />
|
||||
<glyph unicode="󡁀" glyph-name="icon-contrast" d="M512 960c-282.78 0-512-229.24-512-512s229.22-512 512-512 512 229.24 512 512-229.22 512-512 512zM783.52 176.48c-69.111-69.481-164.785-112.481-270.502-112.481-0.358 0-0.716 0-1.074 0.001l0.055 768c212.070-0.010 383.982-171.929 383.982-384 0-106.034-42.977-202.031-112.462-271.52z" />
|
||||
<glyph unicode="󡁁" glyph-name="icon-expand" d="M960 960c0 0 0 0 0 0h-320v-128h165.4l-210.6-210.8c-25-25-25-65.6 0-90.6 12.4-12.4 28.8-18.8 45.2-18.8s32.8 6.2 45.2 18.8l210.8 210.8v-165.4h128v384h-64zM896 154.6l-210.8 210.6c-25 25-65.6 25-90.6 0s-25-65.6 0-90.6l210.8-210.6h-165.4v-128h384v384h-128v-165.4zM218.6 832h165.4v128h-320c0 0 0 0 0 0h-64v-384h128v165.4l210.8-210.8c12.4-12.4 28.8-18.8 45.2-18.8s32.8 6.2 45.2 18.8c25 25 25 65.6 0 90.6l-210.6 210.8zM338.8 365.2l-210.8-210.6v165.4h-128v-384h384v128h-165.4l210.8 210.8c25 25 25 65.6 0 90.6-25.2 24.8-65.6 24.8-90.6-0.2z" />
|
||||
<glyph unicode="󡁂" glyph-name="icon-list-view" d="M0 896h1024v-128h-1024v128zM0 640h1024v-128h-1024v128zM0 384h1024v-128h-1024v128zM0 128h1024v-128h-1024v128z" />
|
||||
<glyph unicode="󡁃" glyph-name="icon-grid-snap-to" d="M382 130h448v448h-448v-448zM510 450h192v-192h-192v192zM-2 386h320v-64h-320v64zM894 386h128v-64h-128v64zM574 962h64v-320h-64v320zM574 66h64v-128h-64v128zM574 386h64v-64h-64v64z" />
|
||||
<glyph unicode="󡁄" glyph-name="icon-grid-snap-no" d="M768 384h192v-64h-192v64zM256 384h192v-64h-192v64zM0 384h192v-64h-192v64zM640 448h-64v-64h-64v-64h64v-64h64v64h64v64h-64zM576 704h64v-192h-64v192zM576 960h64v-192h-64v192zM576 192h64v-192h-64v192z" />
|
||||
<glyph unicode="󡁅" glyph-name="icon-frame-show" d="M0 896v-896h1024v896h-1024zM896 128h-768v640h768v-640zM192 704h384v-128h-384v128z" />
|
||||
<glyph unicode="󡁆" glyph-name="icon-frame-hide" d="M128 770h420l104 128h-652v-802.4l128 157.4zM896 130h-420l-104-128h652v802.4l-128-157.4zM832 962l-832-1024h192l832 1024zM392 578l104 128h-304v-128z" />
|
||||
<glyph unicode="󡁇" glyph-name="icon-import" d="M832 767.6v-639.4c0-0.2-0.2-0.2-0.4-0.4h-319.6v-192h320c105.6 0 192 86.4 192 192v640.2c0 105.6-86.4 192-192 192h-320v-192h319.6c0.2 0 0.4-0.2 0.4-0.4zM192 256v-192l384 384-384 384v-192h-192v-384z" />
|
||||
<glyph unicode="󡁈" glyph-name="icon-export" d="M192 128.34v639.32l0.34 0.34h319.66v192h-320c-105.6 0-192-86.4-192-192v-640c0-105.6 86.4-192 192-192h320v192h-319.66zM1024 448l-384 384v-192h-192v-384h192v-192l384 384z" />
|
||||
<glyph unicode="󡄀" glyph-name="icon-activity" d="M576 896h-256l320-320h-290.256c-44.264 76.516-126.99 128-221.744 128h-128v-512h128c94.754 0 177.48 51.484 221.744 128h290.256l-320-320h256l448 448-448 448z" />
|
||||
<glyph unicode="󡄁" glyph-name="icon-activity-mode" d="M512 960c-214.866 0-398.786-132.372-474.744-320h90.744c56.86 0 107.938-24.724 143.094-64h240.906l-192 192h256l320-320-320-320h-256l192 192h-240.906c-35.156-39.276-86.234-64-143.094-64h-90.744c75.958-187.628 259.878-320 474.744-320 282.77 0 512 229.23 512 512s-229.23 512-512 512z" />
|
||||
<glyph unicode="󡄂" glyph-name="icon-autoflow-tabular" d="M192 960c-105.6 0-192-86.4-192-192v-640c0-105.6 86.4-192 192-192h64v1024h-64zM384 960h256v-1024h-256v1024zM832 960h-64v-704h256v512c0 105.6-86.4 192-192 192z" />
|
||||
@@ -108,4 +117,5 @@
|
||||
<glyph unicode="󡄧" glyph-name="icon-timer-v1.5" horiz-adv-x="896" d="M576 813.4v82.58c0 35.346-28.654 64-64 64h-128c-35.346 0-64-28.654-64-64v-82.58c-185.040-55.080-320-226.48-320-429.42 0-247.42 200.58-448 448-448s448 200.58 448 448c0 202.96-135 374.4-320 429.42zM468 363.98l-263.76-211c-57.105 59.935-92.24 141.251-92.24 230.772 0 0.080 0 0.16 0 0.24 0 185.268 150.72 335.988 336 335.988 6.72 0 13.38-0.22 20-0.62v-355.38z" />
|
||||
<glyph unicode="󡄨" glyph-name="icon-topic" d="M454.36 483.36l86.3 86.3c9.088 8.965 21.577 14.502 35.36 14.502s26.272-5.537 35.366-14.507l86.294-86.294c19.328-19.358 42.832-34.541 69.047-44.082l1.313 171.722-57.64 57.64c-34.407 34.33-81.9 55.558-134.35 55.558s-99.943-21.228-134.354-55.562l-86.296-86.297c-9.088-8.965-21.577-14.502-35.36-14.502s-26.272 5.537-35.366 14.507l-28.674 28.654v-172.14c19.045-7.022 41.040-11.084 63.984-11.084 52.463 0 99.966 21.239 134.379 55.587zM505.64 412.64l-86.3-86.3c-9.088-8.965-21.577-14.502-35.36-14.502s-26.272 5.537-35.366 14.507l-86.294 86.294c-2 2-4.2 4-6.36 6v-197.36c33.664-30.72 78.65-49.537 128.031-49.537 52.44 0 99.923 21.22 134.333 55.541l86.296 86.296c9.088 8.965 21.577 14.502 35.36 14.502s26.272-5.537 35.366-14.507l86.294-86.294c2-2 4.2-4 6.36-6v197.36c-33.664 30.72-78.65 49.537-128.031 49.537-52.44 0-99.923-21.22-134.333-55.541zM832 960h-128v-192h127.66l0.34-0.34v-639.32l-0.34-0.34h-127.66v-192h128c105.6 0 192 86.4 192 192v640c0 105.6-86.4 192-192 192zM320 128h-127.66l-0.34 0.34v639.32l0.34 0.34h127.66v192h-128c-105.6 0-192-86.4-192-192v-640c0-105.6 86.4-192 192-192h128v192z" />
|
||||
<glyph unicode="󡄩" glyph-name="icon-box-with-dashed-lines" d="M0 576h128v-256h-128v256zM128 831.78l0.22 0.22h191.78v128h-192c-70.606-0.215-127.785-57.394-128-127.979v-192.021h128v191.78zM128 64.22v191.78h-128v-192c0.215-70.606 57.394-127.785 127.979-128h192.021v128h-191.78zM384 960h256v-128h-256v128zM896 64.22l-0.22-0.22h-191.78v-128h192c70.606 0.215 127.785 57.394 128 127.979v192.021h-128v-191.78zM896 960h-192v-128h191.78l0.22-0.22v-191.78h128v192c-0.215 70.606-57.394 127.785-127.979 128zM896 576h128v-256h-128v256zM384 64h256v-128h-256v128zM256 704h512v-512h-512v512z" />
|
||||
</font></defs></svg>
|
||||
<glyph unicode="󡄰" glyph-name="icon-summary-widget" d="M896 960h-768c-70.4 0-128-57.6-128-128v-768c0-70.4 57.6-128 128-128h768c70.4 0 128 57.6 128 128v768c0 70.4-57.6 128-128 128zM847.8 349.6l-82.6-143.2-189.6 131.6 19.2-230h-165.4l19.2 230-189.6-131.6-82.6 143.2 208.6 98.4-208.8 98.4 82.6 143.2 189.6-131.6-19.2 230h165.4l-19.2-230 189.6 131.6 82.6-143.2-208.6-98.4 208.8-98.4z" />
|
||||
</font></defs></svg>
|
||||
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 44 KiB |
Binary file not shown.
Binary file not shown.
@@ -21,7 +21,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/********************************************* COLUMN LAYOUTS STYLES */
|
||||
/*@mixin cols($totalCols, $span) {
|
||||
@mixin cols($totalCols, $span) {
|
||||
$cw: 100% / $totalCols;
|
||||
min-width: (500px / $totalCols) * $span;
|
||||
@if ($totalCols != $span) {
|
||||
@@ -89,7 +89,7 @@
|
||||
@include clearfix;
|
||||
padding: $interiorMargin 0;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
/********************************************* FLEX STYLES */
|
||||
.l-flex-row,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/************************** FEATURES */
|
||||
$enableImageryThumbs: false; // Set to true if historical imagery thumbnails are supported
|
||||
$enableImageryThumbs: true; // Set to true if historical imagery thumbnails are supported
|
||||
|
||||
/************************** VERY INFLUENTIAL GLOBAL DIMENSIONS */
|
||||
$bodyMargin: 10px;
|
||||
@@ -82,7 +82,7 @@ $tabularTdPadTB: 2px;
|
||||
/*************** Imagery */
|
||||
$imageMainControlBarH: 25px;
|
||||
$imageThumbsD: 120px;
|
||||
$imageThumbsWrapperH: $imageThumbsD * 1.4;
|
||||
$imageThumbsWrapperH: 155px;
|
||||
$imageThumbPad: 1px;
|
||||
/*************** Ticks */
|
||||
$ticksH: 25px;
|
||||
|
||||
@@ -21,32 +21,11 @@
|
||||
*****************************************************************************/
|
||||
.t-fixed-position {
|
||||
&.l-fixed-position {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
|
||||
.l-grid-holder {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
.l-grid {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
@extend .abs;
|
||||
}
|
||||
|
||||
.l-fixed-position-item {
|
||||
position: absolute;
|
||||
border: 1px solid transparent;
|
||||
|
||||
&.s-not-selected {
|
||||
opacity: 0.8;
|
||||
}
|
||||
@@ -105,37 +84,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.l-fixed-position-item-handle {
|
||||
$brd: 1px solid $colorKey;
|
||||
background: rgba($colorKey, 0.5);
|
||||
cursor: crosshair;
|
||||
border: $brd;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
.edit-mode .t-fixed-position {
|
||||
&.l-fixed-position {
|
||||
.l-grid-holder {
|
||||
.l-grid {
|
||||
&.l-grid-x {
|
||||
@include bgTicks($colorGridLines, 'x');
|
||||
}
|
||||
|
||||
&.l-grid-y {
|
||||
@include bgTicks($colorGridLines, 'y');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.l-fixed-position-item {
|
||||
&:not(.s-selected) {
|
||||
border: 1px dotted rgba($colorKey, 0.75);
|
||||
&:hover {
|
||||
border: 1px dotted rgba($colorKey, 1.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
.s-status-editing {
|
||||
.l-fixed-position-item-handle.edit-corner { display: block; }
|
||||
}
|
||||
|
||||
@@ -81,12 +81,6 @@ input, textarea {
|
||||
letter-spacing: inherit;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="search"] {
|
||||
vertical-align: baseline;
|
||||
padding: $inputTextP;
|
||||
}
|
||||
|
||||
h1, h2, h3 {
|
||||
letter-spacing: 0.04em;
|
||||
margin: 0;
|
||||
|
||||
@@ -1,10 +1,38 @@
|
||||
@mixin glyph($unicode, $family: 'symbolsfont') {
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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.
|
||||
*****************************************************************************/
|
||||
@mixin glyphBefore($unicode, $family: 'symbolsfont') {
|
||||
&:before {
|
||||
content: $unicode;
|
||||
font-family: $family;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin glyphAfter($unicode, $family: 'symbolsfont') {
|
||||
&:after {
|
||||
content: $unicode;
|
||||
font-family: $family;
|
||||
}
|
||||
}
|
||||
|
||||
/************************** CHAR UNICODES */
|
||||
|
||||
$glyph-icon-alert-rect: '\e900';
|
||||
@@ -37,6 +65,8 @@ $glyph-icon-plus: '\e926';
|
||||
$glyph-icon-trash: '\e927';
|
||||
$glyph-icon-x: '\e928';
|
||||
$glyph-icon-brackets: '\e929';
|
||||
$glyph-icon-crosshair: '\e930';
|
||||
$glyph-icon-grippy: '\e931';
|
||||
$glyph-icon-arrows-out: '\e1000';
|
||||
$glyph-icon-arrows-right-left: '\e1001';
|
||||
$glyph-icon-arrows-up-down: '\e1002';
|
||||
@@ -78,6 +108,13 @@ $glyph-icon-x-in-circle: '\e1038';
|
||||
$glyph-icon-brightness: '\e1039';
|
||||
$glyph-icon-contrast: '\e1040';
|
||||
$glyph-icon-expand: '\e1041';
|
||||
$glyph-icon-list-view: '\e1042';
|
||||
$glyph-icon-grid-snap-to: '\e1043';
|
||||
$glyph-icon-grid-snap-no: '\e1044';
|
||||
$glyph-icon-frame-show: '\e1045';
|
||||
$glyph-icon-frame-hide: '\e1046';
|
||||
$glyph-icon-import: '\e1047';
|
||||
$glyph-icon-export: '\e1048';
|
||||
$glyph-icon-activity: '\e1100';
|
||||
$glyph-icon-activity-mode: '\e1101';
|
||||
$glyph-icon-autoflow-tabular: '\e1102';
|
||||
@@ -108,114 +145,122 @@ $glyph-icon-timeline: '\e1126';
|
||||
$glyph-icon-timer: '\e1127';
|
||||
$glyph-icon-topic: '\e1128';
|
||||
$glyph-icon-box-with-dashed-lines: '\e1129';
|
||||
$glyph-icon-summary-widget: '\e1130';
|
||||
|
||||
/************************** 16 PX CLASSES */
|
||||
|
||||
.icon-alert-rect { @include glyph($glyph-icon-alert-rect); }
|
||||
.icon-alert-triangle { @include glyph($glyph-icon-alert-triangle); }
|
||||
.icon-arrow-down { @include glyph($glyph-icon-arrow-down); }
|
||||
.icon-arrow-left { @include glyph($glyph-icon-arrow-left); }
|
||||
.icon-arrow-right { @include glyph($glyph-icon-arrow-right); }
|
||||
.icon-arrow-double-up { @include glyph($glyph-icon-arrow-double-up); }
|
||||
.icon-arrow-tall-up { @include glyph($glyph-icon-arrow-tall-up); }
|
||||
.icon-arrow-tall-down { @include glyph($glyph-icon-arrow-tall-down); }
|
||||
.icon-arrow-double-down { @include glyph($glyph-icon-arrow-double-down); }
|
||||
.icon-arrow-up { @include glyph($glyph-icon-arrow-up); }
|
||||
.icon-asterisk { @include glyph($glyph-icon-asterisk); }
|
||||
.icon-bell { @include glyph($glyph-icon-bell); }
|
||||
.icon-box { @include glyph($glyph-icon-box); }
|
||||
.icon-box-with-arrow { @include glyph($glyph-icon-box-with-arrow); }
|
||||
.icon-check { @include glyph($glyph-icon-check); }
|
||||
.icon-connectivity { @include glyph($glyph-icon-connectivity); }
|
||||
.icon-database-in-brackets { @include glyph($glyph-icon-database-in-brackets); }
|
||||
.icon-eye-open { @include glyph($glyph-icon-eye-open); }
|
||||
.icon-gear { @include glyph($glyph-icon-gear); }
|
||||
.icon-hourglass { @include glyph($glyph-icon-hourglass); }
|
||||
.icon-info { @include glyph($glyph-icon-info); }
|
||||
.icon-link { @include glyph($glyph-icon-link); }
|
||||
.icon-lock { @include glyph($glyph-icon-lock); }
|
||||
.icon-minus { @include glyph($glyph-icon-minus); }
|
||||
.icon-people { @include glyph($glyph-icon-people); }
|
||||
.icon-person { @include glyph($glyph-icon-person); }
|
||||
.icon-plus { @include glyph($glyph-icon-plus); }
|
||||
.icon-trash { @include glyph($glyph-icon-trash); }
|
||||
.icon-x { @include glyph($glyph-icon-x); }
|
||||
.icon-brackets { @include glyph($glyph-icon-brackets); }
|
||||
.icon-arrows-out { @include glyph($glyph-icon-arrows-out); }
|
||||
.icon-arrows-right-left { @include glyph($glyph-icon-arrows-right-left); }
|
||||
.icon-arrows-up-down { @include glyph($glyph-icon-arrows-up-down); }
|
||||
.icon-bullet { @include glyph($glyph-icon-bullet); }
|
||||
.icon-calendar { @include glyph($glyph-icon-calendar); }
|
||||
.icon-chain-links { @include glyph($glyph-icon-chain-links); }
|
||||
.icon-collapse-pane-left { @include glyph($glyph-icon-collapse-pane-left); }
|
||||
.icon-collapse-pane-right { @include glyph($glyph-icon-collapse-pane-right); }
|
||||
.icon-download { @include glyph($glyph-icon-download); }
|
||||
.icon-duplicate { @include glyph($glyph-icon-duplicate); }
|
||||
.icon-folder-new { @include glyph($glyph-icon-folder-new); }
|
||||
.icon-fullscreen-collapse { @include glyph($glyph-icon-fullscreen-collapse); }
|
||||
.icon-fullscreen-expand { @include glyph($glyph-icon-fullscreen-expand); }
|
||||
.icon-layers { @include glyph($glyph-icon-layers); }
|
||||
.icon-line-horz { @include glyph($glyph-icon-line-horz); }
|
||||
.icon-magnify { @include glyph($glyph-icon-magnify); }
|
||||
.icon-magnify-in { @include glyph($glyph-icon-magnify-in); }
|
||||
.icon-magnify-out { @include glyph($glyph-icon-magnify-out); }
|
||||
.icon-menu-hamburger { @include glyph($glyph-icon-menu-hamburger); }
|
||||
.icon-move { @include glyph($glyph-icon-move); }
|
||||
.icon-new-window { @include glyph($glyph-icon-new-window); }
|
||||
.icon-paint-bucket { @include glyph($glyph-icon-paint-bucket); }
|
||||
.icon-pause { @include glyph($glyph-icon-pause); }
|
||||
.icon-pencil { @include glyph($glyph-icon-pencil); }
|
||||
.icon-play { @include glyph($glyph-icon-play); }
|
||||
.icon-plot-resource { @include glyph($glyph-icon-plot-resource); }
|
||||
.icon-pointer-left { @include glyph($glyph-icon-pointer-left); }
|
||||
.icon-pointer-right { @include glyph($glyph-icon-pointer-right); }
|
||||
.icon-refresh { @include glyph($glyph-icon-refresh); }
|
||||
.icon-save { @include glyph($glyph-icon-save); }
|
||||
.icon-sine { @include glyph($glyph-icon-sine); }
|
||||
.icon-T { @include glyph($glyph-icon-T); }
|
||||
.icon-thumbs-strip { @include glyph($glyph-icon-thumbs-strip); }
|
||||
.icon-two-parts-both { @include glyph($glyph-icon-two-parts-both); }
|
||||
.icon-two-parts-one-only { @include glyph($glyph-icon-two-parts-one-only); }
|
||||
.icon-resync { @include glyph($glyph-icon-resync); }
|
||||
.icon-reset { @include glyph($glyph-icon-reset); }
|
||||
.icon-x-in-circle { @include glyph($glyph-icon-x-in-circle); }
|
||||
.icon-brightness { @include glyph($glyph-icon-brightness); }
|
||||
.icon-contrast { @include glyph($glyph-icon-contrast); }
|
||||
.icon-expand { @include glyph($glyph-icon-expand); }
|
||||
.icon-activity { @include glyph($glyph-icon-activity); }
|
||||
.icon-activity-mode { @include glyph($glyph-icon-activity-mode); }
|
||||
.icon-autoflow-tabular { @include glyph($glyph-icon-autoflow-tabular); }
|
||||
.icon-clock { @include glyph($glyph-icon-clock); }
|
||||
.icon-database { @include glyph($glyph-icon-database); }
|
||||
.icon-database-query { @include glyph($glyph-icon-database-query); }
|
||||
.icon-dataset { @include glyph($glyph-icon-dataset); }
|
||||
.icon-datatable { @include glyph($glyph-icon-datatable); }
|
||||
.icon-dictionary { @include glyph($glyph-icon-dictionary); }
|
||||
.icon-folder { @include glyph($glyph-icon-folder); }
|
||||
.icon-image { @include glyph($glyph-icon-image); }
|
||||
.icon-layout { @include glyph($glyph-icon-layout); }
|
||||
.icon-object { @include glyph($glyph-icon-object); }
|
||||
.icon-object-unknown { @include glyph($glyph-icon-object-unknown); }
|
||||
.icon-packet { @include glyph($glyph-icon-packet); }
|
||||
.icon-page { @include glyph($glyph-icon-page); }
|
||||
.icon-plot-overlay { @include glyph($glyph-icon-plot-overlay); }
|
||||
.icon-plot-stacked { @include glyph($glyph-icon-plot-stacked); }
|
||||
.icon-session { @include glyph($glyph-icon-session); }
|
||||
.icon-tabular { @include glyph($glyph-icon-tabular); }
|
||||
.icon-tabular-lad { @include glyph($glyph-icon-tabular-lad); }
|
||||
.icon-tabular-lad-set { @include glyph($glyph-icon-tabular-lad-set); }
|
||||
.icon-tabular-realtime { @include glyph($glyph-icon-tabular-realtime); }
|
||||
.icon-tabular-scrolling { @include glyph($glyph-icon-tabular-scrolling); }
|
||||
.icon-telemetry { @include glyph($glyph-icon-telemetry); }
|
||||
.icon-telemetry-panel { @include glyph($glyph-icon-telemetry-panel); }
|
||||
.icon-timeline { @include glyph($glyph-icon-timeline); }
|
||||
.icon-timer { @include glyph($glyph-icon-timer); }
|
||||
.icon-topic { @include glyph($glyph-icon-topic); }
|
||||
.icon-box-with-dashed-lines { @include glyph($glyph-icon-box-with-dashed-lines); }
|
||||
.icon-alert-rect { @include glyphBefore($glyph-icon-alert-rect); }
|
||||
.icon-alert-triangle { @include glyphBefore($glyph-icon-alert-triangle); }
|
||||
.icon-arrow-down { @include glyphBefore($glyph-icon-arrow-down); }
|
||||
.icon-arrow-left { @include glyphBefore($glyph-icon-arrow-left); }
|
||||
.icon-arrow-right { @include glyphBefore($glyph-icon-arrow-right); }
|
||||
.icon-arrow-double-up { @include glyphBefore($glyph-icon-arrow-double-up); }
|
||||
.icon-arrow-tall-up { @include glyphBefore($glyph-icon-arrow-tall-up); }
|
||||
.icon-arrow-tall-down { @include glyphBefore($glyph-icon-arrow-tall-down); }
|
||||
.icon-arrow-double-down { @include glyphBefore($glyph-icon-arrow-double-down); }
|
||||
.icon-arrow-up { @include glyphBefore($glyph-icon-arrow-up); }
|
||||
.icon-asterisk { @include glyphBefore($glyph-icon-asterisk); }
|
||||
.icon-bell { @include glyphBefore($glyph-icon-bell); }
|
||||
.icon-box { @include glyphBefore($glyph-icon-box); }
|
||||
.icon-box-with-arrow { @include glyphBefore($glyph-icon-box-with-arrow); }
|
||||
.icon-check { @include glyphBefore($glyph-icon-check); }
|
||||
.icon-connectivity { @include glyphBefore($glyph-icon-connectivity); }
|
||||
.icon-database-in-brackets { @include glyphBefore($glyph-icon-database-in-brackets); }
|
||||
.icon-eye-open { @include glyphBefore($glyph-icon-eye-open); }
|
||||
.icon-gear { @include glyphBefore($glyph-icon-gear); }
|
||||
.icon-hourglass { @include glyphBefore($glyph-icon-hourglass); }
|
||||
.icon-info { @include glyphBefore($glyph-icon-info); }
|
||||
.icon-link { @include glyphBefore($glyph-icon-link); }
|
||||
.icon-lock { @include glyphBefore($glyph-icon-lock); }
|
||||
.icon-minus { @include glyphBefore($glyph-icon-minus); }
|
||||
.icon-people { @include glyphBefore($glyph-icon-people); }
|
||||
.icon-person { @include glyphBefore($glyph-icon-person); }
|
||||
.icon-plus { @include glyphBefore($glyph-icon-plus); }
|
||||
.icon-trash { @include glyphBefore($glyph-icon-trash); }
|
||||
.icon-x { @include glyphBefore($glyph-icon-x); }
|
||||
.icon-brackets { @include glyphBefore($glyph-icon-brackets); }
|
||||
.icon-crosshair { @include glyphBefore($glyph-icon-crosshair); }
|
||||
.icon-grippy { @include glyphBefore($glyph-icon-grippy); }
|
||||
.icon-arrows-out { @include glyphBefore($glyph-icon-arrows-out); }
|
||||
.icon-arrows-right-left { @include glyphBefore($glyph-icon-arrows-right-left); }
|
||||
.icon-arrows-up-down { @include glyphBefore($glyph-icon-arrows-up-down); }
|
||||
.icon-bullet { @include glyphBefore($glyph-icon-bullet); }
|
||||
.icon-calendar { @include glyphBefore($glyph-icon-calendar); }
|
||||
.icon-chain-links { @include glyphBefore($glyph-icon-chain-links); }
|
||||
.icon-collapse-pane-left { @include glyphBefore($glyph-icon-collapse-pane-left); }
|
||||
.icon-collapse-pane-right { @include glyphBefore($glyph-icon-collapse-pane-right); }
|
||||
.icon-download { @include glyphBefore($glyph-icon-download); }
|
||||
.icon-duplicate { @include glyphBefore($glyph-icon-duplicate); }
|
||||
.icon-folder-new { @include glyphBefore($glyph-icon-folder-new); }
|
||||
.icon-fullscreen-collapse { @include glyphBefore($glyph-icon-fullscreen-collapse); }
|
||||
.icon-fullscreen-expand { @include glyphBefore($glyph-icon-fullscreen-expand); }
|
||||
.icon-layers { @include glyphBefore($glyph-icon-layers); }
|
||||
.icon-line-horz { @include glyphBefore($glyph-icon-line-horz); }
|
||||
.icon-magnify { @include glyphBefore($glyph-icon-magnify); }
|
||||
.icon-magnify-in { @include glyphBefore($glyph-icon-magnify-in); }
|
||||
.icon-magnify-out { @include glyphBefore($glyph-icon-magnify-out); }
|
||||
.icon-menu-hamburger { @include glyphBefore($glyph-icon-menu-hamburger); }
|
||||
.icon-move { @include glyphBefore($glyph-icon-move); }
|
||||
.icon-new-window { @include glyphBefore($glyph-icon-new-window); }
|
||||
.icon-paint-bucket { @include glyphBefore($glyph-icon-paint-bucket); }
|
||||
.icon-pause { @include glyphBefore($glyph-icon-pause); }
|
||||
.icon-pencil { @include glyphBefore($glyph-icon-pencil); }
|
||||
.icon-play { @include glyphBefore($glyph-icon-play); }
|
||||
.icon-plot-resource { @include glyphBefore($glyph-icon-plot-resource); }
|
||||
.icon-pointer-left { @include glyphBefore($glyph-icon-pointer-left); }
|
||||
.icon-pointer-right { @include glyphBefore($glyph-icon-pointer-right); }
|
||||
.icon-refresh { @include glyphBefore($glyph-icon-refresh); }
|
||||
.icon-save { @include glyphBefore($glyph-icon-save); }
|
||||
.icon-sine { @include glyphBefore($glyph-icon-sine); }
|
||||
.icon-T { @include glyphBefore($glyph-icon-T); }
|
||||
.icon-thumbs-strip { @include glyphBefore($glyph-icon-thumbs-strip); }
|
||||
.icon-two-parts-both { @include glyphBefore($glyph-icon-two-parts-both); }
|
||||
.icon-two-parts-one-only { @include glyphBefore($glyph-icon-two-parts-one-only); }
|
||||
.icon-resync { @include glyphBefore($glyph-icon-resync); }
|
||||
.icon-reset { @include glyphBefore($glyph-icon-reset); }
|
||||
.icon-x-in-circle { @include glyphBefore($glyph-icon-x-in-circle); }
|
||||
.icon-brightness { @include glyphBefore($glyph-icon-brightness); }
|
||||
.icon-contrast { @include glyphBefore($glyph-icon-contrast); }
|
||||
.icon-expand { @include glyphBefore($glyph-icon-expand); }
|
||||
.icon-list-view { @include glyphBefore($glyph-icon-list-view); }
|
||||
.icon-grid-snap-to { @include glyphBefore($glyph-icon-grid-snap-to); }
|
||||
.icon-grid-snap-no { @include glyphBefore($glyph-icon-grid-snap-no); }
|
||||
.icon-frame-show { @include glyphBefore($glyph-icon-frame-show); }
|
||||
.icon-frame-hide { @include glyphBefore($glyph-icon-frame-hide); }
|
||||
.icon-import { @include glyphBefore($glyph-icon-import); }
|
||||
.icon-export { @include glyphBefore($glyph-icon-export); }
|
||||
.icon-activity { @include glyphBefore($glyph-icon-activity); }
|
||||
.icon-activity-mode { @include glyphBefore($glyph-icon-activity-mode); }
|
||||
.icon-autoflow-tabular { @include glyphBefore($glyph-icon-autoflow-tabular); }
|
||||
.icon-clock { @include glyphBefore($glyph-icon-clock); }
|
||||
.icon-database { @include glyphBefore($glyph-icon-database); }
|
||||
.icon-database-query { @include glyphBefore($glyph-icon-database-query); }
|
||||
.icon-dataset { @include glyphBefore($glyph-icon-dataset); }
|
||||
.icon-datatable { @include glyphBefore($glyph-icon-datatable); }
|
||||
.icon-dictionary { @include glyphBefore($glyph-icon-dictionary); }
|
||||
.icon-folder { @include glyphBefore($glyph-icon-folder); }
|
||||
.icon-image { @include glyphBefore($glyph-icon-image); }
|
||||
.icon-layout { @include glyphBefore($glyph-icon-layout); }
|
||||
.icon-object { @include glyphBefore($glyph-icon-object); }
|
||||
.icon-object-unknown { @include glyphBefore($glyph-icon-object-unknown); }
|
||||
.icon-packet { @include glyphBefore($glyph-icon-packet); }
|
||||
.icon-page { @include glyphBefore($glyph-icon-page); }
|
||||
.icon-plot-overlay { @include glyphBefore($glyph-icon-plot-overlay); }
|
||||
.icon-plot-stacked { @include glyphBefore($glyph-icon-plot-stacked); }
|
||||
.icon-session { @include glyphBefore($glyph-icon-session); }
|
||||
.icon-tabular { @include glyphBefore($glyph-icon-tabular); }
|
||||
.icon-tabular-lad { @include glyphBefore($glyph-icon-tabular-lad); }
|
||||
.icon-tabular-lad-set { @include glyphBefore($glyph-icon-tabular-lad-set); }
|
||||
.icon-tabular-realtime { @include glyphBefore($glyph-icon-tabular-realtime); }
|
||||
.icon-tabular-scrolling { @include glyphBefore($glyph-icon-tabular-scrolling); }
|
||||
.icon-telemetry { @include glyphBefore($glyph-icon-telemetry); }
|
||||
.icon-telemetry-panel { @include glyphBefore($glyph-icon-telemetry-panel); }
|
||||
.icon-timeline { @include glyphBefore($glyph-icon-timeline); }
|
||||
.icon-timer { @include glyphBefore($glyph-icon-timer); }
|
||||
.icon-topic { @include glyphBefore($glyph-icon-topic); }
|
||||
.icon-box-with-dashed-lines { @include glyphBefore($glyph-icon-box-with-dashed-lines); }
|
||||
.icon-summary-widget { @include glyphBefore($glyph-icon-summary-widget); }
|
||||
|
||||
/************************** 12 PX CLASSES */
|
||||
|
||||
.icon-eye-open-12px { @include glyph($glyph-icon-eye-open,'symbolsfont-12px'); }
|
||||
.icon-collapse-pane-left-12px { @include glyph($glyph-icon-collapse-pane-left,'symbolsfont-12px'); }
|
||||
.icon-collapse-pane-right-12px { @include glyph($glyph-icon-collapse-pane-right,'symbolsfont-12px'); }
|
||||
.icon-folder-12px { @include glyph($glyph-icon-folder,'symbolsfont-12px'); }
|
||||
.icon-crosshair-12px { @include glyphBefore($glyph-icon-crosshair,'symbolsfont-12px'); }
|
||||
.icon-folder-12px { @include glyphBefore($glyph-icon-folder,'symbolsfont-12px'); }
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
@mixin limitGlyph($iconColor, $glyph: $glyph-icon-alert-triangle) {
|
||||
&:before {
|
||||
color: $iconColor;
|
||||
content: $glyph;
|
||||
font-family: symbolsfont;
|
||||
font-size: 0.8em;
|
||||
display: inline;
|
||||
margin-right: $interiorMarginSm;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.s-limit-red { background: $colorLimitRedBg !important; }
|
||||
.s-limit-yellow { background: $colorLimitYellowBg !important; }
|
||||
|
||||
// Handle limit when applied to a tr
|
||||
tr[class*="s-limit"] {
|
||||
&.s-limit-red td:first-child {
|
||||
@include limitGlyph($colorLimitRedIc);
|
||||
}
|
||||
&.s-limit-yellow td:first-child {
|
||||
@include limitGlyph($colorLimitYellowIc);
|
||||
}
|
||||
&.s-limit-upr td:first-child:before { content: $glyph-icon-arrow-double-up; }
|
||||
&.s-limit-lwr td:first-child:before { content: $glyph-icon-arrow-double-down; }
|
||||
}
|
||||
|
||||
// Handle limit when applied directly to a non-tr element
|
||||
// Assume this is applied to the element that displays the limit value
|
||||
:not(tr)[class*="s-limit"] {
|
||||
&.s-limit-red {
|
||||
@include limitGlyph($colorLimitRedIc);
|
||||
}
|
||||
&.s-limit-yellow {
|
||||
@include limitGlyph($colorLimitYellowIc);
|
||||
}
|
||||
&.s-limit-upr:before { content: $glyph-icon-arrow-double-up; }
|
||||
&.s-limit-lwr:before { content: $glyph-icon-arrow-double-down; }
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
@import "about";
|
||||
@import "text";
|
||||
@import "icons";
|
||||
@import "limits";
|
||||
@import "status";
|
||||
@import "data-status";
|
||||
@import "helpers/bubbles";
|
||||
@import "helpers/splitter";
|
||||
@@ -58,7 +58,6 @@
|
||||
@import "search/search";
|
||||
@import "mobile/search/search";
|
||||
@import "overlay/overlay";
|
||||
@import "mobile/overlay/overlay";
|
||||
@import "tree/tree";
|
||||
@import "object-label";
|
||||
@import "mobile/tree";
|
||||
|
||||
@@ -285,13 +285,14 @@
|
||||
|
||||
@mixin containerBase($bg: $colorBodyBg, $fg: $colorBodyFg) {
|
||||
background-color: $bg;
|
||||
border-radius: $controlCr;
|
||||
//border-radius: $controlCr;
|
||||
box-sizing: border-box;
|
||||
color: $fg;
|
||||
}
|
||||
|
||||
@mixin btnBase($bg: $colorBtnBg, $bgHov: $colorBtnBgHov, $fg: $colorBtnFg, $fgHov: $colorBtnFgHov, $ic: $colorBtnIcon, $icHov: $colorBtnIconHov) {
|
||||
@include user-select(none);
|
||||
border-radius: $controlCr;
|
||||
color: $fg;
|
||||
.icon,
|
||||
&:before {
|
||||
|
||||
86
platform/commonUI/general/res/sass/_status.scss
Normal file
86
platform/commonUI/general/res/sass/_status.scss
Normal file
@@ -0,0 +1,86 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2017, 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.
|
||||
*****************************************************************************/
|
||||
/*************************************************** MIXINS */
|
||||
@mixin formulateStatusColors($c) {
|
||||
// Sets bg and icon colors for elements
|
||||
background: rgba($c, 0.4) !important;
|
||||
&:before { color: $c !important; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************** GENERAL */
|
||||
.s-limit-yellow,
|
||||
.s-limit-red,
|
||||
.s-limit-yellow-icon,
|
||||
.s-limit-red-icon,
|
||||
.s-status-warning-lo,
|
||||
.s-status-warning-hi,
|
||||
.s-status-diagnostic,
|
||||
.s-status-command,
|
||||
.s-status-info,
|
||||
.s-status-ok,
|
||||
.s-status-warning-lo-icon,
|
||||
.s-status-warning-hi-icon,
|
||||
.s-status-diagnostic-icon,
|
||||
.s-status-command-icon,
|
||||
.s-status-info-icon,
|
||||
.s-status-ok-icon {
|
||||
@include trans-prop-nice($props: background, $dur: 500ms);
|
||||
&:before {
|
||||
content:'';
|
||||
font-family: symbolsfont;
|
||||
font-size: 0.8em;
|
||||
display: inline;
|
||||
margin-right: $interiorMarginSm;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************************************************** LIMITS */
|
||||
.s-limit-yellow, .s-limit-yellow-icon {
|
||||
@include formulateStatusColors($colorWarningLo);
|
||||
}
|
||||
|
||||
.s-limit-red, .s-limit-red-icon {
|
||||
@include formulateStatusColors($colorWarningHi);
|
||||
}
|
||||
|
||||
.s-limit-upr:before { content: $glyph-icon-arrow-double-up; }
|
||||
.s-limit-lwr:before { content: $glyph-icon-arrow-double-down; }
|
||||
.s-limit-yellow-icon:before,
|
||||
.s-limit-red-icon:before { content: $glyph-icon-alert-triangle; }
|
||||
|
||||
/*************************************************** STATUS */
|
||||
.s-status-warning-hi, .s-status-warning-hi-icon { @include formulateStatusColors($colorWarningHi); }
|
||||
.s-status-warning-lo, .s-status-warning-lo-icon { @include formulateStatusColors($colorWarningLo); }
|
||||
.s-status-diagnostic, .s-status-diagnostic-icon { @include formulateStatusColors($colorDiagnostic); }
|
||||
.s-status-info, .s-status-info-icon { @include formulateStatusColors($colorInfo); }
|
||||
.s-status-ok, .s-status-ok-icon { @include formulateStatusColors($colorOk); }
|
||||
|
||||
.s-status-warning-hi-icon:before { content: $glyph-icon-alert-triangle; }
|
||||
.s-status-warning-lo-icon:before { content: $glyph-icon-alert-rect; }
|
||||
.s-status-diagnostic-icon:before { content: $glyph-icon-eye-open; }
|
||||
.s-status-info-icon:before { content: $glyph-icon-info; }
|
||||
.s-status-ok-icon:before { content: $glyph-icon-check; }
|
||||
|
||||
|
||||
@@ -72,6 +72,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
.s-hyperlink {
|
||||
// Hyperlink objects
|
||||
&:not(.s-button) {
|
||||
color: $colorKey;
|
||||
font-size: 0.8rem;
|
||||
&:hover { color: $colorKeyHov; }
|
||||
}
|
||||
}
|
||||
|
||||
.s-icon-button {
|
||||
// Clickable icon elements that have hover
|
||||
@extend .ui-symbol;
|
||||
@@ -224,18 +233,28 @@ textarea {
|
||||
|
||||
/******************************************************** INPUTS */
|
||||
input[type="text"],
|
||||
input[type="search"] {
|
||||
input[type="search"],
|
||||
input[type="number"] {
|
||||
@include nice-input();
|
||||
vertical-align: baseline;
|
||||
padding: $inputTextP;
|
||||
&.numeric {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.l-input-sm {
|
||||
input[type="text"],
|
||||
input[type="search"],
|
||||
input[type="number"] {
|
||||
width: 50px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.l-input-lg input[type="text"],
|
||||
input[type="text"].lg { width: 100% !important; }
|
||||
.l-input-med input[type="text"],
|
||||
input[type="text"].med { width: 200px !important; }
|
||||
.l-input-sm input[type="text"],
|
||||
input[type="text"].sm { width: 50px !important; }
|
||||
.l-numeric input[type="text"],
|
||||
input[type="text"].numeric { text-align: right; }
|
||||
@@ -297,6 +316,40 @@ textarea.lg { position: relative; height: 300px; }
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************** AUTOCOMPLETE */
|
||||
.autocomplete {
|
||||
input {
|
||||
width: 226px;
|
||||
padding: 5px 0px 5px 7px;
|
||||
}
|
||||
.icon-arrow-down {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left: 210px;
|
||||
font-size: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.autocompleteOptions {
|
||||
border: 1px solid $colorFormLines;
|
||||
border-radius: 5px;
|
||||
width: 224px;
|
||||
max-height: 170px;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
li {
|
||||
border: 1px solid $colorFormLines;
|
||||
padding: 8px 0px 8px 5px;
|
||||
.optionText {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.optionPreSelected {
|
||||
background-color: $colorInspectorSectionHeaderBg;
|
||||
color: $colorInspectorSectionHeaderFg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************** OBJECT-HEADER */
|
||||
.object-header {
|
||||
font-size: 1em;
|
||||
@@ -651,10 +704,6 @@ textarea {
|
||||
}
|
||||
}
|
||||
|
||||
.view-switcher {
|
||||
@include trans-prop-nice-fade($controlFadeMs);
|
||||
}
|
||||
|
||||
/******************************************************** BROWSER ELEMENTS */
|
||||
body.desktop {
|
||||
::-webkit-scrollbar {
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
.context-menu-holder,
|
||||
.menu-holder {
|
||||
position: absolute;
|
||||
z-index: 70;
|
||||
z-index: 120;
|
||||
.context-menu-wrapper {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
@@ -273,7 +273,7 @@
|
||||
|
||||
.btn-bar.right .menu,
|
||||
.menus-to-left .menu {
|
||||
z-index: 79;
|
||||
z-index: 79;
|
||||
left: auto;
|
||||
right: 0;
|
||||
width: auto;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
// Status coloring
|
||||
.ok, .info {
|
||||
.status-indicator {
|
||||
color: $colorStatusInfo;
|
||||
color: $colorInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,15 +224,15 @@
|
||||
}
|
||||
&.ok,
|
||||
&.info {
|
||||
@include statusBannerColors($colorStatusInfo);
|
||||
@include statusBannerColors($colorInfo);
|
||||
}
|
||||
&.caution,
|
||||
&.warning,
|
||||
&.alert {
|
||||
@include statusBannerColors($colorStatusAlert);
|
||||
@include statusBannerColors($colorWarningLo);
|
||||
}
|
||||
&.error {
|
||||
@include statusBannerColors($colorStatusError);
|
||||
@include statusBannerColors($colorWarningHi);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,15 +248,15 @@
|
||||
|
||||
.message-severity-info .type-icon.message-type {
|
||||
@extend .icon-info;
|
||||
color: $colorStatusInfo;
|
||||
color: $colorInfo;
|
||||
}
|
||||
.message-severity-alert .type-icon.message-type {
|
||||
@extend .icon-bell;
|
||||
color: $colorStatusAlert;
|
||||
color: $colorWarningLo;
|
||||
}
|
||||
.message-severity-error .type-icon.message-type {
|
||||
@extend .icon-alert-rect;
|
||||
color: $colorStatusError;
|
||||
color: $colorWarningHi;
|
||||
}
|
||||
}
|
||||
/* Paths:
|
||||
@@ -311,6 +311,24 @@ body.desktop .t-message-single {
|
||||
}
|
||||
}
|
||||
|
||||
@include phonePortrait {
|
||||
.t-message-single {
|
||||
.l-message {
|
||||
@include flex-direction(column);
|
||||
.message-contents { margin-left: 0; }
|
||||
}
|
||||
.type-icon.message-type {
|
||||
margin-bottom: $interiorMarginLg;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bottom-bar {
|
||||
text-align: center !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Messages in list
|
||||
.t-message-list {
|
||||
@include messageBlock(32px);
|
||||
@@ -350,7 +368,6 @@ body.desktop .t-message-list {
|
||||
.s-unsynced {
|
||||
$c: $colorPausedBg;
|
||||
border: 1px solid $c;
|
||||
@include animTo($animName: pulsePaused, $propName: border-color, $propValStart: rgba($c, 0.8), $propValEnd: rgba($c, 0.5), $dur: $animPausedPulseDur, $dir: alternate, $count: infinite);
|
||||
}
|
||||
|
||||
.s-status-timeconductor-unsynced {
|
||||
|
||||
@@ -19,12 +19,24 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
.s-status-editing .l-object-wrapper,
|
||||
.edit-main {
|
||||
// .s-status-editing .l-object-wrapper is relevant to New Edit Mode;
|
||||
// .edit-main is legacy for old edit mode.
|
||||
$handleD: 15px;
|
||||
$cr: 5px;
|
||||
.t-edit-handle-holder { display: none; }
|
||||
|
||||
.l-grid-holder {
|
||||
display: none;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
.l-grid {
|
||||
@extend .abs;
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
&.l-grid-y { background-position: 0 1px; }
|
||||
}
|
||||
}
|
||||
|
||||
.s-status-editing {
|
||||
$handleD: 5px;
|
||||
.t-edit-handle-holder { display: block; }
|
||||
.edit-corner,
|
||||
.edit-handle {
|
||||
position: absolute;
|
||||
@@ -32,81 +44,59 @@
|
||||
}
|
||||
|
||||
.edit-corner {
|
||||
background: rgba($colorSelectableSelectedPrimary, 0.5);
|
||||
cursor: crosshair;
|
||||
display: none; // Hide by default
|
||||
border: 1px solid $colorSelectableSelectedPrimary;
|
||||
width: $handleD;
|
||||
height: $handleD;
|
||||
$o: (-1 * $handleD) + 1px;
|
||||
&:hover {
|
||||
z-index: 11;
|
||||
}
|
||||
&.edit-resize-nw {
|
||||
border-bottom-right-radius: $cr;
|
||||
cursor: nw-resize;
|
||||
top: 0; left: 0;
|
||||
}
|
||||
&.edit-resize-ne {
|
||||
border-bottom-left-radius: $cr;
|
||||
cursor: ne-resize;
|
||||
top: 0; right: 0;
|
||||
}
|
||||
&.edit-resize-se {
|
||||
border-top-left-radius: $cr;
|
||||
cursor: se-resize;
|
||||
bottom: 0; right: 0;
|
||||
}
|
||||
&.edit-resize-sw {
|
||||
border-top-right-radius: $cr;
|
||||
cursor: sw-resize;
|
||||
bottom: 0; left: 0;
|
||||
}
|
||||
|
||||
&.edit-resize-nw { top: $o; left: $o; }
|
||||
&.edit-resize-ne { top: $o; right: $o; }
|
||||
&.edit-resize-se { bottom: $o; right: $o; }
|
||||
&.edit-resize-sw { bottom: $o; left: $o; }
|
||||
}
|
||||
|
||||
.edit-handle {
|
||||
top: $handleD; right: $handleD; bottom: $handleD; left: $handleD;
|
||||
&.edit-move {
|
||||
$m: 0; //$handleD;
|
||||
cursor: move;
|
||||
left: $m;
|
||||
right: $m;
|
||||
top: $m;
|
||||
bottom: $m;
|
||||
z-index: 1;
|
||||
|
||||
}
|
||||
&.edit-resize-n {
|
||||
top: 0px; bottom: auto;
|
||||
height: $handleD;
|
||||
cursor: n-resize;
|
||||
}
|
||||
&.edit-resize-e {
|
||||
right: 0px; left: auto;
|
||||
width: $handleD;
|
||||
cursor: e-resize;
|
||||
}
|
||||
&.edit-resize-s {
|
||||
bottom: 0px; top: auto;
|
||||
height: $handleD;
|
||||
cursor: s-resize;
|
||||
}
|
||||
&.edit-resize-w {
|
||||
left: 0px; right: auto;
|
||||
width: $handleD;
|
||||
cursor: w-resize;
|
||||
}
|
||||
.edit-handle.edit-move {
|
||||
// main move box for the whole frame element
|
||||
$m: 0;
|
||||
left: $m;
|
||||
right: $m;
|
||||
top: $m;
|
||||
bottom: $m;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.frame.child-frame.panel {
|
||||
&:hover {
|
||||
@include boxShdwLarge();
|
||||
border-color: $colorSelectableSelectedPrimary;
|
||||
.view-switcher {
|
||||
opacity: 1;
|
||||
}
|
||||
.edit-corner {
|
||||
background-color: rgba($colorKey, 0.8);
|
||||
&:hover {
|
||||
background-color: rgba($colorKey, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Editing Grids
|
||||
.l-grid-holder {
|
||||
display: block;
|
||||
.l-grid {
|
||||
&.l-grid-x { @include bgTicks($colorGridLines, 'x'); }
|
||||
&.l-grid-y { @include bgTicks($colorGridLines, 'y'); }
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent nested frames from showing their grids
|
||||
.t-frame-outer .l-grid-holder { display: none !important; }
|
||||
|
||||
// Prevent nested elements from showing s-hover-border
|
||||
.t-frame-outer .s-hover-border {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
// Prevent nested frames from being selectable until we have proper sub-object editing
|
||||
.t-frame-outer .t-frame-outer {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
@if $enableImageryThumbs == true {
|
||||
bottom: $interiorMargin*2 + $imageThumbsWrapperH;
|
||||
}
|
||||
min-height: 100px;
|
||||
min-width: 150px;
|
||||
.l-image-main {
|
||||
background-color: $colorPlotBg;
|
||||
@@ -22,7 +21,9 @@
|
||||
|
||||
.l-image-thumbs-wrapper {
|
||||
top: auto;
|
||||
height: $imageThumbsWrapperH;
|
||||
min-height: $imageThumbsWrapperH;
|
||||
max-height: 60%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.l-date,
|
||||
@@ -43,14 +44,16 @@
|
||||
.l-image-main-controlbar {
|
||||
font-size: 0.8em;
|
||||
line-height: inherit;
|
||||
.left, .right {
|
||||
.l-datetime-w, .l-controls-w {
|
||||
direction: rtl;
|
||||
overflow: hidden;
|
||||
}
|
||||
.left {
|
||||
.l-datetime-w {
|
||||
@include ellipsize();
|
||||
margin-right: $interiorMarginSm;
|
||||
text-align: left;
|
||||
}
|
||||
.right {
|
||||
.l-controls-w {
|
||||
z-index: 2;
|
||||
}
|
||||
.l-date,
|
||||
@@ -82,20 +85,26 @@
|
||||
/*************************************** THUMBS */
|
||||
|
||||
.l-image-thumbs-wrapper {
|
||||
//@include test(green);
|
||||
direction: rtl;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
padding-bottom: $interiorMargin;
|
||||
white-space: nowrap;
|
||||
z-index: 70;
|
||||
}
|
||||
|
||||
.l-image-thumb-item {
|
||||
@include transition(background-color, 0.25s);
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
direction: ltr;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
font-size: 0.8em;
|
||||
padding: 1px;
|
||||
position: relative;
|
||||
margin-left: $interiorMarginSm;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
width: $imageThumbsD + $imageThumbPad*2;
|
||||
white-space: normal;
|
||||
.l-thumb,
|
||||
.l-date,
|
||||
.l-time {
|
||||
@@ -105,16 +114,9 @@
|
||||
.l-time {
|
||||
padding: 2px 3px;
|
||||
}
|
||||
cursor: pointer;
|
||||
direction: ltr;
|
||||
display: inline-block;
|
||||
font-size: 0.8em;
|
||||
margin-left: $interiorMarginSm;
|
||||
text-align: left;
|
||||
width: $imageThumbsD + $imageThumbPad*2;
|
||||
white-space: normal;
|
||||
|
||||
&:hover {
|
||||
background: rgba(#fff, 0.2);
|
||||
background: $colorThumbHoverBg;
|
||||
.l-date,
|
||||
.l-time {
|
||||
color: #fff;
|
||||
@@ -138,6 +140,7 @@
|
||||
/*************************************** LOCAL CONTROLS */
|
||||
.l-local-controls {
|
||||
max-width: 200px;
|
||||
min-width: 100px;
|
||||
width: 35%;
|
||||
input[type="range"] {
|
||||
display: block;
|
||||
@@ -186,7 +189,8 @@
|
||||
/*************************************** WHEN IN FRAME */
|
||||
.frame .t-imagery {
|
||||
.l-image-main-wrapper {
|
||||
bottom: 0;
|
||||
bottom: 0 !important;
|
||||
height: 100% !important;
|
||||
.l-image-main-controlbar {
|
||||
font-size: 0.7em;
|
||||
}
|
||||
@@ -196,7 +200,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.l-image-thumbs-wrapper {
|
||||
.l-image-thumbs-wrapper,
|
||||
mct-splitter {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,36 @@
|
||||
.l-time-display {
|
||||
$transTime: 200ms;
|
||||
$controlSize: 14px;
|
||||
$control1ControlW: $controlSize + $interiorMargin;
|
||||
$control2ControlW: $control1ControlW * 2;
|
||||
line-height: 140%;
|
||||
&:hover {
|
||||
.l-btn.control {
|
||||
.l-btn.controls {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&.l-timer {
|
||||
.l-value:before,
|
||||
.control {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.l-value:before {
|
||||
// Direction +/- element
|
||||
font-size: $controlSize;
|
||||
margin-right: $interiorMarginSm;
|
||||
|
||||
}
|
||||
.control {
|
||||
.controls {
|
||||
@include trans-prop-nice((width, opacity), $transTime);
|
||||
font-size: $controlSize;
|
||||
line-height: inherit;
|
||||
margin-right: 0;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
.flex-elem {
|
||||
margin-right: $interiorMargin;
|
||||
}
|
||||
}
|
||||
&:hover .control {
|
||||
margin-right: $interiorMargin;
|
||||
&:hover .controls {
|
||||
opacity: 1;
|
||||
width: 1em;
|
||||
width: $control2ControlW;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +38,34 @@
|
||||
color: pullForward($colorBodyFg, 50%);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
// States
|
||||
&.s-state-stopped,
|
||||
&.s-state-paused {
|
||||
.l-value {
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
|
||||
&.s-state-started {
|
||||
.l-value {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&.s-state-stopped {
|
||||
// Hide Stop button, 1controlW
|
||||
.t-btn-stop {
|
||||
display: none;
|
||||
}
|
||||
&:hover .controls { width: $control1ControlW; }
|
||||
|
||||
}
|
||||
|
||||
&.s-state-paused {
|
||||
// Paused, do something visual
|
||||
.l-value {
|
||||
&:before { @extend .pulse; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,44 +19,40 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
@mixin labelValidate($sym, $c) {
|
||||
> .label {
|
||||
@include glyphAfter($sym);
|
||||
&:after {
|
||||
color: $c;
|
||||
margin-left: $interiorMargin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mct-form.validates {
|
||||
.form-row.validates {
|
||||
> .label {
|
||||
padding-right: $reqSymbolM; // Keep room for validation element
|
||||
&:before {
|
||||
position: absolute;
|
||||
right: $interiorMargin;
|
||||
&:after {
|
||||
font-size: $reqSymbolFontSize;
|
||||
height: 100%;
|
||||
line-height: 200%;
|
||||
|
||||
}
|
||||
}
|
||||
&.invalid,
|
||||
&.invalid.req {
|
||||
> .label {
|
||||
@extend .icon-x;
|
||||
&:before {
|
||||
color: $colorFormInvalid;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.invalid.req { @include labelValidate($glyph-icon-x, $colorFormInvalid); }
|
||||
|
||||
&.valid,
|
||||
&.valid.req {
|
||||
> .label {
|
||||
@extend .icon-check;
|
||||
&:before {
|
||||
color: $colorFormValid;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.req {
|
||||
> .label {
|
||||
@extend .icon-asterisk;
|
||||
&:before {
|
||||
color: $colorFormRequired;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.valid.req { @include labelValidate($glyph-icon-check, $colorFormValid); }
|
||||
|
||||
&.req { @include labelValidate($glyph-icon-asterisk, $colorFormRequired); }
|
||||
}
|
||||
}
|
||||
|
||||
body.desktop .form-row.validates > .label {
|
||||
&:after {
|
||||
position: absolute;
|
||||
right: $interiorMargin;
|
||||
height: 100%;
|
||||
line-height: 200%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,5 +132,33 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
table.list-view {
|
||||
$s: 1.2em;
|
||||
width: 100%;
|
||||
th, td {
|
||||
cursor: pointer;
|
||||
}
|
||||
tr:hover td {
|
||||
background-color: $colorItemBg;
|
||||
color: $colorItemFg;
|
||||
}
|
||||
td {
|
||||
$p: $interiorMargin;
|
||||
@include ellipsize;
|
||||
color: $colorItemFg;
|
||||
font-size: 1em;
|
||||
line-height: $s;
|
||||
max-width: 0;
|
||||
padding-top: $p;
|
||||
padding-bottom: $p;
|
||||
}
|
||||
.t-item-icon {
|
||||
font-size: $s;
|
||||
margin-right: $interiorMargin;
|
||||
}
|
||||
.t-title-label {
|
||||
@include ellipsize; // Yep, need it here too as well as the <td>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ body.mobile {
|
||||
}
|
||||
|
||||
.object-browse-bar {
|
||||
margin-left: 45px;
|
||||
&.t-primary { margin-left: 45px; }
|
||||
.context-available {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
@include phoneandtablet {
|
||||
.overlay {
|
||||
.clk-icon.close {
|
||||
top: $mobileOverlayMargin; right: $mobileOverlayMargin;
|
||||
}
|
||||
|
||||
> .holder {
|
||||
height: 90%; width: 90%;
|
||||
|
||||
> .contents {
|
||||
top: $mobileOverlayMargin;
|
||||
right: $mobileOverlayMargin;
|
||||
bottom: $mobileOverlayMargin;
|
||||
left: $mobileOverlayMargin;
|
||||
|
||||
.top-bar {
|
||||
> .title {
|
||||
margin-right: 1.2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include phone {
|
||||
.overlay > .holder {
|
||||
$m: 0;
|
||||
border-radius: $m;
|
||||
top: $m;
|
||||
right: $m;
|
||||
bottom: $m;
|
||||
left: $m;
|
||||
height: auto; width: auto;
|
||||
min-width: 200px; min-height: 200px;
|
||||
max-height: 100%; max-width: 100%;
|
||||
overflow: auto;
|
||||
@include transform(none);
|
||||
|
||||
.editor .form .form-row.l-flex-row {
|
||||
// Display elements in a columnar view
|
||||
@include flex-direction(column);
|
||||
> .flex-elem {
|
||||
&:not(:first-child) {
|
||||
margin-top: $interiorMargin;
|
||||
}
|
||||
&.label {
|
||||
width: 100%;
|
||||
}
|
||||
&.controls {
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&.validates > .label:before {
|
||||
position: relative;
|
||||
right: auto;
|
||||
line-height: inherit;
|
||||
margin-right: $interiorMargin;
|
||||
}
|
||||
}
|
||||
}
|
||||
.t-dialog-sm .overlay > .holder {
|
||||
height: auto; max-height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@include phonePortrait {
|
||||
.overlay > .holder {
|
||||
.contents .bottom-bar {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,11 +21,16 @@
|
||||
*****************************************************************************/
|
||||
|
||||
.overlay {
|
||||
font-size: 90%;
|
||||
&.delayEntry100ms {
|
||||
@include keyframes(fadeInFromNone) {
|
||||
0% { display: none; opacity: 0; }
|
||||
100% { display: block; opacity: 1; }
|
||||
0% {
|
||||
display: none;
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@include animation-delay($delayEntryMs);
|
||||
@include animation(fadeInFromNone $durEntryMs ease-in);
|
||||
@@ -35,29 +40,21 @@
|
||||
z-index: 100;
|
||||
}
|
||||
.close {
|
||||
font-size: 0.8rem;
|
||||
$d: $interiorMargin;
|
||||
opacity: 0.3;
|
||||
position: absolute;
|
||||
top: $interiorMarginLg;
|
||||
right: $interiorMarginLg;
|
||||
top: $d;
|
||||
right: $d;
|
||||
bottom: auto;
|
||||
left: auto;
|
||||
z-index: 100;
|
||||
&:hover {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
> .holder {
|
||||
@include containerSubtle($colorOvrBg, $colorOvrFg);
|
||||
border-radius: $basicCr * 3;
|
||||
color: $colorOvrFg;
|
||||
top: 50%;
|
||||
right: auto;
|
||||
bottom: auto;
|
||||
left: 50%;
|
||||
@include transform(translateX(-50%) translateY(-50%));
|
||||
height: 70%;
|
||||
width: 50%;
|
||||
min-height: 300px;
|
||||
min-width: 600px;
|
||||
z-index: 101;
|
||||
> .contents {
|
||||
|
||||
> .abs.outer-holder {
|
||||
z-index: 102;
|
||||
> .abs.inner-holder {
|
||||
$m: $overlayMargin;
|
||||
top: $m;
|
||||
right: $m;
|
||||
@@ -65,78 +62,186 @@
|
||||
left: $m;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
@include ellipsize();
|
||||
font-size: 1.2em;
|
||||
line-height: 120%;
|
||||
margin-bottom: $interiorMargin;
|
||||
}
|
||||
|
||||
.hint, .field-hints { color: $colorFieldHintOverlay !important; }
|
||||
|
||||
.abs.top-bar {
|
||||
height: $ovrTopBarH;
|
||||
}
|
||||
|
||||
.abs.editor,
|
||||
.abs.message-body {
|
||||
top: $ovrTopBarH + $interiorMarginLg;
|
||||
bottom: $ovrFooterH + $interiorMarginLg;
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow: auto;
|
||||
.field.l-input-med {
|
||||
input[type='text'] {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-bar {
|
||||
text-align: right;
|
||||
.s-button {
|
||||
$bg: $colorOvrBtnBg;
|
||||
&:not(.major) {
|
||||
@include btnSubtle($bg, pullForward($bg, 10%), $colorOvrBtnFg, $colorOvrBtnFg);
|
||||
}
|
||||
font-size: 95%;
|
||||
height: $ovrFooterH;
|
||||
line-height: $ovrFooterH;
|
||||
margin-left: $interiorMargin;
|
||||
margin-bottom: $interiorMarginSm;
|
||||
padding: 0 $interiorMargin * 3;
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
&:not(:last-child) {
|
||||
margin-right: $interiorMargin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Dialog boxes, size constrained and centered in desktop/tablet
|
||||
&.l-dialog {
|
||||
.s-button {
|
||||
&:not(.major) {
|
||||
@include btnSubtle($bg: $colorOvrBtnBg, $bgHov: pullForward($colorOvrBtnBg, 10%), $fg: $colorOvrBtnFg, $fgHov: $colorOvrBtnFg, $ic: $colorOvrBtnFg, $icHov: $colorOvrBtnFg);
|
||||
}
|
||||
}
|
||||
|
||||
> .abs.outer-holder {
|
||||
@include desktopandtablet {
|
||||
$max: 1280px;
|
||||
@include transform(translateX(-50%) translateY(-50%));
|
||||
border-radius: $overlayCr;
|
||||
top: 50%; right: auto; bottom: auto; left: 50%;
|
||||
width: 70%; height: 70%;
|
||||
min-width: 520px;
|
||||
max-width: $max; max-height: $max;
|
||||
}
|
||||
@include phone {
|
||||
overflow: auto;
|
||||
|
||||
.editor .form .form-row.l-flex-row {
|
||||
// Display elements in a columnar view
|
||||
@include flex-direction(column);
|
||||
> .flex-elem {
|
||||
&:not(:first-child) {
|
||||
margin-top: $interiorMargin;
|
||||
}
|
||||
&.label {
|
||||
width: 100%;
|
||||
}
|
||||
&.controls {
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&.validates > .label:before {
|
||||
position: relative;
|
||||
right: auto;
|
||||
line-height: inherit;
|
||||
margin-right: $interiorMargin;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include containerSubtle($colorOvrBg, $colorOvrFg);
|
||||
}
|
||||
|
||||
.title {
|
||||
@include ellipsize();
|
||||
font-size: 1.2em;
|
||||
line-height: 120%;
|
||||
margin-bottom: $interiorMargin;
|
||||
}
|
||||
|
||||
.hint, .field-hints {
|
||||
color: $colorFieldHintOverlay !important;
|
||||
}
|
||||
|
||||
.abs.top-bar {
|
||||
height: $ovrTopBarH;
|
||||
}
|
||||
|
||||
.abs.bottom-bar {
|
||||
top: auto;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: visible;
|
||||
height: $ovrFooterH;
|
||||
}
|
||||
|
||||
.abs.editor,
|
||||
.abs.message-body {
|
||||
top: $ovrTopBarH + $interiorMarginLg;
|
||||
bottom: $ovrFooterH + $interiorMarginLg;
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow: auto;
|
||||
.field.l-input-med {
|
||||
input[type='text'] {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.l-progress-bar {
|
||||
$h: $progressBarHOverlay;
|
||||
display: block;
|
||||
height: $h;
|
||||
line-height: $h;
|
||||
margin: .5em 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.select {
|
||||
box-shadow: $shdwBtnsOverlay;
|
||||
}
|
||||
}
|
||||
|
||||
.abs.bottom-bar {
|
||||
top: auto;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: visible;
|
||||
height: $ovrFooterH;
|
||||
// Large view overlays for mobile and desktop
|
||||
&.l-large-view {
|
||||
> .abs.outer-holder {
|
||||
@include keyframes(overlayIn) {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0, 0);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale(1.0, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@include animToParams(overlayIn, $dur: $durLargeViewExpand, $delay: 0);
|
||||
background: $colorBodyBg;
|
||||
z-index: 101;
|
||||
|
||||
.abs.inner-holder {
|
||||
opacity: 0;
|
||||
@include keyframes(contentsIn) {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
@include animToParams(contentsIn, $dur: 50ms, $delay: $durLargeViewExpand * 1.25);
|
||||
}
|
||||
|
||||
// Hide View Large button
|
||||
.t-btn-view-large {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// But show View Large button when it's nested inside a Layout
|
||||
.t-frame-inner .t-frame-inner .t-btn-view-large { display: block; }
|
||||
}
|
||||
}
|
||||
// When multiple Large Views are visible, hide the blocker for all but the first
|
||||
& + .l-large-view {
|
||||
.blocker {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
body.desktop {
|
||||
.overlay {
|
||||
> .abs.outer-holder {
|
||||
border-radius: $overlayCr;
|
||||
}
|
||||
|
||||
&.l-large-view {
|
||||
> .abs.outer-holder {
|
||||
width: 90%;
|
||||
height: 90%;
|
||||
top: 5%;
|
||||
left: 5%;
|
||||
@include boxShdwLarge();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.l-progress-bar {
|
||||
$h: $progressBarHOverlay;
|
||||
display: block;
|
||||
.t-dialog-sm .overlay > .outer-holder {
|
||||
// Used for blocker and in-progress dialogs, modal alerts, etc.
|
||||
$h: 225px;
|
||||
max-height: $h;
|
||||
height: $h;
|
||||
line-height: $h;
|
||||
margin: .5em 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.select {
|
||||
box-shadow: $shdwBtnsOverlay;
|
||||
}
|
||||
}
|
||||
|
||||
.t-dialog-sm .overlay > .holder {
|
||||
// Used for blocker and in-progress dialogs, modal alerts, etc.
|
||||
$h: 225px;
|
||||
min-height: $h;
|
||||
height: $h;
|
||||
}
|
||||
|
||||
@@ -20,69 +20,139 @@
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
.frame {
|
||||
$ohH: $btnFrameH;
|
||||
$bc: $colorInteriorBorder;
|
||||
&.child-frame.panel {
|
||||
background: $colorBodyBg;
|
||||
border: 1px solid $bc;
|
||||
$ohH: $btnFrameH;
|
||||
$bc: $colorInteriorBorder;
|
||||
&.child-frame.panel {
|
||||
z-index: 0; // Needed to prevent child-frame controls from showing through when another child-frame is above
|
||||
&:hover {
|
||||
border-color: lighten($bc, 10%);
|
||||
}
|
||||
}
|
||||
.object-top-bar {
|
||||
font-size: 0.75em;
|
||||
height: $ohH;
|
||||
line-height: $ohH;
|
||||
.left {
|
||||
padding-right: $interiorMarginLg;
|
||||
&:not(.no-frame) {
|
||||
background: $colorBodyBg;
|
||||
border: 1px solid $bc;
|
||||
&:hover {
|
||||
border-color: lighten($bc, 10%);
|
||||
}
|
||||
}
|
||||
}
|
||||
>.object-holder.abs {
|
||||
top: $ohH + $interiorMargin;
|
||||
}
|
||||
.contents {
|
||||
$myM: $interiorMargin;
|
||||
top: $myM;
|
||||
right: $myM;
|
||||
bottom: $myM;
|
||||
left: $myM;
|
||||
}
|
||||
&.frame-template {
|
||||
.s-button,
|
||||
.s-menu-button {
|
||||
height: $ohH;
|
||||
line-height: $ohH;
|
||||
padding: 0 $interiorMargin;
|
||||
> span,
|
||||
}
|
||||
.object-browse-bar {
|
||||
font-size: 0.75em;
|
||||
height: $ohH;
|
||||
line-height: $ohH;
|
||||
.right {
|
||||
@include trans-prop-nice-fade($controlFadeMs);
|
||||
padding-left: $interiorMargin;
|
||||
}
|
||||
}
|
||||
|
||||
&.t-object-type-timer,
|
||||
&.t-object-type-clock,
|
||||
&.t-object-type-hyperlink {
|
||||
// Hide the right side buttons for objects where they don't make sense
|
||||
// Note that this will hide the view Switcher button if applied
|
||||
// to an object that it.
|
||||
.object-browse-bar .right { display: none; }
|
||||
}
|
||||
|
||||
> .object-holder.abs {
|
||||
top: $ohH + $interiorMargin;
|
||||
}
|
||||
.contents {
|
||||
$m: $interiorMargin;
|
||||
top: $m;
|
||||
right: $m;
|
||||
bottom: $m;
|
||||
left: $m;
|
||||
}
|
||||
&.frame-template {
|
||||
.s-button,
|
||||
.s-menu-button {
|
||||
height: $ohH;
|
||||
line-height: $ohH;
|
||||
padding: 0 $interiorMargin;
|
||||
> span,
|
||||
&:before {
|
||||
font-size: 0.65rem;
|
||||
}
|
||||
}
|
||||
font-size: 0.65rem;
|
||||
}
|
||||
}
|
||||
|
||||
.s-menu-button:after {
|
||||
font-size: 8px;
|
||||
}
|
||||
.s-menu-button:after {
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.view-switcher {
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
.view-switcher {
|
||||
// Hide the name when the view switcher is in a frame context
|
||||
.title-label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.view-switcher {
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
.view-switcher {
|
||||
margin-right: $interiorMargin; // Kick other top bar elements away when I'm present.
|
||||
// Hide the name when the view switcher is in a frame context
|
||||
.title-label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.no-frame {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
.object-browse-bar .right {
|
||||
$m: 0; // $interiorMarginSm;
|
||||
background: rgba(black, 0.3);
|
||||
border-radius: $basicCr;
|
||||
padding: $interiorMarginSm;
|
||||
position: absolute;
|
||||
top: $m; right: $m;
|
||||
z-index: 2;
|
||||
}
|
||||
&.t-frame-outer > .t-rep-frame {
|
||||
&.contents {
|
||||
$m: 2px;
|
||||
top: $m;
|
||||
right: $m;
|
||||
bottom: $m;
|
||||
left: $m;
|
||||
}
|
||||
> .t-frame-inner {
|
||||
> .object-browse-bar .left {
|
||||
display: none;
|
||||
}
|
||||
> .object-holder.abs {
|
||||
top: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/********************************************************** OBJECT TYPES */
|
||||
.t-object-type-hyperlink {
|
||||
.s-hyperlink.s-button {
|
||||
// When a hyperlink is a button in a frame, make it expand to fill out to the object-holder
|
||||
@extend .abs;
|
||||
.label {
|
||||
@include ellipsize();
|
||||
@include transform(translateY(-50%));
|
||||
padding: 0 $interiorMargin;
|
||||
position: absolute;
|
||||
min-width: 0;
|
||||
left: 0; right: 0;
|
||||
text-align: center;
|
||||
top: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
body.desktop .frame {
|
||||
// Hide local controls initially and show it them on hover when they're in an element that's in a frame context
|
||||
// Frame template is used because we need to target the lowest nested frame
|
||||
.object-browse-bar .btn-bar {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// Target the first descendant so that we only show the elements in the outermost container.
|
||||
// Handles the case where we have layouts in layouts.
|
||||
&:hover > .object-browse-bar {
|
||||
.btn-bar {
|
||||
opacity: 1;
|
||||
pointer-events: inherit;
|
||||
}
|
||||
}
|
||||
}
|
||||
body.desktop .frame.frame-template {
|
||||
// Hide the view switcher by default when it's in an element that's in a frame context
|
||||
// Frame template is used because we need to target the lowest nested frame
|
||||
.view-switcher {
|
||||
opacity: 0;
|
||||
}
|
||||
&:hover .view-switcher {
|
||||
// Show the view switcher on frame hover
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,14 +136,6 @@
|
||||
.mini-tab-icon.toggle-pane {
|
||||
z-index: 5;
|
||||
}
|
||||
&.items {
|
||||
.object-browse-bar {
|
||||
.left.abs,
|
||||
.right.abs {
|
||||
top: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
body.desktop .pane .mini-tab-icon.toggle-pane {
|
||||
@@ -235,8 +227,13 @@ body.desktop .pane .mini-tab-icon.toggle-pane {
|
||||
top: $ueTopBarH + $interiorMarginLg;
|
||||
}
|
||||
|
||||
.l-object-wrapper-inner {
|
||||
@include trans-prop-nice-resize(0.25s);
|
||||
.l-object-wrapper {
|
||||
padding: 0;
|
||||
@include trans-prop-nice((padding), 0.25s);
|
||||
.l-edit-controls {
|
||||
@include trans-prop-nice((height), 0.5s);
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.object-browse-bar .s-button,
|
||||
@@ -250,10 +247,9 @@ body.desktop .pane .mini-tab-icon.toggle-pane {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.object-browse-bar,
|
||||
.top-bar {
|
||||
.view-switcher {
|
||||
margin-right: $interiorMarginLg * 2;
|
||||
.object-browse-bar {
|
||||
.l-object-action-buttons {
|
||||
margin-left: $interiorMarginLg; // Kick the view switcher and other elements away
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +261,6 @@ body.desktop .pane .mini-tab-icon.toggle-pane {
|
||||
white-space: nowrap;
|
||||
|
||||
.left {
|
||||
padding-right: $interiorMarginLg;
|
||||
.l-back {
|
||||
margin-right: $interiorMarginLg;
|
||||
&.s-status-editing { display: none; }
|
||||
@@ -348,53 +343,21 @@ body.desktop {
|
||||
.pane:not(.resizing) {
|
||||
@include trans-prop-nice-resize-w(250ms);
|
||||
}
|
||||
.pane.primary-pane .object-browse-bar {
|
||||
.pane.primary-pane > .object-browse-bar {
|
||||
min-width: 200px; // Needed for nice display when primary pane is constrained severely via splitters
|
||||
}
|
||||
}
|
||||
|
||||
.s-status-editing {
|
||||
.l-object-wrapper {
|
||||
$t2Dur: $browseToEditAnimMs;
|
||||
$t1Dur: $t2Dur / 2;
|
||||
$pulseDur: $editBorderPulseMs;
|
||||
$bC0: rgba($colorEditAreaFg, 0.5);
|
||||
$bC100: rgba($colorEditAreaFg, 1);
|
||||
|
||||
background-color: $colorEditAreaBg;
|
||||
border-radius: $controlCr;
|
||||
border: 1px dotted $bC0;
|
||||
|
||||
// Transition 1
|
||||
@include keyframes(wrapperIn) {
|
||||
from { border: 0px dotted transparent; padding: 0; }
|
||||
to { border: 1px dotted $bC0; padding: 5px; }
|
||||
}
|
||||
|
||||
// Do last
|
||||
@include keyframes(pulseNew) {
|
||||
from { border-color: $bC0; }
|
||||
to { border-color: $bC100; }
|
||||
}
|
||||
|
||||
@include animation-name(wrapperIn, pulseNew);
|
||||
@include animation-duration($t1Dur, $pulseDur);
|
||||
@include animation-delay(0s, $t1Dur + $t2Dur);
|
||||
@include animation-direction(normal, alternate);
|
||||
@include animation-fill-mode(both, none);
|
||||
@include animation-iteration-count(1, infinite);
|
||||
@include animation-timing-function(ease-in-out, linear);
|
||||
|
||||
border: 1px dotted $colorEditAreaFg;
|
||||
padding: $interiorMargin;
|
||||
|
||||
.l-edit-controls {
|
||||
height: 0;
|
||||
height: $ueEditToolBarH + $interiorMargin; margin-bottom: $interiorMargin;
|
||||
border-bottom: 1px solid $colorInteriorBorder;
|
||||
// Transition 2: reveal edit controls
|
||||
@include keyframes(editIn) {
|
||||
from { border-bottom: 0px solid transparent; height: 0; margin-bottom: 0; }
|
||||
to { border-bottom: 1px solid $colorInteriorBorder; height: $ueEditToolBarH + $interiorMargin; margin-bottom: $interiorMargin; }
|
||||
}
|
||||
@include animToParams(editIn, $dur: $t2Dur, $delay: $t1Dur);
|
||||
.tool-bar {
|
||||
right: $interiorMargin;
|
||||
}
|
||||
|
||||
@@ -19,21 +19,36 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
.s-selectable {
|
||||
border: 1px solid transparent;
|
||||
.s-hover-border {
|
||||
border: 1px dotted transparent;
|
||||
}
|
||||
|
||||
&.s-hover {
|
||||
// Styles when hovering over a selectable object
|
||||
border-color: $colorSelectableHov !important;
|
||||
.s-status-editing {
|
||||
// Limit to editing mode until we have sub-object selection
|
||||
.s-hover-border {
|
||||
// Show a border by default so user can see object bounds and empty objects
|
||||
border: 1px dotted rgba($colorSelectableSelectedPrimary, 0.3) !important;
|
||||
&:hover {
|
||||
border-color: rgba($colorSelectableSelectedPrimary, 0.7) !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.s-selected {
|
||||
.s-selected > .s-hover-border,
|
||||
.s-selected.s-hover-border {
|
||||
// Styles for a selected object. Also used by legacy Fixed Position/Panel objects.
|
||||
border-color: $colorSelectableSelectedPrimary !important;
|
||||
@include boxShdwLarge();
|
||||
// Show edit-corners if you got 'em
|
||||
.edit-corner {
|
||||
display: block;
|
||||
&:hover {
|
||||
background-color: rgba($colorKey, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.s-moveable {
|
||||
@include boxShdwLarge();
|
||||
.s-selected > .s-moveable,
|
||||
.s-selected.s-moveable {
|
||||
cursor: move;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,9 +26,11 @@
|
||||
.l-control-group {
|
||||
height: $btnToolbarH;
|
||||
}
|
||||
input[type="text"] {
|
||||
input[type="text"],
|
||||
input[type="search"],
|
||||
input[type="number"] {
|
||||
box-sizing: border-box;
|
||||
font-size: .9em;
|
||||
font-size: .8em;
|
||||
height: $btnToolbarH;
|
||||
margin-bottom: 1px;
|
||||
position: relative;
|
||||
|
||||
@@ -83,13 +83,14 @@ define(
|
||||
// Callback to fire after each timeout;
|
||||
// update bounds and schedule another timeout
|
||||
function onInterval() {
|
||||
if (!active) {
|
||||
return;
|
||||
}
|
||||
fireEval({
|
||||
width: element[0].offsetWidth,
|
||||
height: element[0].offsetHeight
|
||||
});
|
||||
if (active) {
|
||||
$timeout(onInterval, currentInterval(), false);
|
||||
}
|
||||
$timeout(onInterval, currentInterval(), false);
|
||||
}
|
||||
|
||||
// Stop running in the background
|
||||
|
||||
@@ -93,13 +93,21 @@ define(
|
||||
* @memberof platform/commonUI/general
|
||||
* @constructor
|
||||
*/
|
||||
function MCTSplitPane($parse, $log, $interval) {
|
||||
function MCTSplitPane($parse, $log, $interval, $window) {
|
||||
function controller($scope, $element, $attrs) {
|
||||
var anchorKey = $attrs.anchor || DEFAULT_ANCHOR,
|
||||
positionParsed = $parse($attrs.position),
|
||||
anchor,
|
||||
activeInterval,
|
||||
positionParsed = $parse($attrs.position),
|
||||
position; // Start undefined, until explicitly set
|
||||
position,
|
||||
splitterSize,
|
||||
|
||||
alias = $attrs.alias !== undefined ?
|
||||
"mctSplitPane-" + $attrs.alias : undefined,
|
||||
|
||||
//convert string to number from localStorage
|
||||
userWidthPreference = $window.localStorage.getItem(alias) === null ?
|
||||
undefined : Number($window.localStorage.getItem(alias));
|
||||
|
||||
// Get relevant size (height or width) of DOM element
|
||||
function getSize(domElement) {
|
||||
@@ -109,16 +117,18 @@ define(
|
||||
|
||||
// Apply styles to child elements
|
||||
function updateChildren(children) {
|
||||
position = userWidthPreference || position;
|
||||
|
||||
// Pick out correct elements to update, flowing from
|
||||
// selected anchor edge.
|
||||
var first = children.eq(anchor.reversed ? 2 : 0),
|
||||
splitter = children.eq(1),
|
||||
last = children.eq(anchor.reversed ? 0 : 2),
|
||||
splitterSize = getSize(splitter[0]),
|
||||
firstSize;
|
||||
|
||||
splitterSize = getSize(splitter[0]);
|
||||
first.css(anchor.edge, "0px");
|
||||
first.css(anchor.dimension, (position - splitterSize) + 'px');
|
||||
first.css(anchor.dimension, position + 'px');
|
||||
|
||||
// Get actual size (to obey min-width etc.)
|
||||
firstSize = getSize(first[0]);
|
||||
@@ -126,10 +136,9 @@ define(
|
||||
splitter.css(anchor.edge, firstSize + 'px');
|
||||
splitter.css(anchor.opposite, "auto");
|
||||
|
||||
last.css(anchor.edge, (firstSize + splitterSize) + 'px');
|
||||
last.css(anchor.opposite, "0px");
|
||||
|
||||
position = firstSize + splitterSize;
|
||||
last.css(anchor.edge, firstSize + splitterSize + 'px');
|
||||
last.css(anchor.opposite, '0px');
|
||||
position = firstSize;
|
||||
}
|
||||
|
||||
// Update positioning of contained elements
|
||||
@@ -166,9 +175,22 @@ define(
|
||||
positionParsed.assign($scope, position);
|
||||
}
|
||||
}
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
function setUserWidthPreference(value) {
|
||||
if (alias) {
|
||||
userWidthPreference = value;
|
||||
}
|
||||
}
|
||||
|
||||
function persistToLocalStorage(value) {
|
||||
if (alias) {
|
||||
$window.localStorage.setItem(alias, value);
|
||||
}
|
||||
}
|
||||
|
||||
// Dynamically apply a CSS class to elements when the user
|
||||
// is actively resizing
|
||||
function toggleClass(classToToggle) {
|
||||
@@ -196,18 +218,31 @@ define(
|
||||
activeInterval = $interval(function () {
|
||||
getSetPosition(getSetPosition());
|
||||
}, POLLING_INTERVAL, 0, false);
|
||||
|
||||
// ...and stop polling when we're destroyed.
|
||||
$scope.$on('$destroy', function () {
|
||||
$interval.cancel(activeInterval);
|
||||
});
|
||||
|
||||
|
||||
// Interface exposed by controller, for mct-splitter to user
|
||||
return {
|
||||
position: getSetPosition,
|
||||
toggleClass: toggleClass,
|
||||
anchor: function () {
|
||||
return anchor;
|
||||
},
|
||||
position: function (newPosition) {
|
||||
if (arguments.length === 0) {
|
||||
return getSetPosition();
|
||||
}
|
||||
|
||||
setUserWidthPreference(newPosition);
|
||||
return getSetPosition(newPosition);
|
||||
},
|
||||
startResizing: function () {
|
||||
toggleClass('resizing');
|
||||
},
|
||||
endResizing: function (finalPosition) {
|
||||
persistToLocalStorage(finalPosition);
|
||||
toggleClass('resizing');
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -219,9 +254,7 @@ define(
|
||||
controller: ['$scope', '$element', '$attrs', controller]
|
||||
};
|
||||
}
|
||||
|
||||
return MCTSplitPane;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -37,15 +37,16 @@ define(
|
||||
*/
|
||||
function MCTSplitter() {
|
||||
function link(scope, element, attrs, mctSplitPane) {
|
||||
var initialPosition;
|
||||
var initialPosition,
|
||||
newPosition;
|
||||
|
||||
element.addClass("splitter");
|
||||
|
||||
scope.splitter = {
|
||||
// Begin moving this splitter
|
||||
startMove: function () {
|
||||
mctSplitPane.startResizing();
|
||||
initialPosition = mctSplitPane.position();
|
||||
mctSplitPane.toggleClass('resizing');
|
||||
},
|
||||
// Handle user changes to splitter position
|
||||
move: function (delta) {
|
||||
@@ -55,12 +56,16 @@ define(
|
||||
(anchor.reversed ? -1 : 1);
|
||||
|
||||
// Update the position of this splitter
|
||||
mctSplitPane.position(initialPosition + pixelDelta);
|
||||
newPosition = initialPosition + pixelDelta;
|
||||
|
||||
if (initialPosition !== newPosition) {
|
||||
mctSplitPane.position(newPosition);
|
||||
}
|
||||
},
|
||||
// Grab the event when the user is done moving
|
||||
// the splitter and pass it on
|
||||
endMove: function () {
|
||||
mctSplitPane.toggleClass('resizing');
|
||||
mctSplitPane.endResizing(newPosition);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -83,4 +88,3 @@ define(
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -102,11 +102,16 @@ define(
|
||||
// Broadcast a destroy event
|
||||
mockScope.$on.mostRecentCall.args[1]();
|
||||
|
||||
testElement.offsetWidth = 300;
|
||||
testElement.offsetHeight = 350;
|
||||
mockScope.$eval.reset();
|
||||
|
||||
// Fire the timeout
|
||||
mockTimeout.mostRecentCall.args[0]();
|
||||
|
||||
// Should NOT have scheduled another timeout
|
||||
expect(mockTimeout.calls.length).toEqual(2);
|
||||
expect(mockScope.$eval).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("triggers a digest cycle when size changes", function () {
|
||||
|
||||
@@ -38,7 +38,8 @@ define(
|
||||
mockLog,
|
||||
mockInterval,
|
||||
mockParsed,
|
||||
mctSplitPane;
|
||||
mctSplitPane,
|
||||
mockWindow = {};
|
||||
|
||||
beforeEach(function () {
|
||||
mockParse = jasmine.createSpy('$parse');
|
||||
@@ -48,13 +49,23 @@ define(
|
||||
mockInterval.cancel = jasmine.createSpy('mockCancel');
|
||||
mockParsed = jasmine.createSpy('parsed');
|
||||
mockParsed.assign = jasmine.createSpy('assign');
|
||||
|
||||
mockParse.andReturn(mockParsed);
|
||||
|
||||
mockWindow.localStorage = {
|
||||
store: {},
|
||||
setItem: function (key, value) {
|
||||
this.store[key] = value;
|
||||
},
|
||||
getItem: function (key) {
|
||||
return this.store[key];
|
||||
}
|
||||
};
|
||||
|
||||
mctSplitPane = new MCTSplitPane(
|
||||
mockParse,
|
||||
mockLog,
|
||||
mockInterval
|
||||
mockInterval,
|
||||
mockWindow
|
||||
);
|
||||
});
|
||||
|
||||
@@ -85,7 +96,7 @@ define(
|
||||
jasmine.createSpyObj('$scope', ['$apply', '$watch', '$on']);
|
||||
mockElement =
|
||||
jasmine.createSpyObj('element', JQLITE_METHODS);
|
||||
testAttrs = {};
|
||||
testAttrs = {alias: 'rightSide'};
|
||||
mockChildren =
|
||||
jasmine.createSpyObj('children', JQLITE_METHODS);
|
||||
mockFirstPane =
|
||||
@@ -129,7 +140,7 @@ define(
|
||||
|
||||
it("exposes its splitter's initial position", function () {
|
||||
expect(controller.position()).toEqual(
|
||||
mockFirstPane[0].offsetWidth + mockSplitter[0].offsetWidth
|
||||
mockFirstPane[0].offsetWidth
|
||||
);
|
||||
});
|
||||
|
||||
@@ -142,10 +153,14 @@ define(
|
||||
});
|
||||
});
|
||||
|
||||
it("allows classes to be toggled on contained elements", function () {
|
||||
controller.toggleClass('resizing');
|
||||
expect(mockChildren.toggleClass)
|
||||
.toHaveBeenCalledWith('resizing');
|
||||
it("applies resizing class to children when resizing", function () {
|
||||
controller.startResizing();
|
||||
expect(mockChildren.toggleClass).toHaveBeenCalledWith('resizing');
|
||||
});
|
||||
|
||||
it("removes resizing class from children when resizing action ends", function () {
|
||||
controller.endResizing(0);
|
||||
expect(mockChildren.toggleClass).toHaveBeenCalledWith('resizing');
|
||||
});
|
||||
|
||||
it("allows positions to be set", function () {
|
||||
@@ -153,7 +168,7 @@ define(
|
||||
controller.position(testValue);
|
||||
expect(mockFirstPane.css).toHaveBeenCalledWith(
|
||||
'width',
|
||||
(testValue - mockSplitter[0].offsetWidth) + 'px'
|
||||
(testValue) + 'px'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -185,11 +200,11 @@ define(
|
||||
mockFirstPane[0].offsetWidth += 100;
|
||||
// Should not reflect the change yet
|
||||
expect(controller.position()).not.toEqual(
|
||||
mockFirstPane[0].offsetWidth + mockSplitter[0].offsetWidth
|
||||
mockFirstPane[0].offsetWidth
|
||||
);
|
||||
mockInterval.mostRecentCall.args[0]();
|
||||
expect(controller.position()).toEqual(
|
||||
mockFirstPane[0].offsetWidth + mockSplitter[0].offsetWidth
|
||||
mockFirstPane[0].offsetWidth
|
||||
);
|
||||
});
|
||||
|
||||
@@ -198,6 +213,12 @@ define(
|
||||
fireOn('$destroy');
|
||||
expect(mockInterval.cancel).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("saves user preference to localStorage when user is done resizing", function () {
|
||||
controller.endResizing(100);
|
||||
expect(Number(mockWindow.localStorage.getItem('mctSplitPane-rightSide'))).toEqual(100);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -57,7 +57,7 @@ define(
|
||||
testAttrs = {};
|
||||
mockSplitPane = jasmine.createSpyObj(
|
||||
'mctSplitPane',
|
||||
['position', 'toggleClass', 'anchor']
|
||||
['position', 'startResizing', 'endResizing', 'anchor']
|
||||
);
|
||||
|
||||
mctSplitter.link(
|
||||
@@ -86,9 +86,9 @@ define(
|
||||
mockScope.splitter.startMove();
|
||||
});
|
||||
|
||||
it("adds a 'resizing' class", function () {
|
||||
expect(mockSplitPane.toggleClass)
|
||||
.toHaveBeenCalledWith('resizing');
|
||||
it("tell's the splitter when it is resizing", function () {
|
||||
expect(mockSplitPane.startResizing)
|
||||
.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("repositions during drag", function () {
|
||||
@@ -97,11 +97,10 @@ define(
|
||||
.toHaveBeenCalledWith(testPosition + 10);
|
||||
});
|
||||
|
||||
it("removes the 'resizing' class when finished", function () {
|
||||
mockSplitPane.toggleClass.reset();
|
||||
it("tell's the splitter when it is done resizing", function () {
|
||||
mockScope.splitter.move([10,0]);
|
||||
mockScope.splitter.endMove();
|
||||
expect(mockSplitPane.toggleClass)
|
||||
.toHaveBeenCalledWith('resizing');
|
||||
expect(mockSplitPane.endResizing).toHaveBeenCalledWith(testPosition + 10);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ $hoverRatioPercent: 10%;
|
||||
$basicCr: 3px;
|
||||
$controlCr: 2px;
|
||||
$smallCr: 2px;
|
||||
$overlayCr: 11px;
|
||||
|
||||
// Buttons and Controls
|
||||
$colorBtnBg: pullForward($colorBodyBg, $contrastRatioPercent);
|
||||
@@ -52,9 +53,15 @@ $timeControllerToiLineColor: #00c2ff;
|
||||
$timeControllerToiLineColorHov: #fff;
|
||||
$colorTransLucBg: #666; // Used as a visual blocking element over variable backgrounds, like imagery
|
||||
|
||||
// General Colors
|
||||
// Foundation Colors
|
||||
$colorAlt1: #ffc700;
|
||||
$colorAlert: #ff3c00;
|
||||
$colorWarningHi: #cc0000;
|
||||
$colorWarningLo: #ff9900;
|
||||
$colorDiagnostic: #a4b442;
|
||||
$colorCommand: #3693bd;
|
||||
$colorInfo: #2294a2;
|
||||
$colorOk: #33cc33;
|
||||
$colorIconLink: #49dedb;
|
||||
$colorPausedBg: #c56f01;
|
||||
$colorPausedFg: #fff;
|
||||
@@ -83,8 +90,8 @@ $colorCreateMenuText: $colorMenuFg;
|
||||
// Form colors
|
||||
$colorCheck: $colorKey;
|
||||
$colorFormRequired: $colorAlt1;
|
||||
$colorFormValid: #33cc33;
|
||||
$colorFormError: #990000;
|
||||
$colorFormValid: $colorOk;
|
||||
$colorFormError: $colorWarningHi;
|
||||
$colorFormInvalid: #ff3300;
|
||||
$colorFormFieldErrorBg: $colorFormError;
|
||||
$colorFormFieldErrorFg: rgba(#fff, 0.6);
|
||||
@@ -108,8 +115,8 @@ $colorInspectorSectionHeaderFg: pullForward($colorInspectorBg, 40%);
|
||||
// Status colors, mainly used for messaging and item ancillary symbols
|
||||
$colorStatusFg: #ccc;
|
||||
$colorStatusDefault: #ccc;
|
||||
$colorStatusInfo: #62ba72;
|
||||
$colorStatusAlert: #ffa66d;
|
||||
$colorStatusInfo: $colorInfo;
|
||||
$colorStatusAlert: $colorAlert;
|
||||
$colorStatusError: #d4585c;
|
||||
$colorStatusAvailable: $colorKey;
|
||||
$colorStatusBtnBg: $colorBtnBg;
|
||||
@@ -124,14 +131,14 @@ $animPausedPulseDur: 500ms;
|
||||
$colorSelectBg: $colorBtnBg;
|
||||
$colorSelectFg: $colorBtnFg;
|
||||
|
||||
// Limits and staleness colors
|
||||
// Limits, status and staleness colors
|
||||
$colorTelemFresh: pullForward($colorBodyFg, 20%);
|
||||
$colorTelemStale: pushBack($colorBodyFg, 20%);
|
||||
$styleTelemStale: italic;
|
||||
$colorLimitYellowBg: rgba(#ffaa00, 0.3);
|
||||
$colorLimitYellowIc: #ffaa00;
|
||||
$colorLimitRedBg: rgba(red, 0.3);
|
||||
$colorLimitRedIc: red;
|
||||
$colorLimitYellowBg: rgba($colorWarningLo, 0.3);
|
||||
$colorLimitYellowIc: $colorWarningLo;
|
||||
$colorLimitRedBg: rgba($colorWarningHi, 0.3);
|
||||
$colorLimitRedIc: $colorWarningHi;
|
||||
|
||||
// Bubble colors
|
||||
$colorInfoBubbleBg: #ddd;
|
||||
@@ -146,6 +153,7 @@ $colorOvrFg: pullForward($colorBodyFg, 30%);
|
||||
$colorOvrBtnBg: pullForward($colorOvrBg, 20%);
|
||||
$colorOvrBtnFg: #fff;
|
||||
$colorFieldHintOverlay: pullForward($colorOvrBg, 30%);
|
||||
$durLargeViewExpand: 250ms;
|
||||
|
||||
// Items
|
||||
$colorItemBg: lighten($colorBodyBg, 5%);
|
||||
@@ -189,6 +197,9 @@ $colorItemTreeVCHover: pullForward($colorItemTreeVC, 20%);
|
||||
$colorItemTreeSelectedVC: $colorItemTreeVC;
|
||||
$shdwItemTreeIcon: 0.6;
|
||||
|
||||
// Images
|
||||
$colorThumbHoverBg: $colorItemTreeHoverBg;
|
||||
|
||||
// Scrollbar
|
||||
$scrollbarTrackSize: 10px;
|
||||
$scrollbarTrackShdw: rgba(#000, 0.7) 0 1px 5px;
|
||||
|
||||
@@ -13,3 +13,10 @@
|
||||
// For dark interfaces, darker things move back - opposite for light interfaces
|
||||
@return darken($c, $p);
|
||||
}
|
||||
|
||||
@function bgFg($c) {
|
||||
// Given a single color, return valid background and foreground versions of that color
|
||||
$bg: darken($c, 20%);
|
||||
$fg: lighten($c, 20%);
|
||||
@return $bg, $fg;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ $hoverRatioPercent: 10%;
|
||||
$basicCr: 4px;
|
||||
$controlCr: $basicCr;
|
||||
$smallCr: 3px;
|
||||
$overlayCr: 11px;
|
||||
|
||||
// Buttons and Controls
|
||||
$colorBtnBg: pullForward($colorBodyBg, $contrastRatioPercent);
|
||||
@@ -52,9 +53,15 @@ $timeControllerToiLineColor: $colorBodyFg;
|
||||
$timeControllerToiLineColorHov: #0052b5;
|
||||
$colorTransLucBg: #666; // Used as a visual blocking element over variable backgrounds, like imagery
|
||||
|
||||
// General Colors
|
||||
// Foundation Colors
|
||||
$colorAlt1: #776ba2;
|
||||
$colorAlert: #ff3c00;
|
||||
$colorWarningHi: #990000;
|
||||
$colorWarningLo: #ff9900;
|
||||
$colorDiagnostic: #a4b442;
|
||||
$colorCommand: #3693bd;
|
||||
$colorInfo: #2294a2;
|
||||
$colorOk: #33cc33;
|
||||
$colorIconLink: #49dedb;
|
||||
$colorPausedBg: #ff9900;
|
||||
$colorPausedFg: #fff;
|
||||
@@ -83,8 +90,8 @@ $colorCreateMenuText: $colorBodyFg;
|
||||
// Form colors
|
||||
$colorCheck: $colorKey;
|
||||
$colorFormRequired: $colorKey;
|
||||
$colorFormValid: #33cc33;
|
||||
$colorFormError: #990000;
|
||||
$colorFormValid: $colorOk;
|
||||
$colorFormError: $colorWarningHi;
|
||||
$colorFormInvalid: #ff2200;
|
||||
$colorFormFieldErrorBg: $colorFormError;
|
||||
$colorFormFieldErrorFg: rgba(#fff, 0.6);
|
||||
@@ -106,7 +113,7 @@ $colorInspectorSectionHeaderBg: pullForward($colorInspectorBg, 5%);
|
||||
$colorInspectorSectionHeaderFg: pullForward($colorInspectorBg, 40%);
|
||||
|
||||
// Status colors, mainly used for messaging and item ancillary symbols
|
||||
$colorStatusFg: #fff;
|
||||
$colorStatusFg: #999;
|
||||
$colorStatusDefault: #ccc;
|
||||
$colorStatusInfo: #60ba7b;
|
||||
$colorStatusAlert: #ffb66c;
|
||||
@@ -146,6 +153,7 @@ $colorOvrFg: $colorBodyFg;
|
||||
$colorOvrBtnBg: pullForward($colorOvrBg, 40%);
|
||||
$colorOvrBtnFg: #fff;
|
||||
$colorFieldHintOverlay: pullForward($colorOvrBg, 40%);
|
||||
$durLargeViewExpand: 250ms;
|
||||
|
||||
// Items
|
||||
$colorItemBg: #ddd;
|
||||
@@ -189,6 +197,9 @@ $colorItemTreeVCHover: $colorKey;
|
||||
$colorItemTreeSelectedVC: $colorBodyBg;
|
||||
$shdwItemTreeIcon: none;
|
||||
|
||||
// Images
|
||||
$colorThumbHoverBg: $colorItemTreeHoverBg;
|
||||
|
||||
// Scrollbar
|
||||
$scrollbarTrackSize: 10px;
|
||||
$scrollbarTrackShdw: rgba(#000, 0.2) 0 1px 2px;
|
||||
|
||||
@@ -12,3 +12,11 @@
|
||||
// For dark interfaces, darker things move back - opposite for light interfaces
|
||||
@return lighten($c, $p);
|
||||
}
|
||||
|
||||
@function bgFg($c) {
|
||||
// Given a single color, return valid background and foreground versions of that color
|
||||
$bg: darken($c, 20%);
|
||||
$fg: lighten($c, 20%);
|
||||
@return $bg, $fg;
|
||||
}
|
||||
|
||||
|
||||
@@ -148,13 +148,19 @@ define(
|
||||
*/
|
||||
PersistenceCapability.prototype.refresh = function () {
|
||||
var domainObject = this.domainObject;
|
||||
var $q = this.$q;
|
||||
|
||||
// Update a domain object's model upon refresh
|
||||
function updateModel(model) {
|
||||
var modified = model.modified;
|
||||
return domainObject.useCapability("mutation", function () {
|
||||
return model;
|
||||
}, modified);
|
||||
if (model === undefined) {
|
||||
//Get failed, reject promise
|
||||
return $q.reject('Got empty object model');
|
||||
} else {
|
||||
var modified = model.modified;
|
||||
return domainObject.useCapability("mutation", function () {
|
||||
return model;
|
||||
}, modified);
|
||||
}
|
||||
}
|
||||
|
||||
if (domainObject.getModel().persisted === undefined) {
|
||||
|
||||
@@ -34,23 +34,32 @@ define([], function () {
|
||||
transactionService,
|
||||
cacheService
|
||||
) {
|
||||
|
||||
function hasChanged(domainObject) {
|
||||
var model = domainObject.getModel();
|
||||
return model.persisted === undefined || model.modified > model.persisted;
|
||||
}
|
||||
|
||||
var mutationTopic = topic('mutation');
|
||||
mutationTopic.listen(function (domainObject) {
|
||||
var persistence = domainObject.getCapability('persistence');
|
||||
var wasActive = transactionService.isActive();
|
||||
cacheService.put(domainObject.getId(), domainObject.getModel());
|
||||
|
||||
if (!wasActive) {
|
||||
transactionService.startTransaction();
|
||||
}
|
||||
if (hasChanged(domainObject)) {
|
||||
|
||||
transactionService.addToTransaction(
|
||||
persistence.persist.bind(persistence),
|
||||
persistence.refresh.bind(persistence)
|
||||
);
|
||||
if (!wasActive) {
|
||||
transactionService.startTransaction();
|
||||
}
|
||||
|
||||
if (!wasActive) {
|
||||
transactionService.commit();
|
||||
transactionService.addToTransaction(
|
||||
persistence.persist.bind(persistence),
|
||||
persistence.refresh.bind(persistence)
|
||||
);
|
||||
|
||||
if (!wasActive) {
|
||||
transactionService.commit();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -65,6 +65,20 @@ define(['csv'], function (CSV) {
|
||||
this.saveAs(blob, filename);
|
||||
};
|
||||
|
||||
/**
|
||||
* Export an object as a JSON file. Triggers a download using the function
|
||||
* provided when the ExportService was instantiated.
|
||||
*
|
||||
* @param {Object} obj an object to be exported as JSON
|
||||
* @param {ExportOptions} [options] additional parameters for the file
|
||||
* export
|
||||
*/
|
||||
ExportService.prototype.exportJSON = function (obj, options) {
|
||||
var filename = (options && options.filename) || "test-export.json";
|
||||
var jsonText = JSON.stringify(obj);
|
||||
var blob = new Blob([jsonText], {type: "application/json"});
|
||||
this.saveAs(blob, filename);
|
||||
};
|
||||
/**
|
||||
* Additional parameters for file export.
|
||||
* @typedef ExportOptions
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
define([
|
||||
"moment-timezone",
|
||||
"./src/indicators/ClockIndicator",
|
||||
"./src/services/TickerService",
|
||||
"./src/controllers/ClockController",
|
||||
@@ -28,10 +29,13 @@ define([
|
||||
"./src/controllers/RefreshingController",
|
||||
"./src/actions/StartTimerAction",
|
||||
"./src/actions/RestartTimerAction",
|
||||
"./src/actions/StopTimerAction",
|
||||
"./src/actions/PauseTimerAction",
|
||||
"text!./res/templates/clock.html",
|
||||
"text!./res/templates/timer.html",
|
||||
'legacyRegistry'
|
||||
], function (
|
||||
MomentTimezone,
|
||||
ClockIndicator,
|
||||
TickerService,
|
||||
ClockController,
|
||||
@@ -39,6 +43,8 @@ define([
|
||||
RefreshingController,
|
||||
StartTimerAction,
|
||||
RestartTimerAction,
|
||||
StopTimerAction,
|
||||
PauseTimerAction,
|
||||
clockTemplate,
|
||||
timerTemplate,
|
||||
legacyRegistry
|
||||
@@ -139,6 +145,17 @@ define([
|
||||
"cssClass": "icon-play",
|
||||
"priority": "preferred"
|
||||
},
|
||||
{
|
||||
"key": "timer.pause",
|
||||
"implementation": PauseTimerAction,
|
||||
"depends": [
|
||||
"now"
|
||||
],
|
||||
"category": "contextual",
|
||||
"name": "Pause",
|
||||
"cssClass": "icon-pause",
|
||||
"priority": "preferred"
|
||||
},
|
||||
{
|
||||
"key": "timer.restart",
|
||||
"implementation": RestartTimerAction,
|
||||
@@ -149,6 +166,17 @@ define([
|
||||
"name": "Restart at 0",
|
||||
"cssClass": "icon-refresh",
|
||||
"priority": "preferred"
|
||||
},
|
||||
{
|
||||
"key": "timer.stop",
|
||||
"implementation": StopTimerAction,
|
||||
"depends": [
|
||||
"now"
|
||||
],
|
||||
"category": "contextual",
|
||||
"name": "Stop",
|
||||
"cssClass": "icon-box",
|
||||
"priority": "preferred"
|
||||
}
|
||||
],
|
||||
"types": [
|
||||
@@ -200,13 +228,20 @@ define([
|
||||
"cssClass": "l-inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "timezone",
|
||||
"name": "Timezone",
|
||||
"control": "autocomplete",
|
||||
"options": MomentTimezone.tz.names()
|
||||
}
|
||||
],
|
||||
"model": {
|
||||
"clockFormat": [
|
||||
"YYYY/MM/DD hh:mm:ss",
|
||||
"clock12"
|
||||
]
|
||||
],
|
||||
"timezone": "UTC"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -19,11 +19,16 @@
|
||||
this source code distribution or the Licensing information page available
|
||||
at runtime from the About dialog for additional information.
|
||||
-->
|
||||
<div class="l-time-display l-digital l-timer s-timer" ng-controller="TimerController as timer">
|
||||
<div class="l-time-display l-digital l-timer s-timer s-state-{{timer.timerState}}" ng-controller="TimerController as timer">
|
||||
<div class="l-elem-wrapper l-flex-row">
|
||||
<a ng-click="timer.clickButton()"
|
||||
title="{{timer.buttonText()}}"
|
||||
class="flex-elem control s-icon-button {{timer.buttonCssClass()}}"></a>
|
||||
<div class="l-elem-wrapper l-flex-row controls">
|
||||
<a ng-click="timer.clickStopButton()"
|
||||
title="Stop"
|
||||
class="flex-elem s-icon-button t-btn-stop icon-box"></a>
|
||||
<a ng-click="timer.clickButton()"
|
||||
title="{{timer.buttonText()}}"
|
||||
class="flex-elem s-icon-button t-btn-pauseplay {{timer.buttonCssClass()}}"></a>
|
||||
</div>
|
||||
<span class="flex-elem l-value {{timer.signClass()}}">
|
||||
<span class="value"
|
||||
ng-class="{ active:timer.text() }">{{timer.text() || "--:--:--"}}
|
||||
|
||||
@@ -25,13 +25,10 @@ define(
|
||||
function () {
|
||||
|
||||
/**
|
||||
* Implements the "Start" and "Restart" action for timers.
|
||||
* Implements the "Pause" action for timers.
|
||||
*
|
||||
* Sets the reference timestamp in a timer to the current
|
||||
* time, such that it begins counting up.
|
||||
*
|
||||
* Both "Start" and "Restart" share this implementation, but
|
||||
* control their visibility with different `appliesTo` behavior.
|
||||
* Sets the reference pausedTime in a timer to the current
|
||||
* time, such that it stops counting up.
|
||||
*
|
||||
* @implements {Action}
|
||||
* @memberof platform/features/clock
|
||||
@@ -40,22 +37,35 @@ define(
|
||||
* time (typically wrapping `Date.now`)
|
||||
* @param {ActionContext} context the context for this action
|
||||
*/
|
||||
function AbstractStartTimerAction(now, context) {
|
||||
function PauseTimerAction(now, context) {
|
||||
this.domainObject = context.domainObject;
|
||||
this.now = now;
|
||||
}
|
||||
|
||||
AbstractStartTimerAction.prototype.perform = function () {
|
||||
PauseTimerAction.appliesTo = function (context) {
|
||||
var model =
|
||||
(context.domainObject && context.domainObject.getModel()) ||
|
||||
{};
|
||||
|
||||
|
||||
// We show this variant for timers which have
|
||||
// a target time, or is in a playing state.
|
||||
return model.type === 'timer' &&
|
||||
model.timerState === 'started';
|
||||
};
|
||||
|
||||
PauseTimerAction.prototype.perform = function () {
|
||||
var domainObject = this.domainObject,
|
||||
now = this.now;
|
||||
|
||||
function setTimestamp(model) {
|
||||
model.timestamp = now();
|
||||
function updateModel(model) {
|
||||
model.timerState = 'paused';
|
||||
model.pausedTime = now();
|
||||
}
|
||||
|
||||
return domainObject.useCapability('mutation', setTimestamp);
|
||||
return domainObject.useCapability('mutation', updateModel);
|
||||
};
|
||||
|
||||
return AbstractStartTimerAction;
|
||||
return PauseTimerAction;
|
||||
}
|
||||
);
|
||||
@@ -21,8 +21,8 @@
|
||||
*****************************************************************************/
|
||||
|
||||
define(
|
||||
['./AbstractStartTimerAction'],
|
||||
function (AbstractStartTimerAction) {
|
||||
[],
|
||||
function () {
|
||||
|
||||
/**
|
||||
* Implements the "Restart at 0" action.
|
||||
@@ -30,7 +30,6 @@ define(
|
||||
* Behaves the same as (and delegates functionality to)
|
||||
* the "Start" action.
|
||||
*
|
||||
* @extends {platform/features/clock.AbstractTimerAction}
|
||||
* @implements {Action}
|
||||
* @memberof platform/features/clock
|
||||
* @constructor
|
||||
@@ -39,24 +38,33 @@ define(
|
||||
* @param {ActionContext} context the context for this action
|
||||
*/
|
||||
function RestartTimerAction(now, context) {
|
||||
AbstractStartTimerAction.apply(this, [now, context]);
|
||||
this.domainObject = context.domainObject;
|
||||
this.now = now;
|
||||
}
|
||||
|
||||
RestartTimerAction.prototype =
|
||||
Object.create(AbstractStartTimerAction.prototype);
|
||||
|
||||
RestartTimerAction.appliesTo = function (context) {
|
||||
var model =
|
||||
(context.domainObject && context.domainObject.getModel()) ||
|
||||
{};
|
||||
|
||||
// We show this variant for timers which already have
|
||||
// a target time.
|
||||
// We show this variant for timers which already have a target time.
|
||||
return model.type === 'timer' &&
|
||||
model.timestamp !== undefined;
|
||||
model.timerState !== 'stopped';
|
||||
};
|
||||
|
||||
RestartTimerAction.prototype.perform = function () {
|
||||
var domainObject = this.domainObject,
|
||||
now = this.now;
|
||||
|
||||
function updateModel(model) {
|
||||
model.timestamp = now();
|
||||
model.timerState = 'started';
|
||||
model.pausedTime = undefined;
|
||||
}
|
||||
|
||||
return domainObject.useCapability('mutation', updateModel);
|
||||
};
|
||||
|
||||
return RestartTimerAction;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
*****************************************************************************/
|
||||
|
||||
define(
|
||||
['./AbstractStartTimerAction'],
|
||||
function (AbstractStartTimerAction) {
|
||||
[],
|
||||
function () {
|
||||
|
||||
/**
|
||||
* Implements the "Start" action for timers.
|
||||
@@ -30,7 +30,6 @@ define(
|
||||
* Sets the reference timestamp in a timer to the current
|
||||
* time, such that it begins counting up.
|
||||
*
|
||||
* @extends {platform/features/clock.AbstractTimerAction}
|
||||
* @implements {Action}
|
||||
* @memberof platform/features/clock
|
||||
* @constructor
|
||||
@@ -39,12 +38,10 @@ define(
|
||||
* @param {ActionContext} context the context for this action
|
||||
*/
|
||||
function StartTimerAction(now, context) {
|
||||
AbstractStartTimerAction.apply(this, [now, context]);
|
||||
this.domainObject = context.domainObject;
|
||||
this.now = now;
|
||||
}
|
||||
|
||||
StartTimerAction.prototype =
|
||||
Object.create(AbstractStartTimerAction.prototype);
|
||||
|
||||
StartTimerAction.appliesTo = function (context) {
|
||||
var model =
|
||||
(context.domainObject && context.domainObject.getModel()) ||
|
||||
@@ -53,10 +50,28 @@ define(
|
||||
// We show this variant for timers which do not yet have
|
||||
// a target time.
|
||||
return model.type === 'timer' &&
|
||||
model.timestamp === undefined;
|
||||
model.timerState !== 'started';
|
||||
};
|
||||
|
||||
StartTimerAction.prototype.perform = function () {
|
||||
var domainObject = this.domainObject,
|
||||
now = this.now;
|
||||
|
||||
function updateModel(model) {
|
||||
//if we are resuming
|
||||
if (model.pausedTime) {
|
||||
var timeShift = now() - model.pausedTime;
|
||||
model.timestamp = model.timestamp + timeShift;
|
||||
} else {
|
||||
model.timestamp = now();
|
||||
}
|
||||
model.timerState = 'started';
|
||||
model.pausedTime = undefined;
|
||||
}
|
||||
|
||||
return domainObject.useCapability('mutation', updateModel);
|
||||
};
|
||||
|
||||
return StartTimerAction;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
71
platform/features/clock/src/actions/StopTimerAction.js
Normal file
71
platform/features/clock/src/actions/StopTimerAction.js
Normal file
@@ -0,0 +1,71 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2009-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.
|
||||
*****************************************************************************/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
|
||||
/**
|
||||
* Implements the "Stop" action for timers.
|
||||
*
|
||||
* Sets the reference timestamp in a timer undefined,
|
||||
* such that it is reset and makes no movements.
|
||||
*
|
||||
* @implements {Action}
|
||||
* @memberof platform/features/clock
|
||||
* @constructor
|
||||
* @param {Function} now a function which returns the current
|
||||
* time (typically wrapping `Date.now`)
|
||||
* @param {ActionContext} context the context for this action
|
||||
*/
|
||||
function StopTimerAction(now, context) {
|
||||
this.domainObject = context.domainObject;
|
||||
this.now = now;
|
||||
}
|
||||
|
||||
StopTimerAction.appliesTo = function (context) {
|
||||
var model =
|
||||
(context.domainObject && context.domainObject.getModel()) ||
|
||||
{};
|
||||
|
||||
|
||||
// We show this variant for timers which do not yet have
|
||||
// a target time.
|
||||
return model.type === 'timer' &&
|
||||
model.timerState !== 'stopped';
|
||||
};
|
||||
|
||||
StopTimerAction.prototype.perform = function () {
|
||||
var domainObject = this.domainObject;
|
||||
|
||||
function updateModel(model) {
|
||||
model.timestamp = undefined;
|
||||
model.timerState = 'stopped';
|
||||
model.pausedTime = undefined;
|
||||
}
|
||||
|
||||
return domainObject.useCapability('mutation', updateModel);
|
||||
};
|
||||
|
||||
return StopTimerAction;
|
||||
}
|
||||
);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user