mirror of
https://github.com/nasa/openmct.git
synced 2025-06-25 10:44:21 +00:00
Compare commits
9 Commits
remove-ang
...
es6-1245
Author | SHA1 | Date | |
---|---|---|---|
04618a1a36 | |||
de2e546f18 | |||
c1630c339e | |||
e86a3de31a | |||
fdb269ef97 | |||
ce4b85be6e | |||
1215dd7b99 | |||
f942fd3cf3 | |||
d33e8d9be4 |
@ -3,6 +3,7 @@
|
||||
"browser": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"esversion": 6,
|
||||
"forin": true,
|
||||
"freeze": true,
|
||||
"funcscope": false,
|
||||
|
@ -23,6 +23,7 @@
|
||||
"lodash": "3.10.1",
|
||||
"almond": "~0.3.2",
|
||||
"d3": "~4.1.0",
|
||||
"html2canvas": "^0.4.1"
|
||||
"html2canvas": "^0.4.1",
|
||||
"babel-polyfill": "^0.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,9 @@ var gulp = require('gulp'),
|
||||
specs: [ 'platform/**/*Spec.js', 'src/**/*Spec.js' ],
|
||||
},
|
||||
options = {
|
||||
babel: {
|
||||
presets: ['es2015']
|
||||
},
|
||||
requirejsOptimize: {
|
||||
name: 'bower_components/almond/almond.js',
|
||||
include: paths.main.replace('.js', ''),
|
||||
@ -70,10 +73,12 @@ var gulp = require('gulp'),
|
||||
};
|
||||
|
||||
gulp.task('scripts', function () {
|
||||
var babel = require('gulp-babel');
|
||||
var requirejsOptimize = require('gulp-requirejs-optimize');
|
||||
var replace = require('gulp-replace-task');
|
||||
return gulp.src(paths.main)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(babel(options.babel))
|
||||
.pipe(requirejsOptimize(options.requirejsOptimize))
|
||||
.pipe(sourcemaps.write('.'))
|
||||
.pipe(replace(options.replace))
|
||||
|
@ -53,10 +53,14 @@ module.exports = function(config) {
|
||||
// Preprocess matching files before serving them to the browser.
|
||||
// https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
'openmct.js': ['babel'],
|
||||
'test-main.js': ['babel'],
|
||||
'src/**/*.js': ['babel'],
|
||||
'platform/**/src/**/*.js': ['babel'],
|
||||
'platform/**/test/**/*.js': ['babel'],
|
||||
'src/**/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
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
requirejs.config({
|
||||
"paths": {
|
||||
"browser-polyfill": "bower_components/babel-polyfill/browser-polyfill", // ES6 browser polyfill, must be included before any other loads
|
||||
"legacyRegistry": "src/legacyRegistry",
|
||||
"angular": "bower_components/angular/angular.min",
|
||||
"angular-route": "bower_components/angular-route/angular-route.min",
|
||||
|
@ -8,10 +8,12 @@
|
||||
"request": "^2.69.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-preset-es2015": "^6.18.0",
|
||||
"bower": "^1.7.7",
|
||||
"git-rev-sync": "^1.4.0",
|
||||
"glob": ">= 3.0.0",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-babel": "^6.1.2",
|
||||
"gulp-jscs": "^3.0.2",
|
||||
"gulp-jshint": "^2.0.0",
|
||||
"gulp-jshint-html-reporter": "^0.1.3",
|
||||
@ -24,6 +26,7 @@
|
||||
"jsdoc": "^3.3.2",
|
||||
"jshint": "^2.7.0",
|
||||
"karma": "^0.13.3",
|
||||
"karma-babel-preprocessor": "^6.0.1",
|
||||
"karma-chrome-launcher": "^0.1.8",
|
||||
"karma-cli": "0.0.4",
|
||||
"karma-coverage": "^0.5.3",
|
||||
|
@ -32,7 +32,7 @@ define(
|
||||
html2canvas,
|
||||
saveAs
|
||||
) {
|
||||
var self = this;
|
||||
var self = null;
|
||||
|
||||
/**
|
||||
* The export image service will export any HTML node to
|
||||
@ -44,6 +44,7 @@ define(
|
||||
* @constructor
|
||||
*/
|
||||
function ExportImageService($q, $timeout, $log, EXPORT_IMAGE_TIMEOUT, injHtml2Canvas, injSaveAs, injFileReader) {
|
||||
self = this;
|
||||
self.$q = $q;
|
||||
self.$timeout = $timeout;
|
||||
self.$log = $log;
|
||||
|
@ -20,55 +20,54 @@
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
define(function () {
|
||||
|
||||
function BundleRegistry() {
|
||||
define(() => class BundleRegistry {
|
||||
constructor() {
|
||||
this.bundles = {};
|
||||
this.knownBundles = {};
|
||||
}
|
||||
|
||||
BundleRegistry.prototype.register = function (path, definition) {
|
||||
register(path, definition) {
|
||||
if (this.knownBundles.hasOwnProperty(path)) {
|
||||
throw new Error('Cannot register bundle with duplicate path', path);
|
||||
}
|
||||
this.knownBundles[path] = definition;
|
||||
};
|
||||
}
|
||||
|
||||
BundleRegistry.prototype.enable = function (path) {
|
||||
enable(path) {
|
||||
if (!this.knownBundles[path]) {
|
||||
throw new Error('Unknown bundle ' + path);
|
||||
}
|
||||
this.bundles[path] = this.knownBundles[path];
|
||||
};
|
||||
}
|
||||
|
||||
BundleRegistry.prototype.disable = function (path) {
|
||||
disable(path) {
|
||||
if (!this.bundles[path]) {
|
||||
throw new Error('Tried to disable inactive bundle ' + path);
|
||||
}
|
||||
delete this.bundles[path];
|
||||
};
|
||||
}
|
||||
|
||||
BundleRegistry.prototype.contains = function (path) {
|
||||
contains(path) {
|
||||
return !!this.bundles[path];
|
||||
};
|
||||
}
|
||||
|
||||
BundleRegistry.prototype.get = function (path) {
|
||||
get(path) {
|
||||
return this.bundles[path];
|
||||
};
|
||||
}
|
||||
|
||||
BundleRegistry.prototype.list = function () {
|
||||
list() {
|
||||
return Object.keys(this.bundles);
|
||||
};
|
||||
}
|
||||
|
||||
BundleRegistry.prototype.remove = BundleRegistry.prototype.disable;
|
||||
remove(path) {
|
||||
this.disable(path);
|
||||
}
|
||||
|
||||
BundleRegistry.prototype.delete = function (path) {
|
||||
["delete"](path) {
|
||||
if (!this.knownBundles[path]) {
|
||||
throw new Error('Cannot remove Unknown Bundle ' + path);
|
||||
}
|
||||
delete this.bundles[path];
|
||||
delete this.knownBundles[path];
|
||||
};
|
||||
|
||||
return BundleRegistry;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user