Interactive interface for browsing global, full-resolution satellite imagery
Improve linting rules and fix minor things
Josiah Sprague58b0607b8e65
diff --git a/.eslintignore b/.eslintignorenew file mode 100644index 000000000..ed2ae9c3b--- /dev/null+++ b/.eslintignore@@ -0,0 +1,10 @@+# /node_modules/* and /bower_components/* ignored by default++build/*+dist/*+etc/*+lib/*+options/*+reports/*+web/ext/*+web/dist/*diff --git a/.eslintrc b/.eslintrcindex 621237342..1e14da769 100644--- a/.eslintrc+++ b/.eslintrc@@ -1,19 +1,46 @@-{"env": {"browser": true,"node": true},"parserOptions": {- "ecmaVersion": 5,- "sourceType": "script",- "ecmaFeatures": {- "jsx": false- }+ "ecmaVersion": 6,+ "sourceType": "script"},+ "extends": "eslint:recommended","rules": {- "strict": 0,- "semi": [2, "always"],- "indent": [2, 2, {"SwitchCase": 1}],- }+ "quotes": [ 2, "single" ]+ },+ "overrides": [+ {+ "files": [ "web/**/*.js", "test/**/*.js" ],+ "parserOptions": {+ "ecmaVersion": 5,+ "sourceType": "script",+ "ecmaFeatures": {+ "jsx": false+ }+ },+ "rules": {+ "strict": 0,+ "semi": [2, "always"],+ "indent": [2, 2, {"SwitchCase": 1}],+ "quotes": "off",+ "no-octal": "off",+ "no-unused-vars": "off",+ "no-console": "off",+ "no-undef": "off",+ "no-useless-escape": "off"+ },+ "globals": {+ "wv": true,+ "wvx": true,+ "WVC": true,+ "buster": true,+ "jQuery": true,+ "$": true,+ "_": true+ }+ }+ ]}diff --git a/Gruntfile.js b/Gruntfile.jsindex 502afe7ea..49d509eea 100644--- a/Gruntfile.js+++ b/Gruntfile.js@@ -1,82 +1,82 @@-var fs = require("fs");-var moment = require("moment");+var fs = require('fs');+var moment = require('moment');var nodeModuleFiles = [- "node_modules/babel-polyfill/dist/polyfill.js",- "node_modules/babel-polyfill/dist/polyfill.min.js",- "node_modules/react/dist/react.js",- "node_modules/react/dist/react.min.js",- "node_modules/react-dom/dist/react-dom.js",- "node_modules/react-dom/dist/react-dom.min.js",- "node_modules/worldview-components/browser/wvc.js",- "node_modules/worldview-components/browser/wvc.min.js",- "node_modules/lodash/lodash.js",- "node_modules/lodash/lodash.min.js",- "node_modules/bluebird/js/browser/bluebird.js",- "node_modules/bluebird/js/browser/bluebird.min.js",- "node_modules/gifshot/build/custom/gifshot.custom.js",- "node_modules/gifshot/build/custom/gifshot.custom.min.js",- "node_modules/promise-queue/lib/index.js",- "node_modules/openlayers/dist/ol-debug.js",- "node_modules/openlayers/dist/ol.css",- "node_modules/openlayers/dist/ol-debug.css",- "node_modules/font-awesome/css/font-awesome.min.css",- "node_modules/font-awesome/fonts/*",- "node_modules/isotope-layout/dist/*",- "node_modules/isotope-packery/packery-mode.pkgd.js",- "node_modules/isotope-packery/packery-mode.pkgd.min.js",- "node_modules/perfect-scrollbar/dist/js/*",- "node_modules/perfect-scrollbar/dist/css/*",- "node_modules/clipboard/dist/clipboard.js",- "node_modules/clipboard/dist/clipboard.min.js"+ 'node_modules/babel-polyfill/dist/polyfill.js',+ 'node_modules/babel-polyfill/dist/polyfill.min.js',+ 'node_modules/react/dist/react.js',+ 'node_modules/react/dist/react.min.js',+ 'node_modules/react-dom/dist/react-dom.js',+ 'node_modules/react-dom/dist/react-dom.min.js',+ 'node_modules/worldview-components/browser/wvc.js',+ 'node_modules/worldview-components/browser/wvc.min.js',+ 'node_modules/lodash/lodash.js',+ 'node_modules/lodash/lodash.min.js',+ 'node_modules/bluebird/js/browser/bluebird.js',+ 'node_modules/bluebird/js/browser/bluebird.min.js',+ 'node_modules/gifshot/build/custom/gifshot.custom.js',+ 'node_modules/gifshot/build/custom/gifshot.custom.min.js',+ 'node_modules/promise-queue/lib/index.js',+ 'node_modules/openlayers/dist/ol-debug.js',+ 'node_modules/openlayers/dist/ol.css',+ 'node_modules/openlayers/dist/ol-debug.css',+ 'node_modules/font-awesome/css/font-awesome.min.css',+ 'node_modules/font-awesome/fonts/*',+ 'node_modules/isotope-layout/dist/*',+ 'node_modules/isotope-packery/packery-mode.pkgd.js',+ 'node_modules/isotope-packery/packery-mode.pkgd.min.js',+ 'node_modules/perfect-scrollbar/dist/js/*',+ 'node_modules/perfect-scrollbar/dist/css/*',+ 'node_modules/clipboard/dist/clipboard.js',+ 'node_modules/clipboard/dist/clipboard.min.js'];// Build date shown in the About box-var buildTimestamp = moment.utc().format("MMMM DD, YYYY [-] HH:mm [UTC]");+var buildTimestamp = moment.utc().format('MMMM DD, YYYY [-] HH:mm [UTC]');// Append to all URI references for cache busting-var buildNonce = moment.utc().format("YYYYMMDDHHmmssSSS");-var buildNumber = moment.utc().format("YYMMDDHHmmss");+var buildNonce = moment.utc().format('YYYYMMDDHHmmssSSS');+var buildNumber = moment.utc().format('YYMMDDHHmmss');module.exports = function(grunt) {- var env = grunt.option("env") || "release";+ var env = grunt.option('env') || 'release';var options = {version: 0,release: 0};- var pkg = grunt.file.readJSON("package.json");+ var pkg = grunt.file.readJSON('package.json');- if (fs.existsSync("options/version.json")) {- options = grunt.file.readJSON("options/version.json");+ if (fs.existsSync('options/version.json')) {+ options = grunt.file.readJSON('options/version.json');}// Lists of JavaScript and CSS files to include and in the correct// order- var js = grunt.file.readJSON("deploy/wv.js.json");- var css = grunt.file.readJSON("deploy/wv.css.json");+ var js = grunt.file.readJSON('deploy/wv.js.json');+ var css = grunt.file.readJSON('deploy/wv.css.json');//Platform specific command for findvar findCmd;if (process.platform === 'win32')- findCmd = ";"; //cygwin find doesn't really work in Windows compared to CentOS+ findCmd = ';'; //cygwin find doesn't really work in Windows compared to CentOSelse- findCmd = "find build -type d -empty -delete";+ findCmd = 'find build -type d -empty -delete';// Platform specific location for Pythonvar pythonPath;if (process.platform === 'win32') {- pythonPath = "python/Scripts";+ pythonPath = 'python/Scripts';} else {- pythonPath = "python/bin";+ pythonPath = 'python/bin';}grunt.initConfig({pkg: pkg,opt: options,- apache_version: grunt.option("apache-version") || "22",+ apache_version: grunt.option('apache-version') || '22',postcss: {stylelint: {@@ -107,7 +107,7 @@ module.exports = function(grunt) {console: {},report: {test: {- reporter: "xml"+ reporter: 'xml'}}},@@ -115,32 +115,32 @@ module.exports = function(grunt) {concat: {// Combine all the Worldview JavaScript files into one file.js: {- src: js["wv.js"],- dest: "build/worldview-debug/web/js/wv.js"+ src: js['wv.js'],+ dest: 'build/worldview-debug/web/js/wv.js'},// Combine all the Openlayers JavaScript files into one file.oljs: {- src: js["ol.js"],- dest: "build/worldview-debug/web/js/ol.js"+ src: js['ol.js'],+ dest: 'build/worldview-debug/web/js/ol.js'},// Combine all the Worldview CSS files into one file.css: {src: css,- dest: "build/worldview-debug/web/css/wv.css"+ dest: 'build/worldview-debug/web/css/wv.css'}},copy: {apache: {- src: "etc/dev/worldview-dev.httpd<%=apache_version%>.conf",- dest: "dist/<%=grunt.option('packageName')%>.conf"+ src: 'etc/dev/worldview-dev.httpd<%=apache_version%>.conf',+ dest: 'dist/<%=grunt.option("packageName")%>.conf'},brand_info: {files: [{- src: "options/brand.json",- dest: "build/options/brand.json"+ src: 'options/brand.json',+ dest: 'build/options/brand.json'}]},@@ -149,14 +149,14 @@ module.exports = function(grunt) {files: [{expand: true,- cwd: "build/options/config",- src: ["**"],- dest: "web/config"+ cwd: 'build/options/config',+ src: ['**'],+ dest: 'web/config'}, {expand: true,- cwd: "build/options/brand",- src: ["**"],- dest: "web/brand"+ cwd: 'build/options/brand',+ src: ['**'],+ dest: 'web/brand'}]},@@ -165,21 +165,21 @@ module.exports = function(grunt) {files: [{expand: true,- cwd: "deploy/sources",- src: ["**"],- dest: "build/rpmbuild/SOURCES"+ cwd: 'deploy/sources',+ src: ['**'],+ dest: 'build/rpmbuild/SOURCES'}, {expand: true,- cwd: "deploy",- src: ["worldview.spec"],- dest: "build/rpmbuild/SPECS"+ cwd: 'deploy',+ src: ['worldview.spec'],+ dest: 'build/rpmbuild/SPECS'}, {expand: true,- cwd: "dist",+ cwd: 'dist',src: [- "site-<%=grunt.option('packageName')%>.tar.bz2", "site-<%=grunt.option('packageName')%>-debug.tar.bz2", "worldview-config.tar.bz2"+ 'site-<%=grunt.option("packageName")%>.tar.bz2', 'site-<%=grunt.option("packageName")%>-debug.tar.bz2', 'worldview-config.tar.bz2'],- dest: "build/rpmbuild/SOURCES"+ dest: 'build/rpmbuild/SOURCES'}]},@@ -189,19 +189,19 @@ module.exports = function(grunt) {files: [{expand: true,- cwd: ".",+ cwd: '.',src: [- "bin/**",- "deploy/**",- "web/**",- "*",- "web/**/.htaccess",- "!node_modules/**",- "!web/brand/**",- "!web/config/**",- "!web/var/**"+ 'bin/**',+ 'deploy/**',+ 'web/**',+ '*',+ 'web/**/.htaccess',+ '!node_modules/**',+ '!web/brand/**',+ '!web/config/**',+ '!web/var/**'],- dest: "build/worldview-debug"+ dest: 'build/worldview-debug'}],options: {@@ -213,10 +213,10 @@ module.exports = function(grunt) {files: [{expand: true,- cwd: ".",+ cwd: '.',overwrite: true,src: nodeModuleFiles,- dest: "web/ext"+ dest: 'web/ext'}],options: {@@ -228,11 +228,11 @@ module.exports = function(grunt) {files: [{expand: true,- cwd: "build/worldview-debug",+ cwd: 'build/worldview-debug',src: [- "**", "**/.htaccess"+ '**', '**/.htaccess'],- dest: "build/worldview"+ dest: 'build/worldview'}],options: {@@ -243,8 +243,8 @@ module.exports = function(grunt) {dist_config_versioned: {files: [{- src: "dist/worldview-config.tar.bz2",- dest: "dist/worldview-config" + "-<%=opt.version%>" + "-<%=opt.release%>" + ".git<%= grunt.config.get('config-revision') %>" + ".tar.bz2"+ src: 'dist/worldview-config.tar.bz2',+ dest: 'dist/worldview-config' + '-<%=opt.version%>' + '-<%=opt.release%>' + '.git<%= grunt.config.get("config-revision") %>' + '.tar.bz2'}]},@@ -252,8 +252,8 @@ module.exports = function(grunt) {dist_site_debug_versioned: {files: [{- src: "dist/site-<%=grunt.option('packageName')%>-debug.tar.bz2",- dest: "dist/site-<%=grunt.option('packageName')%>-debug" + "-<%=pkg.version%>" + "-<%=pkg.release%>" + ".tar.bz2"+ src: 'dist/site-<%=grunt.option("packageName")%>-debug.tar.bz2',+ dest: 'dist/site-<%=grunt.option("packageName")%>-debug' + '-<%=pkg.version%>' + '-<%=pkg.release%>' + '.tar.bz2'}]},@@ -261,8 +261,8 @@ module.exports = function(grunt) {dist_site_release_versioned: {files: [{- src: "dist/site-<%=grunt.option('packageName')%>.tar.bz2",- dest: "dist/site-<%=grunt.option('packageName')%>" + "-<%=pkg.version%>" + "-<%=pkg.release%>" + ".tar.bz2"+ src: 'dist/site-<%=grunt.option("packageName")%>.tar.bz2',+ dest: 'dist/site-<%=grunt.option("packageName")%>' + '-<%=pkg.version%>' + '-<%=pkg.release%>' + '.tar.bz2'}]},@@ -270,8 +270,8 @@ module.exports = function(grunt) {dist_source_debug_versioned: {files: [{- src: "dist/worldview-debug.tar.bz2",- dest: "dist/worldview-debug" + "-<%=pkg.version%>" + "-<%=pkg.release%>" + ".git<%= grunt.config.get('source-revision') %>" + ".tar.bz2"+ src: 'dist/worldview-debug.tar.bz2',+ dest: 'dist/worldview-debug' + '-<%=pkg.version%>' + '-<%=pkg.release%>' + '.git<%= grunt.config.get("source-revision") %>' + '.tar.bz2'}]},@@ -279,8 +279,8 @@ module.exports = function(grunt) {dist_source_release_versioned: {files: [{- src: "dist/worldview.tar.bz2",- dest: "dist/worldview" + "-<%=pkg.version%>" + "-<%=pkg.release%>" + ".git<%= grunt.config.get('source-revision') %>" + ".tar.bz2"+ src: 'dist/worldview.tar.bz2',+ dest: 'dist/worldview' + '-<%=pkg.version%>' + '-<%=pkg.release%>' + '.git<%= grunt.config.get("source-revision") %>' + '.tar.bz2'}]},@@ -290,9 +290,9 @@ module.exports = function(grunt) {{expand: true,flatten: true,- cwd: "build/rpmbuild",- src: ["**/*.rpm"],- dest: "dist"+ cwd: 'build/rpmbuild',+ src: ['**/*.rpm'],+ dest: 'dist'}]},@@ -301,34 +301,34 @@ module.exports = function(grunt) {files: [{expand: true,- cwd: "build/worldview-debug",+ cwd: 'build/worldview-debug',src: [- "web/**", "web/**/.htaccess"+ 'web/**', 'web/**/.htaccess'],- dest: "build/site-<%=grunt.option('packageName')%>-debug"+ dest: 'build/site-<%=grunt.option("packageName")%>-debug'}, {expand: true,- cwd: "build/options",- src: ["**"],- dest: "build/site-<%=grunt.option('packageName')%>-debug/web"+ cwd: 'build/options',+ src: ['**'],+ dest: 'build/site-<%=grunt.option("packageName")%>-debug/web'}, {- src: "options/bitly.json",- dest: "build/site-<%=grunt.option('packageName')%>-debug/etc/bitly.json"+ src: 'options/bitly.json',+ dest: 'build/site-<%=grunt.option("packageName")%>-debug/etc/bitly.json'}, {expand: true,- cwd: "build/worldview",+ cwd: 'build/worldview',src: [- "web/**", "web/**/.htaccess"+ 'web/**', 'web/**/.htaccess'],- dest: "build/site-<%=grunt.option('packageName')%>"+ dest: 'build/site-<%=grunt.option("packageName")%>'}, {expand: true,- cwd: "build/options",- src: ["**"],- dest: "build/site-<%=grunt.option('packageName')%>/web"+ cwd: 'build/options',+ src: ['**'],+ dest: 'build/site-<%=grunt.option("packageName")%>/web'}, {- src: "options/bitly.json",- dest: "build/site-<%=grunt.option('packageName')%>/etc/bitly.json"+ src: 'options/bitly.json',+ dest: 'build/site-<%=grunt.option("packageName")%>/etc/bitly.json'}],options: {@@ -344,22 +344,22 @@ module.exports = function(grunt) {keepSpecialComments: false},files: {- "build/worldview/web/css/wv.css": ["build/worldview/web/css/wv.css"]+ 'build/worldview/web/css/wv.css': ['build/worldview/web/css/wv.css']}}},eslint: {options: {- configFile: ".eslintrc",- format: "stylish"+ configFile: '.eslintrc',+ format: 'stylish'},- src: ["web/js/**/wv.*.js", "test/**/*.js"]+ src: ['**/*.js', '!node_modules/**/*', '!build/**/*', '!dist/**/*', '!lib/**/*', '!options/**/*', '!web/dist/**/*', '!web/ext/**/*', '!etc/**/*']},exec: {config: {- command: "bash -c \"PATH=" + pythonPath + ":\"${PATH}\" bin/wv-options-build \"" + env+ command: 'bash -c "PATH=' + pythonPath + ':"${PATH}" bin/wv-options-build "' + env},// After removing JavaScript and CSS files that are no longer@@ -370,14 +370,14 @@ module.exports = function(grunt) {},fetch: {- command: "bash -c \"PATH=" + pythonPath + ":\"${PATH}\" FETCH_GC=1 bin/wv-options-build \"" + env+ command: 'bash -c "PATH=' + pythonPath + ':"${PATH}" FETCH_GC=1 bin/wv-options-build "' + env},node_packages: {command: 'npm update'},python_packages: {- command: 'virtualenv python && bash -c \"PATH=' + pythonPath + ':${PATH} pip install xmltodict isodate\"'+ command: 'virtualenv python && bash -c "PATH=' + pythonPath + ':${PATH} pip install xmltodict isodate"'},rpmbuild: {@@ -385,37 +385,37 @@ module.exports = function(grunt) {},tar_config: {- command: "tar -C build -cjf dist/worldview-config.tar.bz2 " + "options"+ command: 'tar -C build -cjf dist/worldview-config.tar.bz2 ' + 'options'},tar_site_debug: {- command: "tar cjCf build dist/site-<%=grunt.option('packageName')%>-debug.tar.bz2 " + "site-<%=grunt.option('packageName')%>-debug"+ command: 'tar cjCf build dist/site-<%=grunt.option("packageName")%>-debug.tar.bz2 ' + 'site-<%=grunt.option("packageName")%>-debug'},tar_site_release: {- command: "tar cjCf build dist/site-<%=grunt.option('packageName')%>.tar.bz2 " + "site-<%=grunt.option('packageName')%>"+ command: 'tar cjCf build dist/site-<%=grunt.option("packageName")%>.tar.bz2 ' + 'site-<%=grunt.option("packageName")%>'},tar_source_debug: {- command: "tar cjCf build dist/worldview-debug.tar.bz2 " + "worldview-debug"+ command: 'tar cjCf build dist/worldview-debug.tar.bz2 ' + 'worldview-debug'},tar_source_release: {- command: "tar cjCf build dist/worldview.tar.bz2 " + "worldview"+ command: 'tar cjCf build dist/worldview.tar.bz2 ' + 'worldview'}},- "git-rev-parse": {+ 'git-rev-parse': {source: {options: {- prop: "source-revision",+ prop: 'source-revision',number: 6}},config: {options: {- prop: "config-revision",- cwd: "options",+ prop: 'config-revision',+ cwd: 'options',number: 6}}@@ -428,9 +428,9 @@ module.exports = function(grunt) {files: [{expand: true,- cwd: "build",- src: ["**/web/**/*.html"],- dest: "build"+ cwd: 'build',+ src: ['**/web/**/*.html'],+ dest: 'build'}]}@@ -441,28 +441,28 @@ module.exports = function(grunt) {files: [{expand: true,- cwd: "build/options/config/metadata",- src: "**/*.md",- dest: "build/options/config/metadata",- ext: ".html"+ cwd: 'build/options/config/metadata',+ src: '**/*.md',+ dest: 'build/options/config/metadata',+ ext: '.html'}],options: {- template: "deploy/metadata.template.html"+ template: 'deploy/metadata.template.html'}},new: {files: [{expand: true,- cwd: "build/options/brand/pages",- src: "**/*.md",- dest: "build/options/brand/pages",- ext: ".html"+ cwd: 'build/options/brand/pages',+ src: '**/*.md',+ dest: 'build/options/brand/pages',+ ext: '.html'}],options: {- template: "deploy/new.template.html"+ template: 'deploy/new.template.html'}}},@@ -470,56 +470,56 @@ module.exports = function(grunt) {mkdir: {dist: {options: {- create: ["dist"]+ create: ['dist']}},rpmbuild: {options: {- create: ["build/rpmbuild"]+ create: ['build/rpmbuild']}}},remove: {- build: ["build"],- dist: ["dist"],+ build: ['build'],+ dist: ['dist'],// Removes all JavaScript, CSS, and auxillary files not necessary// in a release build. Place exceptions for JavaScript and// CSS here.source: [- "build/worldview-debug/web/css/**/*.css",- "build/worldview-debug/web/**/*.js",- "!build/worldview-debug/web/css/wv.css",- "!build/worldview-debug/web/js/wv.js",- "!build/worldview-debug/web/js/ol.js",- "!build/worldview-debug/web/css/bulkDownload.css",- "!build/worldview-debug/web/ext/**/*"+ 'build/worldview-debug/web/css/**/*.css',+ 'build/worldview-debug/web/**/*.js',+ '!build/worldview-debug/web/css/wv.css',+ '!build/worldview-debug/web/js/wv.js',+ '!build/worldview-debug/web/js/ol.js',+ '!build/worldview-debug/web/css/bulkDownload.css',+ '!build/worldview-debug/web/ext/**/*'],- modules: ["web/ext/node_modules/**"],- config_src: ["web/config/**/*"],+ modules: ['web/ext/node_modules/**'],+ config_src: ['web/config/**/*'],build_source: [- "build/worldview", "build/worldview-debug"+ 'build/worldview', 'build/worldview-debug'],build_config: [- "build/options", "build/options-build"+ 'build/options', 'build/options-build'],build_site: [- "build/site-<%=grunt.option('packageName')%>-debug", "build/site-<%=grunt.option('packageName')%>"+ 'build/site-<%=grunt.option("packageName")%>-debug', 'build/site-<%=grunt.option("packageName")%>'],- dist_rpm: ["dist/*.rpm"],- rpmbuild: ["build/rpmbuild"]+ dist_rpm: ['dist/*.rpm'],+ rpmbuild: ['build/rpmbuild']},replace: {apache: {- src: ["dist/<%=grunt.option('packageName')%>.conf"],+ src: ['dist/<%=grunt.option("packageName")%>.conf'],overwrite: true,replacements: [{- from: "@WORLDVIEW@",- to: "<%=grunt.option('packageName')%>"+ from: '@WORLDVIEW@',+ to: '<%=grunt.option("packageName")%>'}, {- from: "@ROOT@",+ from: '@ROOT@',to: process.cwd()}]@@ -529,37 +529,37 @@ module.exports = function(grunt) {// all the release links <!-- link.prod -->links: {src: [- "build/**/web/index.html", "build/**/web/pages/*.html"+ 'build/**/web/index.html', 'build/**/web/pages/*.html'],overwrite: true,replacements: [{from: /.*link.dev.*/g,- to: ""+ to: ''}, {from: /.*link.prod.*(!--|\/\*)(.*)(--|\*\/).*/g,- to: "$2"+ to: '$2'}]},rpm_sources: {src: [- "build/rpmbuild/SOURCES/*", "build/rpmbuild/SPECS/*", "!**/*.tar.bz2"+ 'build/rpmbuild/SOURCES/*', 'build/rpmbuild/SPECS/*', '!**/*.tar.bz2'],overwrite: true,replacements: [{- from: "@WORLDVIEW@",- to: "<%=grunt.option('packageName')%>"+ from: '@WORLDVIEW@',+ to: '<%=grunt.option("packageName")%>'}, {- from: "@BUILD_VERSION@",- to: "<%=pkg.version%>"+ from: '@BUILD_VERSION@',+ to: '<%=pkg.version%>'}, {- from: "@BUILD_RELEASE@",- to: "<%=pkg.release%>"+ from: '@BUILD_RELEASE@',+ to: '<%=pkg.release%>'}, {- from: "@BUILD_NUMBER@",+ from: '@BUILD_NUMBER@',to: buildNumber}]@@ -567,30 +567,30 @@ module.exports = function(grunt) {tokens: {src: [- "build/site-<%=grunt.option('packageName')%>-debug/**/*.html", "build/site-<%=grunt.option('packageName')%>-debug/**/*.js", "build/site-<%=grunt.option('packageName')%>/**/*.html", "build/site-<%=grunt.option('packageName')%>/**/*.js"+ 'build/site-<%=grunt.option("packageName")%>-debug/**/*.html', 'build/site-<%=grunt.option("packageName")%>-debug/**/*.js', 'build/site-<%=grunt.option("packageName")%>/**/*.html', 'build/site-<%=grunt.option("packageName")%>/**/*.js'],overwrite: true,replacements: [{- from: "@OFFICIAL_NAME@",- to: "<%=grunt.option('officialName')%>"+ from: '@OFFICIAL_NAME@',+ to: '<%=grunt.option("officialName")%>'}, {- from: "@LONG_NAME@",- to: "<%=grunt.option('longName')%>"+ from: '@LONG_NAME@',+ to: '<%=grunt.option("longName")%>'}, {- from: "@NAME@",- to: "<%=grunt.option('shortName')%>"+ from: '@NAME@',+ to: '<%=grunt.option("shortName")%>'}, {- from: "@MAIL@",- to: "<%=grunt.option('email')%>"+ from: '@MAIL@',+ to: '<%=grunt.option("email")%>'}, {- from: "@BUILD_TIMESTAMP@",+ from: '@BUILD_TIMESTAMP@',to: buildTimestamp}, {- from: "@BUILD_VERSION@",- to: "<%=pkg.version%>"+ from: '@BUILD_VERSION@',+ to: '<%=pkg.version%>'}, {- from: "@BUILD_NONCE@",+ from: '@BUILD_NONCE@',to: buildNonce}]@@ -627,136 +627,132 @@ module.exports = function(grunt) {},wv_js: {files: {- "build/worldview/web/js/wv.js": ["build/worldview/web/js/wv.js"]+ 'build/worldview/web/js/wv.js': ['build/worldview/web/js/wv.js']}},ol_js: {files: {- "build/worldview/web/js/ol.js": ["build/worldview/web/js/ol.js"]+ 'build/worldview/web/js/ol.js': ['build/worldview/web/js/ol.js']}}}});- grunt.loadNpmTasks("grunt-buster");- grunt.loadNpmTasks("grunt-contrib-clean");- grunt.loadNpmTasks("grunt-contrib-concat");- grunt.loadNpmTasks("grunt-contrib-compress");- grunt.loadNpmTasks("grunt-contrib-copy");- grunt.loadNpmTasks("grunt-contrib-cssmin");- grunt.loadNpmTasks("gruntify-eslint");- grunt.loadNpmTasks("grunt-contrib-uglify");+ grunt.loadNpmTasks('grunt-buster');+ grunt.loadNpmTasks('grunt-contrib-clean');+ grunt.loadNpmTasks('grunt-contrib-concat');+ grunt.loadNpmTasks('grunt-contrib-compress');+ grunt.loadNpmTasks('grunt-contrib-copy');+ grunt.loadNpmTasks('grunt-contrib-cssmin');+ grunt.loadNpmTasks('gruntify-eslint');+ grunt.loadNpmTasks('grunt-contrib-uglify');grunt.loadNpmTasks('grunt-contrib-watch');- grunt.loadNpmTasks("grunt-line-remover");- grunt.loadNpmTasks("grunt-exec");- grunt.loadNpmTasks("grunt-git-rev-parse");- grunt.loadNpmTasks("grunt-markdown");- grunt.loadNpmTasks("grunt-minjson");- grunt.loadNpmTasks("grunt-mkdir");- grunt.loadNpmTasks("grunt-postcss");- grunt.loadNpmTasks("grunt-stylefmt");- grunt.loadNpmTasks("grunt-text-replace");- grunt.loadNpmTasks("grunt-rename");-- // Lets use "clean" as a target instead of the name of the task- grunt.renameTask("clean", "remove");-- grunt.registerTask("load_branding", "Load branding", function() {- var brand = grunt.file.readJSON("build/options/brand.json");+ grunt.loadNpmTasks('grunt-line-remover');+ grunt.loadNpmTasks('grunt-exec');+ grunt.loadNpmTasks('grunt-git-rev-parse');+ grunt.loadNpmTasks('grunt-markdown');+ grunt.loadNpmTasks('grunt-minjson');+ grunt.loadNpmTasks('grunt-mkdir');+ grunt.loadNpmTasks('grunt-postcss');+ grunt.loadNpmTasks('grunt-stylefmt');+ grunt.loadNpmTasks('grunt-text-replace');+ grunt.loadNpmTasks('grunt-rename');++ // Lets use 'clean' as a target instead of the name of the task+ grunt.renameTask('clean', 'remove');++ grunt.registerTask('load_branding', 'Load branding', function() {+ var brand = grunt.file.readJSON('build/options/brand.json');brand.officialName = brand.officialName || brand.name;brand.longName = brand.longName || brand.name;brand.shortName = brand.shortName || brand.name;- brand.packageName = grunt.option("package-name") || brand.packageName;- brand.email = brand.email || "[email protected]";-- console.log("\n=========================================================");- console.log("[" + brand.packageName + "] " + brand.officialName + ", Version " + pkg.version + "-" + pkg.release);- console.log("=========================================================");-- grunt.option("officialName", brand.officialName);- grunt.option("longName", brand.longName);- grunt.option("shortName", brand.shortName);- grunt.option("packageName", brand.packageName);- grunt.option("email", brand.email);+ brand.packageName = grunt.option('package-name') || brand.packageName;+ brand.email = brand.email || '[email protected]';++ grunt.option('officialName', brand.officialName);+ grunt.option('longName', brand.longName);+ grunt.option('shortName', brand.shortName);+ grunt.option('packageName', brand.packageName);+ grunt.option('email', brand.email);});- grunt.registerTask("autoprefix", ["postcss:autoprefix"]);-- grunt.registerTask("build", [- "remove:build_source",- "git-rev-parse:source",- "copy:source",- "concat",- "remove:source",- "exec:empty",- "copy:release",- "uglify",- "cssmin",- "replace:links",- "lineremover",- "mkdir:dist",- "exec:tar_source_debug",- "copy:dist_source_debug_versioned",- "exec:tar_source_release",- "copy:dist_source_release_versioned"+ grunt.registerTask('autoprefix', ['postcss:autoprefix']);++ grunt.registerTask('build', [+ 'remove:build_source',+ 'git-rev-parse:source',+ 'copy:source',+ 'concat',+ 'remove:source',+ 'exec:empty',+ 'copy:release',+ 'uglify',+ 'cssmin',+ 'replace:links',+ 'lineremover',+ 'mkdir:dist',+ 'exec:tar_source_debug',+ 'copy:dist_source_debug_versioned',+ 'exec:tar_source_release',+ 'copy:dist_source_release_versioned']);- grunt.registerTask("config", [- "remove:build_config",- "git-rev-parse:config",- "remove:config_src",- "exec:config",- "markdown",- "copy:config_src",- "copy:brand_info",- "mkdir:dist",- "exec:tar_config",- "copy:dist_config_versioned"+ grunt.registerTask('config', [+ 'remove:build_config',+ 'git-rev-parse:config',+ 'remove:config_src',+ 'exec:config',+ 'markdown',+ 'copy:config_src',+ 'copy:brand_info',+ 'mkdir:dist',+ 'exec:tar_config',+ 'copy:dist_config_versioned']);- grunt.registerTask("fetch", ["exec:fetch"]);-- grunt.registerTask("site", [- "load_branding",- "remove:build_site",- "copy:site",- "replace:tokens",- "exec:tar_site_debug",- "copy:dist_site_debug_versioned",- "exec:tar_site_release",- "copy:dist_site_release_versioned"+ grunt.registerTask('fetch', ['exec:fetch']);++ grunt.registerTask('site', [+ 'load_branding',+ 'remove:build_site',+ 'copy:site',+ 'replace:tokens',+ 'exec:tar_site_debug',+ 'copy:dist_site_debug_versioned',+ 'exec:tar_site_release',+ 'copy:dist_site_release_versioned']);- grunt.registerTask("stylelint", ["postcss:stylelint"]);-- grunt.registerTask("rpm-only", [- "load_branding",- "git-rev-parse:source",- "remove:rpmbuild",- "mkdir:rpmbuild",- "copy:rpm_sources",- "replace:rpm_sources",- "remove:dist_rpm",- "exec:rpmbuild",- "copy:rpm"+ grunt.registerTask('stylelint', ['postcss:stylelint']);++ grunt.registerTask('rpm-only', [+ 'load_branding',+ 'git-rev-parse:source',+ 'remove:rpmbuild',+ 'mkdir:rpmbuild',+ 'copy:rpm_sources',+ 'replace:rpm_sources',+ 'remove:dist_rpm',+ 'exec:rpmbuild',+ 'copy:rpm']);- grunt.registerTask("apache-config", ["load_branding", "copy:apache", "replace:apache"]);-- grunt.registerTask("update", ["remove:modules", "copy:ext"]);- grunt.registerTask("update-packages", ["exec:python_packages", "exec:node_packages", "update"]);- grunt.registerTask("check", ["lint", "test"]);- grunt.registerTask("clean", ["remove:build"]);- grunt.registerTask("distclean", ["remove:build", "remove:dist"]);- grunt.registerTask("lint", ["eslint"], ["stylelint"]);- grunt.registerTask("test", ["buster:console"]);-- grunt.registerTask("default", [- "update-packages",- "fetch",- "update",- "build",- "config",- "site"+ grunt.registerTask('apache-config', ['load_branding', 'copy:apache', 'replace:apache']);++ grunt.registerTask('update', ['remove:modules', 'copy:ext']);+ grunt.registerTask('update-packages', ['exec:python_packages', 'exec:node_packages', 'update']);+ grunt.registerTask('check', ['lint', 'test']);+ grunt.registerTask('clean', ['remove:build']);+ grunt.registerTask('distclean', ['remove:build', 'remove:dist']);+ grunt.registerTask('lint', ['eslint'], ['stylelint']);+ grunt.registerTask('test', ['buster:console']);++ grunt.registerTask('default', [+ 'update-packages',+ 'fetch',+ 'update',+ 'build',+ 'config',+ 'site']);};diff --git a/buster.js b/buster.jsindex f114ed6ad..3bc2b9dbf 100644--- a/buster.js+++ b/buster.js@@ -1,31 +1,31 @@var config = module.exports;-config["wv"] = {- rootPath: "./",- environment: "browser",+config['wv'] = {+ rootPath: './',+ environment: 'browser',libs: [- "web/ext/main/lodash-2.4.1/lodash.js",- "web/ext/main/jquery-2.1.4/jquery.js",- "web/ext/main/jquery.migrate-1.2.1/jquery-migrate.min.js",- "web/ext/main/jscache-gitba01cdc/cache.js",- "web/ext/proj/proj4js-2.3.3-1/proj4.js",- "node_modules/openlayers/dist/ol-debug.js",- "test/fixtures.js"+ 'web/ext/main/lodash-2.4.1/lodash.js',+ 'web/ext/main/jquery-2.1.4/jquery.js',+ 'web/ext/main/jquery.migrate-1.2.1/jquery-migrate.min.js',+ 'web/ext/main/jscache-gitba01cdc/cache.js',+ 'web/ext/proj/proj4js-2.3.3-1/proj4.js',+ 'node_modules/openlayers/dist/ol-debug.js',+ 'test/fixtures.js'],src: [- "web/js/util/wv.*.js",- "web/js/wv.*.js",- "!web/js/wv.main.js",- "web/js/ui/wv.ui.js",- "web/js/ui/wv.ui.mouse.js",- "web/js/ui/wv.ui.indicator.js",- "web/js/date/wv.*.js",- "web/js/layers/wv.*.js",- "web/js/link/wv.*.js",- "web/js/palettes/wv.*.js",- "web/js/proj/wv.*.js",- "web/js/data/wv.*.js",- "web/js/map/wv.*.js"+ 'web/js/util/wv.*.js',+ 'web/js/wv.*.js',+ '!web/js/wv.main.js',+ 'web/js/ui/wv.ui.js',+ 'web/js/ui/wv.ui.mouse.js',+ 'web/js/ui/wv.ui.indicator.js',+ 'web/js/date/wv.*.js',+ 'web/js/layers/wv.*.js',+ 'web/js/link/wv.*.js',+ 'web/js/palettes/wv.*.js',+ 'web/js/proj/wv.*.js',+ 'web/js/data/wv.*.js',+ 'web/js/map/wv.*.js'],- tests: ["test/**/*.js"]+ tests: ['test/**/*.js']};diff --git a/e2e/browserstack.conf.js b/e2e/browserstack.conf.jsindex 43957f4e5..9ad395232 100644--- a/e2e/browserstack.conf.js+++ b/e2e/browserstack.conf.js@@ -1,6 +1,3 @@-const seleniumServer = require('selenium-server-standalone-jar');-const chromedriver = require('chromedriver');-const geckodriver = require('geckodriver');const environments = require('./environments.json');require('nightwatch-cucumber')({diff --git a/e2e/browserstack.js b/e2e/browserstack.jsindex 181d29457..9383cb2ec 100644--- a/e2e/browserstack.js+++ b/e2e/browserstack.js@@ -1,4 +1,5 @@#!/usr/bin/env node+/* eslint no-console: "off" */var Nightwatch = require('nightwatch');var browserstack = require('browserstack-local');diff --git a/e2e/step_definitions/animations.js b/e2e/step_definitions/animations.jsindex ff2414d1b..e59192051 100644--- a/e2e/step_definitions/animations.js+++ b/e2e/step_definitions/animations.js@@ -1,8 +1,7 @@const {client} = require('nightwatch-cucumber');const {defineSupportCode} = require('cucumber');-const delay = client.globals.delay;-defineSupportCode(({Given, Then, When}) => {+defineSupportCode(({Then}) => {Then('the animation range selector works', () => {return client@@ -16,7 +15,7 @@ defineSupportCode(({Given, Then, When}) => {.mouseButtonUp(0).pause(100);client.getValue('.wv-anim-dates-case .wv-date-selector-widget:first-child #day-input-group', function(result) {- newDay = result.value;+ var newDay = result.value;this.assert.notEqual(startDay, newDay);});});diff --git a/e2e/step_definitions/events.js b/e2e/step_definitions/events.jsindex 7f75bad4d..fcc2f41e3 100644--- a/e2e/step_definitions/events.js+++ b/e2e/step_definitions/events.js@@ -1,8 +1,7 @@const {client} = require('nightwatch-cucumber');const {defineSupportCode} = require('cucumber');-const delay = client.globals.delay;-defineSupportCode(({Given, Then, When}) => {+defineSupportCode(({Then}) => {Then('I see {int}+ markers on the map', (count) => {return client.assert.elementCountGreater(client.globals.selectors['map marker'], count);diff --git a/e2e/step_definitions/runningdata.js b/e2e/step_definitions/runningdata.jsindex b9884a97d..437223d40 100644--- a/e2e/step_definitions/runningdata.js+++ b/e2e/step_definitions/runningdata.js@@ -1,8 +1,7 @@const {client} = require('nightwatch-cucumber');const {defineSupportCode} = require('cucumber');-const delay = client.globals.delay;-defineSupportCode(({Given, Then, When}) => {+defineSupportCode(({Then}) => {Then('label says {string} when hovering at {int},{int}', (label, x, y) => {@@ -15,9 +14,9 @@ defineSupportCode(({Given, Then, When}) => {});Then('label says {string} when hovering on colorbar', (label) => {- return client.getElementSize(".wv-palette .wv-palettes-colorbar", function(result) {- width = result.value.width;- height = result.value.height;+ return client.getElementSize('.wv-palette .wv-palettes-colorbar', function(result) {+ var width = result.value.width;+ var height = result.value.height;client.useCss().moveToElement('.wv-palette .wv-palettes-colorbar', width/2, height/2).click('.ol-viewport');diff --git a/version-check.js b/version-check.jsindex 691b9a671..e87f3671b 100644--- a/version-check.js+++ b/version-check.js@@ -1,3 +1,4 @@+/* eslint no-console: "off" */var packageJson = require('./package.json');var requiredVersion = 'v' + packageJson.engines.node;var nodeBeingUsed = process.version;@@ -7,4 +8,3 @@ if(requiredVersion != nodeBeingUsed ) {console.log('WARN ','\x1b[0m','The suggested version of node for the installation of Worldview is', '\x1b[32m', '\x1b[1m', requiredVersion, '\x1b[0m', ' you are using', '\x1b[32m', '\x1b[1m', nodeBeingUsed);console.log('\x1b[0m', 'If you have difficulties installing Worldview, please try using the install again using the node version','\x1b[32m','\x1b[1m', requiredVersion, '\x1b[0m');}-diff --git a/web/js/date/wv.date.timeline.ticks.js b/web/js/date/wv.date.timeline.ticks.jsindex 7642eaba7..9233f610f 100644--- a/web/js/date/wv.date.timeline.ticks.js+++ b/web/js/date/wv.date.timeline.ticks.js@@ -483,9 +483,6 @@ wv.date.timeline.ticks = wv.date.timeline.ticks || function(models, config, ui)end = tl.zoom.current.ticks.boundary.last();self.add(end, 'path.domain');- }- if (sibElem.classed('end-tick')) {-}// } End terriblediff --git a/web/js/edsc.js b/web/js/edsc.jsindex 63f88cd1b..3f1be0b1c 100644--- a/web/js/edsc.js+++ b/web/js/edsc.js@@ -62,7 +62,7 @@ L.Util = {this.lat = lat;this.lng = lng;}- };+ }L.LatLng = LatLng;L.latLng = function(lat, lng) {diff --git a/web/js/layers/wv.layers.modal.js b/web/js/layers/wv.layers.modal.jsindex c9aa2572d..f78d3a57c 100644--- a/web/js/layers/wv.layers.modal.js+++ b/web/js/layers/wv.layers.modal.js@@ -121,7 +121,10 @@ wv.layers.modal = wv.layers.modal || function(models, ui, config) {var hasMeasurementSource = function(current) {var hasSource;Object.values(current.sources).forEach(function(source) {- if(hasMeasurementSetting(current, source)) { hasSource = true; hasMeasurement = true; };+ if (hasMeasurementSetting(current, source)) {+ hasSource = true;+ hasMeasurement = true;+ }});return hasSource;};diff --git a/web/js/naturalEvents/wv.naturalEvents.markers.js b/web/js/naturalEvents/wv.naturalEvents.markers.jsindex b372d0fcb..c730325ed 100644--- a/web/js/naturalEvents/wv.naturalEvents.markers.js+++ b/web/js/naturalEvents/wv.naturalEvents.markers.js@@ -108,7 +108,9 @@ wv.naturalEvents.markers = wv.naturalEvents.markers || function(models, ui) {try {var eventCopy = new event.constructor(event.type, event);target.dispatchEvent(eventCopy);- } catch (err) {} // Nothing to do, the try/catch prevents IE from crashing+ } catch (err) {+ console.log(err);+ }};var createPin = function(id, category, isSelected){