diff --git a/.circleci/config.yml b/.circleci/config.yml index b6d8b741f6..0640f9adec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,24 +11,20 @@ jobs: name: Update npm command: 'sudo npm install -g npm@latest' - restore_cache: - key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "bower.json" }} + key: dependency-cache-{{ checksum "package.json" }} - run: name: Installing dependencies (npm install) command: npm install - save_cache: - key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "bower.json" }} + key: dependency-cache-{{ checksum "package.json" }} paths: - node_modules - - bower_components - run: name: npm run test command: npm run test - run: name: npm run lint command: npm run lint - - run: - name: npm run checkstyle - command: npm run checkstyle - store_artifacts: path: dist prefix: dist diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..497d70218f --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,79 @@ +module.exports = { + "env": { + "browser": true, + "es6": true, + "jasmine": true, + "amd": true + }, + "extends": "eslint:recommended", + "parser": "babel-eslint", + "parserOptions": { + "allowImportExportEverywhere": true, + "ecmaVersion": 2015, + "ecmaFeatures": { + "impliedStrict": true + } + }, + "rules": { + "no-bitwise": "error", + "curly": "error", + "eqeqeq": "error", + "guard-for-in": "error", + "no-extend-native": "error", + "no-inner-declarations": "off", + "no-use-before-define": ["error", "nofunc"], + "no-caller": "error", + "no-sequences": "error", + "no-irregular-whitespace": "error", + "no-new": "error", + "no-shadow": "error", + "no-undef": "error", + "no-unused-vars": [ + "error", + { + "vars": "all", + "args": "none" + } + ], + "no-console": "off", + "no-trailing-spaces": "error", + "space-before-function-paren": [ + "error", + { + "anonymous": "always", + "asyncArrow": "always", + "named": "never", + } + ], + "array-bracket-spacing": "error", + "space-in-parens": "error", + "space-before-blocks": "error", + "comma-dangle": "error", + "eol-last": "error", + "new-cap": [ + "error", + { + "capIsNew": false, + "properties": false + } + ], + "dot-notation": "error", + "indent": ["error", 4] + }, + "overrides": [ + { + "files": ["*Spec.js"], + "rules": { + "no-unused-vars": [ + "warn", + { + "vars": "all", + "args": "none", + "varsIgnorePattern": "controller", + + } + ] + } + } + ] +}; diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 7229391def..0000000000 --- a/.jscsrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "preset": "crockford", - "requireMultipleVarDecl": false, - "requireVarDeclFirst": false -} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 6899edfb4e..0000000000 --- a/.jshintrc +++ /dev/null @@ -1,26 +0,0 @@ -{ - "bitwise": true, - "browser": true, - "curly": true, - "eqeqeq": true, - "forin": true, - "freeze": true, - "funcscope": false, - "futurehostile": true, - "latedef": true, - "noarg": true, - "nocomma": true, - "nonbsp": true, - "nonew": true, - "predef": [ - "define", - "Promise", - "WeakMap", - "Map" - ], - "shadow": "outer", - "strict": "implied", - "undef": true, - "unused": "vars", - "latedef": "nofunc" -} diff --git a/README.md b/README.md index da942a50a8..30666a7a30 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,6 @@ Documentation will be generated in `target/docs`. ## Deploying Open MCT Open MCT is built using [`npm`](http://npmjs.com/) -and [`gulp`](http://gulpjs.com/). To build Open MCT for deployment: @@ -94,32 +93,13 @@ This will compile and minify JavaScript sources, as well as copy over assets. The contents of the `dist` folder will contain a runnable Open MCT instance (e.g. by starting an HTTP server in that directory), including: -* A `main.js` file containing Open MCT source code. -* Various assets in the `example` and `platform` directories. -* An `index.html` that runs Open MCT in its default configuration. - -Additional `gulp` tasks are defined in [the gulpfile](gulpfile.js). - -## Bundles - -A bundle is a group of software components (including source code, declared -as AMD modules, as well as resources such as images and HTML templates) -that is intended to be added or removed as a single unit. A plug-in for -Open MCT will be expressed as a bundle; platform components are also -expressed as bundles. - -A bundle is also just a directory which contains a file `bundle.json`, -which declares its contents. - -The file `bundles.json` (note the plural), at the top level of the -repository, is a JSON file containing an array of all bundles (expressed as -directory names) to include in a running instance of Open MCT. Adding or -removing paths from this list will add or remove bundles from the running -application. +* `openmct.js` - Open MCT source code. +* `openmct.css` - Basic styles to load to prevent a FOUC. +* `index.html`, an example to run Open MCT in the basic configuration. ## Tests -Tests are written for [Jasmine 1.3](http://jasmine.github.io/1.3/introduction.html) +Tests are written for [Jasmine 3](http://jasmine.github.io/) and run by [Karma](http://karma-runner.github.io). To run: `npm test` diff --git a/app.js b/app.js index 5da16d8f51..5fcbe8958c 100644 --- a/app.js +++ b/app.js @@ -7,79 +7,57 @@ * node app.js [options] */ -(function () { - "use strict"; - var BUNDLE_FILE = 'bundles.json', - options = require('minimist')(process.argv.slice(2)), - express = require('express'), - app = express(), - fs = require('fs'), - request = require('request'); +const options = require('minimist')(process.argv.slice(2)); +const express = require('express'); +const app = express(); +const fs = require('fs'); +const request = require('request'); - // Defaults - options.port = options.port || options.p || 8080; - options.host = options.host || options.h || 'localhost' - options.directory = options.directory || options.D || '.'; - ['include', 'exclude', 'i', 'x'].forEach(function (opt) { - options[opt] = options[opt] || []; - // Make sure includes/excludes always end up as arrays - options[opt] = Array.isArray(options[opt]) ? - options[opt] : [options[opt]]; - }); - options.include = options.include.concat(options.i); - options.exclude = options.exclude.concat(options.x); +// Defaults +options.port = options.port || options.p || 8080; +options.host = options.host || options.h || 'localhost' +options.directory = options.directory || options.D || '.'; - // Show command line options - if (options.help || options.h) { - console.log("\nUsage: node app.js [options]\n"); - console.log("Options:"); - console.log(" --help, -h Show this message."); - console.log(" --port, -p Specify port."); - console.log(" --include, -i Include the specified bundle."); - console.log(" --exclude, -x Exclude the specified bundle."); - console.log(" --directory, -D Serve files from specified directory."); - console.log(""); - process.exit(0); +// Show command line options +if (options.help || options.h) { + console.log("\nUsage: node app.js [options]\n"); + console.log("Options:"); + console.log(" --help, -h Show this message."); + console.log(" --port, -p Specify port."); + console.log(" --directory, -D Serve files from specified directory."); + console.log(""); + process.exit(0); +} + +app.disable('x-powered-by'); + +app.use('/proxyUrl', function proxyRequest(req, res, next) { + console.log('Proxying request to: ', req.query.url); + req.pipe(request({ + url: req.query.url, + strictSSL: false + }).on('error', next)).pipe(res); +}); + +const webpack = require('webpack'); +const webpackConfig = require('./webpack.config.js'); +const compiler = webpack(webpackConfig); +const webpackDevRoute = require('webpack-dev-middleware')( + compiler, { + publicPath: '/dist', + logLevel: 'warn' } +); - app.disable('x-powered-by'); +app.use(webpackDevRoute); - // Override bundles.json for HTTP requests - app.use('/' + BUNDLE_FILE, function (req, res) { - var bundles; +// Expose index.html for development users. +app.get('/', function (req, res) { + fs.createReadStream('index.html').pipe(res); +}); - try { - bundles = JSON.parse(fs.readFileSync(BUNDLE_FILE, 'utf8')); - } catch (e) { - bundles = []; - } - - // Handle command line inclusions/exclusions - bundles = bundles.concat(options.include); - bundles = bundles.filter(function (bundle) { - return options.exclude.indexOf(bundle) === -1; - }); - bundles = bundles.filter(function (bundle, index) { // Uniquify - return bundles.indexOf(bundle) === index; - }); - - res.send(JSON.stringify(bundles)); - }); - - app.use('/proxyUrl', function proxyRequest(req, res, next) { - console.log('Proxying request to: ', req.query.url); - req.pipe(request({ - url: req.query.url, - strictSSL: false - }).on('error', next)).pipe(res); - }); - - // Expose everything else as static files - app.use(express['static'](options.directory)); - - // Finally, open the HTTP server and log the instance to the console - app.listen(options.port, options.host, function() { - console.log('Open MCT application running at %s:%s', options.host, options.port) - }); -}()); +// Finally, open the HTTP server and log the instance to the console +app.listen(options.port, options.host, function() { + console.log('Open MCT application running at %s:%s', options.host, options.port) +}); diff --git a/bower.json b/bower.json deleted file mode 100644 index 08643e4572..0000000000 --- a/bower.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "openmct", - "description": "The Open MCT core platform", - "main": "", - "license": "Apache-2.0", - "moduleType": [], - "homepage": "http://nasa.github.io/openmct/", - "private": true, - "dependencies": { - "angular": "1.4.4", - "angular-route": "1.4.4", - "moment": "^2.11.1", - "moment-duration-format": "^1.3.0", - "requirejs": "~2.1.22", - "text": "requirejs-text#^2.0.14", - "es6-promise": "^3.3.0", - "screenfull": "^3.0.0", - "node-uuid": "^1.4.7", - "comma-separated-values": "^3.6.4", - "file-saver": "1.3.3", - "zepto": "^1.1.6", - "eventemitter3": "^1.2.0", - "lodash": "3.10.1", - "almond": "~0.3.2", - "moment-timezone": "^0.5.13" - } -} \ No newline at end of file diff --git a/example/builtins/README.md b/example/builtins/README.md deleted file mode 100644 index 2f60e54a57..0000000000 --- a/example/builtins/README.md +++ /dev/null @@ -1,8 +0,0 @@ -This bundle is intended to serve as an example of registering -extensions which are mapped directly to built-in Angular features. - -These are: -* Controllers -* Directives -* Routes -* Services diff --git a/example/builtins/bundle.js b/example/builtins/bundle.js deleted file mode 100644 index 48150891c5..0000000000 --- a/example/builtins/bundle.js +++ /dev/null @@ -1,74 +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/ExampleController", - "./src/ExampleDirective", - "./src/ExampleService", - 'legacyRegistry' -], function ( - ExampleController, - ExampleDirective, - ExampleService, - legacyRegistry -) { - "use strict"; - - legacyRegistry.register("example/builtins", { - "name": "Angular Built-ins Example", - "description": "Example showing how to declare extensions with built-in support from Angular.", - "sources": "src", - "extensions": { - "controllers": [ - { - "key": "ExampleController", - "implementation": ExampleController, - "depends": [ - "$scope", - "exampleService" - ] - } - ], - "directives": [ - { - "key": "exampleDirective", - "implementation": ExampleDirective, - "depends": [ - "examples[]" - ] - } - ], - "routes": [ - { - "templateUrl": "templates/example.html" - } - ], - "services": [ - { - "key": "exampleService", - "implementation": ExampleService - } - ] - } - }); -}); diff --git a/example/builtins/res/templates/example.html b/example/builtins/res/templates/example.html deleted file mode 100644 index 3ba43d0fc9..0000000000 --- a/example/builtins/res/templates/example.html +++ /dev/null @@ -1,24 +0,0 @@ - -

Hello, world! I am the default route.

-

My controller has told me: "{{phrase}}"

- diff --git a/example/builtins/src/ExampleController.js b/example/builtins/src/ExampleController.js deleted file mode 100644 index 95a2d4fc8f..0000000000 --- a/example/builtins/src/ExampleController.js +++ /dev/null @@ -1,42 +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 ExampleController. Created by vwoeltje on 11/4/14. - */ -define( - [], - function () { - "use strict"; - - /** - * - * @constructor - */ - function ExampleController($scope, exampleService) { - $scope.phrase = exampleService.getMessage(); - } - - return ExampleController; - } -); diff --git a/example/builtins/src/ExampleDirective.js b/example/builtins/src/ExampleDirective.js deleted file mode 100644 index 2624f0b317..0000000000 --- a/example/builtins/src/ExampleDirective.js +++ /dev/null @@ -1,66 +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 ExampleDirective. Created by vwoeltje on 11/4/14. - */ -define( - [], - function () { - "use strict"; - - var HAS_EXTENSIONS = "A directive loaded these message from " + - "example extensions.", - NO_EXTENSIONS = "A directive tried to load example extensions," + - " but found none.", - MESSAGE = "I heard this from my partial constructor."; - - /** - * - * @constructor - */ - function ExampleDirective(examples) { - // Build up a template from example extensions - var template = examples.length > 0 ? - HAS_EXTENSIONS : NO_EXTENSIONS; - - template += "
    "; - examples.forEach(function (E) { - template += "
  • "; - if (typeof E === 'function') { - template += (new E(MESSAGE)).getText(); - } else { - template += E.text; - } - template += "
  • "; - }); - template += "
"; - - return { - template: template - }; - } - - return ExampleDirective; - } -); diff --git a/example/builtins/src/ExampleService.js b/example/builtins/src/ExampleService.js deleted file mode 100644 index d719151596..0000000000 --- a/example/builtins/src/ExampleService.js +++ /dev/null @@ -1,46 +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 ExampleService. Created by vwoeltje on 11/4/14. - */ -define( - [], - function () { - "use strict"; - - /** - * - * @constructor - */ - function ExampleService() { - return { - getMessage: function () { - return "I heard this from a service"; - } - }; - } - - return ExampleService; - } -); diff --git a/example/composite/bundle.js b/example/composite/bundle.js deleted file mode 100644 index c432ca8148..0000000000 --- a/example/composite/bundle.js +++ /dev/null @@ -1,82 +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/SomeProvider", - "./src/SomeOtherProvider", - "./src/SomeDecorator", - "./src/SomeOtherDecorator", - "./src/SomeAggregator", - "./src/SomeOtherExample", - 'legacyRegistry' -], function ( - SomeProvider, - SomeOtherProvider, - SomeDecorator, - SomeOtherDecorator, - SomeAggregator, - SomeOtherExample, - legacyRegistry -) { - "use strict"; - - legacyRegistry.register("example/composite", { - "extensions": { - "components": [ - { - "implementation": SomeProvider, - "provides": "someService", - "type": "provider" - }, - { - "implementation": SomeOtherProvider, - "provides": "someService", - "type": "provider" - }, - { - "implementation": SomeDecorator, - "provides": "someService", - "type": "decorator" - }, - { - "implementation": SomeOtherDecorator, - "provides": "someService", - "type": "decorator" - }, - { - "implementation": SomeAggregator, - "provides": "someService", - "type": "aggregator" - } - ], - "examples": [ - { - "implementation": SomeOtherExample, - "depends": [ - "someService" - ] - } - ] - } - }); -}); diff --git a/example/composite/src/SomeAggregator.js b/example/composite/src/SomeAggregator.js deleted file mode 100644 index e922c7f412..0000000000 --- a/example/composite/src/SomeAggregator.js +++ /dev/null @@ -1,50 +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 SomeAggregator. Created by vwoeltje on 11/5/14. - */ -define( - [], - function () { - "use strict"; - - /** - * - * @constructor - */ - function SomeAggregator(someProviders) { - return { - getMessages: function () { - return someProviders.map(function (provider) { - return provider.getMessages(); - }).reduce(function (a, b) { - return a.concat(b); - }, []); - } - }; - } - - return SomeAggregator; - } -); diff --git a/example/composite/src/SomeDecorator.js b/example/composite/src/SomeDecorator.js deleted file mode 100644 index 33be63b31d..0000000000 --- a/example/composite/src/SomeDecorator.js +++ /dev/null @@ -1,48 +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 SomeDecorator. Created by vwoeltje on 11/5/14. - */ -define( - [], - function () { - "use strict"; - - /** - * - * @constructor - */ - function SomeDecorator(someProvider) { - return { - getMessages: function () { - return someProvider.getMessages().map(function (msg) { - return msg.toLocaleUpperCase(); - }); - } - }; - } - - return SomeDecorator; - } -); diff --git a/example/composite/src/SomeOtherDecorator.js b/example/composite/src/SomeOtherDecorator.js deleted file mode 100644 index 14cc5050da..0000000000 --- a/example/composite/src/SomeOtherDecorator.js +++ /dev/null @@ -1,48 +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 SomeOtherDecorator. Created by vwoeltje on 11/5/14. - */ -define( - [], - function () { - "use strict"; - - /** - * - * @constructor - */ - function SomeOtherDecorator(someProvider) { - return { - getMessages: function () { - return someProvider.getMessages().map(function (msg) { - return msg + "..."; - }); - } - }; - } - - return SomeOtherDecorator; - } -); diff --git a/example/composite/src/SomeOtherExample.js b/example/composite/src/SomeOtherExample.js deleted file mode 100644 index 2bda95e686..0000000000 --- a/example/composite/src/SomeOtherExample.js +++ /dev/null @@ -1,46 +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 SomeOtherExample. Created by vwoeltje on 11/5/14. - */ -define( - [], - function () { - "use strict"; - - /** - * - * @constructor - */ - function SomeOtherExample(someService) { - return { - getText: function () { - return someService.getMessages().join(" | "); - } - }; - } - - return SomeOtherExample; - } -); diff --git a/example/composite/src/SomeOtherProvider.js b/example/composite/src/SomeOtherProvider.js deleted file mode 100644 index f08761d424..0000000000 --- a/example/composite/src/SomeOtherProvider.js +++ /dev/null @@ -1,48 +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 SomeOtherProvider. Created by vwoeltje on 11/5/14. - */ -define( - [], - function () { - "use strict"; - - /** - * - * @constructor - */ - function SomeOtherProvider() { - return { - getMessages: function () { - return [ - "I am a message from some other provider." - ]; - } - }; - } - - return SomeOtherProvider; - } -); diff --git a/example/composite/src/SomeProvider.js b/example/composite/src/SomeProvider.js deleted file mode 100644 index a8fdbb2dcf..0000000000 --- a/example/composite/src/SomeProvider.js +++ /dev/null @@ -1,48 +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 SomeProvider. Created by vwoeltje on 11/5/14. - */ -define( - [], - function () { - "use strict"; - - /** - * - * @constructor - */ - function SomeProvider() { - return { - getMessages: function () { - return [ - "I am a message from some provider." - ]; - } - }; - } - - return SomeProvider; - } -); diff --git a/example/eventGenerator/src/EventTelemetry.js b/example/eventGenerator/src/EventTelemetry.js index 781723657c..ed6a64ad36 100644 --- a/example/eventGenerator/src/EventTelemetry.js +++ b/example/eventGenerator/src/EventTelemetry.js @@ -22,24 +22,23 @@ /*global define */ /** - * Module defining EventTelemetry. + * Module defining EventTelemetry. * Created by chacskaylo on 06/18/2015. - * Modified by shale on 06/23/2015. + * Modified by shale on 06/23/2015. */ define( - ['text!../data/transcript.json'], - function (transcript) { + ['../data/transcript.json'], + function (messages) { "use strict"; - var firstObservedTime = Date.now(), - messages = JSON.parse(transcript); - + var firstObservedTime = Date.now(); + function EventTelemetry(request, interval) { var latestObservedTime = Date.now(), count = Math.floor((latestObservedTime - firstObservedTime) / interval), generatorData = {}; - + generatorData.getPointCount = function () { return count; }; @@ -48,13 +47,13 @@ define( return i * interval + (domain !== 'delta' ? firstObservedTime : 0); }; - + generatorData.getRangeValue = function (i, range) { var domainDelta = this.getDomainValue(i) - firstObservedTime, ind = i % messages.length; return messages[ind] + " - [" + domainDelta.toString() + "]"; }; - + return generatorData; } diff --git a/example/extensions/bundle.js b/example/extensions/bundle.js deleted file mode 100644 index aaf65cc697..0000000000 --- a/example/extensions/bundle.js +++ /dev/null @@ -1,51 +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/SomeExample", - 'legacyRegistry' -], function ( - SomeExample, - legacyRegistry -) { - "use strict"; - - legacyRegistry.register("example/extensions", { - "name": "Custom Extensions Examples", - "description": "Example showing how to declare custom extensions.", - "sources": "src", - "extensions": { - "examples": [ - { - "text": "I came from example/extensions" - }, - { - "implementation": SomeExample, - "depends": [ - "exampleService" - ] - } - ] - } - }); -}); diff --git a/example/extensions/src/SomeExample.js b/example/extensions/src/SomeExample.js deleted file mode 100644 index baaf523d7c..0000000000 --- a/example/extensions/src/SomeExample.js +++ /dev/null @@ -1,52 +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 SomeExample. Created by vwoeltje on 11/5/14. - */ -define( - [], - function () { - "use strict"; - - /** - * - * @constructor - */ - function SomeExample(exampleService, message) { - return { - getText: function () { - return [ - '"', - exampleService.getMessage(), - '" and "', - message, - '"' - ].join(""); - } - }; - } - - return SomeExample; - } -); diff --git a/example/generator/WorkerInterface.js b/example/generator/WorkerInterface.js index ebf2688868..9c348da71f 100644 --- a/example/generator/WorkerInterface.js +++ b/example/generator/WorkerInterface.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - 'text!./generatorWorker.js', + 'raw-loader!./generatorWorker.js', 'uuid' ], function ( workerText, diff --git a/example/simpleVuePlugin/HelloWorld.vue b/example/simpleVuePlugin/HelloWorld.vue new file mode 100644 index 0000000000..6d7dd5fb86 --- /dev/null +++ b/example/simpleVuePlugin/HelloWorld.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/example/simpleVuePlugin/plugin.js b/example/simpleVuePlugin/plugin.js new file mode 100644 index 0000000000..dbd99ac08b --- /dev/null +++ b/example/simpleVuePlugin/plugin.js @@ -0,0 +1,37 @@ +import Vue from 'Vue'; +import HelloWorld from './HelloWorld.vue'; + +function SimpleVuePlugin () { + return function install(openmct) { + var views = (openmct.mainViews || openmct.objectViews); + + openmct.types.addType('hello-world', { + name: 'Hello World', + description: 'An introduction object', + creatable: true + }); + openmct.objectViews.addProvider({ + name: "demo-provider", + key: "hello-world", + cssClass: "icon-packet", + canView: function (d) { + return d.type === 'hello-world'; + }, + view: function (domainObject) { + var vm; + return { + show: function (container) { + vm = new Vue(HelloWorld); + container.appendChild(vm.$mount().$el); + }, + destroy: function (container) { + vm.$destroy(); + } + }; + } + }); + + } +} + +export default SimpleVuePlugin diff --git a/example/styleguide/bundle.js b/example/styleguide/bundle.js index aa8fda6d84..b06fa66676 100644 --- a/example/styleguide/bundle.js +++ b/example/styleguide/bundle.js @@ -1,10 +1,26 @@ define([ "./src/ExampleStyleGuideModelProvider", "./src/MCTExample", + "./res/templates/intro.html", + "./res/templates/standards.html", + "./res/templates/colors.html", + "./res/templates/status.html", + "./res/templates/glyphs.html", + "./res/templates/controls.html", + "./res/templates/input.html", + "./res/templates/menus.html", 'legacyRegistry' ], function ( ExampleStyleGuideModelProvider, MCTExample, + introTemplate, + standardsTemplate, + colorsTemplate, + statusTemplate, + glyphsTemplate, + controlsTemplate, + inputTemplate, + menusTemplate, legacyRegistry ) { legacyRegistry.register("example/styleguide", { @@ -23,14 +39,14 @@ define([ { "key": "styleguide.menus", "name": "Menus", "cssClass": "icon-page", "description": "Context menus, dropdowns" } ], "views": [ - { "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 }, - { "key": "styleguide.menus", "type": "styleguide.menus", "templateUrl": "templates/menus.html", "editable": false } + { "key": "styleguide.intro", "type": "styleguide.intro", "template": introTemplate, "editable": false }, + { "key": "styleguide.standards", "type": "styleguide.standards", "template": standardsTemplate, "editable": false }, + { "key": "styleguide.colors", "type": "styleguide.colors", "template": colorsTemplate, "editable": false }, + { "key": "styleguide.status", "type": "styleguide.status", "template": statusTemplate, "editable": false }, + { "key": "styleguide.glyphs", "type": "styleguide.glyphs", "template": glyphsTemplate, "editable": false }, + { "key": "styleguide.controls", "type": "styleguide.controls", "template": controlsTemplate, "editable": false }, + { "key": "styleguide.input", "type": "styleguide.input", "template": inputTemplate, "editable": false }, + { "key": "styleguide.menus", "type": "styleguide.menus", "template": menusTemplate, "editable": false } ], "roots": [ { @@ -85,16 +101,6 @@ define([ "$q" ] } - ], - "stylesheets": [ - { - "stylesheetUrl": "css/style-guide-espresso.css", - "theme": "espresso" - }, - { - "stylesheetUrl": "css/style-guide-snow.css", - "theme": "snow" - } ] } }); diff --git a/example/styleguide/res/templates/intro.html b/example/styleguide/res/templates/intro.html index beba9b980d..72fbe4bb4e 100644 --- a/example/styleguide/res/templates/intro.html +++ b/example/styleguide/res/templates/intro.html @@ -34,7 +34,7 @@

As you develop plugins for Open MCT, consider how a generalized component might be combined with others when designing to create a rich and powerful larger object, rather than adding a single monolithic, non-modular plugin. To solve a particular problem or allow a new feature in Open MCT, you may need to introduce more than just one new object type.

- +
@@ -48,7 +48,7 @@

The types of objects that a container can hold should be based on the purpose of the container and the views that it affords. For example, a Folder’s purpose is to allow a user to conceptually organize objects of all other types; a Folder must therefore be able to contain an object of any type.

- +
@@ -60,7 +60,7 @@

Views are simply different ways to view the content of a given object. For example, telemetry data could be viewed as a plot or a table. A clock can display its time in analog fashion or with digital numbers. In each view, all of the content is present; it’s just represented differently. When providing views for an object, all the content of the object should be present in each view.

- +
@@ -70,4 +70,4 @@

- \ No newline at end of file + diff --git a/example/styleguide/src/MCTExample.js b/example/styleguide/src/MCTExample.js index d98150a94c..43b82a2c44 100644 --- a/example/styleguide/src/MCTExample.js +++ b/example/styleguide/src/MCTExample.js @@ -1,5 +1,5 @@ define([ - 'text!../res/templates/mct-example.html' + '../res/templates/mct-example.html' ], function ( MCTExampleTemplate ) { diff --git a/example/taxonomy/bundle.js b/example/taxonomy/bundle.js deleted file mode 100644 index b7031f2f35..0000000000 --- a/example/taxonomy/bundle.js +++ /dev/null @@ -1,68 +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/ExampleTaxonomyModelProvider", - 'legacyRegistry' -], function ( - ExampleTaxonomyModelProvider, - legacyRegistry -) { - "use strict"; - - legacyRegistry.register("example/taxonomy", { - "name": "Example taxonomy", - "description": "Example illustrating the addition of a static top-level hierarchy", - "extensions": { - "roots": [ - { - "id": "exampleTaxonomy" - } - ], - "models": [ - { - "id": "exampleTaxonomy", - "model": { - "type": "folder", - "name": "Stub Subsystems", - "composition": [ - "examplePacket0", - "examplePacket1", - "examplePacket2" - ] - } - } - ], - "components": [ - { - "provides": "modelService", - "type": "provider", - "implementation": ExampleTaxonomyModelProvider, - "depends": [ - "$q" - ] - } - ] - } - }); -}); diff --git a/example/taxonomy/src/ExampleTaxonomyModelProvider.js b/example/taxonomy/src/ExampleTaxonomyModelProvider.js deleted file mode 100644 index 7f779fae23..0000000000 --- a/example/taxonomy/src/ExampleTaxonomyModelProvider.js +++ /dev/null @@ -1,69 +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( - [], - function () { - "use strict"; - - function ExampleTaxonomyModelProvider($q) { - var models = {}, - packetId, - telemetryId, - i, - j; - - // Add some "subsystems" - for (i = 0; i < 3; i += 1) { - packetId = "examplePacket" + i; - - models[packetId] = { - name: "Stub Subsystem " + (i + 1), - type: "telemetry.panel", - composition: [] - }; - - // Add some "telemetry points" - for (j = 0; j < 100 * (i + 1); j += 1) { - telemetryId = "exampleTelemetry" + j; - models[telemetryId] = { - name: "SWG" + i + "." + j, - type: "generator", - telemetry: { - period: 10 + i + j - } - }; - models[packetId].composition.push(telemetryId); - } - } - - return { - getModels: function () { - return $q.when(models); - } - }; - } - - return ExampleTaxonomyModelProvider; - } -); diff --git a/example/worker/README.md b/example/worker/README.md deleted file mode 100644 index 811539ddeb..0000000000 --- a/example/worker/README.md +++ /dev/null @@ -1 +0,0 @@ -Example of running a Web Worker using the `workerService`. diff --git a/example/worker/bundle.js b/example/worker/bundle.js deleted file mode 100644 index 492a258514..0000000000 --- a/example/worker/bundle.js +++ /dev/null @@ -1,52 +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/FibonacciIndicator", - 'legacyRegistry' -], function ( - FibonacciIndicator, - legacyRegistry -) { - "use strict"; - - legacyRegistry.register("example/worker", { - "extensions": { - "indicators": [ - { - "implementation": FibonacciIndicator, - "depends": [ - "workerService", - "$rootScope" - ] - } - ], - "workers": [ - { - "key": "example.fibonacci", - "scriptUrl": "FibonacciWorker.js" - } - ] - } - }); -}); diff --git a/example/worker/src/FibonacciIndicator.js b/example/worker/src/FibonacciIndicator.js deleted file mode 100644 index 9ddf2c0b8e..0000000000 --- a/example/worker/src/FibonacciIndicator.js +++ /dev/null @@ -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( - [], - function () { - "use strict"; - - /** - * Displays Fibonacci numbers in the status area. - * @constructor - */ - function FibonacciIndicator(workerService, $rootScope) { - var latest, - counter = 0, - worker = workerService.run('example.fibonacci'); - - function requestNext() { - worker.postMessage([counter]); - counter += 1; - } - - function handleResponse(event) { - latest = event.data; - $rootScope.$apply(); - requestNext(); - } - - worker.onmessage = handleResponse; - requestNext(); - - return { - getCssClass: function () { - return "icon-object-unknown"; - }, - getText: function () { - return "" + latest; - }, - getDescription: function () { - return ""; - } - }; - } - - return FibonacciIndicator; - } -); diff --git a/example/worker/src/FibonacciWorker.js b/example/worker/src/FibonacciWorker.js deleted file mode 100644 index 2ad8e7f2af..0000000000 --- a/example/worker/src/FibonacciWorker.js +++ /dev/null @@ -1,15 +0,0 @@ -/*global self*/ -(function () { - "use strict"; - - // Calculate fibonacci numbers inefficiently. - // We can do this because we're on a background thread, and - // won't halt the UI. - function fib(n) { - return n < 2 ? n : (fib(n - 1) + fib(n - 2)); - } - - self.onmessage = function (event) { - self.postMessage(fib(event.data)); - }; -}()); diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index cd421329f4..0000000000 --- a/gulpfile.js +++ /dev/null @@ -1,182 +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 require,__dirname*/ - -require("v8-compile-cache"); - -var gulp = require('gulp'), - sourcemaps = require('gulp-sourcemaps'), - path = require('path'), - fs = require('fs'), - git = require('git-rev-sync'), - moment = require('moment'), - project = require('./package.json'), - _ = require('lodash'), - paths = { - main: 'openmct.js', - dist: 'dist', - reports: 'dist/reports', - scss: ['./platform/**/*.scss', './example/**/*.scss'], - assets: [ - './{example,platform}/**/*.{css,css.map,png,svg,ico,woff,eot,ttf}' - ], - scripts: [ 'openmct.js', 'platform/**/*.js', 'src/**/*.js' ], - specs: [ 'platform/**/*Spec.js', 'src/**/*Spec.js' ], - }, - options = { - requirejsOptimize: { - name: 'bower_components/almond/almond.js', - include: paths.main.replace('.js', ''), - wrap: { - start: (function () { - var buildVariables = { - version: project.version, - timestamp: moment.utc(Date.now()).format(), - revision: fs.existsSync('.git') ? git.long() : 'Unknown', - branch: fs.existsSync('.git') ? git.branch() : 'Unknown' - }; - return fs.readFileSync("src/start.frag", 'utf-8') - .replace(/@@(\w+)/g, function (match, key) { - return buildVariables[key]; - });; - }()), - endFile: "src/end.frag" - }, - optimize: 'uglify2', - uglify2: { output: { comments: /@preserve/ } }, - mainConfigFile: paths.main, - wrapShim: true - }, - karma: { - configFile: path.resolve(__dirname, 'karma.conf.js'), - singleRun: true - }, - sass: { - sourceComments: true - } - }; - -if (process.env.NODE_ENV === 'development') { - options.requirejsOptimize.optimize = 'none'; -} - - -gulp.task('scripts', function () { - var requirejsOptimize = require('gulp-requirejs-optimize'); - - return gulp.src(paths.main) - .pipe(sourcemaps.init()) - .pipe(requirejsOptimize(options.requirejsOptimize)) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest(paths.dist)); -}); - -gulp.task('test', function (done) { - var karma = require('karma'); - new karma.Server(options.karma, done).start(); -}); - -gulp.task('stylesheets', function () { - var sass = require('gulp-sass'); - var rename = require('gulp-rename'); - var bourbon = require('node-bourbon'); - options.sass.includePaths = bourbon.includePaths; - - return gulp.src(paths.scss, {base: '.'}) - .pipe(sourcemaps.init()) - .pipe(sass(options.sass).on('error', sass.logError)) - .pipe(rename(function (file) { - file.dirname = - file.dirname.replace(path.sep + 'sass', path.sep + 'css'); - return file; - })) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest(__dirname)); -}); - -gulp.task('lint', function () { - var jshint = require('gulp-jshint'); - var merge = require('merge-stream'); - - var nonspecs = paths.specs.map(function (glob) { - return "!" + glob; - }), - scriptLint = gulp.src(paths.scripts.concat(nonspecs)) - .pipe(jshint()), - specLint = gulp.src(paths.specs) - .pipe(jshint({ jasmine: true })); - - return merge(scriptLint, specLint) - .pipe(jshint.reporter('gulp-jshint-html-reporter', { - filename: paths.reports + '/lint/jshint-report.html', - createMissingFolders : true - })) - .pipe(jshint.reporter('default')) - .pipe(jshint.reporter('fail')); -}); - -gulp.task('checkstyle', function () { - var jscs = require('gulp-jscs'); - var mkdirp = require('mkdirp'); - var reportName = 'jscs-html-report.html'; - var reportPath = path.resolve(paths.reports, 'checkstyle', reportName); - var moveReport = fs.rename.bind(fs, reportName, reportPath, _.noop); - - mkdirp.sync(path.resolve(paths.reports, 'checkstyle')); - - return gulp.src(paths.scripts) - .pipe(jscs()) - .pipe(jscs.reporter()) - .pipe(jscs.reporter('jscs-html-reporter')).on('finish', moveReport) - .pipe(jscs.reporter('fail')); -}); - -gulp.task('fixstyle', function () { - var jscs = require('gulp-jscs'); - - return gulp.src(paths.scripts, { base: '.' }) - .pipe(jscs({ fix: true })) - .pipe(gulp.dest('.')); -}); - -gulp.task('assets', ['stylesheets'], function () { - return gulp.src(paths.assets) - .pipe(gulp.dest(paths.dist)); -}); - -gulp.task('watch', function () { - return gulp.watch(paths.scss, ['stylesheets', 'assets']); -}); - -gulp.task('serve', function () { - console.log('Running development server with all defaults'); - var app = require('./app.js'); -}); - -gulp.task('develop', ['serve', 'stylesheets', 'watch']); - -gulp.task('install', [ 'assets', 'scripts' ]); - -gulp.task('verify', [ 'lint', 'test', 'checkstyle' ]); - -gulp.task('build', [ 'verify', 'install' ]); \ No newline at end of file diff --git a/index.html b/index.html index c03d62a2d3..5281757d0d 100644 --- a/index.html +++ b/index.html @@ -26,66 +26,61 @@ - - - - - - - - + + + + + +
+ diff --git a/karma.conf.js b/karma.conf.js index 660acf3ac5..c373582f7e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -21,70 +21,40 @@ *****************************************************************************/ /*global module,process*/ -module.exports = function(config) { + +const devMode = process.env.NODE_ENV !== 'production'; + +module.exports = (config) => { + + const webpackConfig = require('./webpack.config.js'); + delete webpackConfig.output; + + if (!devMode) { + webpackConfig.module.rules.push({ + test: /\.js$/, + exclude: /node_modules|example/, + use: 'istanbul-instrumenter-loader' + }); + } + config.set({ - - // Base path that will be used to resolve all file patterns. basePath: '', - - // Frameworks to use - // Available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['jasmine', 'requirejs'], - - // List of files / patterns to load in the browser. - // By default, files are also included in a script tag. + frameworks: ['jasmine'], files: [ - {pattern: 'bower_components/**/*.js', included: false}, - {pattern: 'node_modules/d3-*/**/*.js', included: false}, - {pattern: 'node_modules/vue/**/*.js', included: false}, - {pattern: 'node_modules/printj/dist/*.js', included: false}, - {pattern: 'src/**/*', included: false}, - {pattern: 'node_modules/painterro/build/*.js', included: false}, - {pattern: 'node_modules/html2canvas/dist/*', included: false}, - {pattern: 'example/**/*.html', included: false}, - {pattern: 'example/**/*.js', included: false}, - {pattern: 'example/**/*.json', included: false}, - {pattern: 'platform/**/*.js', included: false}, - {pattern: 'warp/**/*.js', included: false}, - {pattern: 'platform/**/*.html', included: false}, - 'test-main.js' + 'platform/**/*Spec.js', + 'src/**/*Spec.js' ], - - // List of files to exclude. - exclude: [ - 'platform/framework/src/Main.js' - ], - - // Preprocess matching files before serving them to the browser. - // https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - 'src/**/!(*Spec).js': [ 'coverage' ], - 'platform/**/src/**/!(*Spec).js': [ 'coverage' ] - }, - - // Test results reporter to use - // Possible values: 'dots', 'progress' - // Available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress', 'coverage', 'html'], - - // Web server port. port: 9876, - - // Wnable / disable colors in the output (reporters and logs). + reporters: [ + 'progress', + 'coverage', + 'html' + ], + browsers: ['ChromeHeadless'], colors: true, - logLevel: config.LOG_INFO, - - // Rerun tests when any file changes. autoWatch: true, - // Specify browsers to run tests in. - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: [ - 'ChromeHeadless' - ], - - // Code coverage reporting. coverageReporter: { dir: process.env.CIRCLE_ARTIFACTS ? process.env.CIRCLE_ARTIFACTS + '/coverage' : @@ -104,8 +74,19 @@ module.exports = function(config) { foldAll: false }, - // Continuous Integration mode. - // If true, Karma captures browsers, runs the tests and exits. + preprocessors: { + // add webpack as preprocessor + 'platform/**/*Spec.js': [ 'webpack' ], + 'src/**/*Spec.js': [ 'webpack' ] + }, + + webpack: webpackConfig, + + webpackMiddleware: { + stats: 'errors-only', + logLevel: 'warn' + }, singleRun: true }); -}; +} + diff --git a/openmct.js b/openmct.js index ae6da66a3c..1e98ace22d 100644 --- a/openmct.js +++ b/openmct.js @@ -19,102 +19,32 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global requirejs,BUILD_CONSTANTS*/ +/*global module,BUILD_CONSTANTS*/ -requirejs.config({ - "paths": { - "legacyRegistry": "src/legacyRegistry", - "angular": "bower_components/angular/angular.min", - "angular-route": "bower_components/angular-route/angular-route.min", - "csv": "bower_components/comma-separated-values/csv.min", - "EventEmitter": "bower_components/eventemitter3/index", - "es6-promise": "bower_components/es6-promise/es6-promise.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/file-saver/FileSaver.min", - "screenfull": "bower_components/screenfull/dist/screenfull.min", - "text": "bower_components/text/text", - "uuid": "bower_components/node-uuid/uuid", - "vue": "node_modules/vue/dist/vue.min", - "zepto": "bower_components/zepto/zepto.min", - "lodash": "bower_components/lodash/lodash", - "d3-selection": "node_modules/d3-selection/dist/d3-selection.min", - "d3-scale": "node_modules/d3-scale/build/d3-scale.min", - "d3-axis": "node_modules/d3-axis/build/d3-axis.min", - "d3-array": "node_modules/d3-array/build/d3-array.min", - "d3-collection": "node_modules/d3-collection/build/d3-collection.min", - "d3-color": "node_modules/d3-color/build/d3-color.min", - "d3-format": "node_modules/d3-format/build/d3-format.min", - "d3-interpolate": "node_modules/d3-interpolate/build/d3-interpolate.min", - "d3-time": "node_modules/d3-time/build/d3-time.min", - "d3-time-format": "node_modules/d3-time-format/build/d3-time-format.min", - "html2canvas": "node_modules/html2canvas/dist/html2canvas.min", - "painterro": "node_modules/painterro/build/painterro.min", - "printj": "node_modules/printj/dist/printj.min" - }, - "shim": { - "angular": { - "exports": "angular" - }, - "angular-route": { - "deps": ["angular"] - }, - "EventEmitter": { - "exports": "EventEmitter" - }, - "moment-duration-format": { - "deps": ["moment"] - }, - "painterro": { - "exports": "Painterro" - }, - "saveAs": { - "exports": "saveAs" - }, - "screenfull": { - "exports": "screenfull" - }, - "zepto": { - "exports": "Zepto" - }, - "lodash": { - "exports": "lodash" - }, - "d3-selection": { - "exports": "d3-selection" - }, - "d3-scale": { - "deps": ["d3-array", "d3-collection", "d3-color", "d3-format", "d3-interpolate", "d3-time", "d3-time-format"], - "exports": "d3-scale" - }, - "d3-axis": { - "exports": "d3-axis" - }, - "dom-to-image": { - "exports": "domtoimage" - } +const matcher = /\/openmct.js$/; +if (document.currentScript) { + let src = document.currentScript.src; + if (src && matcher.test(src)) { + // eslint-disable-next-line no-undef + __webpack_public_path__ = src.replace(matcher, '') + '/'; } +} +const Main = require('./platform/framework/src/Main'); +const defaultRegistry = require('./src/defaultRegistry'); +const MCT = require('./src/MCT'); +const buildInfo = require('./src/plugins/buildInfo/plugin'); + +var openmct = new MCT(); + +openmct.legacyRegistry = defaultRegistry; +openmct.install(openmct.plugins.Plot()); + +if (typeof BUILD_CONSTANTS !== 'undefined') { + openmct.install(buildInfo(BUILD_CONSTANTS)); +} + +openmct.on('start', function () { + return new Main().run(defaultRegistry); }); -define([ - './platform/framework/src/Main', - './src/defaultRegistry', - './src/MCT', - './src/plugins/buildInfo/plugin' -], function (Main, defaultRegistry, MCT, buildInfo) { - var openmct = new MCT(); - - openmct.legacyRegistry = defaultRegistry; - openmct.install(openmct.plugins.Plot()); - - if (typeof BUILD_CONSTANTS !== 'undefined') { - openmct.install(buildInfo(BUILD_CONSTANTS)); - } - - openmct.on('start', function () { - return new Main().run(defaultRegistry); - }); - - return openmct; -}); +module.exports = openmct; diff --git a/package.json b/package.json index 121e0879b8..0313508174 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,15 @@ "name": "openmct", "version": "0.14.0-SNAPSHOT", "description": "The Open MCT core platform", - "dependencies": { + "dependencies": {}, + "devDependencies": { + "angular": "1.4.14", + "angular-route": "1.4.14", + "babel-eslint": "8.2.6", + "comma-separated-values": "^3.6.4", + "concurrently": "^3.6.1", + "copy-webpack-plugin": "^4.5.2", + "css-loader": "^1.0.0", "d3-array": "1.2.x", "d3-axis": "1.0.x", "d3-collection": "1.0.x", @@ -13,59 +21,68 @@ "d3-selection": "1.3.x", "d3-time": "1.0.x", "d3-time-format": "2.1.x", + "eslint": "5.2.0", + "eventemitter3": "^1.2.0", + "exports-loader": "^0.7.0", "express": "^4.13.1", - "minimist": "^1.1.1", - "painterro": "^0.2.65", - "request": "^2.69.0", - "vue": "^2.5.6" - }, - "devDependencies": { - "bower": "^1.7.7", + "fast-sass-loader": "^1.4.5", + "file-loader": "^1.1.11", + "file-saver": "^1.3.8", "git-rev-sync": "^1.4.0", "glob": ">= 3.0.0", - "gulp": "^3.9.1", - "gulp-jscs": "^3.0.2", - "gulp-jshint": "^2.0.0", - "gulp-jshint-html-reporter": "^0.1.3", - "gulp-rename": "^1.2.2", - "gulp-requirejs-optimize": "^0.3.1", - "gulp-sass": "^3.1.0", - "gulp-sourcemaps": "^1.6.0", + "html-loader": "^0.5.5", "html2canvas": "^1.0.0-alpha.12", + "imports-loader": "^0.8.0", + "istanbul-instrumenter-loader": "^3.0.1", "jasmine-core": "^3.1.0", - "jscs-html-reporter": "^0.1.0", "jsdoc": "^3.3.2", - "jshint": "^2.7.0", "karma": "^2.0.3", "karma-chrome-launcher": "^2.2.0", "karma-cli": "^1.0.1", "karma-coverage": "^1.1.2", "karma-html-reporter": "^0.2.7", "karma-jasmine": "^1.1.2", - "karma-requirejs": "^1.1.0", + "karma-webpack": "^3.0.0", "lodash": "^3.10.1", "markdown-toc": "^0.11.7", "marked": "^0.3.5", - "merge-stream": "^1.0.0", - "mkdirp": "^0.5.1", + "mini-css-extract-plugin": "^0.4.1", + "minimist": "^1.1.1", "moment": "^2.11.1", + "moment-duration-format": "^2.2.2", + "moment-timezone": "^0.5.21", "node-bourbon": "^4.2.3", + "node-sass": "^4.9.2", + "painterro": "^0.2.65", "printj": "^1.1.0", - "requirejs": "2.1.x", + "raw-loader": "^0.5.1", + "request": "^2.69.0", + "screenfull": "^3.3.2", "split": "^1.0.0", - "v8-compile-cache": "^1.1.0" + "style-loader": "^0.21.0", + "v8-compile-cache": "^1.1.0", + "vue": "2.5.6", + "vue-loader": "^15.2.6", + "vue-template-compiler": "2.5.6", + "webpack": "^4.16.2", + "webpack-cli": "^3.1.0", + "webpack-dev-middleware": "^3.1.3", + "zepto": "^1.2.0" }, "scripts": { "start": "node app.js", + "lint": "eslint platform src openmct.js", + "lint:fix": "eslint platform src openmct.js --fix", + "build:prod": "NODE_ENV=production webpack", + "build:dev": "webpack", + "build:watch": "webpack --watch", "test": "karma start --single-run", - "jshint": "jshint platform example", - "lint": "./node_modules/gulp/bin/gulp.js lint", - "checkstyle": "./node_modules/gulp/bin/gulp.js checkstyle", - "watch": "karma start", + "test:watch": "karma start --no-single-run", + "verify": "concurrently 'npm:test' 'npm:lint'", "jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api", "otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'", "docs": "npm run jsdoc ; npm run otherdoc", - "prepare": "node ./node_modules/bower/bin/bower install && node ./node_modules/gulp/bin/gulp.js install" + "prepare": "npm run build:prod" }, "repository": { "type": "git", diff --git a/platform/commonUI/about/bundle.js b/platform/commonUI/about/bundle.js index d46625a1ce..1db1575ccf 100644 --- a/platform/commonUI/about/bundle.js +++ b/platform/commonUI/about/bundle.js @@ -21,17 +21,17 @@ *****************************************************************************/ define([ - "text!./res/templates/about-dialog.html", + "./res/templates/about-dialog.html", "./src/LogoController", "./src/AboutController", "./src/LicenseController", - "text!./res/templates/app-logo.html", - "text!./res/templates/about-logo.html", - "text!./res/templates/overlay-about.html", - "text!./res/templates/license-apache.html", - "text!./res/templates/license-mit.html", - "text!./res/templates/licenses.html", - "text!./res/templates/licenses-export-md.html", + "./res/templates/app-logo.html", + "./res/templates/about-logo.html", + "./res/templates/overlay-about.html", + "./res/templates/license-apache.html", + "./res/templates/license-mit.html", + "./res/templates/licenses.html", + "./res/templates/licenses-export-md.html", 'legacyRegistry' ], function ( aboutDialogTemplate, diff --git a/platform/commonUI/browse/bundle.js b/platform/commonUI/browse/bundle.js index 975f3cdb0f..4bd6afad60 100644 --- a/platform/commonUI/browse/bundle.js +++ b/platform/commonUI/browse/bundle.js @@ -33,16 +33,16 @@ define([ "./src/windowing/NewTabAction", "./src/windowing/FullscreenAction", "./src/windowing/WindowTitler", - "text!./res/templates/browse.html", - "text!./res/templates/browse-object.html", - "text!./res/templates/items/grid-item.html", - "text!./res/templates/browse/object-header.html", - "text!./res/templates/browse/object-header-frame.html", - "text!./res/templates/menu-arrow.html", - "text!./res/templates/back-arrow.html", - "text!./res/templates/items/items.html", - "text!./res/templates/browse/object-properties.html", - "text!./res/templates/browse/inspector-region.html", + "./res/templates/browse.html", + "./res/templates/browse-object.html", + "./res/templates/items/grid-item.html", + "./res/templates/browse/object-header.html", + "./res/templates/browse/object-header-frame.html", + "./res/templates/menu-arrow.html", + "./res/templates/back-arrow.html", + "./res/templates/items/items.html", + "./res/templates/browse/object-properties.html", + "./res/templates/browse/inspector-region.html", 'legacyRegistry' ], function ( BrowseController, diff --git a/platform/commonUI/browse/src/BrowseObjectController.js b/platform/commonUI/browse/src/BrowseObjectController.js index 7fc3749dcc..16a731174c 100644 --- a/platform/commonUI/browse/src/BrowseObjectController.js +++ b/platform/commonUI/browse/src/BrowseObjectController.js @@ -31,7 +31,6 @@ define( * @constructor */ function BrowseObjectController($scope, $location, $route) { - var navigatedObject; function setViewForDomainObject(domainObject) { var locationViewKey = $location.search().view; @@ -47,7 +46,6 @@ define( ((domainObject && domainObject.useCapability('view')) || []) .forEach(selectViewIfMatching); } - navigatedObject = domainObject; } function updateQueryParam(viewKey) { diff --git a/platform/commonUI/browse/test/BrowseControllerSpec.js b/platform/commonUI/browse/test/BrowseControllerSpec.js index 20b20805a6..c089992fea 100644 --- a/platform/commonUI/browse/test/BrowseControllerSpec.js +++ b/platform/commonUI/browse/test/BrowseControllerSpec.js @@ -161,7 +161,7 @@ define( instantiateController(); return waitsForNavigation().then(function () { expect(mockNavigationService.setNavigation) - .toHaveBeenCalledWith(mockDefaultRootObject); + .toHaveBeenCalledWith(mockDefaultRootObject); }); }); @@ -172,7 +172,7 @@ define( return waitsForNavigation().then(function () { expect(mockNavigationService.setNavigation) - .toHaveBeenCalledWith(mockDefaultRootObject); + .toHaveBeenCalledWith(mockDefaultRootObject); }); }); diff --git a/platform/commonUI/browse/test/PaneControllerSpec.js b/platform/commonUI/browse/test/PaneControllerSpec.js index 94ec29c417..632581b36c 100644 --- a/platform/commonUI/browse/test/PaneControllerSpec.js +++ b/platform/commonUI/browse/test/PaneControllerSpec.js @@ -27,7 +27,6 @@ define( describe("The PaneController", function () { var mockScope, mockAgentService, - mockDomainObjects, mockWindow, controller, mockLocation, @@ -47,17 +46,6 @@ define( beforeEach(function () { mockScope = jasmine.createSpyObj("$scope", ["$on"]); - mockDomainObjects = ['a', 'b'].map(function (id) { - var mockDomainObject = jasmine.createSpyObj( - 'domainObject-' + id, - ['getId', 'getModel', 'getCapability'] - ); - - mockDomainObject.getId.and.returnValue(id); - mockDomainObject.getModel.and.returnValue({}); - - return mockDomainObject; - }); mockAgentService = jasmine.createSpyObj( "agentService", ["isMobile", "isPhone", "isTablet", "isPortrait", "isLandscape"] diff --git a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js index 7505d8da10..85e6d46d74 100644 --- a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js +++ b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js @@ -56,7 +56,7 @@ define([ return action.perform() .then(function () { expect(mockNavigationService.setNavigation) - .toHaveBeenCalledWith(mockDomainObject, true); + .toHaveBeenCalledWith(mockDomainObject, true); }); }); diff --git a/platform/commonUI/browse/test/windowing/FullscreenActionSpec.js b/platform/commonUI/browse/test/windowing/FullscreenActionSpec.js index ada9518557..3709f4c1b1 100644 --- a/platform/commonUI/browse/test/windowing/FullscreenActionSpec.js +++ b/platform/commonUI/browse/test/windowing/FullscreenActionSpec.js @@ -47,7 +47,7 @@ define( it("toggles fullscreen mode when performed", function () { action.perform(); - expect(window.screenfull.toggle).toHaveBeenCalled(); + expect(screenfull.toggle).toHaveBeenCalled(); }); it("provides displayable metadata", function () { diff --git a/platform/commonUI/browse/test/windowing/NewTabActionSpec.js b/platform/commonUI/browse/test/windowing/NewTabActionSpec.js index 8e2d20fb9f..cde65fdd3b 100644 --- a/platform/commonUI/browse/test/windowing/NewTabActionSpec.js +++ b/platform/commonUI/browse/test/windowing/NewTabActionSpec.js @@ -46,7 +46,7 @@ define( // tree is opened in a new tab using the // context menu mockContextSelected = jasmine.createSpyObj("context", ["selectedObject", - "domainObject"]); + "domainObject"]); // Mocks the urlService used to make the new tab's url from a // domainObject and mode @@ -54,11 +54,11 @@ define( // Action done using the current context or mockContextCurrent actionCurrent = new NewTabAction(mockUrlService, mockWindow, - mockContextCurrent); + mockContextCurrent); // Action done using the selected context or mockContextSelected actionSelected = new NewTabAction(mockUrlService, mockWindow, - mockContextSelected); + mockContextSelected); }); diff --git a/platform/commonUI/browse/test/windowing/WindowTitlerSpec.js b/platform/commonUI/browse/test/windowing/WindowTitlerSpec.js index ec1f6920c6..fdad395f43 100644 --- a/platform/commonUI/browse/test/windowing/WindowTitlerSpec.js +++ b/platform/commonUI/browse/test/windowing/WindowTitlerSpec.js @@ -32,7 +32,7 @@ define( mockRootScope, mockDocument, mockDomainObject, - titler; + titler; // eslint-disable-line beforeEach(function () { mockNavigationService = jasmine.createSpyObj( diff --git a/platform/commonUI/dialog/bundle.js b/platform/commonUI/dialog/bundle.js index 5bb6cc395e..d34de6a63c 100644 --- a/platform/commonUI/dialog/bundle.js +++ b/platform/commonUI/dialog/bundle.js @@ -23,13 +23,13 @@ define([ "./src/DialogService", "./src/OverlayService", - "text!./res/templates/overlay-dialog.html", - "text!./res/templates/overlay-options.html", - "text!./res/templates/dialog.html", - "text!./res/templates/overlay-blocking-message.html", - "text!./res/templates/message.html", - "text!./res/templates/overlay-message-list.html", - "text!./res/templates/overlay.html", + "./res/templates/overlay-dialog.html", + "./res/templates/overlay-options.html", + "./res/templates/dialog.html", + "./res/templates/overlay-blocking-message.html", + "./res/templates/message.html", + "./res/templates/overlay-message-list.html", + "./res/templates/overlay.html", 'legacyRegistry' ], function ( DialogService, diff --git a/platform/commonUI/dialog/test/DialogServiceSpec.js b/platform/commonUI/dialog/test/DialogServiceSpec.js index 85347cf2f3..4d1e6c5d5d 100644 --- a/platform/commonUI/dialog/test/DialogServiceSpec.js +++ b/platform/commonUI/dialog/test/DialogServiceSpec.js @@ -59,8 +59,8 @@ define( ["resolve", "reject"] ); mockDocument = jasmine.createSpyObj( - "$document", - ["find"] + "$document", + ["find"] ); mockBody = jasmine.createSpyObj('body', ['on', 'off']); mockDocument.find.and.returnValue(mockBody); diff --git a/platform/commonUI/edit/bundle.js b/platform/commonUI/edit/bundle.js index 63910dbdf6..2d823606bf 100644 --- a/platform/commonUI/edit/bundle.js +++ b/platform/commonUI/edit/bundle.js @@ -49,14 +49,14 @@ define([ "./src/creation/CreateActionProvider", "./src/creation/AddActionProvider", "./src/creation/CreationService", - "text!./res/templates/create/locator.html", - "text!./res/templates/create/create-button.html", - "text!./res/templates/create/create-menu.html", - "text!./res/templates/library.html", - "text!./res/templates/edit-object.html", - "text!./res/templates/edit-action-buttons.html", - "text!./res/templates/elements.html", - "text!./res/templates/topbar-edit.html", + "./res/templates/create/locator.html", + "./res/templates/create/create-button.html", + "./res/templates/create/create-menu.html", + "./res/templates/library.html", + "./res/templates/edit-object.html", + "./res/templates/edit-action-buttons.html", + "./res/templates/elements.html", + "./res/templates/topbar-edit.html", 'legacyRegistry' ], function ( EditActionController, diff --git a/platform/commonUI/edit/src/actions/SaveAsAction.js b/platform/commonUI/edit/src/actions/SaveAsAction.js index 7b34a1f881..642672cd8a 100644 --- a/platform/commonUI/edit/src/actions/SaveAsAction.js +++ b/platform/commonUI/edit/src/actions/SaveAsAction.js @@ -25,12 +25,12 @@ define([ '../creation/CreateWizard', './SaveInProgressDialog' ], - function ( - CreateWizard, - SaveInProgressDialog - ) { +function ( + CreateWizard, + SaveInProgressDialog +) { - /** + /** * The "Save" action; the action triggered by clicking Save from * Edit Mode. Exits the editing user interface and invokes object * capabilities to persist the changes that have been made. @@ -38,189 +38,189 @@ define([ * @implements {Action} * @memberof platform/commonUI/edit */ - function SaveAsAction( - $injector, - policyService, - dialogService, - copyService, - notificationService, - context - ) { - this.domainObject = (context || {}).domainObject; - this.injectObjectService = function () { - this.objectService = $injector.get("objectService"); - }; - this.policyService = policyService; - this.dialogService = dialogService; - this.copyService = copyService; - this.notificationService = notificationService; - } + function SaveAsAction( + $injector, + policyService, + dialogService, + copyService, + notificationService, + context + ) { + this.domainObject = (context || {}).domainObject; + this.injectObjectService = function () { + this.objectService = $injector.get("objectService"); + }; + this.policyService = policyService; + this.dialogService = dialogService; + this.copyService = copyService; + this.notificationService = notificationService; + } - /** + /** * @private */ - SaveAsAction.prototype.createWizard = function (parent) { - return new CreateWizard( - this.domainObject, - parent, - this.policyService - ); - }; + SaveAsAction.prototype.createWizard = function (parent) { + return new CreateWizard( + this.domainObject, + parent, + this.policyService + ); + }; - /** + /** * @private */ - SaveAsAction.prototype.getObjectService = function () { - // Lazily acquire object service (avoids cyclical dependency) - if (!this.objectService) { - this.injectObjectService(); - } - return this.objectService; - }; - - function resolveWith(object) { - return function () { - return object; - }; + SaveAsAction.prototype.getObjectService = function () { + // Lazily acquire object service (avoids cyclical dependency) + if (!this.objectService) { + this.injectObjectService(); } + return this.objectService; + }; - /** + function resolveWith(object) { + return function () { + return object; + }; + } + + /** * Save changes and conclude editing. * * @returns {Promise} a promise that will be fulfilled when * cancellation has completed * @memberof platform/commonUI/edit.SaveAction# */ - SaveAsAction.prototype.perform = function () { - // Discard the current root view (which will be the editing - // UI, which will have been pushed atop the Browse UI.) - function returnToBrowse(object) { - if (object) { - object.getCapability("action").perform("navigate"); - } - return object; + SaveAsAction.prototype.perform = function () { + // Discard the current root view (which will be the editing + // UI, which will have been pushed atop the Browse UI.) + function returnToBrowse(object) { + if (object) { + object.getCapability("action").perform("navigate"); } + return object; + } - return this.save().then(returnToBrowse); - }; + return this.save().then(returnToBrowse); + }; - /** + /** * @private */ - SaveAsAction.prototype.save = function () { - var self = this, - domainObject = this.domainObject, - copyService = this.copyService, - dialog = new SaveInProgressDialog(this.dialogService), - toUndirty = []; + SaveAsAction.prototype.save = function () { + var self = this, + domainObject = this.domainObject, + copyService = this.copyService, + dialog = new SaveInProgressDialog(this.dialogService), + toUndirty = []; - function doWizardSave(parent) { - var wizard = self.createWizard(parent); + function doWizardSave(parent) { + var wizard = self.createWizard(parent); - return self.dialogService - .getUserInput(wizard.getFormStructure(true), - wizard.getInitialFormValue()) - .then(wizard.populateObjectFromInput.bind(wizard), function (failureReason) { - return Promise.reject("user canceled"); - }); - } - - function showBlockingDialog(object) { - dialog.show(); - return object; - } - - function hideBlockingDialog(object) { - dialog.hide(); - return object; - } - - function fetchObject(objectId) { - return self.getObjectService().getObjects([objectId]).then(function (objects) { - return objects[objectId]; + return self.dialogService + .getUserInput(wizard.getFormStructure(true), + wizard.getInitialFormValue()) + .then(wizard.populateObjectFromInput.bind(wizard), function (failureReason) { + return Promise.reject("user canceled"); }); - } + } - function getParent(object) { - return fetchObject(object.getModel().location); - } + function showBlockingDialog(object) { + dialog.show(); + return object; + } - function allowClone(objectToClone) { - var allowed = + function hideBlockingDialog(object) { + dialog.hide(); + return object; + } + + function fetchObject(objectId) { + return self.getObjectService().getObjects([objectId]).then(function (objects) { + return objects[objectId]; + }); + } + + function getParent(object) { + return fetchObject(object.getModel().location); + } + + function allowClone(objectToClone) { + var allowed = (objectToClone.getId() === domainObject.getId()) || objectToClone.getCapability('location').isOriginal(); - if (allowed) { - toUndirty.push(objectToClone); - } - return allowed; + if (allowed) { + toUndirty.push(objectToClone); } + return allowed; + } - function cloneIntoParent(parent) { - return copyService.perform(domainObject, parent, allowClone); + function cloneIntoParent(parent) { + return copyService.perform(domainObject, parent, allowClone); + } + + function undirty(object) { + return object.getCapability('persistence').refresh(); + } + + function undirtyOriginals(object) { + return Promise.all(toUndirty.map(undirty)) + .then(resolveWith(object)); + } + + function saveAfterClone(clonedObject) { + return domainObject.getCapability("editor").save() + .then(resolveWith(clonedObject)); + } + + function finishEditing(clonedObject) { + return domainObject.getCapability("editor").finish() + .then(function () { + return fetchObject(clonedObject.getId()); + }); + } + + function onSuccess(object) { + self.notificationService.info("Save Succeeded"); + return object; + } + + function onFailure(reason) { + hideBlockingDialog(); + if (reason !== "user canceled") { + self.notificationService.error("Save Failed"); } + return false; + } - function undirty(object) { - return object.getCapability('persistence').refresh(); - } - - function undirtyOriginals(object) { - return Promise.all(toUndirty.map(undirty)) - .then(resolveWith(object)); - } - - function saveAfterClone(clonedObject) { - return domainObject.getCapability("editor").save() - .then(resolveWith(clonedObject)); - } - - function finishEditing(clonedObject) { - return domainObject.getCapability("editor").finish() - .then(function () { - return fetchObject(clonedObject.getId()); - }); - } - - function onSuccess(object) { - self.notificationService.info("Save Succeeded"); - return object; - } - - function onFailure(reason) { - hideBlockingDialog(); - if (reason !== "user canceled") { - self.notificationService.error("Save Failed"); - } - return false; - } - - return getParent(domainObject) - .then(doWizardSave) - .then(showBlockingDialog) - .then(getParent) - .then(cloneIntoParent) - .then(undirtyOriginals) - .then(saveAfterClone) - .then(finishEditing) - .then(hideBlockingDialog) - .then(onSuccess) - .catch(onFailure); - }; + return getParent(domainObject) + .then(doWizardSave) + .then(showBlockingDialog) + .then(getParent) + .then(cloneIntoParent) + .then(undirtyOriginals) + .then(saveAfterClone) + .then(finishEditing) + .then(hideBlockingDialog) + .then(onSuccess) + .catch(onFailure); + }; - /** + /** * Check if this action is applicable in a given context. * This will ensure that a domain object is present in the context, * and that this domain object is in Edit mode. * @returns true if applicable */ - SaveAsAction.appliesTo = function (context) { - var domainObject = (context || {}).domainObject; - return domainObject !== undefined && + SaveAsAction.appliesTo = function (context) { + var domainObject = (context || {}).domainObject; + return domainObject !== undefined && domainObject.hasCapability('editor') && domainObject.getCapability('editor').isEditContextRoot() && domainObject.getModel().persisted === undefined; - }; + }; - return SaveAsAction; - } + return SaveAsAction; +} ); diff --git a/platform/commonUI/edit/src/controllers/EditActionController.js b/platform/commonUI/edit/src/controllers/EditActionController.js index e9e048adae..fc9dc22b0c 100644 --- a/platform/commonUI/edit/src/controllers/EditActionController.js +++ b/platform/commonUI/edit/src/controllers/EditActionController.js @@ -49,8 +49,8 @@ define( // present context. function updateActions() { $scope.saveActions = $scope.action ? - $scope.action.getActions(SAVE_ACTION_CONTEXT) : - []; + $scope.action.getActions(SAVE_ACTION_CONTEXT) : + []; $scope.saveActionsAsMenuOptions = $scope.saveActions.map(actionToMenuOption); @@ -59,8 +59,8 @@ define( }; $scope.otherEditActions = $scope.action ? - $scope.action.getActions(OTHERS_ACTION_CONTEXT) : - []; + $scope.action.getActions(OTHERS_ACTION_CONTEXT) : + []; // Required because Angular does not allow 'bind' // in expressions. diff --git a/platform/commonUI/edit/src/controllers/ElementsController.js b/platform/commonUI/edit/src/controllers/ElementsController.js index 33de3d1db2..ef041b4972 100644 --- a/platform/commonUI/edit/src/controllers/ElementsController.js +++ b/platform/commonUI/edit/src/controllers/ElementsController.js @@ -49,7 +49,7 @@ define( function searchElements(value) { if ($scope.searchText) { return value.getModel().name.toLowerCase().search( - $scope.searchText.toLowerCase()) !== -1; + $scope.searchText.toLowerCase()) !== -1; } else { return true; } diff --git a/platform/commonUI/edit/src/creation/CreateMenuController.js b/platform/commonUI/edit/src/creation/CreateMenuController.js index dccb62c53e..0bc082dfc9 100644 --- a/platform/commonUI/edit/src/creation/CreateMenuController.js +++ b/platform/commonUI/edit/src/creation/CreateMenuController.js @@ -39,8 +39,8 @@ define( // Update the set of Create actions function refreshActions() { $scope.createActions = $scope.action ? - $scope.action.getActions('create') : - []; + $scope.action.getActions('create') : + []; } // Listen for new instances of the represented object's diff --git a/platform/commonUI/edit/src/policies/EditActionPolicy.js b/platform/commonUI/edit/src/policies/EditActionPolicy.js index 4ffee52198..dda1945e1d 100644 --- a/platform/commonUI/edit/src/policies/EditActionPolicy.js +++ b/platform/commonUI/edit/src/policies/EditActionPolicy.js @@ -59,7 +59,7 @@ define( (view.key === 'plot' && type.getKey() === 'telemetry.panel') || (view.key === 'table' && type.getKey() === 'table') || (view.key === 'rt-table' && type.getKey() === 'rttable') - ) { + ) { count++; } }); diff --git a/platform/commonUI/edit/test/actions/EditAndComposeActionSpec.js b/platform/commonUI/edit/test/actions/EditAndComposeActionSpec.js index 6e2aba90a8..7e2b18cacf 100644 --- a/platform/commonUI/edit/test/actions/EditAndComposeActionSpec.js +++ b/platform/commonUI/edit/test/actions/EditAndComposeActionSpec.js @@ -25,8 +25,7 @@ define( function (EditAndComposeAction) { describe("The Link action", function () { - var mockQ, - mockDomainObject, + var mockDomainObject, mockParent, mockContext, mockComposition, @@ -47,13 +46,10 @@ define( } beforeEach(function () { - - mockDomainObject = jasmine.createSpyObj( "domainObject", ["getId", "getCapability"] ); - mockQ = { when: mockPromise }; mockParent = { getModel: function () { return model; diff --git a/platform/commonUI/edit/test/creation/CreateActionSpec.js b/platform/commonUI/edit/test/creation/CreateActionSpec.js index 267258dc1d..0aabf35218 100644 --- a/platform/commonUI/edit/test/creation/CreateActionSpec.js +++ b/platform/commonUI/edit/test/creation/CreateActionSpec.js @@ -34,7 +34,6 @@ define( mockDomainObject, capabilities = {}, mockEditAction, - mockSaveAction, action; function mockPromise(value) { @@ -83,12 +82,6 @@ define( mockDomainObject.getCapability.and.callFake(function (name) { return capabilities[name]; }); - mockSaveAction = jasmine.createSpyObj( - "saveAction", - [ - "perform" - ] - ); capabilities.action = jasmine.createSpyObj( "actionCapability", diff --git a/platform/commonUI/edit/test/creation/CreateWizardSpec.js b/platform/commonUI/edit/test/creation/CreateWizardSpec.js index fd424e0471..c07df0df61 100644 --- a/platform/commonUI/edit/test/creation/CreateWizardSpec.js +++ b/platform/commonUI/edit/test/creation/CreateWizardSpec.js @@ -142,11 +142,11 @@ define( it("populates the model on the associated object", function () { var formValue = { - "A": "ValueA", - "B": "ValueB", - "C": "ValueC" - }, - compareModel = wizard.createModel(formValue); + "A": "ValueA", + "B": "ValueB", + "C": "ValueC" + }, + compareModel = wizard.createModel(formValue); //populateObjectFromInput adds a .location attribute that is not added by createModel. compareModel.location = undefined; wizard.populateObjectFromInput(formValue); diff --git a/platform/commonUI/edit/test/creation/CreationServiceSpec.js b/platform/commonUI/edit/test/creation/CreationServiceSpec.js index 3f0139230e..b1b3706433 100644 --- a/platform/commonUI/edit/test/creation/CreationServiceSpec.js +++ b/platform/commonUI/edit/test/creation/CreationServiceSpec.js @@ -114,7 +114,7 @@ define( mockNewObject.getId.and.returnValue('newId'); mockNewObject.getCapability.and.callFake(function (c) { return c === 'persistence' ? - mockNewPersistenceCapability : undefined; + mockNewPersistenceCapability : undefined; }); mockPersistenceCapability.persist diff --git a/platform/commonUI/edit/test/creation/LocatorControllerSpec.js b/platform/commonUI/edit/test/creation/LocatorControllerSpec.js index 5024323783..3575845f80 100644 --- a/platform/commonUI/edit/test/creation/LocatorControllerSpec.js +++ b/platform/commonUI/edit/test/creation/LocatorControllerSpec.js @@ -76,66 +76,66 @@ define( describe("when context is available", function () { beforeEach(function () { - mockContext.getRoot.and.returnValue(mockRootObject); - controller = new LocatorController(mockScope, mockTimeout, mockObjectService); - }); + mockContext.getRoot.and.returnValue(mockRootObject); + controller = new LocatorController(mockScope, mockTimeout, mockObjectService); + }); it("adds a treeModel to scope", function () { - expect(mockScope.treeModel).toBeDefined(); - }); + expect(mockScope.treeModel).toBeDefined(); + }); it("watches for changes to treeModel", function () { - // This is what the embedded tree representation - // will be modifying. - expect(mockScope.$watch).toHaveBeenCalledWith( - "treeModel.selectedObject", - jasmine.any(Function) - ); - }); + // This is what the embedded tree representation + // will be modifying. + expect(mockScope.$watch).toHaveBeenCalledWith( + "treeModel.selectedObject", + jasmine.any(Function) + ); + }); it("changes its own model on embedded model updates", function () { - // Need to pass on selection changes as updates to - // the control's value - mockScope.$watch.calls.mostRecent().args[1](mockDomainObject); - mockTimeout.calls.mostRecent().args[0](); - expect(mockScope.ngModel.someField).toEqual(mockDomainObject); - expect(mockScope.rootObject).toEqual(mockRootObject); + // Need to pass on selection changes as updates to + // the control's value + mockScope.$watch.calls.mostRecent().args[1](mockDomainObject); + mockTimeout.calls.mostRecent().args[0](); + expect(mockScope.ngModel.someField).toEqual(mockDomainObject); + expect(mockScope.rootObject).toEqual(mockRootObject); - // Verify that the capability we expect to have been used - // was used. - expect(mockDomainObject.getCapability) - .toHaveBeenCalledWith("context"); - }); + // Verify that the capability we expect to have been used + // was used. + expect(mockDomainObject.getCapability) + .toHaveBeenCalledWith("context"); + }); it("rejects changes which fail validation", function () { - mockScope.structure = { validate: jasmine.createSpy('validate') }; - mockScope.structure.validate.and.returnValue(false); + mockScope.structure = { validate: jasmine.createSpy('validate') }; + mockScope.structure.validate.and.returnValue(false); - // Pass selection change - mockScope.$watch.calls.mostRecent().args[1](mockDomainObject); - mockTimeout.calls.mostRecent().args[0](); + // Pass selection change + mockScope.$watch.calls.mostRecent().args[1](mockDomainObject); + mockTimeout.calls.mostRecent().args[0](); - expect(mockScope.structure.validate).toHaveBeenCalled(); - // Change should have been rejected - expect(mockScope.ngModel.someField).not.toEqual(mockDomainObject); - }); + expect(mockScope.structure.validate).toHaveBeenCalled(); + // Change should have been rejected + expect(mockScope.ngModel.someField).not.toEqual(mockDomainObject); + }); it("treats a lack of a selection as invalid", function () { - mockScope.ngModelController = jasmine.createSpyObj( - 'ngModelController', - ['$setValidity'] - ); + mockScope.ngModelController = jasmine.createSpyObj( + 'ngModelController', + ['$setValidity'] + ); - mockScope.$watch.calls.mostRecent().args[1](mockDomainObject); - mockTimeout.calls.mostRecent().args[0](); - expect(mockScope.ngModelController.$setValidity) - .toHaveBeenCalledWith(jasmine.any(String), true); + mockScope.$watch.calls.mostRecent().args[1](mockDomainObject); + mockTimeout.calls.mostRecent().args[0](); + expect(mockScope.ngModelController.$setValidity) + .toHaveBeenCalledWith(jasmine.any(String), true); - mockScope.$watch.calls.mostRecent().args[1](undefined); - mockTimeout.calls.mostRecent().args[0](); - expect(mockScope.ngModelController.$setValidity) - .toHaveBeenCalledWith(jasmine.any(String), false); - }); + mockScope.$watch.calls.mostRecent().args[1](undefined); + mockTimeout.calls.mostRecent().args[0](); + expect(mockScope.ngModelController.$setValidity) + .toHaveBeenCalledWith(jasmine.any(String), false); + }); }); describe("when no context is available", function () { var defaultRoot = "DEFAULT_ROOT"; diff --git a/platform/commonUI/edit/test/policies/EditActionPolicySpec.js b/platform/commonUI/edit/test/policies/EditActionPolicySpec.js index 2b9174488f..2ac5fbf96d 100644 --- a/platform/commonUI/edit/test/policies/EditActionPolicySpec.js +++ b/platform/commonUI/edit/test/policies/EditActionPolicySpec.js @@ -27,7 +27,6 @@ define( describe("The Edit action policy", function () { var editableView, nonEditableView, - undefinedView, testViews, testContext, mockDomainObject, @@ -67,7 +66,6 @@ define( editableView = { editable: true }; nonEditableView = { editable: false }; - undefinedView = { someKey: "some value" }; plotView = { key: "plot", editable: false }; testViews = []; diff --git a/platform/commonUI/edit/test/policies/EditContextualActionPolicySpec.js b/platform/commonUI/edit/test/policies/EditContextualActionPolicySpec.js index f197abb7b9..3a650a0516 100644 --- a/platform/commonUI/edit/test/policies/EditContextualActionPolicySpec.js +++ b/platform/commonUI/edit/test/policies/EditContextualActionPolicySpec.js @@ -75,25 +75,25 @@ define( it('Allows "remove" action when navigated object in edit mode,' + ' and selected object not editable, but its parent is.', - function () { - var mockParent = jasmine.createSpyObj("parentObject", ["hasCapability"]), - mockContextCapability = jasmine.createSpyObj("contextCapability", ["getParent"]); + function () { + var mockParent = jasmine.createSpyObj("parentObject", ["hasCapability"]), + mockContextCapability = jasmine.createSpyObj("contextCapability", ["getParent"]); - mockParent.hasCapability.and.returnValue(true); - mockContextCapability.getParent.and.returnValue(mockParent); - navigatedObject.hasCapability.and.returnValue(true); + mockParent.hasCapability.and.returnValue(true); + mockContextCapability.getParent.and.returnValue(mockParent); + navigatedObject.hasCapability.and.returnValue(true); - mockDomainObject.getCapability.and.returnValue(mockContextCapability); - mockDomainObject.hasCapability.and.callFake(function (capability) { - switch (capability) { - case "editor": return false; - case "context": return true; - } - }); - metadata.key = "remove"; - - expect(policy.allow(mockAction, context)).toBe(true); + mockDomainObject.getCapability.and.returnValue(mockContextCapability); + mockDomainObject.hasCapability.and.callFake(function (capability) { + switch (capability) { + case "editor": return false; + case "context": return true; + } }); + metadata.key = "remove"; + + expect(policy.allow(mockAction, context)).toBe(true); + }); it('Disallows "move" action when navigated object in edit mode,' + ' but selected object not in edit mode ', function () { diff --git a/platform/commonUI/edit/test/policies/EditableViewPolicySpec.js b/platform/commonUI/edit/test/policies/EditableViewPolicySpec.js index 7b6b97b556..094c5ba6b1 100644 --- a/platform/commonUI/edit/test/policies/EditableViewPolicySpec.js +++ b/platform/commonUI/edit/test/policies/EditableViewPolicySpec.js @@ -37,8 +37,8 @@ define( ); mockDomainObject.getCapability.and.returnValue({ inEditContext: function () { - return true; - } + return true; + } }); mockDomainObject.hasCapability.and.callFake(function (c) { return (c === 'editor') && testMode; diff --git a/platform/commonUI/edit/test/representers/EditToolbarSpec.js b/platform/commonUI/edit/test/representers/EditToolbarSpec.js index b394ff3519..cfbe453dfc 100644 --- a/platform/commonUI/edit/test/representers/EditToolbarSpec.js +++ b/platform/commonUI/edit/test/representers/EditToolbarSpec.js @@ -30,12 +30,6 @@ define( mockObjects, mockDomainObject, testStructure, - testAB, - testABC, - testABC2, - testABCXYZ, - testABCYZ, - testM, toolbar; beforeEach(function () { @@ -53,22 +47,15 @@ define( ]); testStructure = [ - { name: "A", property: "a", domainObject: mockDomainObject }, - { name: "B", property: "b", domainObject: mockDomainObject }, - { name: "C", property: "c", domainObject: mockDomainObject }, - { name: "X", property: "x", domainObject: mockDomainObject }, - { name: "Y", property: "y", domainObject: mockDomainObject }, - { name: "Z", property: "z", domainObject: mockDomainObject }, - { name: "M", method: "m", domainObject: mockDomainObject } + { name: "A", property: "a", domainObject: mockDomainObject }, + { name: "B", property: "b", domainObject: mockDomainObject }, + { name: "C", property: "c", domainObject: mockDomainObject }, + { name: "X", property: "x", domainObject: mockDomainObject }, + { name: "Y", property: "y", domainObject: mockDomainObject }, + { name: "Z", property: "z", domainObject: mockDomainObject }, + { name: "M", method: "m", domainObject: mockDomainObject } ]; - testAB = { a: 0, b: 1 }; - testABC = { a: 0, b: 1, c: 2 }; - testABC2 = { a: 4, b: 1, c: 2 }; // For inconsistent-state checking - testABCXYZ = { a: 0, b: 1, c: 2, x: 'X!', y: 'Y!', z: 'Z!' }; - testABCYZ = { a: 0, b: 1, c: 2, y: 'Y!', z: 'Z!' }; - testM = { m: jasmine.createSpy("method") }; - toolbar = new EditToolbar(mockScope, mockOpenMCT, testStructure); }); diff --git a/platform/commonUI/edit/test/services/NestedTransactionSpec.js b/platform/commonUI/edit/test/services/NestedTransactionSpec.js index 05b8bce582..db4cbaa08a 100644 --- a/platform/commonUI/edit/test/services/NestedTransactionSpec.js +++ b/platform/commonUI/edit/test/services/NestedTransactionSpec.js @@ -43,13 +43,12 @@ define(["../../src/services/NestedTransaction"], function (NestedTransaction) { describe("when callbacks are added", function () { var mockCommit, - mockCancel, - remove; + mockCancel; beforeEach(function () { mockCommit = jasmine.createSpy('commit'); mockCancel = jasmine.createSpy('cancel'); - remove = nestedTransaction.add(mockCommit, mockCancel); + nestedTransaction.add(mockCommit, mockCancel); }); it("does not interact with its parent transaction", function () { diff --git a/platform/commonUI/edit/test/services/TransactionServiceSpec.js b/platform/commonUI/edit/test/services/TransactionServiceSpec.js index 8ffe4ada55..cb8f7f9819 100644 --- a/platform/commonUI/edit/test/services/TransactionServiceSpec.js +++ b/platform/commonUI/edit/test/services/TransactionServiceSpec.js @@ -76,8 +76,8 @@ define( beforeEach(function () { onCommits = [0, 1, 2].map(function (val) { - return jasmine.createSpy("onCommit" + val); - }); + return jasmine.createSpy("onCommit" + val); + }); transactionService.startTransaction(); onCommits.forEach(transactionService.addToTransaction.bind(transactionService)); diff --git a/platform/commonUI/formats/src/UTCTimeFormat.js b/platform/commonUI/formats/src/UTCTimeFormat.js index 6f839241f6..6bbf7352cf 100644 --- a/platform/commonUI/formats/src/UTCTimeFormat.js +++ b/platform/commonUI/formats/src/UTCTimeFormat.js @@ -92,8 +92,8 @@ 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); diff --git a/platform/commonUI/general/bundle.js b/platform/commonUI/general/bundle.js index 48d630b244..76c952188d 100644 --- a/platform/commonUI/general/bundle.js +++ b/platform/commonUI/general/bundle.js @@ -52,26 +52,26 @@ define([ "./src/directives/MCTPreview", "./src/actions/MCTPreviewAction", "./src/filters/ReverseFilter", - "text!./res/templates/bottombar.html", - "text!./res/templates/controls/action-button.html", - "text!./res/templates/controls/input-filter.html", - "text!./res/templates/angular-indicator.html", - "text!./res/templates/message-banner.html", - "text!./res/templates/progress-bar.html", - "text!./res/templates/controls/time-controller.html", - "text!./res/templates/containers/accordion.html", - "text!./res/templates/subtree.html", - "text!./res/templates/tree.html", - "text!./res/templates/tree-node.html", - "text!./res/templates/label.html", - "text!./res/templates/controls/action-group.html", - "text!./res/templates/menu/context-menu.html", - "text!./res/templates/controls/switcher.html", - "text!./res/templates/object-inspector.html", - "text!./res/templates/controls/selector.html", - "text!./res/templates/controls/datetime-picker.html", - "text!./res/templates/controls/datetime-field.html", - "text!./res/templates/preview.html", + "./res/templates/bottombar.html", + "./res/templates/controls/action-button.html", + "./res/templates/controls/input-filter.html", + "./res/templates/angular-indicator.html", + "./res/templates/message-banner.html", + "./res/templates/progress-bar.html", + "./res/templates/controls/time-controller.html", + "./res/templates/containers/accordion.html", + "./res/templates/subtree.html", + "./res/templates/tree.html", + "./res/templates/tree-node.html", + "./res/templates/label.html", + "./res/templates/controls/action-group.html", + "./res/templates/menu/context-menu.html", + "./res/templates/controls/switcher.html", + "./res/templates/object-inspector.html", + "./res/templates/controls/selector.html", + "./res/templates/controls/datetime-picker.html", + "./res/templates/controls/datetime-field.html", + "./res/templates/preview.html", 'legacyRegistry' ], function ( UrlService, @@ -173,12 +173,6 @@ define([ "key": "reverse" } ], - "stylesheets": [ - { - "stylesheetUrl": "css/normalize.min.css", - "priority": "mandatory" - } - ], "templates": [ { "key": "bottombar", @@ -418,11 +412,11 @@ define([ "description": "Preview in large dialog", "category": [ "contextual", - "view-control" + "view-control" ], "depends": [ - "$compile", - "$rootScope" + "$compile", + "$rootScope" ], "priority": "preferred" } diff --git a/platform/commonUI/general/res/css/reset.css b/platform/commonUI/general/res/css/reset.css deleted file mode 100644 index ed11813c4e..0000000000 --- a/platform/commonUI/general/res/css/reset.css +++ /dev/null @@ -1,48 +0,0 @@ -/* http://meyerweb.com/eric/tools/css/reset/ - v2.0 | 20110126 - License: none (public domain) -*/ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-collapse: collapse; - border-spacing: 0; -} diff --git a/platform/commonUI/general/src/controllers/ContextMenuController.js b/platform/commonUI/general/src/controllers/ContextMenuController.js index e6e94ecc15..59cec37be5 100644 --- a/platform/commonUI/general/src/controllers/ContextMenuController.js +++ b/platform/commonUI/general/src/controllers/ContextMenuController.js @@ -38,8 +38,8 @@ define( // Refresh variable "menuActions" in the scope function updateActions() { $scope.menuActions = $scope.action ? - $scope.action.getActions({ category: 'contextual' }) : - []; + $scope.action.getActions({ category: 'contextual' }) : + []; } // Update using the action capability diff --git a/platform/commonUI/general/src/controllers/DateTimePickerController.js b/platform/commonUI/general/src/controllers/DateTimePickerController.js index 2e3c88f900..91467d8bd3 100644 --- a/platform/commonUI/general/src/controllers/DateTimePickerController.js +++ b/platform/commonUI/general/src/controllers/DateTimePickerController.js @@ -188,7 +188,7 @@ define( // Ensure some useful default $scope.ngModel[$scope.field] = $scope.ngModel[$scope.field] === undefined ? - now() : $scope.ngModel[$scope.field]; + now() : $scope.ngModel[$scope.field]; $scope.$watch('ngModel[field]', updateFromModel); $scope.$watchCollection('date', updateFromView); diff --git a/platform/commonUI/general/src/directives/MCTPreview.js b/platform/commonUI/general/src/directives/MCTPreview.js index 8121ada068..291615b986 100644 --- a/platform/commonUI/general/src/directives/MCTPreview.js +++ b/platform/commonUI/general/src/directives/MCTPreview.js @@ -28,16 +28,16 @@ define(['zepto', '../services/Overlay'], function ($, Overlay) { notebookAction = actions.getActions({key: 'notebook-new-entry'})[0]; var notebookButton = notebookAction ? - [ - { - class: 'icon-notebook new-notebook-entry', - title: 'New Notebook Entry', - clickHandler: function (event) { - event.stopPropagation(); - notebookAction.perform(); + [ + { + class: 'icon-notebook new-notebook-entry', + title: 'New Notebook Entry', + clickHandler: function (event) { + event.stopPropagation(); + notebookAction.perform(); + } } - } - ] : []; + ] : []; var overlayService = new Overlay({ $document: $document, diff --git a/platform/commonUI/general/src/directives/MCTResize.js b/platform/commonUI/general/src/directives/MCTResize.js index 48c0c08846..39384e8717 100644 --- a/platform/commonUI/general/src/directives/MCTResize.js +++ b/platform/commonUI/general/src/directives/MCTResize.js @@ -62,8 +62,8 @@ define( // Determine how long to wait before the next update function currentInterval() { return attrs.mctResizeInterval ? - scope.$eval(attrs.mctResizeInterval) : - DEFAULT_INTERVAL; + scope.$eval(attrs.mctResizeInterval) : + DEFAULT_INTERVAL; } // Evaluate mct-resize with the current bounds diff --git a/platform/commonUI/general/src/directives/MCTSplitPane.js b/platform/commonUI/general/src/directives/MCTSplitPane.js index 6acf40ff08..45687c0776 100644 --- a/platform/commonUI/general/src/directives/MCTSplitPane.js +++ b/platform/commonUI/general/src/directives/MCTSplitPane.js @@ -103,16 +103,16 @@ define( splitterSize, alias = $attrs.alias !== undefined ? - "mctSplitPane-" + $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)); + undefined : Number($window.localStorage.getItem(alias)); // Get relevant size (height or width) of DOM element function getSize(domElement) { return (anchor.orientation === 'vertical' ? - domElement.offsetWidth : domElement.offsetHeight); + domElement.offsetWidth : domElement.offsetHeight); } // Apply styles to child elements diff --git a/platform/commonUI/general/src/services/Overlay.js b/platform/commonUI/general/src/services/Overlay.js index 5a59e28263..4feb5dc9c8 100644 --- a/platform/commonUI/general/src/services/Overlay.js +++ b/platform/commonUI/general/src/services/Overlay.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ - /** +/** * Module defining OverlayService. Created by deeptailor on 03/29/2018 */ diff --git a/platform/commonUI/general/src/ui/ToggleView.js b/platform/commonUI/general/src/ui/ToggleView.js index d9a4916839..6222a506f4 100644 --- a/platform/commonUI/general/src/ui/ToggleView.js +++ b/platform/commonUI/general/src/ui/ToggleView.js @@ -22,7 +22,7 @@ define([ 'zepto', - 'text!../../res/templates/tree/toggle.html' + '../../res/templates/tree/toggle.html' ], function ($, toggleTemplate) { function ToggleView(state) { this.expanded = !!state; diff --git a/platform/commonUI/general/src/ui/TreeLabelView.js b/platform/commonUI/general/src/ui/TreeLabelView.js index 4f4761cd89..ed524b4d28 100644 --- a/platform/commonUI/general/src/ui/TreeLabelView.js +++ b/platform/commonUI/general/src/ui/TreeLabelView.js @@ -22,7 +22,7 @@ define([ 'zepto', - 'text!../../res/templates/tree/tree-label.html' + '../../res/templates/tree/tree-label.html' ], function ($, labelTemplate) { function TreeLabelView(gestureService) { diff --git a/platform/commonUI/general/src/ui/TreeNodeView.js b/platform/commonUI/general/src/ui/TreeNodeView.js index 944f4b9c6c..9c73058715 100644 --- a/platform/commonUI/general/src/ui/TreeNodeView.js +++ b/platform/commonUI/general/src/ui/TreeNodeView.js @@ -22,7 +22,7 @@ define([ 'zepto', - 'text!../../res/templates/tree/node.html', + '../../res/templates/tree/node.html', './ToggleView', './TreeLabelView' ], function ($, nodeTemplate, ToggleView, TreeLabelView) { diff --git a/platform/commonUI/general/src/ui/TreeView.js b/platform/commonUI/general/src/ui/TreeView.js index 8ee922c287..1b663d1576 100644 --- a/platform/commonUI/general/src/ui/TreeView.js +++ b/platform/commonUI/general/src/ui/TreeView.js @@ -23,7 +23,7 @@ define([ 'zepto', './TreeNodeView', - 'text!../../res/templates/tree/wait-node.html' + '../../res/templates/tree/wait-node.html' ], function ($, TreeNodeView, spinnerTemplate) { function TreeView(gestureService, openmct, selectFn) { diff --git a/platform/commonUI/general/test/StyleSheetLoaderSpec.js b/platform/commonUI/general/test/StyleSheetLoaderSpec.js index 2733b92d70..cc63ecfb09 100644 --- a/platform/commonUI/general/test/StyleSheetLoaderSpec.js +++ b/platform/commonUI/general/test/StyleSheetLoaderSpec.js @@ -31,7 +31,7 @@ define( mockHead, mockElement, testBundle, - loader; + loader; // eslint-disable-line beforeEach(function () { testBundle = { diff --git a/platform/commonUI/general/test/directives/MCTPopupSpec.js b/platform/commonUI/general/test/directives/MCTPopupSpec.js index 9884c665c6..3287a5b8fd 100644 --- a/platform/commonUI/general/test/directives/MCTPopupSpec.js +++ b/platform/commonUI/general/test/directives/MCTPopupSpec.js @@ -41,7 +41,6 @@ define( mockScope, mockElement, testAttrs, - mockBody, mockTransclude, mockParentEl, mockNewElement, @@ -59,8 +58,6 @@ define( jasmine.createSpyObj("$scope", ["$eval", "$apply", "$on"]); mockElement = jasmine.createSpyObj("element", JQLITE_METHODS); - mockBody = - jasmine.createSpyObj("body", JQLITE_METHODS); mockTransclude = jasmine.createSpy("transclude"); mockParentEl = diff --git a/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js b/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js index 09ed25f407..9b63a47b6a 100644 --- a/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js +++ b/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js @@ -25,13 +25,13 @@ define( function (MCTSplitPane) { var JQLITE_METHODS = [ - 'on', - 'addClass', - 'children', - 'eq', - 'toggleClass', - 'css' - ]; + 'on', + 'addClass', + 'children', + 'eq', + 'toggleClass', + 'css' + ]; describe("The mct-split-pane directive", function () { var mockParse, diff --git a/platform/commonUI/inspect/bundle.js b/platform/commonUI/inspect/bundle.js index 5b0031e744..5dbb41f497 100644 --- a/platform/commonUI/inspect/bundle.js +++ b/platform/commonUI/inspect/bundle.js @@ -24,10 +24,10 @@ define([ "./src/gestures/InfoGesture", "./src/gestures/InfoButtonGesture", "./src/services/InfoService", - "text!./res/info-table.html", - "text!./res/info-bubble.html", - "text!./res/bubble.html", - "text!./res/templates/info-button.html", + "./res/info-table.html", + "./res/info-bubble.html", + "./res/bubble.html", + "./res/templates/info-button.html", 'legacyRegistry' ], function ( InfoGesture, diff --git a/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js b/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js index d5eedf1540..8a6164e0aa 100644 --- a/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js +++ b/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js @@ -25,8 +25,7 @@ define( function (InfoButtonGesture) { describe("The info button gesture", function () { - var mockTimeout, - mockDocument, + var mockDocument, mockBody, mockAgentService, mockInfoService, @@ -42,7 +41,6 @@ define( fireDismissGesture; beforeEach(function () { - mockTimeout = jasmine.createSpy('$timeout'); mockDocument = jasmine.createSpyObj('$document', ['find']); mockBody = jasmine.createSpyObj('body', ['on', 'off', 'scope', 'css', 'unbind']); mockDocument.find.and.returnValue(mockBody); diff --git a/platform/commonUI/inspect/test/services/InfoServiceSpec.js b/platform/commonUI/inspect/test/services/InfoServiceSpec.js index 274dd26246..6e8112046d 100644 --- a/platform/commonUI/inspect/test/services/InfoServiceSpec.js +++ b/platform/commonUI/inspect/test/services/InfoServiceSpec.js @@ -114,9 +114,9 @@ define( location = [vertical, horizontal].join('-'); describe("when bubble goes " + location, function () { var expectedLocation = [ - goesUp ? "bottom" : "top", - goesLeft ? "right" : "left" - ].join('-'); + goesUp ? "bottom" : "top", + goesLeft ? "right" : "left" + ].join('-'); beforeEach(function () { mockPopup.goesUp.and.returnValue(goesUp); diff --git a/platform/commonUI/mobile/test/DeviceClassifierSpec.js b/platform/commonUI/mobile/test/DeviceClassifierSpec.js index c7dd7046b9..3e08ce4ecf 100644 --- a/platform/commonUI/mobile/test/DeviceClassifierSpec.js +++ b/platform/commonUI/mobile/test/DeviceClassifierSpec.js @@ -70,11 +70,11 @@ define( TEST_PERMUTATIONS.forEach(function (trueMethods) { var summary = trueMethods.length === 0 ? - "device has no detected characteristics" : - "device " + (trueMethods.join(", ")); + "device has no detected characteristics" : + "device " + (trueMethods.join(", ")); describe("when " + summary, function () { - var classifier; + var classifier; // eslint-disable-line beforeEach(function () { trueMethods.forEach(function (m) { diff --git a/platform/commonUI/notification/bundle.js b/platform/commonUI/notification/bundle.js index fe9b524c3b..4eb4a1e396 100644 --- a/platform/commonUI/notification/bundle.js +++ b/platform/commonUI/notification/bundle.js @@ -24,7 +24,7 @@ define([ "./src/NotificationIndicatorController", "./src/NotificationIndicator", "./src/NotificationService", - "text!./res/notification-indicator.html", + "./res/notification-indicator.html", 'legacyRegistry' ], function ( NotificationIndicatorController, diff --git a/platform/commonUI/notification/src/NotificationService.js b/platform/commonUI/notification/src/NotificationService.js index 5b16fb4689..0823482e7f 100644 --- a/platform/commonUI/notification/src/NotificationService.js +++ b/platform/commonUI/notification/src/NotificationService.js @@ -283,10 +283,10 @@ define( */ NotificationService.prototype.setHighestSeverity = function () { var severity = { - "info": 1, - "alert": 2, - "error": 3 - }; + "info": 1, + "alert": 2, + "error": 3 + }; this.highest.severity = this.notifications.reduce(function (previous, notification) { if (severity[notification.model.severity] > severity[previous]) { return notification.model.severity; diff --git a/platform/commonUI/regions/test/EditableRegionPolicySpec.js b/platform/commonUI/regions/test/EditableRegionPolicySpec.js index f8fcc30960..6aecfd07e8 100644 --- a/platform/commonUI/regions/test/EditableRegionPolicySpec.js +++ b/platform/commonUI/regions/test/EditableRegionPolicySpec.js @@ -41,7 +41,7 @@ define( editableRegionPolicy = new EditableRegionPolicy(); mockEditorCapability = jasmine.createSpyObj("editorCapability", [ - "inEditContext" + "inEditContext" ]); mockDomainObject = jasmine.createSpyObj("domainObject", [ "hasCapability", "getCapability" diff --git a/platform/commonUI/regions/test/RegionSpec.js b/platform/commonUI/regions/test/RegionSpec.js index 94d2b03564..01dd904b3e 100644 --- a/platform/commonUI/regions/test/RegionSpec.js +++ b/platform/commonUI/regions/test/RegionSpec.js @@ -41,11 +41,11 @@ define( it("adding a region at a specified index adds it in that" + " position", function () { - region.addRegion(part2, 1); + region.addRegion(part2, 1); - expect(region.regions.length).toBe(4); - expect(region.regions[1]).toBe(part2); - }); + expect(region.regions.length).toBe(4); + expect(region.regions[1]).toBe(part2); + }); it("adding a region without an index adds it at the end", function () { var partN = new Region({'name': 'partN'}); diff --git a/platform/commonUI/themes/espresso/bundle.js b/platform/commonUI/themes/espresso/bundle.js deleted file mode 100644 index d04e15b032..0000000000 --- a/platform/commonUI/themes/espresso/bundle.js +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, 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([ - - 'legacyRegistry' -], function ( - - legacyRegistry -) { - - legacyRegistry.register("platform/commonUI/themes/espresso", { - "name": "Espresso", - "description": "Espresso theme: dark and rich", - "extensions": { - "stylesheets": [ - { - "stylesheetUrl": "css/theme-espresso.css", - "priority": 1000 - } - ], - "constants": [ - { - "key": "THEME", - "value": "espresso" - } - ] - } - }); -}); diff --git a/platform/commonUI/themes/snow/bundle.js b/platform/commonUI/themes/snow/bundle.js deleted file mode 100644 index e579e8fac1..0000000000 --- a/platform/commonUI/themes/snow/bundle.js +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, 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([ - - 'legacyRegistry' -], function ( - - legacyRegistry -) { - - legacyRegistry.register("platform/commonUI/themes/snow", { - "name": "Snow", - "description": "Snow theme: light and cool", - "extensions": { - "stylesheets": [ - { - "stylesheetUrl": "css/theme-snow.css", - "priority": 1000 - } - ], - "constants": [ - { - "key": "THEME", - "value": "snow" - } - ] - } - }); -}); diff --git a/platform/core/src/actions/ActionProvider.js b/platform/core/src/actions/ActionProvider.js index eb6912b5ad..4a319f991b 100644 --- a/platform/core/src/actions/ActionProvider.js +++ b/platform/core/src/actions/ActionProvider.js @@ -52,7 +52,7 @@ define( // Convert to an array if necessary categories = Array.isArray(categories) ? - categories : [categories]; + categories : [categories]; // Store action under all relevant categories categories.forEach(function (category) { diff --git a/platform/core/src/capabilities/CompositionCapability.js b/platform/core/src/capabilities/CompositionCapability.js index 86555ce49c..3c1564d5c8 100644 --- a/platform/core/src/capabilities/CompositionCapability.js +++ b/platform/core/src/capabilities/CompositionCapability.js @@ -62,7 +62,7 @@ define( CompositionCapability.prototype.add = function (domainObject, index) { var self = this, id = typeof domainObject === 'string' ? - domainObject : domainObject.getId(), + domainObject : domainObject.getId(), model = self.domainObject.getModel(), composition = model.composition, oldIndex = composition.indexOf(id); @@ -104,7 +104,7 @@ define( } return this.domainObject.useCapability('mutation', addIdToModel) - .then(contextualize); + .then(contextualize); }; /** diff --git a/platform/core/src/capabilities/ContextCapability.js b/platform/core/src/capabilities/ContextCapability.js index edc1c88f35..7aaa257aa7 100644 --- a/platform/core/src/capabilities/ContextCapability.js +++ b/platform/core/src/capabilities/ContextCapability.js @@ -82,7 +82,7 @@ define( parentContext = parentObject && parentObject.getCapability('context'), parentPath = parentContext ? - parentContext.getPath() : [this.parentObject]; + parentContext.getPath() : [this.parentObject]; return parentPath.concat([this.domainObject]); }; @@ -102,8 +102,8 @@ define( this.parentObject.getCapability('context'); return parentContext ? - parentContext.getRoot() : - (this.parentObject || this.domainObject); + parentContext.getRoot() : + (this.parentObject || this.domainObject); }; return ContextCapability; diff --git a/platform/core/src/capabilities/ContextualDomainObject.js b/platform/core/src/capabilities/ContextualDomainObject.js index 243f53005a..4797c066bd 100644 --- a/platform/core/src/capabilities/ContextualDomainObject.js +++ b/platform/core/src/capabilities/ContextualDomainObject.js @@ -54,8 +54,8 @@ define( // Intercept requests for a context capability. contextualObject.getCapability = function (name) { return name === "context" ? - contextCapability : - domainObject.getCapability.apply(this, arguments); + contextCapability : + domainObject.getCapability.apply(this, arguments); }; return contextualObject; diff --git a/platform/core/src/capabilities/CoreCapabilityProvider.js b/platform/core/src/capabilities/CoreCapabilityProvider.js index 432e8f54b4..edfb85f82d 100644 --- a/platform/core/src/capabilities/CoreCapabilityProvider.js +++ b/platform/core/src/capabilities/CoreCapabilityProvider.js @@ -56,8 +56,8 @@ define( function filterCapabilities(model, id) { return capabilities.filter(function (capability) { return capability.appliesTo ? - capability.appliesTo(model, id) : - true; + capability.appliesTo(model, id) : + true; }); } diff --git a/platform/core/src/capabilities/DelegationCapability.js b/platform/core/src/capabilities/DelegationCapability.js index a1af2af728..89aba78cee 100644 --- a/platform/core/src/capabilities/DelegationCapability.js +++ b/platform/core/src/capabilities/DelegationCapability.js @@ -91,10 +91,10 @@ define( } return this.doesDelegateCapability(key) ? - promiseChildren().then( - filterObjectsWithCapability(key) - ) : - this.$q.when([]); + promiseChildren().then( + filterObjectsWithCapability(key) + ) : + this.$q.when([]); }; /** diff --git a/platform/core/src/capabilities/MetadataCapability.js b/platform/core/src/capabilities/MetadataCapability.js index 92001f4267..9a5200c61d 100644 --- a/platform/core/src/capabilities/MetadataCapability.js +++ b/platform/core/src/capabilities/MetadataCapability.js @@ -48,8 +48,8 @@ define( function formatTimestamp(timestamp) { return typeof timestamp === 'number' ? - (moment.utc(timestamp).format(TIME_FORMAT) + " UTC") : - undefined; + (moment.utc(timestamp).format(TIME_FORMAT) + " UTC") : + undefined; } function getProperties() { diff --git a/platform/core/src/capabilities/PersistenceCapability.js b/platform/core/src/capabilities/PersistenceCapability.js index bfc4c41582..7b1658e66e 100644 --- a/platform/core/src/capabilities/PersistenceCapability.js +++ b/platform/core/src/capabilities/PersistenceCapability.js @@ -168,9 +168,9 @@ define( } return this.persistenceService.readObject( - this.getSpace(), - this.getKey() - ).then(updateModel); + this.getSpace(), + this.getKey() + ).then(updateModel); }; /** diff --git a/platform/core/src/models/PersistedModelProvider.js b/platform/core/src/models/PersistedModelProvider.js index d845432ce2..be769ff9fa 100644 --- a/platform/core/src/models/PersistedModelProvider.js +++ b/platform/core/src/models/PersistedModelProvider.js @@ -67,7 +67,7 @@ define( // Load a single object model from any persistence spaces function loadModel(parsedId) { return persistenceService - .readObject(parsedId.space, parsedId.key); + .readObject(parsedId.space, parsedId.key); } // Ensure that models read from persistence have some @@ -75,7 +75,7 @@ define( function addPersistedTimestamp(model) { if (model && (model.persisted === undefined)) { model.persisted = model.modified !== undefined ? - model.modified : now(); + model.modified : now(); } return model; @@ -112,8 +112,8 @@ define( parsedIds = ids.map(function (id) { var parts = id.split(":"); return (parts.length > 1) ? - { id: id, space: parts[0], key: parts.slice(1).join(":") } : - { id: id, space: defaultSpace, key: id }; + { id: id, space: parts[0], key: parts.slice(1).join(":") } : + { id: id, space: defaultSpace, key: id }; }); return persistenceService.listSpaces() diff --git a/platform/core/src/types/MergeModels.js b/platform/core/src/types/MergeModels.js index 4b96ac83bd..570621be13 100644 --- a/platform/core/src/types/MergeModels.js +++ b/platform/core/src/types/MergeModels.js @@ -76,8 +76,8 @@ define( var result = {}; Object.keys(a).forEach(function (k) { result[k] = b.hasOwnProperty(k) ? - mergeModels(a[k], b[k], (merger || {})[k]) : - a[k]; + mergeModels(a[k], b[k], (merger || {})[k]) : + a[k]; }); Object.keys(b).forEach(function (k) { // Copy any properties not already merged @@ -93,9 +93,9 @@ define( } mergeFunction = (merger && Function.isFunction(merger)) ? merger : - (Array.isArray(modelA) && Array.isArray(modelB)) ? mergeArrays : - (modelA instanceof Object && modelB instanceof Object) ? mergeObjects : - mergeOther; + (Array.isArray(modelA) && Array.isArray(modelB)) ? mergeArrays : + (modelA instanceof Object && modelB instanceof Object) ? mergeObjects : + mergeOther; return mergeFunction(modelA, modelB); } diff --git a/platform/core/src/types/TypePropertyConversion.js b/platform/core/src/types/TypePropertyConversion.js index fd65efab78..5307b56314 100644 --- a/platform/core/src/types/TypePropertyConversion.js +++ b/platform/core/src/types/TypePropertyConversion.js @@ -29,7 +29,7 @@ define( toModelValue: parseFloat, toFormValue: function (modelValue) { return (typeof modelValue === 'number') ? - modelValue.toString(10) : undefined; + modelValue.toString(10) : undefined; } }, identity: { diff --git a/platform/core/src/types/TypeProvider.js b/platform/core/src/types/TypeProvider.js index 2b2a288b66..04f73c4460 100644 --- a/platform/core/src/types/TypeProvider.js +++ b/platform/core/src/types/TypeProvider.js @@ -63,8 +63,8 @@ define( } return set[element] ? - false : - (set[element] = true); + false : + (set[element] = true); }) : array; } diff --git a/platform/core/src/views/ViewProvider.js b/platform/core/src/views/ViewProvider.js index 160d516148..567c112269 100644 --- a/platform/core/src/views/ViewProvider.js +++ b/platform/core/src/views/ViewProvider.js @@ -149,10 +149,10 @@ define( // Second, filter by matching capabilities. return this.views.filter(function (view) { return viewMatchesType(view, type) && capabilitiesMatch( - domainObject, - view.needs || [], - view.delegation || false - ); + domainObject, + view.needs || [], + view.delegation || false + ); }); }; diff --git a/platform/core/test/capabilities/DelegationCapabilitySpec.js b/platform/core/test/capabilities/DelegationCapabilitySpec.js index 8c050f1fde..041c816f64 100644 --- a/platform/core/test/capabilities/DelegationCapabilitySpec.js +++ b/platform/core/test/capabilities/DelegationCapabilitySpec.js @@ -62,7 +62,7 @@ define( return { then: function (callback) { return value.then ? - value : mockPromise(callback(value)); + value : mockPromise(callback(value)); } }; } diff --git a/platform/core/test/capabilities/InstantiationCapabilitySpec.js b/platform/core/test/capabilities/InstantiationCapabilitySpec.js index 6b5bc77374..b66bddb012 100644 --- a/platform/core/test/capabilities/InstantiationCapabilitySpec.js +++ b/platform/core/test/capabilities/InstantiationCapabilitySpec.js @@ -75,12 +75,12 @@ define( it("uses instantiate and contextualize to create domain objects", function () { var mockDomainObj = jasmine.createSpyObj('domainObject', [ - 'getId', - 'getModel', - 'getCapability', - 'useCapability', - 'hasCapability' - ]), testModel = { someKey: "some value" }; + 'getId', + 'getModel', + 'getCapability', + 'useCapability', + 'hasCapability' + ]), testModel = { someKey: "some value" }; mockInstantiate.and.returnValue(mockDomainObj); instantiation.instantiate(testModel); expect(mockInstantiate) diff --git a/platform/core/test/capabilities/MetadataCapabilitySpec.js b/platform/core/test/capabilities/MetadataCapabilitySpec.js index d1f22b869b..5ffb2b545e 100644 --- a/platform/core/test/capabilities/MetadataCapabilitySpec.js +++ b/platform/core/test/capabilities/MetadataCapabilitySpec.js @@ -55,9 +55,9 @@ define( ); mockProperties = ['a', 'b', 'c'].map(function (k) { var mockProperty = jasmine.createSpyObj( - 'property-' + k, - ['getValue', 'getDefinition'] - ); + 'property-' + k, + ['getValue', 'getDefinition'] + ); mockProperty.getValue.and.returnValue("Value " + k); mockProperty.getDefinition.and.returnValue({ name: "Property " + k}); return mockProperty; diff --git a/platform/core/test/capabilities/PersistenceCapabilitySpec.js b/platform/core/test/capabilities/PersistenceCapabilitySpec.js index 94dfc2ae85..aa112fb8cf 100644 --- a/platform/core/test/capabilities/PersistenceCapabilitySpec.js +++ b/platform/core/test/capabilities/PersistenceCapabilitySpec.js @@ -173,10 +173,10 @@ define( describe("unsuccessful persistence", function () { var sadPromise = { - then: function (callback) { - return asPromise(callback(0), true); - } - }; + then: function (callback) { + return asPromise(callback(0), true); + } + }; beforeEach(function () { mockPersistenceService.createObject.and.returnValue(sadPromise); }); diff --git a/platform/core/test/runs/TransactingMutationListenerSpec.js b/platform/core/test/runs/TransactingMutationListenerSpec.js index 139b0fa6dd..f4042a2e51 100644 --- a/platform/core/test/runs/TransactingMutationListenerSpec.js +++ b/platform/core/test/runs/TransactingMutationListenerSpec.js @@ -102,9 +102,9 @@ define( it("adds to the active transaction", function () { expect(mockTransactionService.addToTransaction) .toHaveBeenCalledWith( - jasmine.any(Function), - jasmine.any(Function) - ); + jasmine.any(Function), + jasmine.any(Function) + ); }); it(innerVerb + " immediately commit", function () { diff --git a/platform/core/test/types/TypePropertyConversionSpec.js b/platform/core/test/types/TypePropertyConversionSpec.js index 7bdc817910..b0525baa49 100644 --- a/platform/core/test/types/TypePropertyConversionSpec.js +++ b/platform/core/test/types/TypePropertyConversionSpec.js @@ -48,10 +48,11 @@ define( }); it("throws exceptions on unrecognized conversions", function () { - var caught = false, tmp; + var caught = false; try { - tmp = new TypePropertyConversion("some-unknown-conversion"); + // eslint-disable-next-line + new TypePropertyConversion("some-unknown-conversion"); } catch (e) { caught = true; } diff --git a/platform/entanglement/src/actions/CopyAction.js b/platform/entanglement/src/actions/CopyAction.js index 537582626a..5592277de5 100644 --- a/platform/entanglement/src/actions/CopyAction.js +++ b/platform/entanglement/src/actions/CopyAction.js @@ -126,17 +126,17 @@ define( var errorDialog, errorMessage = { - title: "Error copying objects.", - severity: "error", - hint: errorDetails.message, - minimized: true, // want the notification to be minimized initially (don't show banner) - options: [{ - label: "OK", - callback: function () { - errorDialog.dismiss(); - } - }] - }; + title: "Error copying objects.", + severity: "error", + hint: errorDetails.message, + minimized: true, // want the notification to be minimized initially (don't show banner) + options: [{ + label: "OK", + callback: function () { + errorDialog.dismiss(); + } + }] + }; self.dialog.dismiss(); if (self.notification) { diff --git a/platform/entanglement/test/services/CopyServiceSpec.js b/platform/entanglement/test/services/CopyServiceSpec.js index 97bda1af8c..b8e2384a6b 100644 --- a/platform/entanglement/test/services/CopyServiceSpec.js +++ b/platform/entanglement/test/services/CopyServiceSpec.js @@ -124,7 +124,6 @@ define( var mockQ, mockDeferred, - createObjectPromise, copyService, object, newParent, @@ -138,7 +137,6 @@ define( resolvedValue; beforeEach(function () { - createObjectPromise = synchronousPromise(undefined); policyService.allow.and.returnValue(true); persistObjectPromise = synchronousPromise(undefined); @@ -275,8 +273,7 @@ define( describe("on domainObject with composition", function () { var childObject, objectClone, - childObjectClone, - compositionPromise; + childObjectClone; beforeEach(function () { var invocationCount = 0, @@ -325,11 +322,6 @@ define( } }); - compositionPromise = jasmine.createSpyObj( - 'compositionPromise', - ['then'] - ); - compositionCapability .invoke .and.returnValue(synchronousPromise([childObject])); diff --git a/platform/entanglement/test/services/MoveServiceSpec.js b/platform/entanglement/test/services/MoveServiceSpec.js index 7e1cdb1905..941e597e6a 100644 --- a/platform/entanglement/test/services/MoveServiceSpec.js +++ b/platform/entanglement/test/services/MoveServiceSpec.js @@ -178,7 +178,6 @@ define( type: { type: 'object' } } }); - moveResult = moveService.perform(object, newParent); }); @@ -189,6 +188,10 @@ define( ); }); + it("returns a promise", function () { + expect(moveResult.then).toEqual(jasmine.any(Function)); + }); + it("waits for result of link", function () { expect(linkService.perform.calls.mostRecent().promise.then) .toHaveBeenCalledWith(jasmine.any(Function)); diff --git a/platform/execution/src/WorkerService.js b/platform/execution/src/WorkerService.js index 791ecfd117..3271384f3d 100644 --- a/platform/execution/src/WorkerService.js +++ b/platform/execution/src/WorkerService.js @@ -81,7 +81,7 @@ define( WorkerService.prototype.run = function (key) { var scriptUrl = this.workerUrls[key], Worker = this.sharedWorkers[key] ? - this.SharedWorker : this.Worker; + this.SharedWorker : this.Worker; return scriptUrl && Worker && new Worker(scriptUrl); }; diff --git a/platform/features/clock/bundle.js b/platform/features/clock/bundle.js index 433f69de0f..513632c93e 100644 --- a/platform/features/clock/bundle.js +++ b/platform/features/clock/bundle.js @@ -34,8 +34,8 @@ define([ "./src/actions/RestartTimerAction", "./src/actions/StopTimerAction", "./src/actions/PauseTimerAction", - "text!./res/templates/clock.html", - "text!./res/templates/timer.html", + "./res/templates/clock.html", + "./res/templates/timer.html", 'legacyRegistry' ], function ( MomentTimezone, diff --git a/platform/features/clock/src/controllers/ClockController.js b/platform/features/clock/src/controllers/ClockController.js index 3c7dc7b216..6cab60f43a 100644 --- a/platform/features/clock/src/controllers/ClockController.js +++ b/platform/features/clock/src/controllers/ClockController.js @@ -23,13 +23,13 @@ define([ 'moment', 'moment-timezone' - ], - function ( - moment, - momentTimezone - ) { +], +function ( + moment, + momentTimezone +) { - /** + /** * Controller for views of a Clock domain object. * * @constructor @@ -38,73 +38,73 @@ define([ * @param {platform/features/clock.TickerService} tickerService * a service used to align behavior with clock ticks */ - function ClockController($scope, tickerService) { - var lastTimestamp, - unlisten, - timeFormat, - zoneName, - self = this; + function ClockController($scope, tickerService) { + var lastTimestamp, + unlisten, + timeFormat, + zoneName, + self = this; - function update() { - var m = zoneName ? - moment.utc(lastTimestamp).tz(zoneName) : moment.utc(lastTimestamp); - self.zoneAbbr = m.zoneAbbr(); - self.textValue = timeFormat && m.format(timeFormat); - self.ampmValue = m.format("A"); // Just the AM or PM part - } - - function tick(timestamp) { - lastTimestamp = timestamp; - update(); - } - - function updateModel(model) { - var baseFormat; - if (model !== undefined) { - baseFormat = model.clockFormat[0]; - - self.use24 = model.clockFormat[1] === 'clock24'; - timeFormat = self.use24 ? - baseFormat.replace('hh', "HH") : baseFormat; - // If wrong timezone is provided, the UTC will be used - zoneName = momentTimezone.tz.names().includes(model.timezone) ? - model.timezone : "UTC"; - update(); - } - } - - // Pull in the model (clockFormat and timezone) from the domain object model - $scope.$watch('model', updateModel); - - // Listen for clock ticks ... and stop listening on destroy - unlisten = tickerService.listen(tick); - $scope.$on('$destroy', unlisten); + function update() { + var m = zoneName ? + moment.utc(lastTimestamp).tz(zoneName) : moment.utc(lastTimestamp); + self.zoneAbbr = m.zoneAbbr(); + self.textValue = timeFormat && m.format(timeFormat); + self.ampmValue = m.format("A"); // Just the AM or PM part } - /** + function tick(timestamp) { + lastTimestamp = timestamp; + update(); + } + + function updateModel(model) { + var baseFormat; + if (model !== undefined) { + baseFormat = model.clockFormat[0]; + + self.use24 = model.clockFormat[1] === 'clock24'; + timeFormat = self.use24 ? + baseFormat.replace('hh', "HH") : baseFormat; + // If wrong timezone is provided, the UTC will be used + zoneName = momentTimezone.tz.names().includes(model.timezone) ? + model.timezone : "UTC"; + update(); + } + } + + // Pull in the model (clockFormat and timezone) from the domain object model + $scope.$watch('model', updateModel); + + // Listen for clock ticks ... and stop listening on destroy + unlisten = tickerService.listen(tick); + $scope.$on('$destroy', unlisten); + } + + /** * Get the clock's time zone, as displayable text. * @returns {string} */ - ClockController.prototype.zone = function () { - return this.zoneAbbr; - }; + ClockController.prototype.zone = function () { + return this.zoneAbbr; + }; - /** + /** * Get the current time, as displayable text. * @returns {string} */ - ClockController.prototype.text = function () { - return this.textValue; - }; + ClockController.prototype.text = function () { + return this.textValue; + }; - /** + /** * Get the text to display to qualify a time as AM or PM. * @returns {string} */ - ClockController.prototype.ampm = function () { - return this.use24 ? '' : this.ampmValue; - }; + ClockController.prototype.ampm = function () { + return this.use24 ? '' : this.ampmValue; + }; - return ClockController; - } + return ClockController; +} ); diff --git a/platform/features/clock/test/actions/PauseTimerActionSpec.js b/platform/features/clock/test/actions/PauseTimerActionSpec.js index f68b0c461d..7443b76ab6 100644 --- a/platform/features/clock/test/actions/PauseTimerActionSpec.js +++ b/platform/features/clock/test/actions/PauseTimerActionSpec.js @@ -33,10 +33,10 @@ define( function asPromise(value) { return (value || {}).then ? value : { - then: function (callback) { - return asPromise(callback(value)); - } - }; + then: function (callback) { + return asPromise(callback(value)); + } + }; } function testState(type, timerState, timestamp, expected) { diff --git a/platform/features/clock/test/actions/StartTimerActionSpec.js b/platform/features/clock/test/actions/StartTimerActionSpec.js index 23da7e5434..8d8e60d986 100644 --- a/platform/features/clock/test/actions/StartTimerActionSpec.js +++ b/platform/features/clock/test/actions/StartTimerActionSpec.js @@ -33,10 +33,10 @@ define( function asPromise(value) { return (value || {}).then ? value : { - then: function (callback) { - return asPromise(callback(value)); - } - }; + then: function (callback) { + return asPromise(callback(value)); + } + }; } function testState(type, timerState, timestamp, expected) { diff --git a/platform/features/clock/test/actions/StopTimerActionSpec.js b/platform/features/clock/test/actions/StopTimerActionSpec.js index 1dcfd58d11..a64dc7a9e3 100644 --- a/platform/features/clock/test/actions/StopTimerActionSpec.js +++ b/platform/features/clock/test/actions/StopTimerActionSpec.js @@ -33,10 +33,10 @@ define( function asPromise(value) { return (value || {}).then ? value : { - then: function (callback) { - return asPromise(callback(value)); - } - }; + then: function (callback) { + return asPromise(callback(value)); + } + }; } function testState(type, timerState, timestamp, expected) { diff --git a/platform/features/conductor/core/bundle.js b/platform/features/conductor/core/bundle.js index e173e363e6..e0417b166f 100644 --- a/platform/features/conductor/core/bundle.js +++ b/platform/features/conductor/core/bundle.js @@ -29,10 +29,10 @@ define([ "./src/ui/ConductorAxisDirective", "./src/ui/NumberFormat", "./src/ui/StringFormat", - "text!./res/templates/time-conductor.html", - "text!./res/templates/mode-selector/mode-selector.html", - "text!./res/templates/mode-selector/mode-menu.html", - "text!./res/templates/time-of-interest.html", + "./res/templates/time-conductor.html", + "./res/templates/mode-selector/mode-selector.html", + "./res/templates/mode-selector/mode-menu.html", + "./res/templates/time-of-interest.html", "legacyRegistry" ], function ( TimeConductorController, @@ -97,16 +97,6 @@ define([ "implementation": ConductorTOIDirective } ], - "stylesheets": [ - { - "stylesheetUrl": "css/time-conductor-espresso.css", - "theme": "espresso" - }, - { - "stylesheetUrl": "css/time-conductor-snow.css", - "theme": "snow" - } - ], "templates": [ { "key": "conductor", diff --git a/platform/features/conductor/core/src/ui/ConductorAxisControllerSpec.js b/platform/features/conductor/core/src/ui/ConductorAxisControllerSpec.js index f1a3d0df70..93ed5abae2 100644 --- a/platform/features/conductor/core/src/ui/ConductorAxisControllerSpec.js +++ b/platform/features/conductor/core/src/ui/ConductorAxisControllerSpec.js @@ -37,8 +37,6 @@ define([ mockConductorViewService, mockFormatService, mockScope, - mockElement, - mockTarget, mockBounds, element, mockTimeSystem, @@ -56,13 +54,6 @@ define([ ]); //Add some HTML elements - mockTarget = { - offsetWidth: 0, - offsetHeight: 0 - }; - mockElement = { - firstChild: mockTarget - }; mockBounds = { start: 100, end: 200 diff --git a/platform/features/conductor/core/src/ui/TimeConductorControllerSpec.js b/platform/features/conductor/core/src/ui/TimeConductorControllerSpec.js index c49bd110a7..8fb7d5972d 100644 --- a/platform/features/conductor/core/src/ui/TimeConductorControllerSpec.js +++ b/platform/features/conductor/core/src/ui/TimeConductorControllerSpec.js @@ -376,7 +376,6 @@ define(['./TimeConductorController'], function (TimeConductorController) { describe("when the URL defines conductor state", function () { var urlBounds; var urlTimeSystem; - var urlMode; var urlDeltas; var mockDeltaFormat; @@ -439,7 +438,6 @@ define(['./TimeConductorController'], function (TimeConductorController) { end: 200 }; urlTimeSystem = "otherTimeSystem"; - urlMode = "realtime"; urlDeltas = { start: 300, end: 400 diff --git a/platform/features/fixed/bundle.js b/platform/features/fixed/bundle.js index 8901790fbf..7e2b1b77b1 100644 --- a/platform/features/fixed/bundle.js +++ b/platform/features/fixed/bundle.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - "text!../layout/res/templates/fixed.html", + "../layout/res/templates/fixed.html", 'legacyRegistry' ], function ( fixedTemplate, @@ -78,10 +78,10 @@ define([ path = "configuration['fixed-display'].elements[" + elementProxy.index + "]"; properties = type === 'fixed.image' ? imageProperties : - type === 'fixed.text' ? textProperties : - type === 'fixed.box' ? boxProperties : - type === 'fixed.line' ? lineProperties : - type === 'fixed.telemetry' ? telemetryProperties : []; + type === 'fixed.text' ? textProperties : + type === 'fixed.box' ? boxProperties : + type === 'fixed.line' ? lineProperties : + type === 'fixed.telemetry' ? telemetryProperties : []; } else if (fixedItem) { properties = domainObject && domainObject.type === 'layout' ? [] : fixedPageProperties; } diff --git a/platform/features/hyperlink/bundle.js b/platform/features/hyperlink/bundle.js index 7cf66eb288..842899eb61 100644 --- a/platform/features/hyperlink/bundle.js +++ b/platform/features/hyperlink/bundle.js @@ -23,7 +23,7 @@ define([ './src/HyperlinkController', 'legacyRegistry', - 'text!./res/templates/hyperlink.html' + './res/templates/hyperlink.html' ], function ( HyperlinkController, legacyRegistry, @@ -33,88 +33,88 @@ define([ "name": "Hyperlink", "description": "Insert a hyperlink to reference a link", "extensions": { - "types": [ - { - "key": "hyperlink", - "name": "Hyperlink", - "cssClass": "icon-chain-links", - "description": "A hyperlink to redirect to a different link", - "features": ["creation"], - "properties": [ - { - "key": "url", - "name": "URL", - "control": "textfield", - "pattern": "^(ftp|https?)\\:\\/\\/", - "required": true, - "cssClass": "l-input-lg" - }, - - { - "key": "displayText", - "name": "Text to Display", - "control": "textfield", - "required": true, - "cssClass": "l-input-lg" - }, + "types": [ { - "key": "displayFormat", - "name": "Display Format", - "control": "select", - "options": [ - { - "name": "Link", - "value": "link" - }, - { - "value": "button", - "name": "Button" - } - ], - "cssClass": "l-inline" - }, - { - "key": "openNewTab", - "name": "Tab to Open Hyperlink", - "control": "select", - "options": [ - { - "name": "Open in this tab", - "value": "thisTab" - }, - { - "value": "newTab", - "name": "Open in a new tab" - } - ], - "cssClass": "l-inline" + "key": "hyperlink", + "name": "Hyperlink", + "cssClass": "icon-chain-links", + "description": "A hyperlink to redirect to a different link", + "features": ["creation"], + "properties": [ + { + "key": "url", + "name": "URL", + "control": "textfield", + "pattern": "^(ftp|https?)\\:\\/\\/", + "required": true, + "cssClass": "l-input-lg" + }, + + { + "key": "displayText", + "name": "Text to Display", + "control": "textfield", + "required": true, + "cssClass": "l-input-lg" + }, + { + "key": "displayFormat", + "name": "Display Format", + "control": "select", + "options": [ + { + "name": "Link", + "value": "link" + }, + { + "value": "button", + "name": "Button" + } + ], + "cssClass": "l-inline" + }, + { + "key": "openNewTab", + "name": "Tab to Open Hyperlink", + "control": "select", + "options": [ + { + "name": "Open in this tab", + "value": "thisTab" + }, + { + "value": "newTab", + "name": "Open in a new tab" + } + ], + "cssClass": "l-inline" + + } + ], + "model": { + "displayFormat": "link", + "openNewTab": "thisTab", + "removeTitle": true + } - } - ], - "model": { - "displayFormat": "link", - "openNewTab": "thisTab", - "removeTitle": true } - - } - ], - "views": [ - { - "key": "hyperlink", - "type": "hyperlink", - "name": "Hyperlink Display", - "template": hyperlinkTemplate, - "editable": false - } - ], - "controllers": [ - { - "key": "HyperlinkController", - "implementation": HyperlinkController, - "depends": ["$scope"] - } - ] - } + ], + "views": [ + { + "key": "hyperlink", + "type": "hyperlink", + "name": "Hyperlink Display", + "template": hyperlinkTemplate, + "editable": false + } + ], + "controllers": [ + { + "key": "HyperlinkController", + "implementation": HyperlinkController, + "depends": ["$scope"] + } + ] + } }); }); diff --git a/platform/features/hyperlink/src/HyperlinkController.js b/platform/features/hyperlink/src/HyperlinkController.js index 13f77a96ca..2b2276c653 100644 --- a/platform/features/hyperlink/src/HyperlinkController.js +++ b/platform/features/hyperlink/src/HyperlinkController.js @@ -55,4 +55,4 @@ define( return HyperlinkController; } - ); +); diff --git a/platform/features/hyperlink/test/HyperlinkControllerSpec.js b/platform/features/hyperlink/test/HyperlinkControllerSpec.js index bd89b2615f..9d66882054 100644 --- a/platform/features/hyperlink/test/HyperlinkControllerSpec.js +++ b/platform/features/hyperlink/test/HyperlinkControllerSpec.js @@ -30,22 +30,22 @@ define( scope; beforeEach(function () { scope = jasmine.createSpyObj( - "$scope", - ["domainObject"] - ); + "$scope", + ["domainObject"] + ); domainObject = jasmine.createSpyObj( - "domainObject", - ["getModel"] - ); + "domainObject", + ["getModel"] + ); scope.domainObject = domainObject; controller = new HyperlinkController(scope); }); it("knows when it should open a new tab", function () { scope.domainObject.getModel.and.returnValue({ - "displayFormat": "link", - "openNewTab": "newTab", - "showTitle": false - } + "displayFormat": "link", + "openNewTab": "newTab", + "showTitle": false + } ); controller = new HyperlinkController(scope); expect(controller.openNewTab()) @@ -53,10 +53,10 @@ define( }); it("knows when it is a button", function () { scope.domainObject.getModel.and.returnValue({ - "displayFormat": "button", - "openNewTab": "thisTab", - "showTitle": false - } + "displayFormat": "button", + "openNewTab": "thisTab", + "showTitle": false + } ); controller = new HyperlinkController(scope); expect(controller.isButton()) @@ -64,10 +64,10 @@ define( }); it("knows when it should open in the same tab", function () { scope.domainObject.getModel.and.returnValue({ - "displayFormat": "link", - "openNewTab": "thisTab", - "showTitle": false - } + "displayFormat": "link", + "openNewTab": "thisTab", + "showTitle": false + } ); controller = new HyperlinkController(scope); expect(controller.openNewTab()) @@ -75,10 +75,10 @@ define( }); it("knows when it is a link", function () { scope.domainObject.getModel.and.returnValue({ - "displayFormat": "link", - "openNewTab": "thisTab", - "showTitle": false - } + "displayFormat": "link", + "openNewTab": "thisTab", + "showTitle": false + } ); controller = new HyperlinkController(scope); expect(controller.openNewTab()) diff --git a/platform/features/imagery/bundle.js b/platform/features/imagery/bundle.js index 75701cf37d..a4f19934fb 100644 --- a/platform/features/imagery/bundle.js +++ b/platform/features/imagery/bundle.js @@ -24,7 +24,7 @@ define([ "./src/policies/ImageryViewPolicy", "./src/controllers/ImageryController", "./src/directives/MCTBackgroundImage", - "text!./res/templates/imagery.html", + "./res/templates/imagery.html", 'legacyRegistry' ], function ( ImageryViewPolicy, diff --git a/platform/features/imagery/src/controllers/ImageryController.js b/platform/features/imagery/src/controllers/ImageryController.js index bfa810b2ef..ef69903304 100644 --- a/platform/features/imagery/src/controllers/ImageryController.js +++ b/platform/features/imagery/src/controllers/ImageryController.js @@ -103,17 +103,17 @@ define( var requestId = this.requestCount; this.openmct.telemetry .request(this.domainObject, bounds) - .then(function (values) { - if (this.requestCount > requestId) { - return Promise.resolve('Stale request'); - } + .then(function (values) { + if (this.requestCount > requestId) { + return Promise.resolve('Stale request'); + } - values.forEach(function (datum) { - this.updateHistory(datum); - }, this); + values.forEach(function (datum) { + this.updateHistory(datum); + }, this); - this.updateValues(values[values.length - 1]); - }.bind(this)); + this.updateValues(values[values.length - 1]); + }.bind(this)); }; ImageryController.prototype.stopListening = function () { diff --git a/platform/features/layout/bundle.js b/platform/features/layout/bundle.js index b89cbd6459..5cddd68986 100644 --- a/platform/features/layout/bundle.js +++ b/platform/features/layout/bundle.js @@ -25,14 +25,14 @@ define([ "./src/FixedController", "./src/LayoutCompositionPolicy", './src/MCTTriggerModal', - "text!./res/templates/layout.html", - "text!./res/templates/fixed.html", - "text!./res/templates/frame.html", - "text!./res/templates/elements/telemetry.html", - "text!./res/templates/elements/box.html", - "text!./res/templates/elements/line.html", - "text!./res/templates/elements/text.html", - "text!./res/templates/elements/image.html", + "./res/templates/layout.html", + "./res/templates/fixed.html", + "./res/templates/frame.html", + "./res/templates/elements/telemetry.html", + "./res/templates/elements/box.html", + "./res/templates/elements/line.html", + "./res/templates/elements/text.html", + "./res/templates/elements/image.html", 'legacyRegistry' ], function ( LayoutController, diff --git a/platform/features/layout/src/LayoutController.js b/platform/features/layout/src/LayoutController.js index b157770ff8..ed3b016ae2 100644 --- a/platform/features/layout/src/LayoutController.js +++ b/platform/features/layout/src/LayoutController.js @@ -121,8 +121,8 @@ define( // request? If not, discard it. Prevents race condition if (thisCount === callbackCount) { ids = composition.map(function (object) { - return object.getId(); - }) || []; + return object.getId(); + }) || []; $scope.composition = composition; self.layoutPanels(ids); diff --git a/platform/features/layout/src/elements/AccessorMutator.js b/platform/features/layout/src/elements/AccessorMutator.js index 756965f5da..bc16b812fa 100644 --- a/platform/features/layout/src/elements/AccessorMutator.js +++ b/platform/features/layout/src/elements/AccessorMutator.js @@ -46,8 +46,8 @@ define( return function (value) { if (arguments.length > 0) { object[key] = updater ? - updater(value, object[key]) : - value; + updater(value, object[key]) : + value; } return object[key]; }; diff --git a/platform/features/layout/test/LayoutDragSpec.js b/platform/features/layout/test/LayoutDragSpec.js index 196081562d..95b3cadf6a 100644 --- a/platform/features/layout/test/LayoutDragSpec.js +++ b/platform/features/layout/test/LayoutDragSpec.js @@ -26,9 +26,9 @@ define( describe("A Layout drag handler", function () { var testPosition = { - position: [8, 11], - dimensions: [3, 2] - }; + position: [8, 11], + dimensions: [3, 2] + }; it("changes position by a supplied factor, rounding by grid size", function () { var handler = new LayoutDrag( diff --git a/platform/features/listview/bundle.js b/platform/features/listview/bundle.js index a6416849c6..59c6758410 100644 --- a/platform/features/listview/bundle.js +++ b/platform/features/listview/bundle.js @@ -20,10 +20,10 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ - define([ +define([ './src/controllers/ListViewController', './src/directives/MCTGesture', - 'text!./res/templates/listview.html', + './res/templates/listview.html', 'legacyRegistry' ], function ( ListViewController, diff --git a/platform/features/listview/src/controllers/ListViewController.js b/platform/features/listview/src/controllers/ListViewController.js index 456abec91c..514a858775 100644 --- a/platform/features/listview/src/controllers/ListViewController.js +++ b/platform/features/listview/src/controllers/ListViewController.js @@ -49,7 +49,7 @@ define(function () { this.$scope.children = formattedChildren; this.$scope.data = {children: formattedChildren}; }.bind(this) - ); + ); }; ListViewController.prototype.formatChildren = function (children) { return children.map(function (child) { diff --git a/platform/features/listview/src/directives/MCTGesture.js b/platform/features/listview/src/directives/MCTGesture.js index 06631ca5cb..86b85ddde1 100644 --- a/platform/features/listview/src/directives/MCTGesture.js +++ b/platform/features/listview/src/directives/MCTGesture.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ - define(function () { +define(function () { function MCTGesture(gestureService) { return { restrict : 'A', diff --git a/platform/features/listview/test/directives/MCTGestureSpec.js b/platform/features/listview/test/directives/MCTGestureSpec.js index 7ea8571b77..8a7cd50cd4 100644 --- a/platform/features/listview/test/directives/MCTGestureSpec.js +++ b/platform/features/listview/test/directives/MCTGestureSpec.js @@ -75,7 +75,7 @@ define( mctGesture.link(scope, element, attrs); expect(scope.$on).toHaveBeenCalledWith( '$destroy', - jasmine.any(Function) + jasmine.any(Function) ); scope.$on.calls.mostRecent().args[1](); expect(attachedGesture.destroy).toHaveBeenCalled(); diff --git a/platform/features/notebook/bundle.js b/platform/features/notebook/bundle.js index 02c17c7e3e..28677ee219 100644 --- a/platform/features/notebook/bundle.js +++ b/platform/features/notebook/bundle.js @@ -13,13 +13,13 @@ define([ "./src/actions/NewEntryContextual", "./src/capabilities/NotebookCapability", "./src/policies/CompositionPolicy", - "text!./res/templates/notebook.html", - "text!./res/templates/entry.html", - "text!./res/templates/annotation.html", - "text!./res/templates/notifications.html", - "text!../layout/res/templates/frame.html", - "text!./res/templates/controls/embedControl.html", - "text!./res/templates/controls/snapSelect.html" + "./res/templates/notebook.html", + "./res/templates/entry.html", + "./res/templates/annotation.html", + "./res/templates/notifications.html", + "../layout/res/templates/frame.html", + "./res/templates/controls/embedControl.html", + "./res/templates/controls/snapSelect.html" ], function ( legacyRegistry, NotebookController, @@ -49,24 +49,24 @@ define([ "extensions": { "types": [ - { - "key": "notebook", - "name": "Notebook", - "cssClass": "icon-notebook", - "description": "Create and save timestamped notes with embedded object snapshots.", - "features": ["creation"], - "model": { - "entries": [], - "composition": [], - "entryTypes": [], - "defaultSort": "-createdOn" - }, - "properties": [ - { - "key": "defaultSort", - "name": "Default Sort", - "control": "select", - "options": [ + { + "key": "notebook", + "name": "Notebook", + "cssClass": "icon-notebook", + "description": "Create and save timestamped notes with embedded object snapshots.", + "features": ["creation"], + "model": { + "entries": [], + "composition": [], + "entryTypes": [], + "defaultSort": "-createdOn" + }, + "properties": [ + { + "key": "defaultSort", + "name": "Default Sort", + "control": "select", + "options": [ { "name": "Newest First", "value": "-createdOn" @@ -76,66 +76,66 @@ define([ "value": "createdOn" } ], - "cssClass": "l-inline" - } - ] - } - ], + "cssClass": "l-inline" + } + ] + } + ], "views": [ - { - "key": "notebook.view", - "type": "notebook", - "cssClass": "icon-notebook", - "name": "notebook", - "template": notebookTemplate, - "editable": false, - "uses": [ - "composition", - "action" - ], - "gestures": [ - "drop" - ] - } - ], + { + "key": "notebook.view", + "type": "notebook", + "cssClass": "icon-notebook", + "name": "notebook", + "template": notebookTemplate, + "editable": false, + "uses": [ + "composition", + "action" + ], + "gestures": [ + "drop" + ] + } + ], "controllers": [ - { - "key": "NotebookController", - "implementation": NotebookController, - "depends": [ - "$scope", - "dialogService", - "popupService", - "agentService", - "objectService", - "navigationService", - "now", - "actionService", - "$timeout", - "$element", - "$sce" - ] - }, - { - "key": "NewEntryController", - "implementation": NewEntryController, - "depends": ["$scope", - "$rootScope" - ] - }, - { - "key": "selectSnapshotController", - "implementation": SelectSnapshotController, - "depends": ["$scope", - "$rootScope" - ] - }, - { - "key": "LayoutNotebookController", - "implementation": LayoutNotebookController, - "depends": ["$scope"] - } - ], + { + "key": "NotebookController", + "implementation": NotebookController, + "depends": [ + "$scope", + "dialogService", + "popupService", + "agentService", + "objectService", + "navigationService", + "now", + "actionService", + "$timeout", + "$element", + "$sce" + ] + }, + { + "key": "NewEntryController", + "implementation": NewEntryController, + "depends": ["$scope", + "$rootScope" + ] + }, + { + "key": "selectSnapshotController", + "implementation": SelectSnapshotController, + "depends": ["$scope", + "$rootScope" + ] + }, + { + "key": "LayoutNotebookController", + "implementation": LayoutNotebookController, + "depends": ["$scope"] + } + ], "representations": [ { "key": "draggedEntry", @@ -188,7 +188,7 @@ define([ "description": "View the large image in a modal", "category": "embed", "depends": [ - "$compile" + "$compile" ] }, { @@ -199,9 +199,9 @@ define([ "description": "Annotate embed's snapshot", "category": "embed", "depends": [ - "dialogService", - "dndService", - "$rootScope" + "dialogService", + "dndService", + "$rootScope" ] }, @@ -216,7 +216,7 @@ define([ "embed-no-snap" ], "depends": [ - "dialogService" + "dialogService" ] }, { @@ -227,7 +227,7 @@ define([ "description": "Remove Snapshot of the embed", "category": "embed", "depends": [ - "dialogService" + "dialogService" ] }, { @@ -237,14 +237,14 @@ define([ "cssClass": "icon-notebook labeled", "description": "Add a new Notebook entry", "category": [ - "view-control" + "view-control" ], "depends": [ - "$compile", - "$rootScope", - "dialogService", - "notificationService", - "linkService" + "$compile", + "$rootScope", + "dialogService", + "notificationService", + "linkService" ], "priority": "preferred" } @@ -280,28 +280,15 @@ define([ } ], "controls": [ - { - "key": "embed-control", - "template": embedControlTemplate - }, - { - "key": "snapshot-select", - "template": snapSelectTemplate - } - ], - "stylesheets": [ { - "stylesheetUrl": "css/notebook.css" + "key": "embed-control", + "template": embedControlTemplate }, { - "stylesheetUrl": "css/notebook-espresso.css", - "theme": "espresso" - }, - { - "stylesheetUrl": "css/notebook-snow.css", - "theme": "snow" + "key": "snapshot-select", + "template": snapSelectTemplate } - ] + ] } }); }); diff --git a/platform/features/notebook/src/actions/AnnotateSnapshot.js b/platform/features/notebook/src/actions/AnnotateSnapshot.js index b67d7e09d6..b58973be80 100644 --- a/platform/features/notebook/src/actions/AnnotateSnapshot.js +++ b/platform/features/notebook/src/actions/AnnotateSnapshot.js @@ -101,7 +101,7 @@ define( saveSnap(image.asBlob(), embedPos, elementPos, DOMAIN_OBJECT); }else { ROOTSCOPE.snapshot = {'src': image.asDataURL('image/png'), - 'modified': Date.now()}; + 'modified': Date.now()}; } } done(true); @@ -155,7 +155,7 @@ define( } this.dialogService.getUserChoice(annotationStruct) - .then(saveNotes, rejectNotes); + .then(saveNotes, rejectNotes); }; diff --git a/platform/features/notebook/src/actions/NewEntryContextual.js b/platform/features/notebook/src/actions/NewEntryContextual.js index a6ad6851e0..08be83d59c 100644 --- a/platform/features/notebook/src/actions/NewEntryContextual.js +++ b/platform/features/notebook/src/actions/NewEntryContextual.js @@ -156,11 +156,11 @@ define( 'createdOn': date, 'text': options.entry, 'embeds': [{'type': options.embedObject.getId(), - 'id': '' + date, - 'cssClass': options.cssClass, - 'name': options.selectedModel.name, - 'snapshot': options.snapshot - }] + 'id': '' + date, + 'cssClass': options.cssClass, + 'name': options.selectedModel.name, + 'snapshot': options.snapshot + }] }); }else { model.entries[entries.length - 1] = { @@ -168,11 +168,11 @@ define( 'createdOn': date, 'text': options.entry, 'embeds': [{'type': options.embedObject.getId(), - 'id': '' + date, - 'cssClass': options.cssClass, - 'name': options.selectedModel.name, - 'snapshot': options.snapshot - }] + 'id': '' + date, + 'cssClass': options.cssClass, + 'name': options.selectedModel.name, + 'snapshot': options.snapshot + }] }; } }); diff --git a/platform/features/notebook/src/actions/ViewSnapshot.js b/platform/features/notebook/src/actions/ViewSnapshot.js index 30160cb53c..a5111bd546 100644 --- a/platform/features/notebook/src/actions/ViewSnapshot.js +++ b/platform/features/notebook/src/actions/ViewSnapshot.js @@ -38,95 +38,95 @@ var OVERLAY_TEMPLATE = '' + define([ 'zepto', - "text!../../res/templates/snapshotHeader.html" - ], - function ($, headerTemplate) { + "../../res/templates/snapshotHeader.html" +], +function ($, headerTemplate) { - var toggleOverlay, - overlay, - closeButton, - doneButton, - blocker, - overlayContainer, - img, - annotateButton, - annotateImg; + var toggleOverlay, + overlay, + closeButton, + doneButton, + blocker, + overlayContainer, + img, + annotateButton, + annotateImg; - function ViewSnapshot($compile) { - this.$compile = $compile; - } + function ViewSnapshot($compile) { + this.$compile = $compile; + } - function openOverlay(url, header) { - overlay = document.createElement('div'); - $(overlay).addClass('abs overlay l-large-view'); - overlay.innerHTML = OVERLAY_TEMPLATE; - overlayContainer = overlay.querySelector('.t-contents'); - closeButton = overlay.querySelector('a.close'); - closeButton.addEventListener('click', toggleOverlay); - doneButton = overlay.querySelector('a.t-done'); - doneButton.addEventListener('click', toggleOverlay); - blocker = overlay.querySelector('.abs.blocker'); - blocker.addEventListener('click', toggleOverlay); - annotateButton = header.querySelector('a.icon-pencil'); - annotateButton.addEventListener('click', annotateImg); - document.body.appendChild(overlay); - img = document.createElement('div'); - $(img).addClass('abs object-holder t-image-holder s-image-holder'); - img.innerHTML = '
'; - overlayContainer.appendChild(header); - overlayContainer.appendChild(img); - } + function openOverlay(url, header) { + overlay = document.createElement('div'); + $(overlay).addClass('abs overlay l-large-view'); + overlay.innerHTML = OVERLAY_TEMPLATE; + overlayContainer = overlay.querySelector('.t-contents'); + closeButton = overlay.querySelector('a.close'); + closeButton.addEventListener('click', toggleOverlay); + doneButton = overlay.querySelector('a.t-done'); + doneButton.addEventListener('click', toggleOverlay); + blocker = overlay.querySelector('.abs.blocker'); + blocker.addEventListener('click', toggleOverlay); + annotateButton = header.querySelector('a.icon-pencil'); + annotateButton.addEventListener('click', annotateImg); + document.body.appendChild(overlay); + img = document.createElement('div'); + $(img).addClass('abs object-holder t-image-holder s-image-holder'); + img.innerHTML = '
'; + overlayContainer.appendChild(header); + overlayContainer.appendChild(img); + } - function closeOverlay() { - overlayContainer.removeChild(img); - document.body.removeChild(overlay); - closeButton.removeEventListener('click', toggleOverlay); - closeButton = undefined; - doneButton.removeEventListener('click', toggleOverlay); - doneButton = undefined; - blocker.removeEventListener('click', toggleOverlay); - blocker = undefined; - overlayContainer = undefined; - overlay = undefined; - img = undefined; - } + function closeOverlay() { + overlayContainer.removeChild(img); + document.body.removeChild(overlay); + closeButton.removeEventListener('click', toggleOverlay); + closeButton = undefined; + doneButton.removeEventListener('click', toggleOverlay); + doneButton = undefined; + blocker.removeEventListener('click', toggleOverlay); + blocker = undefined; + overlayContainer = undefined; + overlay = undefined; + img = undefined; + } - ViewSnapshot.prototype.perform = function ($event, snapshot, embedId, entryId, $scope, embed) { - var isOpen = false; + ViewSnapshot.prototype.perform = function ($event, snapshot, embedId, entryId, $scope, embed) { + var isOpen = false; - // onclick for menu items in overlay header context menu - $scope.menuPerform = function (menu) { - menu.perform(); - closeOverlay(); - }; - - // Create the overlay element and add it to the document's body - $scope.cssClass = embed.cssClass; - $scope.embedType = embed.type; - $scope.entryName = embed.name; - $scope.snapDate = +embedId; - var element = this.$compile(headerTemplate)($scope); - - var annotateAction = $scope.action.getActions({category: 'embed'})[1]; - - toggleOverlay = function () { - if (!isOpen) { - openOverlay(snapshot, element[0]); - isOpen = true; - } else { - closeOverlay(); - isOpen = false; - } - }; - - annotateImg = function () { - closeOverlay(); - annotateAction.perform($event, snapshot, embedId, entryId, $scope); - }; - - toggleOverlay(); + // onclick for menu items in overlay header context menu + $scope.menuPerform = function (menu) { + menu.perform(); + closeOverlay(); }; - return ViewSnapshot; - } + // Create the overlay element and add it to the document's body + $scope.cssClass = embed.cssClass; + $scope.embedType = embed.type; + $scope.entryName = embed.name; + $scope.snapDate = +embedId; + var element = this.$compile(headerTemplate)($scope); + + var annotateAction = $scope.action.getActions({category: 'embed'})[1]; + + toggleOverlay = function () { + if (!isOpen) { + openOverlay(snapshot, element[0]); + isOpen = true; + } else { + closeOverlay(); + isOpen = false; + } + }; + + annotateImg = function () { + closeOverlay(); + annotateAction.perform($event, snapshot, embedId, entryId, $scope); + }; + + toggleOverlay(); + }; + + return ViewSnapshot; +} ); diff --git a/platform/features/notebook/src/controllers/NewEntryController.js b/platform/features/notebook/src/controllers/NewEntryController.js index 320884c2c5..6df17225e7 100644 --- a/platform/features/notebook/src/controllers/NewEntryController.js +++ b/platform/features/notebook/src/controllers/NewEntryController.js @@ -32,7 +32,7 @@ define( $scope.snapToggle = true; $scope.entryText = ''; var annotateAction = $rootScope.selObj.getCapability('action').getActions( - {category: 'embed'})[1]; + {category: 'embed'})[1]; $scope.$parent.$parent.ngModel[$scope.$parent.$parent.field] = $rootScope.selObj; $scope.objectName = $rootScope.selObj.getModel().name; diff --git a/platform/features/notebook/src/controllers/NotebookController.js b/platform/features/notebook/src/controllers/NotebookController.js index 720d8379f9..ffd5d1bc0d 100644 --- a/platform/features/notebook/src/controllers/NotebookController.js +++ b/platform/features/notebook/src/controllers/NotebookController.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ - /*-- main controller file, here is the core functionality of the notebook plugin --*/ +/*-- main controller file, here is the core functionality of the notebook plugin --*/ define( ['zepto'], @@ -28,17 +28,17 @@ define( function NotebookController( - $scope, - dialogService, - popupService, - agentService, - objectService, - navigationService, - now, - actionService, - $timeout, - $element, - $sce + $scope, + dialogService, + popupService, + agentService, + objectService, + navigationService, + now, + actionService, + $timeout, + $element, + $sce ) { $scope.entriesEl = $(document.body).find('.t-entries-list'); @@ -224,16 +224,16 @@ define( // present context. function updateActions() { $scope.menuEmbed = $scope.action ? - $scope.action.getActions({category: 'embed'}) : - []; + $scope.action.getActions({category: 'embed'}) : + []; $scope.menuEmbedNoSnap = $scope.action ? - $scope.action.getActions({category: 'embed-no-snap'}) : - []; + $scope.action.getActions({category: 'embed-no-snap'}) : + []; $scope.menuActions = $scope.action ? - $scope.action.getActions({key: 'window'}) : - []; + $scope.action.getActions({key: 'window'}) : + []; } // Update set of actions whenever the action capability @@ -284,19 +284,19 @@ define( $scope.getDomainObj(embedType).then(function (resp) { $scope.embedActions = []; $scope.embedActions.push($scope.actionToMenuOption( - $scope.action.getActions({key: 'mct-preview-action', selectedObject: resp[embedType]})[0] - )); + $scope.action.getActions({key: 'mct-preview-action', selectedObject: resp[embedType]})[0] + )); $scope.embedActions.push($scope.actionToMenuOption( - $scope.action.getActions({key: 'window', selectedObject: resp[embedType]})[0] - )); + $scope.action.getActions({key: 'window', selectedObject: resp[embedType]})[0] + )); $scope.embedActions.push({ - key: 'navigate', - name: 'Go to Original', - cssClass: '', - perform: function () { - $scope.navigate('', embedType); - } - }); + key: 'navigate', + name: 'Go to Original', + cssClass: '', + perform: function () { + $scope.navigate('', embedType); + } + }); }); } } @@ -308,10 +308,9 @@ define( var body = $(document).find('body'), initiatingEvent = agentService.isMobile() ? - 'touchstart' : 'mousedown', + 'touchstart' : 'mousedown', dismissExistingMenu, - menu, - popup; + menu; var container = $($event.currentTarget).parent().parent(); @@ -333,7 +332,7 @@ define( // ...and record the presence of this menu. dismissExistingMenu = dismiss; - popup = popupService.display(menu, [$event.pageX,$event.pageY], { + popupService.display(menu, [$event.pageX,$event.pageY], { marginX: 0, marginY: -50 }); diff --git a/platform/features/notebook/src/directives/EntryDnd.js b/platform/features/notebook/src/directives/EntryDnd.js index 9dc0509051..49612ba2b7 100644 --- a/platform/features/notebook/src/directives/EntryDnd.js +++ b/platform/features/notebook/src/directives/EntryDnd.js @@ -31,34 +31,32 @@ define(['zepto'], function ($) { var selectedModel = selectedObject.getModel(); var cssClass = selectedObject.getCapability('type').typeDef.cssClass; var entryId = -1; - var embedId = -1; $scope.clearSearch(); if ($element[0].id === 'newEntry') { entryId = $scope.domainObject.model.entries.length; - embedId = 0; var lastEntry = $scope.domainObject.model.entries[entryId - 1]; if (lastEntry === undefined || lastEntry.text || lastEntry.embeds) { $scope.domainObject.useCapability('mutation', function (model) { model.entries.push({'createdOn': +Date.now(), - 'id': +Date.now(), - 'embeds': [{'type': selectedObject.getId(), - 'id': '' + Date.now(), - 'cssClass': cssClass, - 'name': selectedModel.name, - 'snapshot': '' - }] - }); + 'id': +Date.now(), + 'embeds': [{'type': selectedObject.getId(), + 'id': '' + Date.now(), + 'cssClass': cssClass, + 'name': selectedModel.name, + 'snapshot': '' + }] + }); }); }else { $scope.domainObject.useCapability('mutation', function (model) { model.entries[entryId - 1] = {'createdOn': +Date.now(), - 'embeds': [{'type': selectedObject.getId(), - 'id': '' + Date.now(), - 'cssClass': cssClass, - 'name': selectedModel.name, - 'snapshot': '' - }] + 'embeds': [{'type': selectedObject.getId(), + 'id': '' + Date.now(), + 'cssClass': cssClass, + 'name': selectedModel.name, + 'snapshot': '' + }] }; }); } @@ -77,15 +75,13 @@ define(['zepto'], function ($) { $scope.domainObject.useCapability('mutation', function (model) { model.entries[entryId].embeds.push({'type': selectedObject.getId(), - 'id': '' + Date.now(), - 'cssClass': cssClass, - 'name': selectedModel.name, - 'snapshot': '' - }); + 'id': '' + Date.now(), + 'cssClass': cssClass, + 'name': selectedModel.name, + 'snapshot': '' + }); }); - embedId = $scope.domainObject.model.entries[entryId].embeds.length - 1; - if (selectedObject) { e.preventDefault(); diff --git a/platform/features/pages/bundle.js b/platform/features/pages/bundle.js index 8e930ac0de..eb85719fb1 100644 --- a/platform/features/pages/bundle.js +++ b/platform/features/pages/bundle.js @@ -22,7 +22,7 @@ define([ "./src/EmbeddedPageController", - "text!./res/iframe.html", + "./res/iframe.html", 'legacyRegistry' ], function ( EmbeddedPageController, diff --git a/platform/features/static-markup/bundle.js b/platform/features/static-markup/bundle.js index 623478d06e..b633de36fe 100644 --- a/platform/features/static-markup/bundle.js +++ b/platform/features/static-markup/bundle.js @@ -22,7 +22,7 @@ define([ - "text!./res/markup.html", + "./res/markup.html", 'legacyRegistry' ], function ( diff --git a/platform/features/table/bundle.js b/platform/features/table/bundle.js index 64f858c796..7e4c37ec75 100644 --- a/platform/features/table/bundle.js +++ b/platform/features/table/bundle.js @@ -26,8 +26,8 @@ define([ "./src/controllers/TableOptionsController", '../../commonUI/regions/src/Region', '../../commonUI/browse/src/InspectorRegion', - "text!./res/templates/table-options-edit.html", - "text!./res/templates/telemetry-table.html", + "./res/templates/table-options-edit.html", + "./res/templates/telemetry-table.html", "legacyRegistry" ], function ( MCTTable, @@ -121,12 +121,6 @@ define([ "key": "table-options-edit", "template": tableOptionsEditTemplate } - ], - "stylesheets": [ - { - "stylesheetUrl": "css/table.css", - "priority": "mandatory" - } ] } }); diff --git a/platform/features/table/src/controllers/MCTTableController.js b/platform/features/table/src/controllers/MCTTableController.js index 59baf2b70e..7c8242b03e 100644 --- a/platform/features/table/src/controllers/MCTTableController.js +++ b/platform/features/table/src/controllers/MCTTableController.js @@ -467,7 +467,7 @@ define( //It's possible that the insertion point is a duplicate of the element to be inserted var isDupe = function () { return this.sortComparator(searchElement, - searchArray[testIndex][this.$scope.sortColumn].text) === 0; + searchArray[testIndex][this.$scope.sortColumn].text) === 0; }.bind(this); // In the event of a duplicate, scan left or right (depending on @@ -493,14 +493,14 @@ define( } switch (this.sortComparator(searchElement, searchArray[sampleAt][this.$scope.sortColumn].text)) { - case -1: - return this.binarySearch(searchArray, searchElement, min, - sampleAt - 1); - case 0: - return sampleAt; - case 1: - return this.binarySearch(searchArray, searchElement, - sampleAt + 1, max); + case -1: + return this.binarySearch(searchArray, searchElement, min, + sampleAt - 1); + case 0: + return sampleAt; + case 1: + return this.binarySearch(searchArray, searchElement, + sampleAt + 1, max); } }; diff --git a/platform/features/table/src/controllers/TelemetryTableController.js b/platform/features/table/src/controllers/TelemetryTableController.js index c89ab09677..1789b27554 100644 --- a/platform/features/table/src/controllers/TelemetryTableController.js +++ b/platform/features/table/src/controllers/TelemetryTableController.js @@ -145,11 +145,11 @@ define( } this.unobserveObject = this.openmct.objects.observe(this.domainObject, "*", - function (domainObject) { - this.domainObject = domainObject; - this.getData(); - }.bind(this) - ); + function (domainObject) { + this.domainObject = domainObject; + this.getData(); + }.bind(this) + ); this.openmct.time.on('timeSystem', this.sortByTimeSystem); this.openmct.time.on('bounds', this.changeBounds); diff --git a/platform/features/table/src/directives/MCTTable.js b/platform/features/table/src/directives/MCTTable.js index cb351fc3ad..2ce6d8d8f0 100644 --- a/platform/features/table/src/directives/MCTTable.js +++ b/platform/features/table/src/directives/MCTTable.js @@ -23,7 +23,7 @@ define( [ "../controllers/MCTTableController", - "text!../../res/templates/mct-table.html" + "../../res/templates/mct-table.html" ], function (MCTTableController, TableTemplate) { /** diff --git a/platform/features/table/test/TableConfigurationSpec.js b/platform/features/table/test/TableConfigurationSpec.js index 02de9168bb..21402471df 100644 --- a/platform/features/table/test/TableConfigurationSpec.js +++ b/platform/features/table/test/TableConfigurationSpec.js @@ -164,12 +164,12 @@ define( it("Column configuration exposes persisted configuration", function () { var tableConfig, modelConfig = { - table: { - columns : { - 'Range 1': false + table: { + columns : { + 'Range 1': false + } } - } - }; + }; mockModel.configuration = modelConfig; tableConfig = table.buildColumnConfiguration(); diff --git a/platform/features/table/test/TelemetryCollectionSpec.js b/platform/features/table/test/TelemetryCollectionSpec.js index 6331b09ebb..6738ebefff 100644 --- a/platform/features/table/test/TelemetryCollectionSpec.js +++ b/platform/features/table/test/TelemetryCollectionSpec.js @@ -110,12 +110,12 @@ define( it("emits an event", function () { var addedObject = { - timestamp: 10000, - value: { - integer: 10, - text: integerTextMap[10] - } - }; + timestamp: 10000, + value: { + integer: 10, + text: integerTextMap[10] + } + }; collection.add([addedObject]); expect(addedCallback).toHaveBeenCalledWith([addedObject]); } diff --git a/platform/features/table/test/controllers/MCTTableControllerSpec.js b/platform/features/table/test/controllers/MCTTableControllerSpec.js index a6ef4cac5d..f004bd69fa 100644 --- a/platform/features/table/test/controllers/MCTTableControllerSpec.js +++ b/platform/features/table/test/controllers/MCTTableControllerSpec.js @@ -56,10 +56,10 @@ define( watches = {}; mockScope = jasmine.createSpyObj('scope', [ - '$watch', - '$on', - '$watchCollection', - '$digest' + '$watch', + '$on', + '$watchCollection', + '$digest' ]); mockScope.$watchCollection.and.callFake(function (event, callback) { watches[event] = callback; diff --git a/platform/features/table/test/controllers/TableOptionsControllerSpec.js b/platform/features/table/test/controllers/TableOptionsControllerSpec.js index 891c933f43..f88b26a428 100644 --- a/platform/features/table/test/controllers/TableOptionsControllerSpec.js +++ b/platform/features/table/test/controllers/TableOptionsControllerSpec.js @@ -37,8 +37,8 @@ define( 'listen' ]); mockDomainObject = jasmine.createSpyObj('domainObject', [ - 'getCapability', - 'getModel' + 'getCapability', + 'getModel' ]); mockDomainObject.getCapability.and.returnValue(mockCapability); mockDomainObject.getModel.and.returnValue({}); diff --git a/platform/features/timeline/bundle.js b/platform/features/timeline/bundle.js index 34b387cf4e..4bc363edb3 100644 --- a/platform/features/timeline/bundle.js +++ b/platform/features/timeline/bundle.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - "text!./res/templates/deprecated-timeline-message.html", + "./res/templates/deprecated-timeline-message.html", 'legacyRegistry' ], function ( deprecatedTimelineMessage, diff --git a/platform/forms/bundle.js b/platform/forms/bundle.js index f837a1adb5..dd5c5ce2af 100644 --- a/platform/forms/bundle.js +++ b/platform/forms/bundle.js @@ -31,20 +31,20 @@ define([ "./src/controllers/CompositeController", "./src/controllers/ColorController", "./src/controllers/DialogButtonController", - "text!./res/templates/controls/autocomplete.html", - "text!./res/templates/controls/checkbox.html", - "text!./res/templates/controls/datetime.html", - "text!./res/templates/controls/select.html", - "text!./res/templates/controls/textfield.html", - "text!./res/templates/controls/numberfield.html", - "text!./res/templates/controls/textarea.html", - "text!./res/templates/controls/button.html", - "text!./res/templates/controls/color.html", - "text!./res/templates/controls/composite.html", - "text!./res/templates/controls/menu-button.html", - "text!./res/templates/controls/dialog.html", - "text!./res/templates/controls/radio.html", - "text!./res/templates/controls/file-input.html", + "./res/templates/controls/autocomplete.html", + "./res/templates/controls/checkbox.html", + "./res/templates/controls/datetime.html", + "./res/templates/controls/select.html", + "./res/templates/controls/textfield.html", + "./res/templates/controls/numberfield.html", + "./res/templates/controls/textarea.html", + "./res/templates/controls/button.html", + "./res/templates/controls/color.html", + "./res/templates/controls/composite.html", + "./res/templates/controls/menu-button.html", + "./res/templates/controls/dialog.html", + "./res/templates/controls/radio.html", + "./res/templates/controls/file-input.html", 'legacyRegistry' ], function ( MCTForm, diff --git a/platform/forms/src/MCTFileInput.js b/platform/forms/src/MCTFileInput.js index 96b97349fb..acb3e24772 100644 --- a/platform/forms/src/MCTFileInput.js +++ b/platform/forms/src/MCTFileInput.js @@ -35,8 +35,8 @@ define( function setText(fileName) { scope.structure.text = fileName.length > 20 ? - fileName.substr(0, 20) + "..." : - fileName; + fileName.substr(0, 20) + "..." : + fileName; } function handleClick() { diff --git a/platform/forms/src/MCTForm.js b/platform/forms/src/MCTForm.js index dda1859dcb..abd1a00622 100644 --- a/platform/forms/src/MCTForm.js +++ b/platform/forms/src/MCTForm.js @@ -26,7 +26,7 @@ * @namespace platform/forms */ define( - ["./controllers/FormController", "text!../res/templates/form.html"], + ["./controllers/FormController", "../res/templates/form.html"], function (FormController, formTemplate) { /** diff --git a/platform/forms/src/MCTToolbar.js b/platform/forms/src/MCTToolbar.js index 5a7ce38da9..c0fd8a52bc 100644 --- a/platform/forms/src/MCTToolbar.js +++ b/platform/forms/src/MCTToolbar.js @@ -26,7 +26,7 @@ define( [ "./MCTForm", - "text!../res/templates/toolbar.html", + "../res/templates/toolbar.html", "./controllers/ToolbarController" ], function ( diff --git a/platform/forms/src/controllers/AutocompleteController.js b/platform/forms/src/controllers/AutocompleteController.js index 9e4695f3d1..a70da6c1b3 100644 --- a/platform/forms/src/controllers/AutocompleteController.js +++ b/platform/forms/src/controllers/AutocompleteController.js @@ -33,10 +33,10 @@ define( function AutocompleteController($scope, $element) { var key = { - down: 40, - up: 38, - enter: 13 - }, + down: 40, + up: 38, + enter: 13 + }, autocompleteInputElement = $element[0].getElementsByClassName('autocompleteInput')[0]; if ($scope.options[0].name) { @@ -86,17 +86,17 @@ define( if ($scope.filteredOptions) { var keyCode = $event.keyCode; switch (keyCode) { - case key.down: - incrementOptionIndex(); - break; - case key.up: - $event.preventDefault(); // Prevents cursor jumping back and forth - decrementOptionIndex(); - break; - case key.enter: - if ($scope.filteredOptions[$scope.optionIndex]) { - fillInputWithString($scope.filteredOptions[$scope.optionIndex].name); - } + case key.down: + incrementOptionIndex(); + break; + case key.up: + $event.preventDefault(); // Prevents cursor jumping back and forth + decrementOptionIndex(); + break; + case key.enter: + if ($scope.filteredOptions[$scope.optionIndex]) { + fillInputWithString($scope.filteredOptions[$scope.optionIndex].name); + } } } }; diff --git a/platform/forms/src/controllers/ColorController.js b/platform/forms/src/controllers/ColorController.js index b2ada967c6..d98215ef47 100644 --- a/platform/forms/src/controllers/ColorController.js +++ b/platform/forms/src/controllers/ColorController.js @@ -48,9 +48,9 @@ define( function toGradient(triplet, value) { return triplet.map(function (v) { return Math.round(value > 0 ? - (v + (255 - v) * value) : - (v * (1 + value)) - ); + (v + (255 - v) * value) : + (v * (1 + value)) + ); }); } diff --git a/platform/forms/src/controllers/DateTimeController.js b/platform/forms/src/controllers/DateTimeController.js index fea0322f46..fa5dbdf5b0 100644 --- a/platform/forms/src/controllers/DateTimeController.js +++ b/platform/forms/src/controllers/DateTimeController.js @@ -44,9 +44,9 @@ define( min = $scope.datetime.min, sec = $scope.datetime.sec, fullDateTime = moment.utc(date, DATE_FORMAT) - .hour(hour || 0) - .minute(min || 0) - .second(sec || 0); + .hour(hour || 0) + .minute(min || 0) + .second(sec || 0); if (fullDateTime.isValid()) { $scope.ngModel[$scope.field] = fullDateTime.valueOf(); @@ -97,7 +97,7 @@ define( // Initialize forms values updateDateTime( ($scope.ngModel && $scope.field) ? - $scope.ngModel[$scope.field] : undefined + $scope.ngModel[$scope.field] : undefined ); } diff --git a/platform/forms/test/MCTFileInputSpec.js b/platform/forms/test/MCTFileInputSpec.js index 112ed3846b..539f5f6167 100644 --- a/platform/forms/test/MCTFileInputSpec.js +++ b/platform/forms/test/MCTFileInputSpec.js @@ -41,8 +41,8 @@ define( ['getInput'] ); mockScope = jasmine.createSpyObj( - '$scope', - ['$watch'] + '$scope', + ['$watch'] ); mockScope.structure = {text: 'Select File'}; diff --git a/platform/forms/test/controllers/AutocompleteControllerSpec.js b/platform/forms/test/controllers/AutocompleteControllerSpec.js index efd22b769e..c8945385e7 100644 --- a/platform/forms/test/controllers/AutocompleteControllerSpec.js +++ b/platform/forms/test/controllers/AutocompleteControllerSpec.js @@ -49,7 +49,7 @@ define([ it("filters options by returning array containing optionId and name", function () { mockScope.filterOptions('Asia'); var filteredOptions = [{ optionId : 0, name : 'Asia/Dhaka' }, - { optionId : 1, name : 'Asia/Shanghai' }]; + { optionId : 1, name : 'Asia/Shanghai' }]; expect(mockScope.filteredOptions).toEqual(filteredOptions); }); diff --git a/platform/framework/src/FrameworkLayer.js b/platform/framework/src/FrameworkLayer.js index 684c7f0eb0..53e56168c0 100644 --- a/platform/framework/src/FrameworkLayer.js +++ b/platform/framework/src/FrameworkLayer.js @@ -20,10 +20,9 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global window,requirejs*/ +/*global window*/ define([ - 'require', './Constants', './FrameworkInitializer', './LogLevel', @@ -31,13 +30,11 @@ define([ './resolve/ImplementationLoader', './resolve/ExtensionResolver', './resolve/BundleResolver', - './resolve/RequireConfigurator', './register/CustomRegistrars', './register/ExtensionRegistrar', './register/ExtensionSorter', './bootstrap/ApplicationBootstrapper' ], function ( - require, Constants, FrameworkInitializer, LogLevel, @@ -45,7 +42,6 @@ define([ ImplementationLoader, ExtensionResolver, BundleResolver, - RequireConfigurator, CustomRegistrars, ExtensionRegistrar, ExtensionSorter, @@ -68,10 +64,9 @@ define([ loader = new BundleLoader($http, $log, legacyRegistry), resolver = new BundleResolver( new ExtensionResolver( - new ImplementationLoader(require), + new ImplementationLoader({}), $log ), - new RequireConfigurator(requirejs), $log ), registrar = new ExtensionRegistrar( diff --git a/platform/framework/src/Main.js b/platform/framework/src/Main.js index 9ab416331d..05dde3ae2f 100644 --- a/platform/framework/src/Main.js +++ b/platform/framework/src/Main.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -/*global window,requirejs*/ +/*global window*/ /** * Implements the framework layer, which handles the loading of bundles @@ -29,15 +29,11 @@ */ define( [ - 'require', - 'es6-promise', './FrameworkLayer', 'angular', 'angular-route' ], function ( - require, - es6promise, FrameworkLayer, angular ) { @@ -56,12 +52,9 @@ define( return match ? match[1] : ""; } - // Polyfill Promise, in case browser does not natively provide Promise - window.Promise = window.Promise || es6promise.Promise; // Reconfigure base url, since bundle paths will all be relative // to the root now. - requirejs.config({"baseUrl": ""}); injector.instantiate(['$http', '$log', FrameworkLayer]) .initializeApplication(angular, legacyRegistry, logLevel()); }; diff --git a/platform/framework/src/load/BundleLoader.js b/platform/framework/src/load/BundleLoader.js index e0616892ab..263dcd7958 100644 --- a/platform/framework/src/load/BundleLoader.js +++ b/platform/framework/src/load/BundleLoader.js @@ -147,8 +147,8 @@ define( } return Array.isArray(bundles) ? loadBundlesFromArray(bundles) : - (typeof bundles === 'string') ? loadBundlesFromFile(bundles) : - Promise.reject(new Error(INVALID_ARGUMENT_MESSAGE)); + (typeof bundles === 'string') ? loadBundlesFromFile(bundles) : + Promise.reject(new Error(INVALID_ARGUMENT_MESSAGE)); }; return BundleLoader; diff --git a/platform/framework/src/load/Extension.js b/platform/framework/src/load/Extension.js index 47c7508e98..263297dbe3 100644 --- a/platform/framework/src/load/Extension.js +++ b/platform/framework/src/load/Extension.js @@ -132,8 +132,8 @@ define( */ Extension.prototype.getImplementationPath = function () { return (this.hasImplementation() && !this.hasImplementationValue()) ? - this.bundle.getSourcePath(this.definition.implementation) : - undefined; + this.bundle.getSourcePath(this.definition.implementation) : + undefined; }; /** @@ -143,8 +143,8 @@ define( */ Extension.prototype.getImplementationValue = function () { return typeof this.definition.implementation === 'function' ? - this.definition.implementation : - undefined; + this.definition.implementation : + undefined; }; /** diff --git a/platform/framework/src/register/ExtensionRegistrar.js b/platform/framework/src/register/ExtensionRegistrar.js index dbd003181b..c945e8a721 100644 --- a/platform/framework/src/register/ExtensionRegistrar.js +++ b/platform/framework/src/register/ExtensionRegistrar.js @@ -180,8 +180,8 @@ define( (extension.depends || []).filter( isExtensionDependency ).forEach(function (dependency) { - needed[dependency] = true; - }); + needed[dependency] = true; + }); }); // Remove categories which have been provided diff --git a/platform/framework/src/resolve/BundleResolver.js b/platform/framework/src/resolve/BundleResolver.js index ac61426329..3ebad64326 100644 --- a/platform/framework/src/resolve/BundleResolver.js +++ b/platform/framework/src/resolve/BundleResolver.js @@ -35,9 +35,8 @@ define( * @memberof platform/framework * @constructor */ - function BundleResolver(extensionResolver, requireConfigurator, $log) { + function BundleResolver(extensionResolver, $log) { this.extensionResolver = extensionResolver; - this.requireConfigurator = requireConfigurator; this.$log = $log; } @@ -53,7 +52,6 @@ define( */ BundleResolver.prototype.resolveBundles = function (bundles) { var extensionResolver = this.extensionResolver, - requireConfigurator = this.requireConfigurator, $log = this.$log; /* @@ -116,9 +114,6 @@ define( .then(giveResult); } - // First, make sure Require is suitably configured - requireConfigurator.configure(bundles); - // Then, resolve all extension implementations. return Promise.all(bundles.map(resolveBundle)) .then(mergeResolvedBundles); diff --git a/platform/framework/src/resolve/ExtensionResolver.js b/platform/framework/src/resolve/ExtensionResolver.js index f950b8e4d2..15e916f5bf 100644 --- a/platform/framework/src/resolve/ExtensionResolver.js +++ b/platform/framework/src/resolve/ExtensionResolver.js @@ -60,8 +60,8 @@ define( function loadImplementation(ext) { var implPromise = ext.hasImplementationValue() ? - Promise.resolve(ext.getImplementationValue()) : - loader.load(ext.getImplementationPath()), + Promise.resolve(ext.getImplementationValue()) : + loader.load(ext.getImplementationPath()), definition = ext.getDefinition(); // Wrap a constructor function (to avoid modifying the original) diff --git a/platform/framework/src/resolve/RequireConfigurator.js b/platform/framework/src/resolve/RequireConfigurator.js deleted file mode 100644 index c54b61abbf..0000000000 --- a/platform/framework/src/resolve/RequireConfigurator.js +++ /dev/null @@ -1,112 +0,0 @@ -/***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, 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 () { - - /** - * Handles configuration of RequireJS to expose libraries - * from bundles with module names that can be used from other - * bundles. - * @memberof platform/framework - * @constructor - * @param requirejs an instance of RequireJS - */ - function RequireConfigurator(requirejs) { - this.requirejs = requirejs; - } - - // Utility function to clone part of a bundle definition - function clone(obj) { - return JSON.parse(JSON.stringify(obj)); - } - - // Look up module configuration from the bundle definition. - // This will adjust paths to libraries as-needed. - function getConfiguration(bundle) { - var configuration = bundle.getConfiguration(); - - // Adjust paths to point to libraries - if (configuration.paths) { - // Don't modify the actual bundle definition... - configuration = clone(configuration); - // ...replace values in a clone instead. - Object.keys(configuration.paths).forEach(function (path) { - configuration.paths[path] = - bundle.getLibraryPath(configuration.paths[path]); - }); - } - - return configuration; - } - - // Build up paths and shim values from multiple bundles; - // this is sensitive to the value from baseConfiguration - // passed via reduce in buildConfiguration below, insofar - // as it assumes paths and shim will have initial empty values. - function mergeConfigurations(base, next) { - ["paths", "shim"].forEach(function (k) { - Object.keys(next[k] || {}).forEach(function (p) { - base[k][p] = next[k][p]; - }); - }); - return base; - } - - // Build a configuration object, to pass to requirejs.config, - // based on the defined configurations for all bundles. - // The paths and shim properties from all bundles will be - // merged to allow one requirejs.config call. - function buildConfiguration(bundles) { - // Provide an initial requirejs configuration... - var baseConfiguration = { - baseUrl: "", - paths: {}, - shim: {} - }, - // ...and pull out all bundle-specific parts - bundleConfigurations = bundles.map(getConfiguration); - - // Reduce this into one configuration object. - return bundleConfigurations.reduce( - mergeConfigurations, - baseConfiguration - ); - } - - /** - * Configure RequireJS to utilize any path/shim definitions - * provided by these bundles. - * - * @param {Bundle[]} the bundles to include in this - * configuration - * @memberof platform/framework.RequireConfigurator# - */ - RequireConfigurator.prototype.configure = function (bundles) { - return this.requirejs.config(buildConfiguration(bundles)); - }; - - return RequireConfigurator; - - } -); diff --git a/platform/framework/test/resolve/BundleResolverSpec.js b/platform/framework/test/resolve/BundleResolverSpec.js index 4909dc09bf..3442f97bd9 100644 --- a/platform/framework/test/resolve/BundleResolverSpec.js +++ b/platform/framework/test/resolve/BundleResolverSpec.js @@ -29,7 +29,6 @@ define( describe("The bundle resolver", function () { var mockExtensionResolver, - mockRequireConfigurator, mockLog, resolver; @@ -38,10 +37,6 @@ define( "extensionResolver", ["resolve"] ); - mockRequireConfigurator = jasmine.createSpyObj( - "requireConfigurator", - ["configure"] - ); mockLog = jasmine.createSpyObj( "$log", ["error", "warn", "info", "debug"] @@ -51,7 +46,6 @@ define( resolver = new BundleResolver( mockExtensionResolver, - mockRequireConfigurator, mockLog ); }); @@ -67,18 +61,6 @@ define( }); }); - it("configures require before loading implementations", function () { - var bundles = [ - new Bundle("x", { extensions: { tests: [{}, {}, {}] } }), - new Bundle("y", { extensions: { tests: [{}, {}], others: [{}, {}] } }), - new Bundle("z", { extensions: { others: [{}] } }) - ]; - - resolver.resolveBundles(bundles); - expect(mockRequireConfigurator.configure) - .toHaveBeenCalledWith(bundles); - }); - }); } ); diff --git a/platform/framework/test/resolve/RequireConfiguratorSpec.js b/platform/framework/test/resolve/RequireConfiguratorSpec.js deleted file mode 100644 index 6a9a3e5e3b..0000000000 --- a/platform/framework/test/resolve/RequireConfiguratorSpec.js +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, 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( - ["../../src/resolve/RequireConfigurator", "../../src/load/Bundle"], - function (RequireConfigurator, Bundle) { - - describe("The RequireJS configurator", function () { - var mockRequire, - configurator; - - beforeEach(function () { - mockRequire = jasmine.createSpyObj( - "requirejs", - ["config"] - ); - configurator = new RequireConfigurator(mockRequire); - }); - - it("configures RequireJS when invoked", function () { - // Verify precondition - no config call - expect(mockRequire.config).not.toHaveBeenCalled(); - // Configure with an empty set of bundles - configurator.configure([]); - // Should have invoked require.config - expect(mockRequire.config).toHaveBeenCalled(); - }); - - it("assembles configurations from bundles", function () { - configurator.configure([ - new Bundle("test/a", { configuration: { - paths: { a: "path/to/a", b: "path/to/b" } - } }), - new Bundle("test/b", { configuration: { - paths: { b: "path/to/b" }, - shim: { - b: { "exports": "someExport" }, - c: {} - } - } }), - new Bundle("test/c", { configuration: { - shim: { - c: { "exports": "someOtherExport" } - } - } }) - ]); - - expect(mockRequire.config).toHaveBeenCalledWith({ - baseUrl: "", - paths: { - a: "test/a/lib/path/to/a", - b: "test/b/lib/path/to/b" - }, - shim: { - b: { "exports": "someExport" }, - c: { "exports": "someOtherExport" } - } - }); - - }); - }); - } -); diff --git a/platform/identity/test/IdentityCreationDecoratorSpec.js b/platform/identity/test/IdentityCreationDecoratorSpec.js index 3b39cc44b3..d20fc86f32 100644 --- a/platform/identity/test/IdentityCreationDecoratorSpec.js +++ b/platform/identity/test/IdentityCreationDecoratorSpec.js @@ -77,14 +77,14 @@ define( return decorator.createObject(testModel, mockParent) .then(function (object) { expect(object) - .toEqual(mockCreatedObject); + .toEqual(mockCreatedObject); // Make sure arguments were delegated appropriately expect(mockCreationService.createObject) - .toHaveBeenCalledWith( - { someKey: "some value", creator: "test-user-id" }, - mockParent - ); + .toHaveBeenCalledWith( + { someKey: "some value", creator: "test-user-id" }, + mockParent + ); }); }); diff --git a/platform/import-export/bundle.js b/platform/import-export/bundle.js index a89de82911..7c0ba82b57 100644 --- a/platform/import-export/bundle.js +++ b/platform/import-export/bundle.js @@ -33,8 +33,8 @@ define([ return function (openmct) { ExportAsJSONAction.appliesTo = function (context) { return openmct.$injector.get('policyService') - .allow("creation", context.domainObject.getCapability("type") - ); + .allow("creation", context.domainObject.getCapability("type") + ); }; openmct.legacyRegistry.register("platform/import-export", { @@ -63,10 +63,10 @@ define([ "category": "contextual", "cssClass": "icon-import", "depends": [ - "exportService", - "identifierService", - "dialogService", - "openmct" + "exportService", + "identifierService", + "dialogService", + "openmct" ] } ] diff --git a/platform/import-export/src/actions/ImportAsJSONAction.js b/platform/import-export/src/actions/ImportAsJSONAction.js index 233486a965..deb57be834 100644 --- a/platform/import-export/src/actions/ImportAsJSONAction.js +++ b/platform/import-export/src/actions/ImportAsJSONAction.js @@ -149,20 +149,20 @@ define(['zepto'], function ($) { ImportAsJSONAction.prototype.displayError = function () { var dialog, - model = { - title: "Invalid File", - actionText: "The selected file was either invalid JSON or was " + + model = { + title: "Invalid File", + actionText: "The selected file was either invalid JSON or was " + "not formatted properly for import into Open MCT.", - severity: "error", - options: [ - { - label: "Ok", - callback: function () { - dialog.dismiss(); + severity: "error", + options: [ + { + label: "Ok", + callback: function () { + dialog.dismiss(); + } } - } - ] - }; + ] + }; dialog = this.dialogService.showBlockingMessage(model); }; diff --git a/platform/import-export/test/actions/ExportAsJSONActionSpec.js b/platform/import-export/test/actions/ExportAsJSONActionSpec.js index b179dde296..dd76f0e116 100644 --- a/platform/import-export/test/actions/ExportAsJSONActionSpec.js +++ b/platform/import-export/test/actions/ExportAsJSONActionSpec.js @@ -53,9 +53,9 @@ define( openmct.objects.addProvider('', mockObjectProvider); exportService = jasmine.createSpyObj('exportService', - ['exportJSON']); + ['exportJSON']); identifierService = jasmine.createSpyObj('identifierService', - ['generate']); + ['generate']); policyService = jasmine.createSpyObj('policyService', ['allow']); mockType = jasmine.createSpyObj('type', ['hasFeature']); @@ -87,7 +87,7 @@ define( }); action = new ExportAsJSONAction(openmct, exportService, policyService, - identifierService, typeService, context); + identifierService, typeService, context); }); function invokeAdapter() { diff --git a/platform/import-export/test/actions/ImportAsJSONActionSpec.js b/platform/import-export/test/actions/ImportAsJSONActionSpec.js index 305ab5cb3d..1d43a5ed44 100644 --- a/platform/import-export/test/actions/ImportAsJSONActionSpec.js +++ b/platform/import-export/test/actions/ImportAsJSONActionSpec.js @@ -57,18 +57,17 @@ define( "capabilities": {} }; var locationCapability = { - setPrimaryLocation: jasmine.createSpy - ('setPrimaryLocation').and.callFake( - function (newLocation) { - config.model.location = newLocation; - } - ) + setPrimaryLocation: jasmine.createSpy('setPrimaryLocation') + .and + .callFake(function (newLocation) { + config.model.location = newLocation; + }) }; config.capabilities.location = locationCapability; if (model.composition) { var compCapability = jasmine.createSpy('compCapability') - .and.returnValue(model.composition); + .and.returnValue(model.composition); compCapability.add = jasmine.createSpy('add') .and.callFake(function (newObj) { config.model.composition.push(newObj.getId()); diff --git a/platform/persistence/aggregator/src/PersistenceAggregator.js b/platform/persistence/aggregator/src/PersistenceAggregator.js index 4efef6074f..f1b59e1f34 100644 --- a/platform/persistence/aggregator/src/PersistenceAggregator.js +++ b/platform/persistence/aggregator/src/PersistenceAggregator.js @@ -78,8 +78,8 @@ define( return this.providerMapPromise.then(function (map) { var provider = map[space]; return provider ? - provider[method].apply(provider, delegateArgs) : - METHOD_DEFAULTS[method]; + provider[method].apply(provider, delegateArgs) : + METHOD_DEFAULTS[method]; }); }; }); diff --git a/platform/persistence/elastic/test/ElasticSearchProviderSpec.js b/platform/persistence/elastic/test/ElasticSearchProviderSpec.js index d8698be6cf..62d02decb4 100644 --- a/platform/persistence/elastic/test/ElasticSearchProviderSpec.js +++ b/platform/persistence/elastic/test/ElasticSearchProviderSpec.js @@ -106,32 +106,32 @@ define([ .toBe('pwr~ dvc~ 43~'); expect(provider.fuzzyMatchUnquotedTerms( - 'hello welcome "to quoted village" have fun' - )).toBe( - 'hello~ welcome~ "to quoted village" have~ fun~' - ); + 'hello welcome "to quoted village" have fun' + )).toBe( + 'hello~ welcome~ "to quoted village" have~ fun~' + ); }); it('can parse responses', function () { var elasticSearchResponse = { - data: { - hits: { - total: 2, - hits: [ - { - '_id': 'hit1Id', - '_source': 'hit1Model', - '_score': 0.56 - }, - { - '_id': 'hit2Id', - '_source': 'hit2Model', - '_score': 0.34 - } - ] - } + data: { + hits: { + total: 2, + hits: [ + { + '_id': 'hit1Id', + '_source': 'hit1Model', + '_score': 0.56 + }, + { + '_id': 'hit2Id', + '_source': 'hit2Model', + '_score': 0.34 + } + ] } - }; + } + }; expect(provider.parseResponse(elasticSearchResponse)) .toEqual({ diff --git a/platform/persistence/local/src/LocalStoragePersistenceProvider.js b/platform/persistence/local/src/LocalStoragePersistenceProvider.js index 0ecb028606..001802fb3d 100644 --- a/platform/persistence/local/src/LocalStoragePersistenceProvider.js +++ b/platform/persistence/local/src/LocalStoragePersistenceProvider.js @@ -56,7 +56,7 @@ define( */ LocalStoragePersistenceProvider.prototype.getValue = function (key) { return this.localStorage[key] ? - JSON.parse(this.localStorage[key]) : {}; + JSON.parse(this.localStorage[key]) : {}; }; LocalStoragePersistenceProvider.prototype.listSpaces = function () { diff --git a/platform/persistence/queue/bundle.js b/platform/persistence/queue/bundle.js index 78ab1c4960..1906328adc 100644 --- a/platform/persistence/queue/bundle.js +++ b/platform/persistence/queue/bundle.js @@ -24,7 +24,7 @@ define([ "./src/QueuingPersistenceCapabilityDecorator", "./src/PersistenceQueue", "./src/PersistenceFailureController", - "text!./res/templates/persistence-failure-dialog.html", + "./res/templates/persistence-failure-dialog.html", 'legacyRegistry' ], function ( QueuingPersistenceCapabilityDecorator, diff --git a/platform/persistence/queue/src/PersistenceFailureDialog.js b/platform/persistence/queue/src/PersistenceFailureDialog.js index 792f4716ec..85fd29916a 100644 --- a/platform/persistence/queue/src/PersistenceFailureDialog.js +++ b/platform/persistence/queue/src/PersistenceFailureDialog.js @@ -66,7 +66,7 @@ define( unrecoverable: otherErrors }, options: revisionErrors.length > 0 ? - OVERWRITE_CANCEL_OPTIONS : OK_OPTIONS + OVERWRITE_CANCEL_OPTIONS : OK_OPTIONS }; } diff --git a/platform/persistence/queue/src/PersistenceFailureHandler.js b/platform/persistence/queue/src/PersistenceFailureHandler.js index 55fc6c9a53..7caecec88e 100644 --- a/platform/persistence/queue/src/PersistenceFailureHandler.js +++ b/platform/persistence/queue/src/PersistenceFailureHandler.js @@ -87,8 +87,8 @@ define( function () { return model; }, - model.modified - ); + model.modified + ); } // Cache the object models we might want to save diff --git a/platform/representation/src/actions/ContextMenuAction.js b/platform/representation/src/actions/ContextMenuAction.js index cbd2643c3c..2365c41584 100644 --- a/platform/representation/src/actions/ContextMenuAction.js +++ b/platform/representation/src/actions/ContextMenuAction.js @@ -80,7 +80,7 @@ define( body = $document.find('body'), scope = $rootScope.$new(), initiatingEvent = this.agentService.isMobile() ? - 'touchstart' : 'mousedown', + 'touchstart' : 'mousedown', menu, popup; diff --git a/platform/representation/src/gestures/GestureProvider.js b/platform/representation/src/gestures/GestureProvider.js index 72991bea6f..a96c9a114e 100644 --- a/platform/representation/src/gestures/GestureProvider.js +++ b/platform/representation/src/gestures/GestureProvider.js @@ -95,8 +95,8 @@ define( return gestureMap[key]; }).filter(function (Gesture) { return Gesture !== undefined && (Gesture.appliesTo ? - Gesture.appliesTo(domainObject) : - true); + Gesture.appliesTo(domainObject) : + true); }).map(function (Gesture) { return new Gesture(element, domainObject); }); diff --git a/platform/representation/test/TemplateLinkerSpec.js b/platform/representation/test/TemplateLinkerSpec.js index 73431a2a97..46f35b929c 100644 --- a/platform/representation/test/TemplateLinkerSpec.js +++ b/platform/representation/test/TemplateLinkerSpec.js @@ -68,7 +68,7 @@ define( mockTemplateRequest.and.returnValue(mockPromise); mockCompile.and.callFake(function (toCompile) { var html = typeof toCompile === 'string' ? - toCompile : toCompile.testHtml; + toCompile : toCompile.testHtml; mockTemplates[html] = jasmine.createSpy('template'); mockElements[html] = jasmine.createSpyObj('templateEl', JQLITE_METHODS); diff --git a/platform/representation/test/TemplatePrefetcherSpec.js b/platform/representation/test/TemplatePrefetcherSpec.js index 90dc30af31..17bccea9e8 100644 --- a/platform/representation/test/TemplatePrefetcherSpec.js +++ b/platform/representation/test/TemplatePrefetcherSpec.js @@ -29,7 +29,7 @@ define( var mockTemplateLinker, testExtensions, testPathPrefix, - prefetcher; + prefetcher; // eslint-disable-line beforeEach(function () { testPathPrefix = "some/path/"; diff --git a/platform/representation/test/actions/ContextMenuActionSpec.js b/platform/representation/test/actions/ContextMenuActionSpec.js index 5f3ef86ef7..07827d6f7c 100644 --- a/platform/representation/test/actions/ContextMenuActionSpec.js +++ b/platform/representation/test/actions/ContextMenuActionSpec.js @@ -42,7 +42,6 @@ define( mockRootScope, mockAgentService, mockScope, - mockElement, mockDomainObject, mockEvent, mockPopup, @@ -65,7 +64,6 @@ define( mockRootScope = jasmine.createSpyObj("$rootScope", ["$new"]); mockAgentService = jasmine.createSpyObj("agentService", ["isMobile"]); mockScope = jasmine.createSpyObj("scope", ["$destroy"]); - mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS); mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS); mockEvent = jasmine.createSpyObj("event", ["preventDefault", "stopPropagation"]); mockEvent.pageX = 123; diff --git a/platform/representation/test/gestures/ContextMenuGestureSpec.js b/platform/representation/test/gestures/ContextMenuGestureSpec.js index 207ef0381d..aed8bada4b 100644 --- a/platform/representation/test/gestures/ContextMenuGestureSpec.js +++ b/platform/representation/test/gestures/ContextMenuGestureSpec.js @@ -37,10 +37,8 @@ define( mockElement, mockAgentService, mockDomainObject, - mockEvent, mockTouchEvent, mockContextMenuAction, - mockActionContext, mockTouch, gesture, fireGesture, @@ -52,13 +50,11 @@ define( mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS); mockAgentService = jasmine.createSpyObj("agentService", ["isMobile"]); mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS); - mockEvent = jasmine.createSpyObj("event", ["preventDefault"]); mockContextMenuAction = jasmine.createSpyObj( "action", ["perform", "getActions"] ); - mockActionContext = {domainObject: mockDomainObject, event: mockEvent}; mockDomainObject.getCapability.and.returnValue(mockContextMenuAction); mockContextMenuAction.perform.and.returnValue(jasmine.any(Function)); mockAgentService.isMobile.and.returnValue(false); diff --git a/platform/search/bundle.js b/platform/search/bundle.js index 04d27b2b06..6a5b578dae 100644 --- a/platform/search/bundle.js +++ b/platform/search/bundle.js @@ -25,10 +25,10 @@ define([ "./src/controllers/SearchMenuController", "./src/services/GenericSearchProvider", "./src/services/SearchAggregator", - "text!./res/templates/search-item.html", - "text!./res/templates/search.html", - "text!./res/templates/search-menu.html", - "text!./src/services/GenericSearchWorker.js", + "./res/templates/search-item.html", + "./res/templates/search.html", + "./res/templates/search-menu.html", + "raw-loader!./src/services/GenericSearchWorker.js", 'legacyRegistry' ], function ( SearchController, diff --git a/platform/search/src/services/GenericSearchProvider.js b/platform/search/src/services/GenericSearchProvider.js index 913f3249b2..a2b7d785a1 100644 --- a/platform/search/src/services/GenericSearchProvider.js +++ b/platform/search/src/services/GenericSearchProvider.js @@ -158,7 +158,7 @@ define([ GenericSearchProvider.prototype.keepIndexing = function () { while (this.pendingRequests < this.MAX_CONCURRENT_REQUESTS && this.idsToIndex.length - ) { + ) { this.beginIndexRequest(); } }; diff --git a/platform/search/src/services/GenericSearchWorker.js b/platform/search/src/services/GenericSearchWorker.js index 35bb140145..a3b88692fe 100644 --- a/platform/search/src/services/GenericSearchWorker.js +++ b/platform/search/src/services/GenericSearchWorker.js @@ -30,7 +30,7 @@ // An array of objects composed of domain object IDs and models // {id: domainObject's ID, model: domainObject's model} var indexedItems = [], - TERM_SPLITTER = /[ _\*]/; + TERM_SPLITTER = /[ _*]/; function indexItem(id, model) { var vector = { @@ -50,8 +50,8 @@ // Helper function for search() function convertToTerms(input) { var query = { - exactInput: input - }; + exactInput: input + }; query.inputClean = input.trim(); query.inputLowerCase = query.inputClean.toLocaleLowerCase(); query.terms = query.inputLowerCase.split(TERM_SPLITTER); diff --git a/platform/search/src/services/SearchAggregator.js b/platform/search/src/services/SearchAggregator.js index 1ea79e04fa..20acf5e60b 100644 --- a/platform/search/src/services/SearchAggregator.js +++ b/platform/search/src/services/SearchAggregator.js @@ -106,9 +106,9 @@ define([ .all(resultPromises) .then(function (providerResults) { var modelResults = { - hits: [], - total: 0 - }; + hits: [], + total: 0 + }; providerResults.forEach(function (providerResult) { modelResults.hits = diff --git a/platform/search/test/services/GenericSearchWorkerSpec.js b/platform/search/test/services/GenericSearchWorkerSpec.js index 2f3cb3882a..9f06321f25 100644 --- a/platform/search/test/services/GenericSearchWorkerSpec.js +++ b/platform/search/test/services/GenericSearchWorkerSpec.js @@ -26,11 +26,17 @@ * SearchSpec. Created by shale on 07/31/2015. */ define([ - + "raw-loader!../../src/services/GenericSearchWorker.js" ], function ( - + GenericSearchWorkerText ) { + var WORKER_FILE = URL.createObjectURL(new Blob( + [GenericSearchWorkerText], + {type: 'application/javascript'} + )); + + describe('GenericSearchWorker', function () { // If this test fails, make sure this path is correct var worker, @@ -40,9 +46,7 @@ define([ itemsToIndex; beforeEach(function () { - worker = new Worker( - require.toUrl('platform/search/src/services/GenericSearchWorker.js') - ); + worker = new Worker(WORKER_FILE); objectX = { id: 'x', diff --git a/platform/search/test/services/SearchAggregatorSpec.js b/platform/search/test/services/SearchAggregatorSpec.js index 7420141cf3..6a12808f17 100644 --- a/platform/search/test/services/SearchAggregatorSpec.js +++ b/platform/search/test/services/SearchAggregatorSpec.js @@ -160,9 +160,9 @@ define([ it('can send queries to providers', function () { var provider = jasmine.createSpyObj( - 'provider', - ['query'] - ); + 'provider', + ['query'] + ); provider.query.and.returnValue('i prooomise!'); providers.push(provider); @@ -177,9 +177,9 @@ define([ it('supplies max results when none is provided', function () { var provider = jasmine.createSpyObj( - 'provider', - ['query'] - ); + 'provider', + ['query'] + ); providers.push(provider); aggregator.query('find me'); expect(provider.query).toHaveBeenCalledWith( @@ -190,23 +190,23 @@ define([ it('can combine responses from multiple providers', function () { var providerResponses = [ - { - hits: [ - 'oneHit', - 'twoHit' - ], - total: 2 - }, - { - hits: [ - 'redHit', - 'blueHit', - 'by', - 'Pete' - ], - total: 4 - } - ]; + { + hits: [ + 'oneHit', + 'twoHit' + ], + total: 2 + }, + { + hits: [ + 'redHit', + 'blueHit', + 'by', + 'Pete' + ], + total: 4 + } + ]; $q.all.and.returnValue(Promise.resolve(providerResponses)); spyOn(aggregator, 'orderByScore').and.returnValue('orderedByScore!'); diff --git a/platform/status/test/StatusServiceSpec.js b/platform/status/test/StatusServiceSpec.js index 0f262b640c..d7b5956c20 100644 --- a/platform/status/test/StatusServiceSpec.js +++ b/platform/status/test/StatusServiceSpec.js @@ -78,7 +78,7 @@ define( .toHaveBeenCalledWith([testStatus]); statusService.setStatus(testId, testStatus, false); expect(mockTopicInstance.notify) - .toHaveBeenCalledWith([ ]); + .toHaveBeenCalledWith([]); expect(mockTopic) .toHaveBeenCalledWith(jasmine.any(String)); diff --git a/platform/telemetry/src/TelemetryCapability.js b/platform/telemetry/src/TelemetryCapability.js index c023c36ae4..c5ac36cd3d 100644 --- a/platform/telemetry/src/TelemetryCapability.js +++ b/platform/telemetry/src/TelemetryCapability.js @@ -34,8 +34,8 @@ define( ) { var ZERO = function () { - return 0; - }, + return 0; + }, EMPTY_SERIES = { getPointCount: ZERO, getDomainValue: ZERO, diff --git a/platform/telemetry/src/TelemetryController.js b/platform/telemetry/src/TelemetryController.js index a24d51a6bd..da8e54c90d 100644 --- a/platform/telemetry/src/TelemetryController.js +++ b/platform/telemetry/src/TelemetryController.js @@ -351,7 +351,7 @@ define( */ getResponse: function getResponse(arg) { var id = arg && (typeof arg === 'string' ? - arg : arg.getId()); + arg : arg.getId()); if (id) { return (self.response[id] || {}).data; diff --git a/platform/telemetry/src/TelemetryFormatter.js b/platform/telemetry/src/TelemetryFormatter.js index e26763889d..2f09e7ef17 100644 --- a/platform/telemetry/src/TelemetryFormatter.js +++ b/platform/telemetry/src/TelemetryFormatter.js @@ -51,8 +51,8 @@ define( */ TelemetryFormatter.prototype.formatDomainValue = function (v, key) { var formatter = (key === undefined) ? - this.defaultFormat : - this.formatService.getFormat(key); + this.defaultFormat : + this.formatService.getFormat(key); return isNaN(v) ? "" : formatter.format(v); }; diff --git a/platform/telemetry/src/TelemetryHandle.js b/platform/telemetry/src/TelemetryHandle.js index deb02ef200..2c218ac3d3 100644 --- a/platform/telemetry/src/TelemetryHandle.js +++ b/platform/telemetry/src/TelemetryHandle.js @@ -101,7 +101,7 @@ define( // If the request is a simple number, treat it as a duration request = (typeof request === 'number') ? - { duration: request } : request; + { duration: request } : request; // Look up telemetry-providing objects from the subscription, // then issue new requests. @@ -131,8 +131,8 @@ define( } return typeof index !== 'number' ? - subscription.getDatum(telemetryObject) : - makeNewDatum(this.getSeries(telemetryObject)); + subscription.getDatum(telemetryObject) : + makeNewDatum(this.getSeries(telemetryObject)); }; return self; diff --git a/platform/telemetry/src/TelemetrySubscription.js b/platform/telemetry/src/TelemetrySubscription.js index 4735e6df9e..ac39052a79 100644 --- a/platform/telemetry/src/TelemetrySubscription.js +++ b/platform/telemetry/src/TelemetrySubscription.js @@ -190,8 +190,8 @@ define( // telemetry-capable objects may be an asynchronous operation.) self.telemetryObjectPromise = promiseRelevantObjects(domainObject); self.unsubscribePromise = self.telemetryObjectPromise - .then(cacheObjectReferences) - .then(subscribeAll); + .then(cacheObjectReferences) + .then(subscribeAll); } function idsMatch(ids) { @@ -292,8 +292,8 @@ define( var id = domainObject.getId(), latestValue = this.latestValues[id]; return latestValue && (key ? - latestValue.datum[key] : - latestValue.domain); + latestValue.datum[key] : + latestValue.domain); }; /** @@ -315,8 +315,8 @@ define( var id = domainObject.getId(), latestValue = this.latestValues[id]; return latestValue && (key ? - latestValue.datum[key] : - latestValue.range); + latestValue.datum[key] : + latestValue.range); }; /** diff --git a/src/MCT.js b/src/MCT.js index 7f8da7ac81..2ae6ef6a8d 100644 --- a/src/MCT.js +++ b/src/MCT.js @@ -31,7 +31,8 @@ define([ './ui/ViewRegistry', './ui/InspectorViewRegistry', './ui/ToolbarRegistry', - './adapter/indicators/legacy-indicators-plugin' + './adapter/indicators/legacy-indicators-plugin', + './styles/core.scss' ], function ( EventEmitter, legacyRegistry, @@ -43,7 +44,8 @@ define([ ViewRegistry, InspectorViewRegistry, ToolbarRegistry, - LegacyIndicatorsPlugin + LegacyIndicatorsPlugin, + coreStyles ) { /** * Open MCT is an extensible web application for building mission diff --git a/src/adapter/capabilities/AlternateCompositionCapability.js b/src/adapter/capabilities/AlternateCompositionCapability.js index 8981eaea61..a8e3f7d829 100644 --- a/src/adapter/capabilities/AlternateCompositionCapability.js +++ b/src/adapter/capabilities/AlternateCompositionCapability.js @@ -27,81 +27,81 @@ define([ '../../api/objects/object-utils', '../../../platform/core/src/capabilities/ContextualDomainObject' ], function (objectUtils, ContextualDomainObject) { - function AlternateCompositionCapability($injector, domainObject) { - this.domainObject = domainObject; - this.getDependencies = function () { - this.instantiate = $injector.get("instantiate"); - this.getDependencies = undefined; - this.openmct = $injector.get("openmct"); - }.bind(this); + function AlternateCompositionCapability($injector, domainObject) { + this.domainObject = domainObject; + this.getDependencies = function () { + this.instantiate = $injector.get("instantiate"); + this.getDependencies = undefined; + this.openmct = $injector.get("openmct"); + }.bind(this); + } + + AlternateCompositionCapability.prototype.add = function (child, index) { + if (typeof index !== 'undefined') { + // At first glance I don't see a location in the existing + // codebase where add is called with an index. Won't support. + throw new Error( + 'Composition Capability does not support adding at index' + ); } - AlternateCompositionCapability.prototype.add = function (child, index) { - if (typeof index !== 'undefined') { - // At first glance I don't see a location in the existing - // codebase where add is called with an index. Won't support. - throw new Error( - 'Composition Capability does not support adding at index' - ); + function addChildToComposition(model) { + var existingIndex = model.composition.indexOf(child.getId()); + if (existingIndex === -1) { + model.composition.push(child.getId()); } + } - function addChildToComposition(model) { - var existingIndex = model.composition.indexOf(child.getId()); - if (existingIndex === -1) { - model.composition.push(child.getId()); - } - } + return this.domainObject.useCapability( + 'mutation', + addChildToComposition + ) + .then(this.invoke.bind(this)) + .then(function (children) { + return children.filter(function (c) { + return c.getId() === child.getId(); + })[0]; + }); + }; - return this.domainObject.useCapability( - 'mutation', - addChildToComposition - ) - .then(this.invoke.bind(this)) - .then(function (children) { - return children.filter(function (c) { - return c.getId() === child.getId(); - })[0]; - }); - }; + AlternateCompositionCapability.prototype.contextualizeChild = function ( + child + ) { + if (this.getDependencies) { + this.getDependencies(); + } - AlternateCompositionCapability.prototype.contextualizeChild = function ( - child - ) { - if (this.getDependencies) { - this.getDependencies(); - } + var keyString = objectUtils.makeKeyString(child.identifier); + var oldModel = objectUtils.toOldFormat(child); + var newDO = this.instantiate(oldModel, keyString); + return new ContextualDomainObject(newDO, this.domainObject); - var keyString = objectUtils.makeKeyString(child.identifier); - var oldModel = objectUtils.toOldFormat(child); - var newDO = this.instantiate(oldModel, keyString); - return new ContextualDomainObject(newDO, this.domainObject); + }; - }; + AlternateCompositionCapability.prototype.invoke = function () { + var newFormatDO = objectUtils.toNewFormat( + this.domainObject.getModel(), + this.domainObject.getId() + ); - AlternateCompositionCapability.prototype.invoke = function () { - var newFormatDO = objectUtils.toNewFormat( - this.domainObject.getModel(), - this.domainObject.getId() - ); + if (this.getDependencies) { + this.getDependencies(); + } - if (this.getDependencies) { - this.getDependencies(); - } + var collection = this.openmct.composition.get(newFormatDO); - var collection = this.openmct.composition.get(newFormatDO); + return collection.load() + .then(function (children) { + return children.map(this.contextualizeChild, this); + }.bind(this)); + }; - return collection.load() - .then(function (children) { - return children.map(this.contextualizeChild, this); - }.bind(this)); - }; + AlternateCompositionCapability.appliesTo = function () { + // Will get replaced by a runs exception to properly + // bind to running openmct instance + return false; + }; - AlternateCompositionCapability.appliesTo = function () { - // Will get replaced by a runs exception to properly - // bind to running openmct instance - return false; - }; - - return AlternateCompositionCapability; - } + return AlternateCompositionCapability; +} ); diff --git a/src/adapter/capabilities/patchViewCapability.js b/src/adapter/capabilities/patchViewCapability.js index 345ae8130d..48f1081e03 100644 --- a/src/adapter/capabilities/patchViewCapability.js +++ b/src/adapter/capabilities/patchViewCapability.js @@ -48,9 +48,9 @@ define([ } return vd; }) - .sortBy('priority') - .map('view') - .value(); + .sortBy('priority') + .map('view') + .value(); }; return capability; }; diff --git a/src/adapter/runs/TimeSettingsURLHandlerSpec.js b/src/adapter/runs/TimeSettingsURLHandlerSpec.js index 496958255a..0c5e8115d5 100644 --- a/src/adapter/runs/TimeSettingsURLHandlerSpec.js +++ b/src/adapter/runs/TimeSettingsURLHandlerSpec.js @@ -32,7 +32,7 @@ define([ var $location; var $rootScope; var search; - var handler; + var handler; // eslint-disable-line var clockA; var clockB; var timeSystemA; diff --git a/src/adapter/services/LegacyObjectAPIInterceptor.js b/src/adapter/services/LegacyObjectAPIInterceptor.js index df8d05afde..ac011e12e1 100644 --- a/src/adapter/services/LegacyObjectAPIInterceptor.js +++ b/src/adapter/services/LegacyObjectAPIInterceptor.js @@ -73,10 +73,10 @@ define([ var key = object.key; return object.getCapability('persistence') - .persist() - .then(function () { - return utils.toNewFormat(object, key); - }); + .persist() + .then(function () { + return utils.toNewFormat(object, key); + }); }; ObjectServiceProvider.prototype.delete = function (object) { diff --git a/src/adapter/services/MissingModelCompatibilityDecorator.js b/src/adapter/services/MissingModelCompatibilityDecorator.js index 1635337322..e9cbd3cb6c 100644 --- a/src/adapter/services/MissingModelCompatibilityDecorator.js +++ b/src/adapter/services/MissingModelCompatibilityDecorator.js @@ -60,8 +60,8 @@ define([ }, this); return Promise.all(promises).then(function () { - return results; - }); + return results; + }); }; /** @@ -72,8 +72,8 @@ define([ return this.modelService.getModels(ids) .then(function (models) { var missingIds = ids.filter(function (id) { - return !models[id]; - }); + return !models[id]; + }); if (!missingIds.length) { return models; diff --git a/src/api/indicators/SimpleIndicator.js b/src/api/indicators/SimpleIndicator.js index 999a75d3a7..742c5da620 100644 --- a/src/api/indicators/SimpleIndicator.js +++ b/src/api/indicators/SimpleIndicator.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define(['zepto', 'text!./res/indicator-template.html'], +define(['zepto', './res/indicator-template.html'], function ($, indicatorTemplate) { var DEFAULT_ICON_CLASS = 'icon-info'; diff --git a/src/api/objects/object-utils.js b/src/api/objects/object-utils.js index ea67922417..86be028d53 100644 --- a/src/api/objects/object-utils.js +++ b/src/api/objects/object-utils.js @@ -97,7 +97,7 @@ define([ return identifier.key; } return [ - identifier.namespace.replace(/\:/g, '\\:'), + identifier.namespace.replace(/:/g, '\\:'), identifier.key ].join(':'); } diff --git a/src/api/objects/test/object-utilsSpec.js b/src/api/objects/test/object-utilsSpec.js index cc3f26ddd9..9a98b246e8 100644 --- a/src/api/objects/test/object-utilsSpec.js +++ b/src/api/objects/test/object-utilsSpec.js @@ -68,8 +68,8 @@ define([ it('translate ids', function () { expect(objectUtils.toNewFormat({ - prop: 'someValue' - }, 'objId')) + prop: 'someValue' + }, 'objId')) .toEqual({ prop: 'someValue', identifier: { @@ -81,12 +81,12 @@ define([ it('translates composition', function () { expect(objectUtils.toNewFormat({ - prop: 'someValue', - composition: [ - 'anotherObjectId', - 'scratch:anotherObjectId' - ] - }, 'objId')) + prop: 'someValue', + composition: [ + 'anotherObjectId', + 'scratch:anotherObjectId' + ] + }, 'objId')) .toEqual({ prop: 'someValue', composition: [ @@ -111,12 +111,12 @@ define([ it('removes ids', function () { expect(objectUtils.toOldFormat({ - prop: 'someValue', - identifier: { - namespace: '', - key: 'objId' - } - })) + prop: 'someValue', + identifier: { + namespace: '', + key: 'objId' + } + })) .toEqual({ prop: 'someValue' }); @@ -124,22 +124,22 @@ define([ it('translates composition', function () { expect(objectUtils.toOldFormat({ - prop: 'someValue', - composition: [ - { - namespace: '', - key: 'anotherObjectId' - }, - { - namespace: 'scratch', - key: 'anotherObjectId' - } - ], - identifier: { + prop: 'someValue', + composition: [ + { namespace: '', - key: 'objId' + key: 'anotherObjectId' + }, + { + namespace: 'scratch', + key: 'anotherObjectId' } - })) + ], + identifier: { + namespace: '', + key: 'objId' + } + })) .toEqual({ prop: 'someValue', composition: [ diff --git a/src/api/ui/Dialog.js b/src/api/ui/Dialog.js index 954a162f60..068c8206da 100644 --- a/src/api/ui/Dialog.js +++ b/src/api/ui/Dialog.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define(['text!./dialog.html', 'zepto'], function (dialogTemplate, $) { +define(['./dialog.html', 'zepto'], function (dialogTemplate, $) { /** * A dialog may be displayed to show blocking content to users. diff --git a/src/defaultRegistry.js b/src/defaultRegistry.js index e2ebc0de7e..a9d97ed564 100644 --- a/src/defaultRegistry.js +++ b/src/defaultRegistry.js @@ -25,11 +25,8 @@ define([ '../src/adapter/bundle', - '../example/builtins/bundle', - '../example/composite/bundle', '../example/eventGenerator/bundle', '../example/export/bundle', - '../example/extensions/bundle', '../example/forms/bundle', '../example/identity/bundle', '../example/mobile/bundle', @@ -40,8 +37,6 @@ define([ '../example/profiling/bundle', '../example/scratchpad/bundle', '../example/styleguide/bundle', - '../example/taxonomy/bundle', - '../example/worker/bundle', '../platform/commonUI/about/bundle', '../platform/commonUI/browse/bundle', @@ -53,8 +48,6 @@ define([ '../platform/commonUI/mobile/bundle', '../platform/commonUI/notification/bundle', '../platform/commonUI/regions/bundle', - '../platform/commonUI/themes/espresso/bundle', - '../platform/commonUI/themes/snow/bundle', '../platform/containment/bundle', '../platform/core/bundle', '../platform/entanglement/bundle', diff --git a/platform/commonUI/general/res/fonts/symbols/icomoon-project-openmct-symbols-12px.json b/src/fonts/symbols/icomoon-project-openmct-symbols-12px.json similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/icomoon-project-openmct-symbols-12px.json rename to src/fonts/symbols/icomoon-project-openmct-symbols-12px.json diff --git a/platform/commonUI/general/res/fonts/symbols/icomoon-project-openmct-symbols-16px.json b/src/fonts/symbols/icomoon-project-openmct-symbols-16px.json similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/icomoon-project-openmct-symbols-16px.json rename to src/fonts/symbols/icomoon-project-openmct-symbols-16px.json diff --git a/platform/commonUI/general/res/fonts/symbols/openmct-symbols-12px.eot b/src/fonts/symbols/openmct-symbols-12px.eot similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/openmct-symbols-12px.eot rename to src/fonts/symbols/openmct-symbols-12px.eot diff --git a/platform/commonUI/general/res/fonts/symbols/openmct-symbols-12px.svg b/src/fonts/symbols/openmct-symbols-12px.svg similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/openmct-symbols-12px.svg rename to src/fonts/symbols/openmct-symbols-12px.svg diff --git a/platform/commonUI/general/res/fonts/symbols/openmct-symbols-12px.ttf b/src/fonts/symbols/openmct-symbols-12px.ttf similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/openmct-symbols-12px.ttf rename to src/fonts/symbols/openmct-symbols-12px.ttf diff --git a/platform/commonUI/general/res/fonts/symbols/openmct-symbols-12px.woff b/src/fonts/symbols/openmct-symbols-12px.woff similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/openmct-symbols-12px.woff rename to src/fonts/symbols/openmct-symbols-12px.woff diff --git a/platform/commonUI/general/res/fonts/symbols/openmct-symbols-16px.eot b/src/fonts/symbols/openmct-symbols-16px.eot similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/openmct-symbols-16px.eot rename to src/fonts/symbols/openmct-symbols-16px.eot diff --git a/platform/commonUI/general/res/fonts/symbols/openmct-symbols-16px.svg b/src/fonts/symbols/openmct-symbols-16px.svg similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/openmct-symbols-16px.svg rename to src/fonts/symbols/openmct-symbols-16px.svg diff --git a/platform/commonUI/general/res/fonts/symbols/openmct-symbols-16px.ttf b/src/fonts/symbols/openmct-symbols-16px.ttf similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/openmct-symbols-16px.ttf rename to src/fonts/symbols/openmct-symbols-16px.ttf diff --git a/platform/commonUI/general/res/fonts/symbols/openmct-symbols-16px.woff b/src/fonts/symbols/openmct-symbols-16px.woff similarity index 100% rename from platform/commonUI/general/res/fonts/symbols/openmct-symbols-16px.woff rename to src/fonts/symbols/openmct-symbols-16px.woff diff --git a/platform/commonUI/general/res/images/bg-splash.jpg b/src/images/bg-splash.jpg similarity index 100% rename from platform/commonUI/general/res/images/bg-splash.jpg rename to src/images/bg-splash.jpg diff --git a/platform/commonUI/general/res/images/favicons/favicon-16x16.png b/src/images/favicons/favicon-16x16.png similarity index 100% rename from platform/commonUI/general/res/images/favicons/favicon-16x16.png rename to src/images/favicons/favicon-16x16.png diff --git a/platform/commonUI/general/res/images/favicons/favicon-32x32.png b/src/images/favicons/favicon-32x32.png similarity index 100% rename from platform/commonUI/general/res/images/favicons/favicon-32x32.png rename to src/images/favicons/favicon-32x32.png diff --git a/platform/commonUI/general/res/images/favicons/favicon-96x96.png b/src/images/favicons/favicon-96x96.png similarity index 100% rename from platform/commonUI/general/res/images/favicons/favicon-96x96.png rename to src/images/favicons/favicon-96x96.png diff --git a/platform/commonUI/general/res/images/favicons/favicon.ico b/src/images/favicons/favicon.ico similarity index 100% rename from platform/commonUI/general/res/images/favicons/favicon.ico rename to src/images/favicons/favicon.ico diff --git a/platform/commonUI/general/res/images/logo-app-shdw.svg b/src/images/logo-app-shdw.svg similarity index 100% rename from platform/commonUI/general/res/images/logo-app-shdw.svg rename to src/images/logo-app-shdw.svg diff --git a/platform/commonUI/general/res/images/logo-app.svg b/src/images/logo-app.svg similarity index 100% rename from platform/commonUI/general/res/images/logo-app.svg rename to src/images/logo-app.svg diff --git a/platform/commonUI/general/res/images/logo-nasa.svg b/src/images/logo-nasa.svg similarity index 100% rename from platform/commonUI/general/res/images/logo-nasa.svg rename to src/images/logo-nasa.svg diff --git a/src/legacyRegistry.js b/src/legacyRegistry.js index 1d363015d4..e40340d4e6 100644 --- a/src/legacyRegistry.js +++ b/src/legacyRegistry.js @@ -20,6 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define(['src/BundleRegistry'], function (BundleRegistry) { +define(['./BundleRegistry'], function (BundleRegistry) { return new BundleRegistry(); }); diff --git a/src/plugins/URLIndicatorPlugin/URLIndicator.js b/src/plugins/URLIndicatorPlugin/URLIndicator.js index 719250fc6b..dacacdaed3 100644 --- a/src/plugins/URLIndicatorPlugin/URLIndicator.js +++ b/src/plugins/URLIndicatorPlugin/URLIndicator.js @@ -52,21 +52,21 @@ define( URLIndicator.prototype.setIndicatorToState = function (state) { switch (state) { - case CONNECTED: { - this.indicator.text(this.label + " is connected"); - this.indicator.description(this.label + " is online, checking status every " + this.interval + " milliseconds."); - break; - } - case PENDING: { - this.indicator.text("Checking status of " + this.label + " please stand by..."); - this.indicator.description("Checking status of " + this.label + " please stand by..."); - break; - } - case DISCONNECTED: { - this.indicator.text(this.label + " is offline"); - this.indicator.description(this.label + " is offline, checking status every " + this.interval + " milliseconds"); - break; - } + case CONNECTED: { + this.indicator.text(this.label + " is connected"); + this.indicator.description(this.label + " is online, checking status every " + this.interval + " milliseconds."); + break; + } + case PENDING: { + this.indicator.text("Checking status of " + this.label + " please stand by..."); + this.indicator.description("Checking status of " + this.label + " please stand by..."); + break; + } + case DISCONNECTED: { + this.indicator.text(this.label + " is offline"); + this.indicator.description(this.label + " is offline, checking status every " + this.interval + " milliseconds"); + break; + } } this.indicator.statusClass(state.statusClass); diff --git a/src/plugins/URLIndicatorPlugin/URLIndicatorSpec.js b/src/plugins/URLIndicatorPlugin/URLIndicatorSpec.js index bfd2c058c1..eee0553a8b 100644 --- a/src/plugins/URLIndicatorPlugin/URLIndicatorSpec.js +++ b/src/plugins/URLIndicatorPlugin/URLIndicatorSpec.js @@ -40,7 +40,7 @@ define( var indicatorElement; var pluginOptions; var ajaxOptions; - var urlIndicator; + var urlIndicator; // eslint-disable-line beforeEach(function () { jasmine.clock().install(); diff --git a/src/plugins/autoflow/AutoflowTabularView.js b/src/plugins/autoflow/AutoflowTabularView.js index 1209f35c3f..3c514d6fff 100644 --- a/src/plugins/autoflow/AutoflowTabularView.js +++ b/src/plugins/autoflow/AutoflowTabularView.js @@ -24,7 +24,7 @@ define([ './AutoflowTabularController', './AutoflowTabularConstants', '../../ui/VueView', - 'text!./autoflow-tabular.html' + './autoflow-tabular.html' ], function ( AutoflowTabularController, AutoflowTabularConstants, @@ -59,7 +59,7 @@ define([ increaseColumnWidth: function () { data.width += COLUMN_WIDTH_STEP; data.width = data.width > MAX_COLUMN_WIDTH ? - INITIAL_COLUMN_WIDTH : data.width; + INITIAL_COLUMN_WIDTH : data.width; }, reflow: function () { var column = []; diff --git a/src/plugins/plot/plugin.js b/src/plugins/plot/plugin.js index 5220c984d0..426f4fe343 100644 --- a/src/plugins/plot/plugin.js +++ b/src/plugins/plot/plugin.js @@ -37,11 +37,11 @@ define([ "./src/inspector/HideElementPoolDirective", "./src/services/ExportImageService", './src/PlotViewPolicy', - "text!./res/templates/plot-options.html", - "text!./res/templates/plot-options-browse.html", - "text!./res/templates/plot-options-edit.html", - "text!./res/templates/stacked-plot.html", - "text!./res/templates/plot.html" + "./res/templates/plot-options.html", + "./res/templates/plot-options-browse.html", + "./res/templates/plot-options-edit.html", + "./res/templates/stacked-plot.html", + "./res/templates/plot.html" ], function ( MCTChartDirective, MCTPlotDirective, diff --git a/src/plugins/plot/src/PlotViewPolicy.js b/src/plugins/plot/src/PlotViewPolicy.js index ca23502cbe..55f9a8d29b 100644 --- a/src/plugins/plot/src/PlotViewPolicy.js +++ b/src/plugins/plot/src/PlotViewPolicy.js @@ -40,7 +40,7 @@ define( if (!adaptedObject.telemetry) { return domainObject.hasCapability('delegation') && domainObject.getCapability('delegation') - .doesDelegateCapability('telemetry'); + .doesDelegateCapability('telemetry'); } var metadata = this.openmct.telemetry.getMetadata(adaptedObject); diff --git a/src/plugins/plot/src/draw/DrawLoader.js b/src/plugins/plot/src/draw/DrawLoader.js index bb1c3f61a1..6b78233d10 100644 --- a/src/plugins/plot/src/draw/DrawLoader.js +++ b/src/plugins/plot/src/draw/DrawLoader.js @@ -29,17 +29,17 @@ define( function (DrawWebGL, Draw2D) { var CHARTS = [ - { - MAX_INSTANCES: 16, - API: DrawWebGL, - ALLOCATIONS: [] - }, - { - MAX_INSTANCES: Number.POSITIVE_INFINITY, - API: Draw2D, - ALLOCATIONS: [] - } - ]; + { + MAX_INSTANCES: 16, + API: DrawWebGL, + ALLOCATIONS: [] + }, + { + MAX_INSTANCES: Number.POSITIVE_INFINITY, + API: Draw2D, + ALLOCATIONS: [] + } + ]; /** * Draw loader attaches a draw API to a canvas element and returns the diff --git a/src/plugins/plot/src/lib/eventHelpers.js b/src/plugins/plot/src/lib/eventHelpers.js index e464a8e33f..71af5d11d5 100644 --- a/src/plugins/plot/src/lib/eventHelpers.js +++ b/src/plugins/plot/src/lib/eventHelpers.js @@ -37,7 +37,7 @@ define([ event: event, callback: callback, context: context, - _cb: !!context ? callback.bind(context) : callback + _cb: context ? callback.bind(context) : callback }; if (object.$watch && event.indexOf('change:') === 0) { var scopePath = event.replace('change:', ''); @@ -58,20 +58,20 @@ define([ } this._listeningTo.filter(function (listener) { - if (object && object !== listener.object) { - return false; - } - if (event && event !== listener.event) { - return false; - } - if (callback && callback !== listener.callback) { - return false; - } - if (context && context !== listener.context) { - return false; - } - return true; - }) + if (object && object !== listener.object) { + return false; + } + if (event && event !== listener.event) { + return false; + } + if (callback && callback !== listener.callback) { + return false; + } + if (context && context !== listener.context) { + return false; + } + return true; + }) .map(function (listener) { if (listener.unlisten) { listener.unlisten(); diff --git a/src/plugins/plot/src/plot/MCTPlotDirective.js b/src/plugins/plot/src/plot/MCTPlotDirective.js index 2d1e155e1b..2804d00b23 100644 --- a/src/plugins/plot/src/plot/MCTPlotDirective.js +++ b/src/plugins/plot/src/plot/MCTPlotDirective.js @@ -22,7 +22,7 @@ define([ './MCTPlotController', - 'text!../../res/templates/mct-plot.html' + '../../res/templates/mct-plot.html' ], function ( MCTPlotController, PlotTemplate diff --git a/src/plugins/plot/src/services/ExportImageService.js b/src/plugins/plot/src/services/ExportImageService.js index c3566cda7b..55a040f7f5 100644 --- a/src/plugins/plot/src/services/ExportImageService.js +++ b/src/plugins/plot/src/services/ExportImageService.js @@ -91,16 +91,16 @@ define( console.log('error capturing image', error); dialog.dismiss(); var errorDialog = dialogService.showBlockingMessage({ - title: "Error capturing image", - severity: "error", - hint: "Image was not captured successfully!", - options: [{ - label: "OK", - callback: function () { - errorDialog.dismiss(); - } - }] - }); + title: "Error capturing image", + severity: "error", + hint: "Image was not captured successfully!", + options: [{ + label: "OK", + callback: function () { + errorDialog.dismiss(); + } + }] + }); }); }; diff --git a/src/plugins/plot/src/telemetry/MCTOverlayPlot.js b/src/plugins/plot/src/telemetry/MCTOverlayPlot.js index dcebe96d09..d8ab7beaf1 100644 --- a/src/plugins/plot/src/telemetry/MCTOverlayPlot.js +++ b/src/plugins/plot/src/telemetry/MCTOverlayPlot.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - 'text!../../res/templates/plot.html' + '../../res/templates/plot.html' ], function ( PlotTemplate ) { diff --git a/src/plugins/plot/src/telemetry/PlotController.js b/src/plugins/plot/src/telemetry/PlotController.js index 12a74a9b65..4ff54a8c0c 100644 --- a/src/plugins/plot/src/telemetry/PlotController.js +++ b/src/plugins/plot/src/telemetry/PlotController.js @@ -160,10 +160,10 @@ define([ this.config.series.map(function (plotSeries) { this.startLoading(); plotSeries.load({ - size: this.$element[0].offsetWidth, - start: range.min, - end: range.max - }) + size: this.$element[0].offsetWidth, + start: range.min, + end: range.max + }) .then(this.stopLoading.bind(this)); if (purge) { plotSeries.purgeRecordsOutsideRange(range); diff --git a/src/plugins/plot/src/telemetry/StackedPlotController.js b/src/plugins/plot/src/telemetry/StackedPlotController.js index dceaee46cb..322e55c4d1 100644 --- a/src/plugins/plot/src/telemetry/StackedPlotController.js +++ b/src/plugins/plot/src/telemetry/StackedPlotController.js @@ -28,7 +28,6 @@ define([ function StackedPlotController($scope, openmct, objectService, $element, exportImageService) { var tickWidth = 0, - newFormatObject, composition, currentRequest, unlisten, @@ -39,15 +38,6 @@ define([ $scope.telemetryObjects = []; - function oldId(newIdentifier) { - var idParts = []; - if (newIdentifier.namespace) { - idParts.push(newIdentifier.namespace.replace(/\:/g, '\\:')); - } - idParts.push(newIdentifier.key); - return idParts.join(':'); - } - function onDomainObjectChange(domainObject) { var thisRequest = { pending: 0 @@ -64,7 +54,7 @@ define([ } function addChild(child) { - var id = oldId(child.identifier); + var id = openmct.objects.makeKeyString(child.identifier); thisTickWidthMap[id] = 0; thisRequest.pending += 1; objectService.getObjects([id]) @@ -76,7 +66,7 @@ define([ } function removeChild(childIdentifier) { - var id = oldId(childIdentifier); + var id = openmct.objects.makeKeyString(childIdentifier); delete thisTickWidthMap[id]; var childObj = telemetryObjects.filter(function (c) { return c.getId() === id; @@ -89,21 +79,20 @@ define([ } thisRequest.pending += 1; openmct.objects.get(domainObject.getId()) - .then(function (obj) { - thisRequest.pending -= 1; - if (thisRequest !== currentRequest) { - return; - } - newFormatObject = obj; - composition = openmct.composition.get(obj); - composition.on('add', addChild); - composition.on('remove', removeChild); - composition.load(); - unlisten = function () { - composition.off('add', addChild); - composition.off('remove', removeChild); - }; - }); + .then(function (obj) { + thisRequest.pending -= 1; + if (thisRequest !== currentRequest) { + return; + } + composition = openmct.composition.get(obj); + composition.on('add', addChild); + composition.on('remove', removeChild); + composition.load(); + unlisten = function () { + composition.off('add', addChild); + composition.off('remove', removeChild); + }; + }); } function onCompositionChange(newComp, oldComp) { diff --git a/src/plugins/plugins.js b/src/plugins/plugins.js index 69d396d8e5..e7df3bfb7e 100644 --- a/src/plugins/plugins.js +++ b/src/plugins/plugins.js @@ -50,13 +50,9 @@ define([ StaticRootPlugin ) { var bundleMap = { - CouchDB: 'platform/persistence/couch', - Elasticsearch: 'platform/persistence/elastic', - Espresso: 'platform/commonUI/themes/espresso', LocalStorage: 'platform/persistence/local', MyItems: 'platform/features/my-items', - Notebook: 'platform/features/notebook', - Snow: 'platform/commonUI/themes/snow' + Notebook: 'platform/features/notebook' }; var plugins = _.mapValues(bundleMap, function (bundleName, pluginName) { @@ -67,6 +63,26 @@ define([ }; }); + plugins.Snow = function () { + return function install(openmct) { + openmct.legacyExtension('constants', { + key: "THEME", + value: "snow" + }); + import('snow' /* webpackChunkName: "theme-snow" */); + }; + }; + + plugins.Espresso = function () { + return function install(openmct) { + openmct.legacyExtension('constants', { + key: "THEME", + value: "espresso" + }); + import('espresso' /* webpackChunkName: "theme-espresso" */); + }; + }; + plugins.UTCTimeSystem = UTCTimeSystem; plugins.ImportExport = ImportExport; diff --git a/src/plugins/staticRootPlugin/StaticModelProviderSpec.js b/src/plugins/staticRootPlugin/StaticModelProviderSpec.js index 80a3592263..34031f3506 100644 --- a/src/plugins/staticRootPlugin/StaticModelProviderSpec.js +++ b/src/plugins/staticRootPlugin/StaticModelProviderSpec.js @@ -1,9 +1,9 @@ define([ './StaticModelProvider', - 'text!./static-provider-test.json' + './static-provider-test.json' ], function ( StaticModelProvider, - testStaticDataText + testStaticData ) { describe('StaticModelProvider', function () { @@ -11,7 +11,7 @@ define([ var staticProvider; beforeEach(function () { - var staticData = JSON.parse(testStaticDataText); + var staticData = JSON.parse(JSON.stringify(testStaticData)); staticProvider = new StaticModelProvider(staticData, { namespace: 'my-import', key: 'root' diff --git a/src/plugins/summaryWidget/plugin.js b/src/plugins/summaryWidget/plugin.js index 92220a7ae2..9f8ab5adfb 100755 --- a/src/plugins/summaryWidget/plugin.js +++ b/src/plugins/summaryWidget/plugin.js @@ -70,15 +70,15 @@ define([ "name": "Tab to Open Hyperlink", "control": "select", "options": [ - { - "value": "thisTab", - "name": "Open in this tab" - }, - { - "value": "newTab", - "name": "Open in a new tab" - } - ], + { + "value": "thisTab", + "name": "Open in this tab" + }, + { + "value": "newTab", + "name": "Open in a new tab" + } + ], "cssClass": "l-inline" } ] diff --git a/src/plugins/summaryWidget/src/Condition.js b/src/plugins/summaryWidget/src/Condition.js index f24684a0d6..f46a410897 100644 --- a/src/plugins/summaryWidget/src/Condition.js +++ b/src/plugins/summaryWidget/src/Condition.js @@ -1,5 +1,5 @@ define([ - 'text!../res/conditionTemplate.html', + '../res/conditionTemplate.html', './input/ObjectSelect', './input/KeySelect', './input/OperationSelect', diff --git a/src/plugins/summaryWidget/src/Rule.js b/src/plugins/summaryWidget/src/Rule.js index 516bc11726..18df7bf1db 100644 --- a/src/plugins/summaryWidget/src/Rule.js +++ b/src/plugins/summaryWidget/src/Rule.js @@ -1,5 +1,5 @@ define([ - 'text!../res/ruleTemplate.html', + '../res/ruleTemplate.html', './Condition', './input/ColorPalette', './input/IconPalette', diff --git a/src/plugins/summaryWidget/src/SummaryWidget.js b/src/plugins/summaryWidget/src/SummaryWidget.js index a302e76517..9c3436a143 100644 --- a/src/plugins/summaryWidget/src/SummaryWidget.js +++ b/src/plugins/summaryWidget/src/SummaryWidget.js @@ -1,5 +1,5 @@ define([ - 'text!../res/widgetTemplate.html', + '../res/widgetTemplate.html', './Rule', './ConditionManager', './TestDataManager', @@ -363,7 +363,7 @@ define([ } ruleConfig = this.domainObject.configuration.ruleConfigById[ruleId]; this.rulesById[ruleId] = new Rule(ruleConfig, this.domainObject, this.openmct, - this.conditionManager, this.widgetDnD, this.container); + this.conditionManager, this.widgetDnD, this.container); this.rulesById[ruleId].on('remove', this.refreshRules, this); this.rulesById[ruleId].on('duplicate', this.duplicateRule, this); this.rulesById[ruleId].on('change', this.updateWidget, this); diff --git a/src/plugins/summaryWidget/src/TestDataItem.js b/src/plugins/summaryWidget/src/TestDataItem.js index 94f8b4aa1e..20dc75bdd2 100644 --- a/src/plugins/summaryWidget/src/TestDataItem.js +++ b/src/plugins/summaryWidget/src/TestDataItem.js @@ -1,5 +1,5 @@ define([ - 'text!../res/testDataItemTemplate.html', + '../res/testDataItemTemplate.html', './input/ObjectSelect', './input/KeySelect', './eventHelpers', diff --git a/src/plugins/summaryWidget/src/TestDataManager.js b/src/plugins/summaryWidget/src/TestDataManager.js index 8f5b631bac..ac865db16f 100644 --- a/src/plugins/summaryWidget/src/TestDataManager.js +++ b/src/plugins/summaryWidget/src/TestDataManager.js @@ -1,6 +1,6 @@ define([ './eventHelpers', - 'text!../res/testDataTemplate.html', + '../res/testDataTemplate.html', './TestDataItem', 'zepto', 'lodash' @@ -74,12 +74,12 @@ define([ */ TestDataManager.prototype.initItem = function (config) { var sourceIndex = config && config.index, - defaultItem = { - object: '', - key: '', - value: '' - }, - newItem; + defaultItem = { + object: '', + key: '', + value: '' + }, + newItem; newItem = (config !== undefined ? config.sourceItem : defaultItem); if (sourceIndex !== undefined) { diff --git a/src/plugins/summaryWidget/src/WidgetDnD.js b/src/plugins/summaryWidget/src/WidgetDnD.js index 69f50b574c..89dbad4cb5 100644 --- a/src/plugins/summaryWidget/src/WidgetDnD.js +++ b/src/plugins/summaryWidget/src/WidgetDnD.js @@ -1,5 +1,5 @@ define([ - 'text!../res/ruleImageTemplate.html', + '../res/ruleImageTemplate.html', 'EventEmitter', 'zepto' ], function ( diff --git a/src/plugins/summaryWidget/src/eventHelpers.js b/src/plugins/summaryWidget/src/eventHelpers.js index 3dc80de611..a52fd49549 100644 --- a/src/plugins/summaryWidget/src/eventHelpers.js +++ b/src/plugins/summaryWidget/src/eventHelpers.js @@ -1,4 +1,3 @@ -var listenersCount = 0; /*global define*/ // jscs:disable disallowDanglingUnderscores define([], function () { @@ -12,7 +11,7 @@ define([], function () { event: event, callback: callback, context: context, - _cb: !!context ? callback.bind(context) : callback + _cb: context ? callback.bind(context) : callback }; if (object.$watch && event.indexOf('change:') === 0) { var scopePath = event.replace('change:', ''); @@ -25,7 +24,6 @@ define([], function () { object.on(event, listener._cb); } this._listeningTo.push(listener); - listenersCount++; }, stopListening: function (object, event, callback, context) { @@ -34,20 +32,20 @@ define([], function () { } this._listeningTo.filter(function (listener) { - if (object && object !== listener.object) { - return false; - } - if (event && event !== listener.event) { - return false; - } - if (callback && callback !== listener.callback) { - return false; - } - if (context && context !== listener.context) { - return false; - } - return true; - }) + if (object && object !== listener.object) { + return false; + } + if (event && event !== listener.event) { + return false; + } + if (callback && callback !== listener.callback) { + return false; + } + if (context && context !== listener.context) { + return false; + } + return true; + }) .map(function (listener) { if (listener.unlisten) { listener.unlisten(); @@ -56,7 +54,6 @@ define([], function () { } else { listener.object.off(listener.event, listener._cb); } - listenersCount--; return listener; }) .forEach(function (listener) { diff --git a/src/plugins/summaryWidget/src/input/ColorPalette.js b/src/plugins/summaryWidget/src/input/ColorPalette.js index d0dee7b8f3..9d310de321 100644 --- a/src/plugins/summaryWidget/src/input/ColorPalette.js +++ b/src/plugins/summaryWidget/src/input/ColorPalette.js @@ -17,7 +17,7 @@ function ( '#a61c00','#cc0000','#e69138','#f1c232','#6aa84f','#45818e','#3c78d8','#3d85c6','#674ea7','#a64d79', '#85200c','#990000','#b45f06','#bf9000','#38761d','#134f5c','#1155cc','#0b5394','#351c75','#741b47', '#5b0f00','#660000','#783f04','#7f6000','#274e13','#0c343d','#1c4587','#073763','#20124d','#4c1130' - ]; + ]; /** * Instantiates a new Open MCT Color Palette input diff --git a/src/plugins/summaryWidget/src/input/IconPalette.js b/src/plugins/summaryWidget/src/input/IconPalette.js index 911a0f3d3f..3cc70df34f 100644 --- a/src/plugins/summaryWidget/src/input/IconPalette.js +++ b/src/plugins/summaryWidget/src/input/IconPalette.js @@ -1,6 +1,6 @@ define([ - './Palette', - 'zepto' + './Palette', + 'zepto' ], function ( Palette, $ diff --git a/src/plugins/summaryWidget/src/input/Palette.js b/src/plugins/summaryWidget/src/input/Palette.js index bdc1a54d9e..4ff75d91b7 100644 --- a/src/plugins/summaryWidget/src/input/Palette.js +++ b/src/plugins/summaryWidget/src/input/Palette.js @@ -1,6 +1,6 @@ define([ '../eventHelpers', - 'text!../../res/input/paletteTemplate.html', + '../../res/input/paletteTemplate.html', 'EventEmitter', 'zepto' ], function ( diff --git a/src/plugins/summaryWidget/src/input/Select.js b/src/plugins/summaryWidget/src/input/Select.js index d0619a6896..800c0f31e6 100644 --- a/src/plugins/summaryWidget/src/input/Select.js +++ b/src/plugins/summaryWidget/src/input/Select.js @@ -1,6 +1,6 @@ define([ '../eventHelpers', - 'text!../../res/input/selectTemplate.html', + '../../res/input/selectTemplate.html', 'EventEmitter', 'zepto' ], function ( diff --git a/src/plugins/summaryWidget/src/views/SummaryWidgetView.js b/src/plugins/summaryWidget/src/views/SummaryWidgetView.js index c6c70f0e76..cedfd90f7e 100644 --- a/src/plugins/summaryWidget/src/views/SummaryWidgetView.js +++ b/src/plugins/summaryWidget/src/views/SummaryWidgetView.js @@ -1,5 +1,5 @@ define([ - 'text!./summary-widget.html' + './summary-widget.html' ], function ( summaryWidgetTemplate ) { diff --git a/src/plugins/summaryWidget/test/ConditionEvaluatorSpec.js b/src/plugins/summaryWidget/test/ConditionEvaluatorSpec.js index 0380ef2bb0..1b7fa0b832 100644 --- a/src/plugins/summaryWidget/test/ConditionEvaluatorSpec.js +++ b/src/plugins/summaryWidget/test/ConditionEvaluatorSpec.js @@ -216,7 +216,7 @@ define(['../src/ConditionEvaluator'], function (ConditionEvaluator) { it('gets the keys for possible operations', function () { expect(evaluator.getOperationKeys()).toEqual( - ['greaterThan', 'lessThan', 'textContains', 'textIsExactly', 'isHalfHorse'] + ['greaterThan', 'lessThan', 'textContains', 'textIsExactly', 'isHalfHorse'] ); }); diff --git a/src/plugins/summaryWidget/test/RuleSpec.js b/src/plugins/summaryWidget/test/RuleSpec.js index 0161e3512d..8a6f944203 100644 --- a/src/plugins/summaryWidget/test/RuleSpec.js +++ b/src/plugins/summaryWidget/test/RuleSpec.js @@ -52,7 +52,7 @@ define(['../src/Rule', 'zepto'], function (Rule, $) { mockEvaluator = {}; mockEvaluator.getOperationDescription = jasmine.createSpy('evaluator') - .and.returnValue('Operation Description'); + .and.returnValue('Operation Description'); mockConditionManager = jasmine.createSpyObj('mockConditionManager', [ 'on', @@ -86,7 +86,7 @@ define(['../src/Rule', 'zepto'], function (Rule, $) { conditionChangeSpy = jasmine.createSpy('conditionChangeCallback'); testRule = new Rule(mockRuleConfig, mockDomainObject, mockOpenMCT, mockConditionManager, - mockWidgetDnD); + mockWidgetDnD); testRule.on('remove', removeSpy); testRule.on('duplicate', duplicateSpy); testRule.on('change', changeSpy); diff --git a/src/plugins/timeConductor/plugin.js b/src/plugins/timeConductor/plugin.js index cedf6960a1..8aea344388 100644 --- a/src/plugins/timeConductor/plugin.js +++ b/src/plugins/timeConductor/plugin.js @@ -68,15 +68,15 @@ define([], function () { }, {}); return config.menuOptions.map(function (menuOption, index) { - if (menuOption.timeSystem && !systems[menuOption.timeSystem]) { - return "menuOption at index " + index + " specifies a " + + if (menuOption.timeSystem && !systems[menuOption.timeSystem]) { + return "menuOption at index " + index + " specifies a " + "timeSystem that does not exist: " + menuOption.timeSystem; - } - if (menuOption.clock && !clocks[menuOption.clock]) { - return "menuOption at index " + index + " specifies a " + + } + if (menuOption.clock && !clocks[menuOption.clock]) { + return "menuOption at index " + index + " specifies a " + "clock that does not exist: " + menuOption.clock; - } - }) + } + }) .filter(isTruthy) .join('\n'); } diff --git a/platform/commonUI/general/res/sass/_about.scss b/src/styles/_about.scss similarity index 100% rename from platform/commonUI/general/res/sass/_about.scss rename to src/styles/_about.scss diff --git a/platform/commonUI/general/res/sass/_animations.scss b/src/styles/_animations.scss similarity index 100% rename from platform/commonUI/general/res/sass/_animations.scss rename to src/styles/_animations.scss diff --git a/platform/commonUI/general/res/sass/_app-start.scss b/src/styles/_app-start.scss similarity index 100% rename from platform/commonUI/general/res/sass/_app-start.scss rename to src/styles/_app-start.scss diff --git a/platform/commonUI/general/res/sass/_archetypes.scss b/src/styles/_archetypes.scss similarity index 100% rename from platform/commonUI/general/res/sass/_archetypes.scss rename to src/styles/_archetypes.scss diff --git a/platform/commonUI/general/res/sass/_autoflow.scss b/src/styles/_autoflow.scss similarity index 100% rename from platform/commonUI/general/res/sass/_autoflow.scss rename to src/styles/_autoflow.scss diff --git a/platform/commonUI/general/res/sass/_badges.scss b/src/styles/_badges.scss similarity index 100% rename from platform/commonUI/general/res/sass/_badges.scss rename to src/styles/_badges.scss diff --git a/platform/commonUI/general/res/sass/_constants.scss b/src/styles/_constants.scss similarity index 98% rename from platform/commonUI/general/res/sass/_constants.scss rename to src/styles/_constants.scss index d79da903ab..748d92e80a 100644 --- a/platform/commonUI/general/res/sass/_constants.scss +++ b/src/styles/_constants.scss @@ -136,7 +136,8 @@ $btnFrameH: 18px; /************************** PATHS */ // Paths need to be relative to /platform/commonUI/theme//css/ directory -$dirCommonRes: '../../../../general/res/'; +$dirCommonRes: '../'; +$dirFonts: $dirCommonRes + 'fonts/'; $dirImgs: $dirCommonRes + 'images/'; /************************** TIMINGS */ diff --git a/platform/commonUI/general/res/sass/_data-status.scss b/src/styles/_data-status.scss similarity index 100% rename from platform/commonUI/general/res/sass/_data-status.scss rename to src/styles/_data-status.scss diff --git a/platform/commonUI/general/res/sass/_effects.scss b/src/styles/_effects.scss similarity index 100% rename from platform/commonUI/general/res/sass/_effects.scss rename to src/styles/_effects.scss diff --git a/platform/commonUI/general/res/sass/_fixed-position.scss b/src/styles/_fixed-position.scss similarity index 100% rename from platform/commonUI/general/res/sass/_fixed-position.scss rename to src/styles/_fixed-position.scss diff --git a/platform/commonUI/general/res/sass/_global.scss b/src/styles/_global.scss similarity index 86% rename from platform/commonUI/general/res/sass/_global.scss rename to src/styles/_global.scss index c25558055f..0c302fc6aa 100644 --- a/platform/commonUI/general/res/sass/_global.scss +++ b/src/styles/_global.scss @@ -26,11 +26,11 @@ * to generate font files */ font-family: 'symbolsfont'; - src: url($dirCommonRes + 'fonts/symbols/openmct-symbols-16px.eot'); - src: url($dirCommonRes + 'fonts/symbols/openmct-symbols-16px.eot?#iefix') format('embedded-opentype'), - url($dirCommonRes + 'fonts/symbols/openmct-symbols-16px.woff') format('woff'), - url($dirCommonRes + 'fonts/symbols/openmct-symbols-16px.ttf') format('truetype'), - url($dirCommonRes + 'fonts/symbols/openmct-symbols-16px.svg') format('svg'); + src: url($dirFonts + 'symbols/openmct-symbols-16px.eot'); + src: url($dirFonts + 'symbols/openmct-symbols-16px.eot?#iefix') format('embedded-opentype'), + url($dirFonts + 'symbols/openmct-symbols-16px.woff') format('woff'), + url($dirFonts + 'symbols/openmct-symbols-16px.ttf') format('truetype'), + url($dirFonts + 'symbols/openmct-symbols-16px.svg') format('svg'); font-weight: normal; font-style: normal; } @@ -41,11 +41,11 @@ * to generate font files */ font-family: 'symbolsfont-12px'; - src: url($dirCommonRes + 'fonts/symbols/openmct-symbols-12px.eot'); - src: url($dirCommonRes + 'fonts/symbols/openmct-symbols-12px.eot?#iefix') format('embedded-opentype'), - url($dirCommonRes + 'fonts/symbols/openmct-symbols-12px.woff') format('woff'), - url($dirCommonRes + 'fonts/symbols/openmct-symbols-12px.ttf') format('truetype'), - url($dirCommonRes + 'fonts/symbols/openmct-symbols-12px.svg') format('svg'); + src: url($dirFonts + 'symbols/openmct-symbols-12px.eot'); + src: url($dirFonts + 'symbols/openmct-symbols-12px.eot?#iefix') format('embedded-opentype'), + url($dirFonts + 'symbols/openmct-symbols-12px.woff') format('woff'), + url($dirFonts + 'symbols/openmct-symbols-12px.ttf') format('truetype'), + url($dirFonts + 'symbols/openmct-symbols-12px.svg') format('svg'); font-weight: normal; font-style: normal; } diff --git a/platform/commonUI/general/res/sass/_glyphs.scss b/src/styles/_glyphs.scss similarity index 100% rename from platform/commonUI/general/res/sass/_glyphs.scss rename to src/styles/_glyphs.scss diff --git a/platform/commonUI/general/res/sass/_icons.scss b/src/styles/_icons.scss similarity index 100% rename from platform/commonUI/general/res/sass/_icons.scss rename to src/styles/_icons.scss diff --git a/platform/commonUI/general/res/sass/_iframe.scss b/src/styles/_iframe.scss similarity index 100% rename from platform/commonUI/general/res/sass/_iframe.scss rename to src/styles/_iframe.scss diff --git a/platform/commonUI/general/res/sass/_inspector.scss b/src/styles/_inspector.scss similarity index 100% rename from platform/commonUI/general/res/sass/_inspector.scss rename to src/styles/_inspector.scss diff --git a/platform/commonUI/general/res/sass/_logo-and-bg.scss b/src/styles/_logo-and-bg.scss similarity index 100% rename from platform/commonUI/general/res/sass/_logo-and-bg.scss rename to src/styles/_logo-and-bg.scss diff --git a/platform/commonUI/general/res/sass/_main.scss b/src/styles/_main.scss similarity index 98% rename from platform/commonUI/general/res/sass/_main.scss rename to src/styles/_main.scss index f8f0c41f33..e8f96de9fd 100644 --- a/platform/commonUI/general/res/sass/_main.scss +++ b/src/styles/_main.scss @@ -76,6 +76,8 @@ @import "views"; @import "items/item"; @import "mobile/item"; +@import "table"; +@import "notebook/notebook"; /********************************* TO BE MOVED */ @import "autoflow"; diff --git a/platform/commonUI/general/res/sass/_mixins.scss b/src/styles/_mixins.scss similarity index 100% rename from platform/commonUI/general/res/sass/_mixins.scss rename to src/styles/_mixins.scss diff --git a/platform/commonUI/general/res/sass/_object-label.scss b/src/styles/_object-label.scss similarity index 100% rename from platform/commonUI/general/res/sass/_object-label.scss rename to src/styles/_object-label.scss diff --git a/platform/commonUI/general/res/sass/openmct.scss b/src/styles/_openmct.scss similarity index 100% rename from platform/commonUI/general/res/sass/openmct.scss rename to src/styles/_openmct.scss diff --git a/platform/commonUI/general/res/sass/startup-base.scss b/src/styles/_startup-base.scss similarity index 100% rename from platform/commonUI/general/res/sass/startup-base.scss rename to src/styles/_startup-base.scss diff --git a/platform/commonUI/general/res/sass/_status.scss b/src/styles/_status.scss similarity index 100% rename from platform/commonUI/general/res/sass/_status.scss rename to src/styles/_status.scss diff --git a/platform/features/table/res/sass/table.scss b/src/styles/_table.scss similarity index 100% rename from platform/features/table/res/sass/table.scss rename to src/styles/_table.scss diff --git a/platform/commonUI/general/res/sass/_text.scss b/src/styles/_text.scss similarity index 100% rename from platform/commonUI/general/res/sass/_text.scss rename to src/styles/_text.scss diff --git a/platform/commonUI/general/res/sass/_views.scss b/src/styles/_views.scss similarity index 100% rename from platform/commonUI/general/res/sass/_views.scss rename to src/styles/_views.scss diff --git a/platform/commonUI/general/res/sass/_widgets.scss b/src/styles/_widgets.scss similarity index 100% rename from platform/commonUI/general/res/sass/_widgets.scss rename to src/styles/_widgets.scss diff --git a/platform/features/conductor/core/res/sass/_constants.scss b/src/styles/conductor/_constants.scss similarity index 100% rename from platform/features/conductor/core/res/sass/_constants.scss rename to src/styles/conductor/_constants.scss diff --git a/platform/features/conductor/core/res/sass/_time-conductor-base.scss b/src/styles/conductor/_time-conductor-base.scss similarity index 100% rename from platform/features/conductor/core/res/sass/_time-conductor-base.scss rename to src/styles/conductor/_time-conductor-base.scss diff --git a/platform/features/conductor/core/res/sass/_time-of-interest.scss b/src/styles/conductor/_time-of-interest.scss similarity index 100% rename from platform/features/conductor/core/res/sass/_time-of-interest.scss rename to src/styles/conductor/_time-of-interest.scss diff --git a/platform/features/conductor/core/res/sass/time-conductor-espresso.scss b/src/styles/conductor/time-conductor-espresso.scss similarity index 79% rename from platform/features/conductor/core/res/sass/time-conductor-espresso.scss rename to src/styles/conductor/time-conductor-espresso.scss index 323e5025d4..836c7b36c3 100644 --- a/platform/features/conductor/core/res/sass/time-conductor-espresso.scss +++ b/src/styles/conductor/time-conductor-espresso.scss @@ -21,14 +21,6 @@ *****************************************************************************/ $output-bourbon-deprecation-warnings: false; @import "bourbon"; -@import "../../../../../commonUI/general/res/sass/constants"; -@import "../../../../../commonUI/general/res/sass/mixins"; -@import "../../../../../commonUI/general/res/sass/mobile/constants"; -@import "../../../../../commonUI/general/res/sass/mobile/mixins"; -@import "../../../../../commonUI/themes/espresso/res/sass/constants"; -@import "../../../../../commonUI/themes/espresso/res/sass/mixins"; -@import "../../../../../commonUI/general/res/sass/glyphs"; -@import "../../../../../commonUI/general/res/sass/icons"; @import "constants"; // Thematic constants diff --git a/platform/features/conductor/core/res/sass/time-conductor-snow.scss b/src/styles/conductor/time-conductor-snow.scss similarity index 79% rename from platform/features/conductor/core/res/sass/time-conductor-snow.scss rename to src/styles/conductor/time-conductor-snow.scss index 3f47b3dc27..ead52a20fb 100644 --- a/platform/features/conductor/core/res/sass/time-conductor-snow.scss +++ b/src/styles/conductor/time-conductor-snow.scss @@ -21,14 +21,6 @@ *****************************************************************************/ $output-bourbon-deprecation-warnings: false; @import "bourbon"; -@import "../../../../../commonUI/general/res/sass/constants"; -@import "../../../../../commonUI/general/res/sass/mixins"; -@import "../../../../../commonUI/general/res/sass/mobile/constants"; -@import "../../../../../commonUI/general/res/sass/mobile/mixins"; -@import "../../../../../commonUI/themes/snow/res/sass/constants"; -@import "../../../../../commonUI/themes/snow/res/sass/mixins"; -@import "../../../../../commonUI/general/res/sass/glyphs"; -@import "../../../../../commonUI/general/res/sass/icons"; @import "constants"; // Thematic constants diff --git a/platform/commonUI/general/res/sass/controls/_breadcrumb.scss b/src/styles/controls/_breadcrumb.scss similarity index 100% rename from platform/commonUI/general/res/sass/controls/_breadcrumb.scss rename to src/styles/controls/_breadcrumb.scss diff --git a/platform/commonUI/general/res/sass/controls/_buttons.scss b/src/styles/controls/_buttons.scss similarity index 100% rename from platform/commonUI/general/res/sass/controls/_buttons.scss rename to src/styles/controls/_buttons.scss diff --git a/platform/commonUI/general/res/sass/controls/_controls.scss b/src/styles/controls/_controls.scss similarity index 100% rename from platform/commonUI/general/res/sass/controls/_controls.scss rename to src/styles/controls/_controls.scss diff --git a/platform/commonUI/general/res/sass/controls/_indicators.scss b/src/styles/controls/_indicators.scss similarity index 100% rename from platform/commonUI/general/res/sass/controls/_indicators.scss rename to src/styles/controls/_indicators.scss diff --git a/platform/commonUI/general/res/sass/controls/_lists.scss b/src/styles/controls/_lists.scss similarity index 100% rename from platform/commonUI/general/res/sass/controls/_lists.scss rename to src/styles/controls/_lists.scss diff --git a/platform/commonUI/general/res/sass/controls/_menus.scss b/src/styles/controls/_menus.scss similarity index 100% rename from platform/commonUI/general/res/sass/controls/_menus.scss rename to src/styles/controls/_menus.scss diff --git a/platform/commonUI/general/res/sass/controls/_messages.scss b/src/styles/controls/_messages.scss similarity index 100% rename from platform/commonUI/general/res/sass/controls/_messages.scss rename to src/styles/controls/_messages.scss diff --git a/platform/commonUI/general/res/sass/controls/_palette.scss b/src/styles/controls/_palette.scss similarity index 100% rename from platform/commonUI/general/res/sass/controls/_palette.scss rename to src/styles/controls/_palette.scss diff --git a/platform/commonUI/general/res/sass/controls/_ticks.scss b/src/styles/controls/_ticks.scss similarity index 100% rename from platform/commonUI/general/res/sass/controls/_ticks.scss rename to src/styles/controls/_ticks.scss diff --git a/platform/telemetry/test/TelemetryDelegatorSpec.js b/src/styles/core.scss similarity index 80% rename from platform/telemetry/test/TelemetryDelegatorSpec.js rename to src/styles/core.scss index 4159fe92ba..2a7d354e9f 100644 --- a/platform/telemetry/test/TelemetryDelegatorSpec.js +++ b/src/styles/core.scss @@ -20,16 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define( - ["../src/TelemetryDelegator"], - function (TelemetryDelegator) { - - describe("The telemetry delegator", function () { - var delegator; - - beforeEach(function () { - delegator = new TelemetryDelegator(); - }); - }); - } -); +@import "vendor/normalize.min.css"; +@import "startup-base"; +@import "openmct"; diff --git a/platform/commonUI/general/res/sass/edit/_editor.scss b/src/styles/edit/_editor.scss similarity index 100% rename from platform/commonUI/general/res/sass/edit/_editor.scss rename to src/styles/edit/_editor.scss diff --git a/platform/commonUI/general/res/sass/features/_imagery.scss b/src/styles/features/_imagery.scss similarity index 100% rename from platform/commonUI/general/res/sass/features/_imagery.scss rename to src/styles/features/_imagery.scss diff --git a/platform/commonUI/general/res/sass/features/_time-display.scss b/src/styles/features/_time-display.scss similarity index 100% rename from platform/commonUI/general/res/sass/features/_time-display.scss rename to src/styles/features/_time-display.scss diff --git a/platform/commonUI/general/res/sass/forms/_channel-selector.scss b/src/styles/forms/_channel-selector.scss similarity index 100% rename from platform/commonUI/general/res/sass/forms/_channel-selector.scss rename to src/styles/forms/_channel-selector.scss diff --git a/platform/commonUI/general/res/sass/forms/_datetime.scss b/src/styles/forms/_datetime.scss similarity index 100% rename from platform/commonUI/general/res/sass/forms/_datetime.scss rename to src/styles/forms/_datetime.scss diff --git a/platform/commonUI/general/res/sass/forms/_elems.scss b/src/styles/forms/_elems.scss similarity index 100% rename from platform/commonUI/general/res/sass/forms/_elems.scss rename to src/styles/forms/_elems.scss diff --git a/platform/commonUI/general/res/sass/forms/_filter.scss b/src/styles/forms/_filter.scss similarity index 100% rename from platform/commonUI/general/res/sass/forms/_filter.scss rename to src/styles/forms/_filter.scss diff --git a/platform/commonUI/general/res/sass/forms/_validation.scss b/src/styles/forms/_validation.scss similarity index 100% rename from platform/commonUI/general/res/sass/forms/_validation.scss rename to src/styles/forms/_validation.scss diff --git a/platform/commonUI/general/res/sass/helpers/_bubbles.scss b/src/styles/helpers/_bubbles.scss similarity index 100% rename from platform/commonUI/general/res/sass/helpers/_bubbles.scss rename to src/styles/helpers/_bubbles.scss diff --git a/platform/commonUI/general/res/sass/helpers/_splitter.scss b/src/styles/helpers/_splitter.scss similarity index 100% rename from platform/commonUI/general/res/sass/helpers/_splitter.scss rename to src/styles/helpers/_splitter.scss diff --git a/platform/commonUI/general/res/sass/helpers/_wait-spinner.scss b/src/styles/helpers/_wait-spinner.scss similarity index 100% rename from platform/commonUI/general/res/sass/helpers/_wait-spinner.scss rename to src/styles/helpers/_wait-spinner.scss diff --git a/platform/commonUI/general/res/sass/items/_item.scss b/src/styles/items/_item.scss similarity index 100% rename from platform/commonUI/general/res/sass/items/_item.scss rename to src/styles/items/_item.scss diff --git a/platform/commonUI/general/res/sass/lists/_tabular.scss b/src/styles/lists/_tabular.scss similarity index 100% rename from platform/commonUI/general/res/sass/lists/_tabular.scss rename to src/styles/lists/_tabular.scss diff --git a/platform/commonUI/general/res/sass/mobile/_constants.scss b/src/styles/mobile/_constants.scss similarity index 100% rename from platform/commonUI/general/res/sass/mobile/_constants.scss rename to src/styles/mobile/_constants.scss diff --git a/platform/commonUI/general/res/sass/mobile/_item.scss b/src/styles/mobile/_item.scss similarity index 100% rename from platform/commonUI/general/res/sass/mobile/_item.scss rename to src/styles/mobile/_item.scss diff --git a/platform/commonUI/general/res/sass/mobile/_layout.scss b/src/styles/mobile/_layout.scss similarity index 100% rename from platform/commonUI/general/res/sass/mobile/_layout.scss rename to src/styles/mobile/_layout.scss diff --git a/platform/commonUI/general/res/sass/mobile/_mixins.scss b/src/styles/mobile/_mixins.scss similarity index 100% rename from platform/commonUI/general/res/sass/mobile/_mixins.scss rename to src/styles/mobile/_mixins.scss diff --git a/platform/commonUI/general/res/sass/mobile/_tree.scss b/src/styles/mobile/_tree.scss similarity index 100% rename from platform/commonUI/general/res/sass/mobile/_tree.scss rename to src/styles/mobile/_tree.scss diff --git a/platform/commonUI/general/res/sass/mobile/controls/_menus.scss b/src/styles/mobile/controls/_menus.scss similarity index 100% rename from platform/commonUI/general/res/sass/mobile/controls/_menus.scss rename to src/styles/mobile/controls/_menus.scss diff --git a/platform/commonUI/general/res/sass/mobile/search/_search.scss b/src/styles/mobile/search/_search.scss similarity index 100% rename from platform/commonUI/general/res/sass/mobile/search/_search.scss rename to src/styles/mobile/search/_search.scss diff --git a/platform/features/notebook/res/sass/_notebook-base.scss b/src/styles/notebook/_notebook-base.scss similarity index 100% rename from platform/features/notebook/res/sass/_notebook-base.scss rename to src/styles/notebook/_notebook-base.scss diff --git a/platform/features/notebook/res/sass/_notebook-thematic.scss b/src/styles/notebook/_notebook-thematic.scss similarity index 100% rename from platform/features/notebook/res/sass/_notebook-thematic.scss rename to src/styles/notebook/_notebook-thematic.scss diff --git a/platform/features/notebook/res/sass/notebook-espresso.scss b/src/styles/notebook/notebook-espresso.scss similarity index 79% rename from platform/features/notebook/res/sass/notebook-espresso.scss rename to src/styles/notebook/notebook-espresso.scss index 6f6077dacc..42574e5033 100644 --- a/platform/features/notebook/res/sass/notebook-espresso.scss +++ b/src/styles/notebook/notebook-espresso.scss @@ -22,9 +22,4 @@ $output-bourbon-deprecation-warnings: false; @import "bourbon"; -@import "../../../../commonUI/general/res/sass/constants"; -@import "../../../../commonUI/general/res/sass/mixins"; -@import "../../../../commonUI/general/res/sass/glyphs"; -@import "../../../../commonUI/themes/espresso/res/sass/constants"; -@import "../../../../commonUI/themes/espresso/res/sass/mixins"; -@import "notebook-thematic"; \ No newline at end of file +@import "notebook-thematic"; diff --git a/platform/features/notebook/res/sass/notebook-snow.scss b/src/styles/notebook/notebook-snow.scss similarity index 79% rename from platform/features/notebook/res/sass/notebook-snow.scss rename to src/styles/notebook/notebook-snow.scss index b279deadea..42574e5033 100644 --- a/platform/features/notebook/res/sass/notebook-snow.scss +++ b/src/styles/notebook/notebook-snow.scss @@ -22,9 +22,4 @@ $output-bourbon-deprecation-warnings: false; @import "bourbon"; -@import "../../../../commonUI/general/res/sass/constants"; -@import "../../../../commonUI/general/res/sass/mixins"; -@import "../../../../commonUI/general/res/sass/glyphs"; -@import "../../../../commonUI/themes/snow/res/sass/constants"; -@import "../../../../commonUI/themes/snow/res/sass/mixins"; -@import "notebook-thematic"; \ No newline at end of file +@import "notebook-thematic"; diff --git a/platform/features/notebook/res/sass/notebook.scss b/src/styles/notebook/notebook.scss similarity index 84% rename from platform/features/notebook/res/sass/notebook.scss rename to src/styles/notebook/notebook.scss index 75432c248a..81a39e4bd7 100644 --- a/platform/features/notebook/res/sass/notebook.scss +++ b/src/styles/notebook/notebook.scss @@ -21,8 +21,4 @@ *****************************************************************************/ $output-bourbon-deprecation-warnings: false; @import "bourbon"; -@import "../../../../commonUI/general/res/sass/constants"; -@import "../../../../commonUI/general/res/sass/mixins"; -@import "../../../../commonUI/general/res/sass/mobile/constants"; -@import "../../../../commonUI/general/res/sass/mobile/mixins"; @import "notebook-base"; diff --git a/platform/commonUI/general/res/sass/overlay/_overlay.scss b/src/styles/overlay/_overlay.scss similarity index 100% rename from platform/commonUI/general/res/sass/overlay/_overlay.scss rename to src/styles/overlay/_overlay.scss diff --git a/platform/commonUI/general/res/sass/plots/_legend.scss b/src/styles/plots/_legend.scss similarity index 100% rename from platform/commonUI/general/res/sass/plots/_legend.scss rename to src/styles/plots/_legend.scss diff --git a/platform/commonUI/general/res/sass/plots/_plots-main.scss b/src/styles/plots/_plots-main.scss similarity index 100% rename from platform/commonUI/general/res/sass/plots/_plots-main.scss rename to src/styles/plots/_plots-main.scss diff --git a/platform/commonUI/general/res/sass/search/_search.scss b/src/styles/search/_search.scss similarity index 100% rename from platform/commonUI/general/res/sass/search/_search.scss rename to src/styles/search/_search.scss diff --git a/example/styleguide/res/sass/_style-guide-base.scss b/src/styles/style-guide/_style-guide-base.scss similarity index 100% rename from example/styleguide/res/sass/_style-guide-base.scss rename to src/styles/style-guide/_style-guide-base.scss diff --git a/example/styleguide/res/sass/style-guide-espresso.scss b/src/styles/style-guide/style-guide-espresso.scss similarity index 77% rename from example/styleguide/res/sass/style-guide-espresso.scss rename to src/styles/style-guide/style-guide-espresso.scss index a3b8dcb9ac..1da75938f5 100644 --- a/example/styleguide/res/sass/style-guide-espresso.scss +++ b/src/styles/style-guide/style-guide-espresso.scss @@ -20,12 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ @import "bourbon"; -@import "../../../../platform/commonUI/general/res/sass/constants"; -@import "../../../../platform/commonUI/general/res/sass/mixins"; -@import "../../../../platform/commonUI/themes/espresso/res/sass/constants"; -@import "../../../../platform/commonUI/themes/espresso/res/sass/mixins"; -@import "../../../../platform/commonUI/general/res/sass/glyphs"; -@import "../../../../platform/commonUI/general/res/sass/icons"; // Thematic constants $colorCode: rgba(black, 0.2); diff --git a/example/styleguide/res/sass/style-guide-snow.scss b/src/styles/style-guide/style-guide-snow.scss similarity index 75% rename from example/styleguide/res/sass/style-guide-snow.scss rename to src/styles/style-guide/style-guide-snow.scss index a48aec3756..b057288d5b 100644 --- a/example/styleguide/res/sass/style-guide-snow.scss +++ b/src/styles/style-guide/style-guide-snow.scss @@ -20,12 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ @import "bourbon"; -@import "../../../../platform/commonUI/general/res/sass/constants"; -@import "../../../../platform/commonUI/general/res/sass/mixins"; -@import "../../../../platform/commonUI/themes/snow/res/sass/constants"; -@import "../../../../platform/commonUI/themes/snow/res/sass/mixins"; -@import "../../../../platform/commonUI/general/res/sass/glyphs"; -@import "../../../../platform/commonUI/general/res/sass/icons"; // Thematic constants $colorCode: rgba(black, 0.1); @@ -34,4 +28,4 @@ $colorGlyphExample: darken($colorBodyBg, 30%); @import "style-guide-base"; div.themed.snow { display: block; } -span.themed.snow { display: inline; } \ No newline at end of file +span.themed.snow { display: inline; } diff --git a/platform/commonUI/themes/espresso/res/sass/theme-espresso.scss b/src/styles/theme-espresso.scss similarity index 82% rename from platform/commonUI/themes/espresso/res/sass/theme-espresso.scss rename to src/styles/theme-espresso.scss index b840aedf96..920dd90ace 100644 --- a/platform/commonUI/themes/espresso/res/sass/theme-espresso.scss +++ b/src/styles/theme-espresso.scss @@ -22,12 +22,15 @@ $output-bourbon-deprecation-warnings: false; @import "bourbon"; -@import "../../../../general/res/sass/_mixins"; -@import "../../../../general/res/sass/mobile/mixins"; @import "mixins"; +@import "mobile/mixins"; +@import "themes/espresso/mixins"; -@import "../../../../general/res/sass/constants"; -@import "../../../../general/res/sass/mobile/constants"; @import "constants"; +@import "mobile/constants"; +@import "themes/espresso/constants"; -@import "../../../../general/res/sass/main"; +@import "main"; +@import "conductor/time-conductor-espresso"; +@import "notebook/notebook-espresso"; +@import "style-guide/style-guide-espresso"; diff --git a/platform/commonUI/themes/snow/res/sass/theme-snow.scss b/src/styles/theme-snow.scss similarity index 82% rename from platform/commonUI/themes/snow/res/sass/theme-snow.scss rename to src/styles/theme-snow.scss index 5f6b4affa1..8303382d7b 100644 --- a/platform/commonUI/themes/snow/res/sass/theme-snow.scss +++ b/src/styles/theme-snow.scss @@ -22,17 +22,20 @@ $output-bourbon-deprecation-warnings: false; @import "bourbon"; -@import "../../../../general/res/sass/_mixins"; -@import "../../../../general/res/sass/mobile/mixins"; @import "mixins"; +@import "mobile/mixins"; +@import "themes/snow/mixins"; -@import "../../../../general/res/sass/constants"; -@import "../../../../general/res/sass/mobile/constants"; @import "constants"; +@import "mobile/constants"; +@import "themes/snow/constants"; -@import "../../../../general/res/sass/main"; // -@import "controls"; - +@import "main"; +@import "themes/snow/controls"; + +@import "conductor/time-conductor-snow"; +@import "notebook/notebook-snow"; +@import "style-guide/style-guide-snow"; diff --git a/platform/commonUI/themes/espresso/res/sass/_constants.scss b/src/styles/themes/espresso/_constants.scss similarity index 100% rename from platform/commonUI/themes/espresso/res/sass/_constants.scss rename to src/styles/themes/espresso/_constants.scss diff --git a/platform/commonUI/themes/espresso/res/sass/_mixins.scss b/src/styles/themes/espresso/_mixins.scss similarity index 100% rename from platform/commonUI/themes/espresso/res/sass/_mixins.scss rename to src/styles/themes/espresso/_mixins.scss diff --git a/platform/commonUI/themes/snow/res/sass/_constants.scss b/src/styles/themes/snow/_constants.scss similarity index 100% rename from platform/commonUI/themes/snow/res/sass/_constants.scss rename to src/styles/themes/snow/_constants.scss diff --git a/platform/commonUI/themes/snow/res/sass/_controls.scss b/src/styles/themes/snow/_controls.scss similarity index 100% rename from platform/commonUI/themes/snow/res/sass/_controls.scss rename to src/styles/themes/snow/_controls.scss diff --git a/platform/commonUI/themes/snow/res/sass/_mixins.scss b/src/styles/themes/snow/_mixins.scss similarity index 100% rename from platform/commonUI/themes/snow/res/sass/_mixins.scss rename to src/styles/themes/snow/_mixins.scss diff --git a/platform/commonUI/general/res/sass/tree/_tree.scss b/src/styles/tree/_tree.scss similarity index 100% rename from platform/commonUI/general/res/sass/tree/_tree.scss rename to src/styles/tree/_tree.scss diff --git a/platform/commonUI/general/res/sass/user-environ/_frame.scss b/src/styles/user-environ/_frame.scss similarity index 100% rename from platform/commonUI/general/res/sass/user-environ/_frame.scss rename to src/styles/user-environ/_frame.scss diff --git a/platform/commonUI/general/res/sass/user-environ/_layout.scss b/src/styles/user-environ/_layout.scss similarity index 100% rename from platform/commonUI/general/res/sass/user-environ/_layout.scss rename to src/styles/user-environ/_layout.scss diff --git a/platform/commonUI/general/res/sass/user-environ/_selecting.scss b/src/styles/user-environ/_selecting.scss similarity index 100% rename from platform/commonUI/general/res/sass/user-environ/_selecting.scss rename to src/styles/user-environ/_selecting.scss diff --git a/platform/commonUI/general/res/sass/user-environ/_tool-bar.scss b/src/styles/user-environ/_tool-bar.scss similarity index 100% rename from platform/commonUI/general/res/sass/user-environ/_tool-bar.scss rename to src/styles/user-environ/_tool-bar.scss diff --git a/platform/commonUI/general/res/sass/user-environ/_top-bar.scss b/src/styles/user-environ/_top-bar.scss similarity index 100% rename from platform/commonUI/general/res/sass/user-environ/_top-bar.scss rename to src/styles/user-environ/_top-bar.scss diff --git a/platform/commonUI/general/res/css/normalize.min.css b/src/styles/vendor/normalize.min.css similarity index 100% rename from platform/commonUI/general/res/css/normalize.min.css rename to src/styles/vendor/normalize.min.css diff --git a/src/ui/ToolbarRegistry.js b/src/ui/ToolbarRegistry.js index 7d34421a9f..fd3a8f5e53 100644 --- a/src/ui/ToolbarRegistry.js +++ b/src/ui/ToolbarRegistry.js @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ - /*global console */ +/*global console */ define([], function () { diff --git a/test-main.js b/test-main.js deleted file mode 100644 index fe24a57a95..0000000000 --- a/test-main.js +++ /dev/null @@ -1,133 +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 require,window*/ -var allTestFiles = []; -var TEST_REGEXP = /(Spec)\.js$/; -var SRC_REGEXP = /^\/base\/(src|platform).*\.js$/; - -var pathToModule = function(path) { - return path.replace(/^\/base\//, '').replace(/\.js$/, ''); -}; - -Object.keys(window.__karma__.files).forEach(function(file) { - if (TEST_REGEXP.test(file) || SRC_REGEXP.test(file)) { - // Normalize paths to RequireJS module names. - allTestFiles.push(pathToModule(file)); - } -}); - -// Force es6-promise to load. -allTestFiles.unshift('es6-promise'); - -// Drop legacyRegistry, since it is at a different path by RequireJS config -allTestFiles = allTestFiles.filter(function (file) { - return file.indexOf('legacyRegistry') === -1; -}); - -requirejs.config({ - // Karma serves files from the basePath defined in karma.conf.js - baseUrl: '/base', - - "paths": { - "legacyRegistry": "src/legacyRegistry", - "angular": "bower_components/angular/angular.min", - "angular-route": "bower_components/angular-route/angular-route.min", - "csv": "bower_components/comma-separated-values/csv.min", - "EventEmitter": "bower_components/eventemitter3/index", - "es6-promise": "bower_components/es6-promise/es6-promise.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/file-saver/FileSaver.min", - "screenfull": "bower_components/screenfull/dist/screenfull.min", - "text": "bower_components/text/text", - "uuid": "bower_components/node-uuid/uuid", - "vue": "node_modules/vue/dist/vue.min", - "zepto": "bower_components/zepto/zepto.min", - "lodash": "bower_components/lodash/lodash", - "d3-selection": "node_modules/d3-selection/dist/d3-selection.min", - "d3-scale": "node_modules/d3-scale/build/d3-scale.min", - "d3-axis": "node_modules/d3-axis/build/d3-axis.min", - "d3-array": "node_modules/d3-array/build/d3-array.min", - "d3-collection": "node_modules/d3-collection/build/d3-collection.min", - "d3-color": "node_modules/d3-color/build/d3-color.min", - "d3-format": "node_modules/d3-format/build/d3-format.min", - "d3-interpolate": "node_modules/d3-interpolate/build/d3-interpolate.min", - "d3-time": "node_modules/d3-time/build/d3-time.min", - "d3-time-format": "node_modules/d3-time-format/build/d3-time-format.min", - "html2canvas": "node_modules/html2canvas/dist/html2canvas.min", - "painterro": "node_modules/painterro/build/painterro.min", - "printj": "node_modules/printj/dist/printj.min" - }, - - "shim": { - "angular": { - "exports": "angular" - }, - "angular-route": { - "deps": [ "angular" ] - }, - "EventEmitter": { - "exports": "EventEmitter" - }, - "moment-duration-format": { - "deps": [ "moment" ] - }, - "screenfull": { - "exports": "screenfull" - }, - "zepto": { - "exports": "Zepto" - }, - "lodash": { - "exports": "lodash" - }, - "d3-selection": { - "exports": "d3-selection" - }, - "d3-scale": { - "deps": ["d3-array", "d3-collection", "d3-color", "d3-format", "d3-interpolate", "d3-time", "d3-time-format"], - "exports": "d3-scale" - }, - "d3-axis": { - "exports": "d3-axis" - }, - "dom-to-image": { - "exports": "domtoimage" - } - }, - - // dynamically load all test files - deps: allTestFiles, - - // we have to kickoff jasmine, as it is asynchronous - callback: function () { - var args = [].slice.apply(arguments); - require(['es6-promise'], function (es6Promise) { - if (!window.Promise) { - window.Promise = es6Promise.Promise; - } - window.__karma__.start.apply(window.__karma__, args); - }); - } -}); diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000000..f7efd75355 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,103 @@ +const path = require('path'); +const bourbon = require('node-bourbon'); + +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const CopyWebpackPlugin = require('copy-webpack-plugin'); + +const devMode = process.env.NODE_ENV !== 'production'; +const VueLoaderPlugin = require('vue-loader/lib/plugin'); +// TODO: Build Constants w/ git-rev-sync + +const webpackConfig = { + mode: devMode ? 'development' : 'production', + entry: { + openmct: './openmct.js', + }, + output: { + filename: '[name].js', + library: '[name]', + path: path.resolve(__dirname, 'dist') + }, + resolve: { + alias: { + "legacyRegistry": path.join(__dirname, "src/legacyRegistry"), + "saveAs": "file-saver", + "csv": "comma-separated-values", + "EventEmitter": "eventemitter3", + "bourbon": "bourbon.scss", + "espresso": path.join(__dirname, "src/styles/theme-espresso.scss"), + "snow": path.join(__dirname, "src/styles/theme-snow.scss"), + "vue": path.join(__dirname, "node_modules/vue/dist/vue.min.js"), + "d3-scale": path.join(__dirname, "node_modules/d3-scale/build/d3-scale.min.js") + } + }, + devtool: devMode ? 'eval-source-map' : 'source-map', + plugins: [ + new VueLoaderPlugin(), + new MiniCssExtractPlugin({ + path: 'assets/styles/', + filename: '[name].css' + }), + new CopyWebpackPlugin([ + { + from: 'src/images/favicons', + to: 'favicons' + }, + { + from: './index.html', + transform: function (content) { + return content.toString().replace(/dist\//g, ''); + } + } + ]) + ], + module: { + rules: [ + { + test: /\.(sc|sa|c)ss$/, + use: [ + devMode ? 'style-loader': MiniCssExtractPlugin.loader, + 'css-loader', + { + loader: 'fast-sass-loader', + options: { + includePaths: bourbon.includePaths + } + } + ] + }, + { + test: /\.html$/, + use: 'html-loader' + }, + { + test: /zepto/, + use: [ + "imports-loader?this=>window", + "exports-loader?Zepto" + ] + }, + { + test: /\.(jpg|jpeg|png|svg|ico|woff2?|eot|ttf)$/, + loader: 'file-loader', + options: { + name: '[name].[ext]', + useRelativePath: true, + outputPath: 'assets/' + } + }, + { + test: /\.vue$/, + use: 'vue-loader' + } + ] + }, + stats: { + modules: false, + timings: true, + colors: true, + warningsFilter: /asset size limit/g + } +}; + +module.exports = webpackConfig;