CLIMATE-512 - Replace frontend with new Yeoman/Grunt/Bower frontend
Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/652ea657 Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/652ea657 Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/652ea657 Branch: refs/heads/master Commit: 652ea6576b850bb8882482752085c77195ff6fb8 Parents: fb37845 Author: Michael Joyce <[email protected]> Authored: Wed Aug 27 10:07:58 2014 -0700 Committer: Michael Joyce <[email protected]> Committed: Wed Aug 27 10:07:58 2014 -0700 ---------------------------------------------------------------------- ocw-ui/frontend-new/.bowerrc | 3 - ocw-ui/frontend-new/.editorconfig | 21 - ocw-ui/frontend-new/.gitattributes | 1 - ocw-ui/frontend-new/.gitignore | 5 - ocw-ui/frontend-new/.jshintrc | 24 - ocw-ui/frontend-new/.travis.yml | 6 - ocw-ui/frontend-new/Gruntfile.js | 412 - ocw-ui/frontend-new/app/.buildignore | 1 - ocw-ui/frontend-new/app/.htaccess | 543 - ocw-ui/frontend-new/app/404.html | 175 - ocw-ui/frontend-new/app/favicon.ico | Bin 4286 -> 0 bytes ocw-ui/frontend-new/app/index.html | 148 - ocw-ui/frontend-new/app/robots.txt | 3 - ocw-ui/frontend-new/app/scripts/app.js | 96 - .../app/scripts/controllers/datasetdisplay.js | 43 - .../app/scripts/controllers/datasetselect.js | 64 - .../app/scripts/controllers/main.js | 36 - .../scripts/controllers/observationselect.js | 203 - .../app/scripts/controllers/parameterselect.js | 275 - .../app/scripts/controllers/rcmedselection.js | 144 - .../app/scripts/controllers/result.js | 47 - .../app/scripts/controllers/resultdetail.js | 46 - .../app/scripts/controllers/settings.js | 34 - .../app/scripts/controllers/timeline.js | 103 - .../app/scripts/controllers/worldmap.js | 104 - .../app/scripts/directives/bootstrapmodal.js | 79 - .../scripts/directives/bootstrapmodalopen.js | 43 - .../app/scripts/directives/leafletmap.js | 46 - .../app/scripts/directives/onblur.js | 38 - .../directives/predictivefilebrowserinput.js | 316 - .../app/scripts/directives/previewmap.js | 76 - .../app/scripts/directives/timeline.js | 54 - .../scripts/filters/isodatetomiddleendian.js | 55 - .../app/scripts/services/evaluationsettings.js | 56 - .../app/scripts/services/regionselectparams.js | 46 - .../services/selecteddatasetinformation.js | 57 - ocw-ui/frontend-new/app/styles/main.css | 120 - ocw-ui/frontend-new/app/views/main.html | 274 - ocw-ui/frontend-new/app/views/modelselect.html | 87 - ocw-ui/frontend-new/app/views/results.html | 34 - .../frontend-new/app/views/resultsdetail.html | 30 - ocw-ui/frontend-new/app/views/resultslist.html | 21 - .../app/views/selectobservation.html | 80 - ocw-ui/frontend-new/app/views/selectrcmed.html | 40 - ocw-ui/frontend-new/bower.json | 25 - ocw-ui/frontend-new/package.json | 40 - ocw-ui/frontend-new/test/.jshintrc | 36 - ocw-ui/frontend-new/test/karma.conf.js | 86 - .../test/spec/controllers/datasetdisplay.js | 59 - .../test/spec/controllers/datasetselect.js | 54 - .../frontend-new/test/spec/controllers/main.js | 41 - .../test/spec/controllers/observationselect.js | 122 - .../test/spec/controllers/parameterselect.js | 136 - .../test/spec/controllers/rcmedselection.js | 145 - .../test/spec/controllers/result.js | 37 - .../test/spec/controllers/resultdetail.js | 37 - .../test/spec/controllers/settings.js | 37 - .../test/spec/controllers/timeline.js | 37 - .../test/spec/controllers/worldmap.js | 57 - .../test/spec/directives/bootstrapmodal.js | 33 - .../test/spec/directives/bootstrapmodalopen.js | 33 - .../test/spec/directives/leafletmap.js | 33 - .../frontend-new/test/spec/directives/onblur.js | 50 - .../directives/predictivefilebrowserinput.js | 33 - .../test/spec/directives/previewmap.js | 53 - .../test/spec/directives/timeline.js | 33 - .../test/spec/filters/isodatetomiddleendian.js | 76 - .../test/spec/services/evaluationsettings.js | 44 - .../test/spec/services/regionselectparams.js | 44 - .../spec/services/selecteddatasetinformation.js | 92 - ocw-ui/frontend/.bowerrc | 3 + ocw-ui/frontend/.editorconfig | 21 + ocw-ui/frontend/.gitattributes | 1 + ocw-ui/frontend/.gitignore | 5 + ocw-ui/frontend/.jshintrc | 24 + ocw-ui/frontend/.travis.yml | 6 + ocw-ui/frontend/Gruntfile.js | 412 + ocw-ui/frontend/app/.buildignore | 1 + ocw-ui/frontend/app/.htaccess | 543 + ocw-ui/frontend/app/404.html | 175 + ocw-ui/frontend/app/css/app.css | 108 - .../app/css/lib/bootstrap-responsive.min.css | 9 - ocw-ui/frontend/app/css/lib/bootstrap.min.css | 9 - .../frontend/app/css/lib/font-awesome.min.css | 403 - ocw-ui/frontend/app/css/lib/timeline.css | 193 - ocw-ui/frontend/app/favicon.ico | Bin 0 -> 4286 bytes ocw-ui/frontend/app/font/FontAwesome.otf | Bin 61896 -> 0 bytes .../frontend/app/font/fontawesome-webfont.eot | Bin 37405 -> 0 bytes .../frontend/app/font/fontawesome-webfont.svg | 399 - .../frontend/app/font/fontawesome-webfont.ttf | Bin 79076 -> 0 bytes .../frontend/app/font/fontawesome-webfont.woff | Bin 43572 -> 0 bytes ocw-ui/frontend/app/img/globe.png | Bin 25857 -> 0 bytes .../app/img/glyphicons-halflings-white.png | Bin 8777 -> 0 bytes .../frontend/app/img/glyphicons-halflings.png | Bin 12799 -> 0 bytes ocw-ui/frontend/app/index.html | 213 +- ocw-ui/frontend/app/js/app.js | 91 - .../app/js/controllers/DatasetDisplayCtrl.js | 34 - .../app/js/controllers/DatasetSelectCtrl.js | 55 - .../app/js/controllers/ObservationSelectCtrl.js | 194 - .../app/js/controllers/ParameterSelectCtrl.js | 296 - .../app/js/controllers/RcmedSelectionCtrl.js | 133 - .../frontend/app/js/controllers/ResultCtrl.js | 38 - .../app/js/controllers/ResultDetailCtrl.js | 38 - .../frontend/app/js/controllers/SettingsCtrl.js | 24 - .../frontend/app/js/controllers/TimelineCtrl.js | 92 - .../frontend/app/js/controllers/WorldMapCtrl.js | 95 - .../app/js/directives/BootstrapModal.js | 71 - .../app/js/directives/BootstrapModalOpen.js | 39 - ocw-ui/frontend/app/js/directives/LeafletMap.js | 38 - ocw-ui/frontend/app/js/directives/OnBlur.js | 36 - .../js/directives/PredictiveFileBrowserInput.js | 308 - ocw-ui/frontend/app/js/directives/PreviewMap.js | 68 - ocw-ui/frontend/app/js/directives/Timeline.js | 44 - .../app/js/filters/ISODateToMiddleEndian.js | 48 - .../js/lib/angular-ui/angular-ui-0.4-tpls.js | 2 - .../js/lib/angular-ui/angular-ui-router.min.js | 7 - .../angular-ui/ui-bootstrap-tpls-0.5.0.min.js | 2 - .../app/js/lib/angular/angular-cookies.js | 183 - .../app/js/lib/angular/angular-cookies.min.js | 7 - .../app/js/lib/angular/angular-loader.js | 276 - .../app/js/lib/angular/angular-loader.min.js | 7 - .../app/js/lib/angular/angular-resource.js | 445 - .../app/js/lib/angular/angular-resource.min.js | 10 - .../app/js/lib/angular/angular-sanitize.js | 535 - .../app/js/lib/angular/angular-sanitize.min.js | 13 - ocw-ui/frontend/app/js/lib/angular/angular.js | 14733 --------- .../frontend/app/js/lib/angular/angular.min.js | 161 - ocw-ui/frontend/app/js/lib/angular/version.txt | 1 - .../frontend/app/js/lib/bootstrap/bootstrap.js | 2276 -- .../app/js/lib/bootstrap/bootstrap.min.js | 6 - .../frontend/app/js/lib/jquery/jquery-1.10.1.js | 9807 ------ .../jquery/jquery-ui/datepicker-wrapper/date.js | 125 - .../jquery/jquery-ui/jquery-ui-1.10.3.min.js | 12 - .../frontend/app/js/lib/leaflet/leaflet-0.5.js | 8 - .../app/js/lib/timeline/timeline-locales.js | 101 - .../app/js/lib/timeline/timeline-min.js | 199 - ocw-ui/frontend/app/js/lib/timeline/timeline.js | 6381 ---- .../app/js/services/EvaluationSettings.js | 47 - .../app/js/services/RegionSelectParams.js | 37 - .../js/services/SelectedDatasetInformation.js | 49 - ocw-ui/frontend/app/partials/main.html | 261 - ocw-ui/frontend/app/partials/modelSelect.html | 86 - .../frontend/app/partials/results.detail.html | 30 - ocw-ui/frontend/app/partials/results.html | 34 - ocw-ui/frontend/app/partials/results.list.html | 22 - .../app/partials/selectObservation.html | 58 - ocw-ui/frontend/app/partials/selectRcmed.html | 44 - ocw-ui/frontend/app/robots.txt | 3 + ocw-ui/frontend/app/scripts/app.js | 96 + .../app/scripts/controllers/datasetdisplay.js | 43 + .../app/scripts/controllers/datasetselect.js | 64 + ocw-ui/frontend/app/scripts/controllers/main.js | 36 + .../scripts/controllers/observationselect.js | 203 + .../app/scripts/controllers/parameterselect.js | 275 + .../app/scripts/controllers/rcmedselection.js | 144 + .../frontend/app/scripts/controllers/result.js | 47 + .../app/scripts/controllers/resultdetail.js | 46 + .../app/scripts/controllers/settings.js | 34 + .../app/scripts/controllers/timeline.js | 103 + .../app/scripts/controllers/worldmap.js | 104 + .../app/scripts/directives/bootstrapmodal.js | 79 + .../scripts/directives/bootstrapmodalopen.js | 43 + .../app/scripts/directives/leafletmap.js | 46 + .../frontend/app/scripts/directives/onblur.js | 38 + .../directives/predictivefilebrowserinput.js | 316 + .../app/scripts/directives/previewmap.js | 76 + .../frontend/app/scripts/directives/timeline.js | 54 + .../scripts/filters/isodatetomiddleendian.js | 55 + .../app/scripts/services/evaluationsettings.js | 56 + .../app/scripts/services/regionselectparams.js | 46 + .../services/selecteddatasetinformation.js | 57 + ocw-ui/frontend/app/styles/main.css | 120 + ocw-ui/frontend/app/views/main.html | 274 + ocw-ui/frontend/app/views/modelselect.html | 87 + ocw-ui/frontend/app/views/results.html | 34 + ocw-ui/frontend/app/views/resultsdetail.html | 30 + ocw-ui/frontend/app/views/resultslist.html | 21 + .../frontend/app/views/selectobservation.html | 80 + ocw-ui/frontend/app/views/selectrcmed.html | 40 + ocw-ui/frontend/bower.json | 25 + ocw-ui/frontend/config/karma-e2e.conf.js | 40 - ocw-ui/frontend/config/karma.conf.js | 48 - ocw-ui/frontend/package.json | 40 + ocw-ui/frontend/scripts/e2e-test.sh | 27 - ocw-ui/frontend/scripts/test.sh | 27 - ocw-ui/frontend/scripts/web-server.js | 313 - ocw-ui/frontend/test/.jshintrc | 36 + ocw-ui/frontend/test/e2e/runner.html | 28 - ocw-ui/frontend/test/e2e/scenarios.js | 63 - ocw-ui/frontend/test/karma.conf.js | 86 + .../frontend/test/lib/angular/angular-mocks.js | 1764 -- .../test/lib/angular/angular-scenario.js | 26195 ----------------- ocw-ui/frontend/test/lib/angular/version.txt | 1 - .../test/spec/controllers/datasetdisplay.js | 59 + .../test/spec/controllers/datasetselect.js | 54 + ocw-ui/frontend/test/spec/controllers/main.js | 41 + .../test/spec/controllers/observationselect.js | 122 + .../test/spec/controllers/parameterselect.js | 136 + .../test/spec/controllers/rcmedselection.js | 145 + ocw-ui/frontend/test/spec/controllers/result.js | 37 + .../test/spec/controllers/resultdetail.js | 37 + .../frontend/test/spec/controllers/settings.js | 37 + .../frontend/test/spec/controllers/timeline.js | 37 + .../frontend/test/spec/controllers/worldmap.js | 57 + .../test/spec/directives/bootstrapmodal.js | 33 + .../test/spec/directives/bootstrapmodalopen.js | 33 + .../frontend/test/spec/directives/leafletmap.js | 33 + ocw-ui/frontend/test/spec/directives/onblur.js | 50 + .../directives/predictivefilebrowserinput.js | 33 + .../frontend/test/spec/directives/previewmap.js | 53 + .../frontend/test/spec/directives/timeline.js | 33 + .../test/spec/filters/isodatetomiddleendian.js | 76 + .../test/spec/services/evaluationsettings.js | 44 + .../test/spec/services/regionselectparams.js | 44 + .../spec/services/selecteddatasetinformation.js | 92 + .../unit/controllers/DatasetDisplayCtrlTest.js | 65 - .../unit/controllers/DatasetSelectCtrlTest.js | 51 - .../controllers/ObservationSelectCtrlTest.js | 151 - .../unit/controllers/ParameterSelectCtrlTest.js | 269 - .../unit/controllers/RcmedSelectionCtrlTest.js | 161 - .../test/unit/controllers/SettingsCtrlTest.js | 47 - .../test/unit/controllers/WorldMapCtrlTest.js | 48 - .../test/unit/directives/BootstrapModalTest.js | 41 - .../frontend/test/unit/directives/OnBlurTest.js | 42 - .../test/unit/directives/PreviewMapTest.js | 46 - .../unit/filters/ISODateToMiddleEndianTest.js | 67 - .../unit/services/EvaluationSettingsTest.js | 40 - .../unit/services/RegionSelectParamsTest.js | 41 - .../services/SelectedDatasetInfomationTest.js | 90 - 229 files changed, 5532 insertions(+), 74150 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/.bowerrc ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/.bowerrc b/ocw-ui/frontend-new/.bowerrc deleted file mode 100644 index 69fad35..0000000 --- a/ocw-ui/frontend-new/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "bower_components" -} http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/.editorconfig ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/.editorconfig b/ocw-ui/frontend-new/.editorconfig deleted file mode 100644 index c2cdfb8..0000000 --- a/ocw-ui/frontend-new/.editorconfig +++ /dev/null @@ -1,21 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] - -# Change these settings to your own preference -indent_style = space -indent_size = 2 - -# We recommend you to keep these unchanged -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/.gitattributes ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/.gitattributes b/ocw-ui/frontend-new/.gitattributes deleted file mode 100644 index 2125666..0000000 --- a/ocw-ui/frontend-new/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto \ No newline at end of file http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/.gitignore ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/.gitignore b/ocw-ui/frontend-new/.gitignore deleted file mode 100644 index a22a458..0000000 --- a/ocw-ui/frontend-new/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -dist -.tmp -.sass-cache -bower_components http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/.jshintrc ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/.jshintrc b/ocw-ui/frontend-new/.jshintrc deleted file mode 100644 index 40377ba..0000000 --- a/ocw-ui/frontend-new/.jshintrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "node": true, - "browser": true, - "esnext": true, - "bitwise": true, - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "indent": 2, - "latedef": true, - "newcap": true, - "noarg": true, - "quotmark": "single", - "regexp": true, - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - "smarttabs": true, - "globals": { - "angular": false - } -} http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/.travis.yml ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/.travis.yml b/ocw-ui/frontend-new/.travis.yml deleted file mode 100644 index a80b6e0..0000000 --- a/ocw-ui/frontend-new/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - '0.10' -before_script: - - 'npm install -g bower grunt-cli' - - 'bower install' http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/Gruntfile.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/Gruntfile.js b/ocw-ui/frontend-new/Gruntfile.js deleted file mode 100644 index 0efb4ae..0000000 --- a/ocw-ui/frontend-new/Gruntfile.js +++ /dev/null @@ -1,412 +0,0 @@ -// Generated on 2014-07-15 using generator-angular 0.9.5 -'use strict'; - -// # Globbing -// for performance reasons we're only matching one level down: -// 'test/spec/{,*/}*.js' -// use this if you want to recursively match all subfolders: -// 'test/spec/**/*.js' - -module.exports = function (grunt) { - - // Load grunt tasks automatically - require('load-grunt-tasks')(grunt); - - // Time how long tasks take. Can help when optimizing build times - require('time-grunt')(grunt); - - // Configurable paths for the application - var appConfig = { - app: require('./bower.json').appPath || 'app', - dist: 'dist' - }; - - // Define the configuration for all the tasks - grunt.initConfig({ - - // Project settings - yeoman: appConfig, - - // Watches files for changes and runs tasks based on the changed files - watch: { - bower: { - files: ['bower.json'], - tasks: ['wiredep'] - }, - js: { - files: ['<%= yeoman.app %>/scripts/{,*/}*.js'], - tasks: ['newer:jshint:all'], - options: { - livereload: '<%= connect.options.livereload %>' - } - }, - jsTest: { - files: ['test/spec/{,*/}*.js'], - tasks: ['newer:jshint:test', 'karma'] - }, - styles: { - files: ['<%= yeoman.app %>/styles/{,*/}*.css'], - tasks: ['newer:copy:styles', 'autoprefixer'] - }, - gruntfile: { - files: ['Gruntfile.js'] - }, - livereload: { - options: { - livereload: '<%= connect.options.livereload %>' - }, - files: [ - '<%= yeoman.app %>/{,*/}*.html', - '.tmp/styles/{,*/}*.css', - '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' - ] - } - }, - - // The actual grunt server settings - connect: { - options: { - port: 9000, - // Change this to '0.0.0.0' to access the server from outside. - hostname: 'localhost', - livereload: 35729 - }, - livereload: { - options: { - open: true, - middleware: function (connect) { - return [ - connect.static('.tmp'), - connect().use( - '/bower_components', - connect.static('./bower_components') - ), - connect.static(appConfig.app) - ]; - } - } - }, - test: { - options: { - port: 9001, - middleware: function (connect) { - return [ - connect.static('.tmp'), - connect.static('test'), - connect().use( - '/bower_components', - connect.static('./bower_components') - ), - connect.static(appConfig.app) - ]; - } - } - }, - dist: { - options: { - open: true, - base: '<%= yeoman.dist %>' - } - } - }, - - // Make sure code styles are up to par and there are no obvious mistakes - jshint: { - options: { - jshintrc: '.jshintrc', - reporter: require('jshint-stylish') - }, - all: { - src: [ - 'Gruntfile.js', - '<%= yeoman.app %>/scripts/{,*/}*.js' - ] - }, - test: { - options: { - jshintrc: 'test/.jshintrc' - }, - src: ['test/spec/{,*/}*.js'] - } - }, - - // Empties folders to start fresh - clean: { - dist: { - files: [{ - dot: true, - src: [ - '.tmp', - '<%= yeoman.dist %>/{,*/}*', - '!<%= yeoman.dist %>/.git*' - ] - }] - }, - server: '.tmp' - }, - - // Add vendor prefixed styles - autoprefixer: { - options: { - browsers: ['last 1 version'] - }, - dist: { - files: [{ - expand: true, - cwd: '.tmp/styles/', - src: '{,*/}*.css', - dest: '.tmp/styles/' - }] - } - }, - - // Automatically inject Bower components into the app - wiredep: { - options: { - cwd: '<%= yeoman.app %>' - }, - app: { - src: ['<%= yeoman.app %>/index.html'], - ignorePath: /\.\.\// - } - }, - - // Renames files for browser caching purposes - filerev: { - dist: { - src: [ - '<%= yeoman.dist %>/scripts/{,*/}*.js', - '<%= yeoman.dist %>/styles/{,*/}*.css', - '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', - '<%= yeoman.dist %>/styles/fonts/*' - ] - } - }, - - // Reads HTML for usemin blocks to enable smart builds that automatically - // concat, minify and revision files. Creates configurations in memory so - // additional tasks can operate on them - useminPrepare: { - html: '<%= yeoman.app %>/index.html', - options: { - dest: '<%= yeoman.dist %>', - flow: { - html: { - steps: { - js: ['concat', 'uglifyjs'], - css: ['cssmin'] - }, - post: {} - } - } - } - }, - - // Performs rewrites based on filerev and the useminPrepare configuration - usemin: { - html: ['<%= yeoman.dist %>/{,*/}*.html'], - css: ['<%= yeoman.dist %>/styles/{,*/}*.css'], - options: { - assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images'] - } - }, - - // The following *-min tasks will produce minified files in the dist folder - // By default, your `index.html`'s <!-- Usemin block --> will take care of - // minification. These next options are pre-configured if you do not wish - // to use the Usemin blocks. - // cssmin: { - // dist: { - // files: { - // '<%= yeoman.dist %>/styles/main.css': [ - // '.tmp/styles/{,*/}*.css' - // ] - // } - // } - // }, - // uglify: { - // dist: { - // files: { - // '<%= yeoman.dist %>/scripts/scripts.js': [ - // '<%= yeoman.dist %>/scripts/scripts.js' - // ] - // } - // } - // }, - // concat: { - // dist: {} - // }, - - imagemin: { - dist: { - files: [{ - expand: true, - cwd: '<%= yeoman.app %>/images', - src: '{,*/}*.{png,jpg,jpeg,gif}', - dest: '<%= yeoman.dist %>/images' - }] - } - }, - - svgmin: { - dist: { - files: [{ - expand: true, - cwd: '<%= yeoman.app %>/images', - src: '{,*/}*.svg', - dest: '<%= yeoman.dist %>/images' - }] - } - }, - - htmlmin: { - dist: { - options: { - collapseWhitespace: true, - conservativeCollapse: true, - collapseBooleanAttributes: true, - removeCommentsFromCDATA: true, - removeOptionalTags: true - }, - files: [{ - expand: true, - cwd: '<%= yeoman.dist %>', - src: ['*.html', 'views/{,*/}*.html'], - dest: '<%= yeoman.dist %>' - }] - } - }, - - // ngmin tries to make the code safe for minification automatically by - // using the Angular long form for dependency injection. It doesn't work on - // things like resolve or inject so those have to be done manually. - ngmin: { - dist: { - files: [{ - expand: true, - cwd: '.tmp/concat/scripts', - src: '*.js', - dest: '.tmp/concat/scripts' - }] - } - }, - - // Replace Google CDN references - cdnify: { - dist: { - html: ['<%= yeoman.dist %>/*.html'] - } - }, - - // Copies remaining files to places other tasks can use - copy: { - dist: { - files: [{ - expand: true, - dot: true, - cwd: '<%= yeoman.app %>', - dest: '<%= yeoman.dist %>', - src: [ - '*.{ico,png,txt}', - '.htaccess', - '*.html', - 'views/{,*/}*.html', - 'images/{,*/}*.{webp}', - 'fonts/*' - ] - }, { - expand: true, - cwd: '.tmp/images', - dest: '<%= yeoman.dist %>/images', - src: ['generated/*'] - }, { - expand: true, - cwd: 'bower_components/bootstrap/dist', - src: 'fonts/*', - dest: '<%= yeoman.dist %>' - }] - }, - styles: { - expand: true, - cwd: '<%= yeoman.app %>/styles', - dest: '.tmp/styles/', - src: '{,*/}*.css' - } - }, - - // Run some tasks in parallel to speed up the build process - concurrent: { - server: [ - 'copy:styles' - ], - test: [ - 'copy:styles' - ], - dist: [ - 'copy:styles', - 'imagemin', - 'svgmin' - ] - }, - - // Test settings - karma: { - unit: { - configFile: 'test/karma.conf.js', - singleRun: true - } - } - }); - - - grunt.registerTask('serve', 'Compile then start a connect web server', function (target) { - if (target === 'dist') { - return grunt.task.run(['build', 'connect:dist:keepalive']); - } - - grunt.task.run([ - 'clean:server', - 'wiredep', - 'concurrent:server', - 'autoprefixer', - 'connect:livereload', - 'watch' - ]); - }); - - grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) { - grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.'); - grunt.task.run(['serve:' + target]); - }); - - grunt.registerTask('test', [ - 'clean:server', - 'concurrent:test', - 'autoprefixer', - 'connect:test', - 'karma' - ]); - - grunt.registerTask('build', [ - 'clean:dist', - 'wiredep', - 'useminPrepare', - 'concurrent:dist', - 'autoprefixer', - 'concat', - 'ngmin', - 'copy:dist', - 'cdnify', - 'cssmin', - 'uglify', - 'filerev', - 'usemin', - 'htmlmin' - ]); - - grunt.registerTask('default', [ - 'newer:jshint', - 'test', - 'build' - ]); -}; http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/.buildignore ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/.buildignore b/ocw-ui/frontend-new/app/.buildignore deleted file mode 100644 index fc98b8e..0000000 --- a/ocw-ui/frontend-new/app/.buildignore +++ /dev/null @@ -1 +0,0 @@ -*.coffee \ No newline at end of file http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/.htaccess ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/.htaccess b/ocw-ui/frontend-new/app/.htaccess deleted file mode 100644 index cb84cb9..0000000 --- a/ocw-ui/frontend-new/app/.htaccess +++ /dev/null @@ -1,543 +0,0 @@ -# Apache Configuration File - -# (!) Using `.htaccess` files slows down Apache, therefore, if you have access -# to the main server config file (usually called `httpd.conf`), you should add -# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html. - -# ############################################################################## -# # CROSS-ORIGIN RESOURCE SHARING (CORS) # -# ############################################################################## - -# ------------------------------------------------------------------------------ -# | Cross-domain AJAX requests | -# ------------------------------------------------------------------------------ - -# Enable cross-origin AJAX requests. -# http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity -# http://enable-cors.org/ - -# <IfModule mod_headers.c> -# Header set Access-Control-Allow-Origin "*" -# </IfModule> - -# ------------------------------------------------------------------------------ -# | CORS-enabled images | -# ------------------------------------------------------------------------------ - -# Send the CORS header for images when browsers request it. -# https://developer.mozilla.org/en/CORS_Enabled_Image -# http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html -# http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/ - -<IfModule mod_setenvif.c> - <IfModule mod_headers.c> - <FilesMatch "\.(gif|ico|jpe?g|png|svg|svgz|webp)$"> - SetEnvIf Origin ":" IS_CORS - Header set Access-Control-Allow-Origin "*" env=IS_CORS - </FilesMatch> - </IfModule> -</IfModule> - -# ------------------------------------------------------------------------------ -# | Web fonts access | -# ------------------------------------------------------------------------------ - -# Allow access from all domains for web fonts - -<IfModule mod_headers.c> - <FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$"> - Header set Access-Control-Allow-Origin "*" - </FilesMatch> -</IfModule> - - -# ############################################################################## -# # ERRORS # -# ############################################################################## - -# ------------------------------------------------------------------------------ -# | 404 error prevention for non-existing redirected folders | -# ------------------------------------------------------------------------------ - -# Prevent Apache from returning a 404 error for a rewrite if a directory -# with the same name does not exist. -# http://httpd.apache.org/docs/current/content-negotiation.html#multiviews -# http://www.webmasterworld.com/apache/3808792.htm - -Options -MultiViews - -# ------------------------------------------------------------------------------ -# | Custom error messages / pages | -# ------------------------------------------------------------------------------ - -# You can customize what Apache returns to the client in case of an error (see -# http://httpd.apache.org/docs/current/mod/core.html#errordocument), e.g.: - -ErrorDocument 404 /404.html - - -# ############################################################################## -# # INTERNET EXPLORER # -# ############################################################################## - -# ------------------------------------------------------------------------------ -# | Better website experience | -# ------------------------------------------------------------------------------ - -# Force IE to render pages in the highest available mode in the various -# cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf. - -<IfModule mod_headers.c> - Header set X-UA-Compatible "IE=edge" - # `mod_headers` can't match based on the content-type, however, we only - # want to send this header for HTML pages and not for the other resources - <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$"> - Header unset X-UA-Compatible - </FilesMatch> -</IfModule> - -# ------------------------------------------------------------------------------ -# | Cookie setting from iframes | -# ------------------------------------------------------------------------------ - -# Allow cookies to be set from iframes in IE. - -# <IfModule mod_headers.c> -# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"" -# </IfModule> - -# ------------------------------------------------------------------------------ -# | Screen flicker | -# ------------------------------------------------------------------------------ - -# Stop screen flicker in IE on CSS rollovers (this only works in -# combination with the `ExpiresByType` directives for images from below). - -# BrowserMatch "MSIE" brokenvary=1 -# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1 -# BrowserMatch "Opera" !brokenvary -# SetEnvIf brokenvary 1 force-no-vary - - -# ############################################################################## -# # MIME TYPES AND ENCODING # -# ############################################################################## - -# ------------------------------------------------------------------------------ -# | Proper MIME types for all files | -# ------------------------------------------------------------------------------ - -<IfModule mod_mime.c> - - # Audio - AddType audio/mp4 m4a f4a f4b - AddType audio/ogg oga ogg - - # JavaScript - # Normalize to standard type (it's sniffed in IE anyways): - # http://tools.ietf.org/html/rfc4329#section-7.2 - AddType application/javascript js jsonp - AddType application/json json - - # Video - AddType video/mp4 mp4 m4v f4v f4p - AddType video/ogg ogv - AddType video/webm webm - AddType video/x-flv flv - - # Web fonts - AddType application/font-woff woff - AddType application/vnd.ms-fontobject eot - - # Browsers usually ignore the font MIME types and sniff the content, - # however, Chrome shows a warning if other MIME types are used for the - # following fonts. - AddType application/x-font-ttf ttc ttf - AddType font/opentype otf - - # Make SVGZ fonts work on iPad: - # https://twitter.com/FontSquirrel/status/14855840545 - AddType image/svg+xml svg svgz - AddEncoding gzip svgz - - # Other - AddType application/octet-stream safariextz - AddType application/x-chrome-extension crx - AddType application/x-opera-extension oex - AddType application/x-shockwave-flash swf - AddType application/x-web-app-manifest+json webapp - AddType application/x-xpinstall xpi - AddType application/xml atom rdf rss xml - AddType image/webp webp - AddType image/x-icon ico - AddType text/cache-manifest appcache manifest - AddType text/vtt vtt - AddType text/x-component htc - AddType text/x-vcard vcf - -</IfModule> - -# ------------------------------------------------------------------------------ -# | UTF-8 encoding | -# ------------------------------------------------------------------------------ - -# Use UTF-8 encoding for anything served as `text/html` or `text/plain`. -AddDefaultCharset utf-8 - -# Force UTF-8 for certain file formats. -<IfModule mod_mime.c> - AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml -</IfModule> - - -# ############################################################################## -# # URL REWRITES # -# ############################################################################## - -# ------------------------------------------------------------------------------ -# | Rewrite engine | -# ------------------------------------------------------------------------------ - -# Turning on the rewrite engine and enabling the `FollowSymLinks` option is -# necessary for the following directives to work. - -# If your web host doesn't allow the `FollowSymlinks` option, you may need to -# comment it out and use `Options +SymLinksIfOwnerMatch` but, be aware of the -# performance impact: http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks - -# Also, some cloud hosting services require `RewriteBase` to be set: -# http://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-mod-rewrite-not-working-on-my-site - -<IfModule mod_rewrite.c> - Options +FollowSymlinks - # Options +SymLinksIfOwnerMatch - RewriteEngine On - # RewriteBase / -</IfModule> - -# ------------------------------------------------------------------------------ -# | Suppressing / Forcing the "www." at the beginning of URLs | -# ------------------------------------------------------------------------------ - -# The same content should never be available under two different URLs especially -# not with and without "www." at the beginning. This can cause SEO problems -# (duplicate content), therefore, you should choose one of the alternatives and -# redirect the other one. - -# By default option 1 (no "www.") is activated: -# http://no-www.org/faq.php?q=class_b - -# If you'd prefer to use option 2, just comment out all the lines from option 1 -# and uncomment the ones from option 2. - -# IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME! - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Option 1: rewrite www.example.com â example.com - -<IfModule mod_rewrite.c> - RewriteCond %{HTTPS} !=on - RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] - RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] -</IfModule> - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Option 2: rewrite example.com â www.example.com - -# Be aware that the following might not be a good idea if you use "real" -# subdomains for certain parts of your website. - -# <IfModule mod_rewrite.c> -# RewriteCond %{HTTPS} !=on -# RewriteCond %{HTTP_HOST} !^www\..+$ [NC] -# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] -# </IfModule> - - -# ############################################################################## -# # SECURITY # -# ############################################################################## - -# ------------------------------------------------------------------------------ -# | Content Security Policy (CSP) | -# ------------------------------------------------------------------------------ - -# You can mitigate the risk of cross-site scripting and other content-injection -# attacks by setting a Content Security Policy which whitelists trusted sources -# of content for your site. - -# The example header below allows ONLY scripts that are loaded from the current -# site's origin (no inline scripts, no CDN, etc). This almost certainly won't -# work as-is for your site! - -# To get all the details you'll need to craft a reasonable policy for your site, -# read: http://html5rocks.com/en/tutorials/security/content-security-policy (or -# see the specification: http://w3.org/TR/CSP). - -# <IfModule mod_headers.c> -# Header set Content-Security-Policy "script-src 'self'; object-src 'self'" -# <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$"> -# Header unset Content-Security-Policy -# </FilesMatch> -# </IfModule> - -# ------------------------------------------------------------------------------ -# | File access | -# ------------------------------------------------------------------------------ - -# Block access to directories without a default document. -# Usually you should leave this uncommented because you shouldn't allow anyone -# to surf through every directory on your server (which may includes rather -# private places like the CMS's directories). - -<IfModule mod_autoindex.c> - Options -Indexes -</IfModule> - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Block access to hidden files and directories. -# This includes directories used by version control systems such as Git and SVN. - -<IfModule mod_rewrite.c> - RewriteCond %{SCRIPT_FILENAME} -d [OR] - RewriteCond %{SCRIPT_FILENAME} -f - RewriteRule "(^|/)\." - [F] -</IfModule> - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Block access to backup and source files. -# These files may be left by some text editors and can pose a great security -# danger when anyone has access to them. - -<FilesMatch "(^#.*#|\.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|sw[op])|~)$"> - Order allow,deny - Deny from all - Satisfy All -</FilesMatch> - -# ------------------------------------------------------------------------------ -# | Secure Sockets Layer (SSL) | -# ------------------------------------------------------------------------------ - -# Rewrite secure requests properly to prevent SSL certificate warnings, e.g.: -# prevent `https://www.example.com` when your certificate only allows -# `https://secure.example.com`. - -# <IfModule mod_rewrite.c> -# RewriteCond %{SERVER_PORT} !^443 -# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L] -# </IfModule> - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Force client-side SSL redirection. - -# If a user types "example.com" in his browser, the above rule will redirect him -# to the secure version of the site. That still leaves a window of opportunity -# (the initial HTTP connection) for an attacker to downgrade or redirect the -# request. The following header ensures that browser will ONLY connect to your -# server via HTTPS, regardless of what the users type in the address bar. -# http://www.html5rocks.com/en/tutorials/security/transport-layer-security/ - -# <IfModule mod_headers.c> -# Header set Strict-Transport-Security max-age=16070400; -# </IfModule> - -# ------------------------------------------------------------------------------ -# | Server software information | -# ------------------------------------------------------------------------------ - -# Avoid displaying the exact Apache version number, the description of the -# generic OS-type and the information about Apache's compiled-in modules. - -# ADD THIS DIRECTIVE IN THE `httpd.conf` AS IT WILL NOT WORK IN THE `.htaccess`! - -# ServerTokens Prod - - -# ############################################################################## -# # WEB PERFORMANCE # -# ############################################################################## - -# ------------------------------------------------------------------------------ -# | Compression | -# ------------------------------------------------------------------------------ - -<IfModule mod_deflate.c> - - # Force compression for mangled headers. - # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping - <IfModule mod_setenvif.c> - <IfModule mod_headers.c> - SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding - RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding - </IfModule> - </IfModule> - - # Compress all output labeled with one of the following MIME-types - # (for Apache versions below 2.3.7, you don't need to enable `mod_filter` - # and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines - # as `AddOutputFilterByType` is still in the core directives). - <IfModule mod_filter.c> - AddOutputFilterByType DEFLATE application/atom+xml \ - application/javascript \ - application/json \ - application/rss+xml \ - application/vnd.ms-fontobject \ - application/x-font-ttf \ - application/x-web-app-manifest+json \ - application/xhtml+xml \ - application/xml \ - font/opentype \ - image/svg+xml \ - image/x-icon \ - text/css \ - text/html \ - text/plain \ - text/x-component \ - text/xml - </IfModule> - -</IfModule> - -# ------------------------------------------------------------------------------ -# | Content transformations | -# ------------------------------------------------------------------------------ - -# Prevent some of the mobile network providers from modifying the content of -# your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5. - -# <IfModule mod_headers.c> -# Header set Cache-Control "no-transform" -# </IfModule> - -# ------------------------------------------------------------------------------ -# | ETag removal | -# ------------------------------------------------------------------------------ - -# Since we're sending far-future expires headers (see below), ETags can -# be removed: http://developer.yahoo.com/performance/rules.html#etags. - -# `FileETag None` is not enough for every server. -<IfModule mod_headers.c> - Header unset ETag -</IfModule> - -FileETag None - -# ------------------------------------------------------------------------------ -# | Expires headers (for better cache control) | -# ------------------------------------------------------------------------------ - -# The following expires headers are set pretty far in the future. If you don't -# control versioning with filename-based cache busting, consider lowering the -# cache time for resources like CSS and JS to something like 1 week. - -<IfModule mod_expires.c> - - ExpiresActive on - ExpiresDefault "access plus 1 month" - - # CSS - ExpiresByType text/css "access plus 1 year" - - # Data interchange - ExpiresByType application/json "access plus 0 seconds" - ExpiresByType application/xml "access plus 0 seconds" - ExpiresByType text/xml "access plus 0 seconds" - - # Favicon (cannot be renamed!) - ExpiresByType image/x-icon "access plus 1 week" - - # HTML components (HTCs) - ExpiresByType text/x-component "access plus 1 month" - - # HTML - ExpiresByType text/html "access plus 0 seconds" - - # JavaScript - ExpiresByType application/javascript "access plus 1 year" - - # Manifest files - ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" - ExpiresByType text/cache-manifest "access plus 0 seconds" - - # Media - ExpiresByType audio/ogg "access plus 1 month" - ExpiresByType image/gif "access plus 1 month" - ExpiresByType image/jpeg "access plus 1 month" - ExpiresByType image/png "access plus 1 month" - ExpiresByType video/mp4 "access plus 1 month" - ExpiresByType video/ogg "access plus 1 month" - ExpiresByType video/webm "access plus 1 month" - - # Web feeds - ExpiresByType application/atom+xml "access plus 1 hour" - ExpiresByType application/rss+xml "access plus 1 hour" - - # Web fonts - ExpiresByType application/font-woff "access plus 1 month" - ExpiresByType application/vnd.ms-fontobject "access plus 1 month" - ExpiresByType application/x-font-ttf "access plus 1 month" - ExpiresByType font/opentype "access plus 1 month" - ExpiresByType image/svg+xml "access plus 1 month" - -</IfModule> - -# ------------------------------------------------------------------------------ -# | Filename-based cache busting | -# ------------------------------------------------------------------------------ - -# If you're not using a build process to manage your filename version revving, -# you might want to consider enabling the following directives to route all -# requests such as `/css/style.12345.css` to `/css/style.css`. - -# To understand why this is important and a better idea than `*.css?v231`, read: -# http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring - -# <IfModule mod_rewrite.c> -# RewriteCond %{REQUEST_FILENAME} !-f -# RewriteCond %{REQUEST_FILENAME} !-d -# RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] -# </IfModule> - -# ------------------------------------------------------------------------------ -# | File concatenation | -# ------------------------------------------------------------------------------ - -# Allow concatenation from within specific CSS and JS files, e.g.: -# Inside of `script.combined.js` you could have -# <!--#include file="libs/jquery.js" --> -# <!--#include file="plugins/jquery.idletimer.js" --> -# and they would be included into this single file. - -# <IfModule mod_include.c> -# <FilesMatch "\.combined\.js$"> -# Options +Includes -# AddOutputFilterByType INCLUDES application/javascript application/json -# SetOutputFilter INCLUDES -# </FilesMatch> -# <FilesMatch "\.combined\.css$"> -# Options +Includes -# AddOutputFilterByType INCLUDES text/css -# SetOutputFilter INCLUDES -# </FilesMatch> -# </IfModule> - -# ------------------------------------------------------------------------------ -# | Persistent connections | -# ------------------------------------------------------------------------------ - -# Allow multiple requests to be sent over the same TCP connection: -# http://httpd.apache.org/docs/current/en/mod/core.html#keepalive. - -# Enable if you serve a lot of static content but, be aware of the -# possible disadvantages! - -# <IfModule mod_headers.c> -# Header set Connection Keep-Alive -# </IfModule> http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/404.html ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/404.html b/ocw-ui/frontend-new/app/404.html deleted file mode 100644 index b530975..0000000 --- a/ocw-ui/frontend-new/app/404.html +++ /dev/null @@ -1,175 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. ---> -<!DOCTYPE html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <title>Page Not Found :(</title> - <style> - ::-moz-selection { - background: #b3d4fc; - text-shadow: none; - } - - ::selection { - background: #b3d4fc; - text-shadow: none; - } - - html { - padding: 30px 10px; - font-size: 20px; - line-height: 1.4; - color: #737373; - background: #f0f0f0; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; - } - - html, - input { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - } - - body { - max-width: 500px; - _width: 500px; - padding: 30px 20px 50px; - border: 1px solid #b3b3b3; - border-radius: 4px; - margin: 0 auto; - box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff; - background: #fcfcfc; - } - - h1 { - margin: 0 10px; - font-size: 50px; - text-align: center; - } - - h1 span { - color: #bbb; - } - - h3 { - margin: 1.5em 0 0.5em; - } - - p { - margin: 1em 0; - } - - ul { - padding: 0 0 0 40px; - margin: 1em 0; - } - - .container { - max-width: 380px; - _width: 380px; - margin: 0 auto; - } - - /* google search */ - - #goog-fixurl ul { - list-style: none; - padding: 0; - margin: 0; - } - - #goog-fixurl form { - margin: 0; - } - - #goog-wm-qt, - #goog-wm-sb { - border: 1px solid #bbb; - font-size: 16px; - line-height: normal; - vertical-align: top; - color: #444; - border-radius: 2px; - } - - #goog-wm-qt { - width: 220px; - height: 20px; - padding: 5px; - margin: 5px 10px 0 0; - box-shadow: inset 0 1px 1px #ccc; - } - - #goog-wm-sb { - display: inline-block; - height: 32px; - padding: 0 10px; - margin: 5px 0 0; - white-space: nowrap; - cursor: pointer; - background-color: #f5f5f5; - background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1); - background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1); - background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1); - background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1); - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - *overflow: visible; - *display: inline; - *zoom: 1; - } - - #goog-wm-sb:hover, - #goog-wm-sb:focus { - border-color: #aaa; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); - background-color: #f8f8f8; - } - - #goog-wm-qt:hover, - #goog-wm-qt:focus { - border-color: #105cb6; - outline: 0; - color: #222; - } - - input::-moz-focus-inner { - padding: 0; - border: 0; - } - </style> - </head> - <body> - <div class="container"> - <h1>Not found <span>:(</span></h1> - <p>Sorry, but the page you were trying to view does not exist.</p> - <p>It looks like this was the result of either:</p> - <ul> - <li>a mistyped address</li> - <li>an out-of-date link</li> - </ul> - <script> - var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host; - </script> - <script src="//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script> - </div> - </body> -</html> http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/favicon.ico ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/favicon.ico b/ocw-ui/frontend-new/app/favicon.ico deleted file mode 100644 index 6527905..0000000 Binary files a/ocw-ui/frontend-new/app/favicon.ico and /dev/null differ http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/index.html ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/index.html b/ocw-ui/frontend-new/app/index.html deleted file mode 100644 index 01a6e89..0000000 --- a/ocw-ui/frontend-new/app/index.html +++ /dev/null @@ -1,148 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you 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. ---> - -<!doctype html> -<html class="no-js"> - <head> - <meta charset="utf-8"> - <title></title> - <meta name="description" content=""> - <meta name="viewport" content="width=device-width"> - <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> - <!-- build:css(.) styles/vendor.css --> - <!-- bower:css --> - <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" /> - <link rel="stylesheet" href="bower_components/leaflet/dist/leaflet.css" /> - <link rel="stylesheet" href="bower_components/chap-links-timeline/timeline.css" /> - <link rel="stylesheet" href="bower_components/components-font-awesome/css/font-awesome.css" /> - <!-- endbower --> - <!-- endbuild --> - <!-- build:css(.tmp) styles/main.css --> - <link rel="stylesheet" href="styles/main.css"> - <!-- endbuild --> - <link rel="stylesheet" href="bower_components/jquery-ui/themes/smoothness/jquery-ui.css" /> - </head> - <body ng-app="ocwUiApp"> - <!--[if lt IE 7]> - <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> - <![endif]--> - - <div class="container"> - <div class="row"> - <div class="navbar navbar-default" id="ocw-navbar" role="navigation"> - <div class="container"> - <div class="navbar-header"> - <a class="navbar-brand brand" href="#">OCW UI</a> - </div> - <div class="navbar-collapse"> - <ul class="nav navbar-nav"> - <li ng-class="{ active: $state.includes('main') }"><a href="#/evalute">Evaluate</a></li> - <li ng-class="{ active: $state.includes('results') }"><a href="#/results">Results</a></li> - </ul> - </div> - </div> - </div> - <div class="row"> - <div class="col-md-12"> - <div id="header"> - <img id="header-img" src=""/> - <h3 id="header-title">Project Name</h3> - <h5 id="OCW-powered">Powered by Apache Open Climate Workbench</h5> - </div> - </div> - </div> - </div> - <!-- Main Content --> - <div id="main-container" class="container" ui-view></div> - </div> - - <!-- Google Analytics: change UA-XXXXX-X to be your site's ID --> - <script> - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - ga('create', 'UA-XXXXX-X'); - ga('send', 'pageview'); - </script> - - <!-- build:js(.) scripts/oldieshim.js --> - <!--[if lt IE 9]> - <script src="bower_components/es5-shim/es5-shim.js"></script> - <script src="bower_components/json3/lib/json3.min.js"></script> - <![endif]--> - <!-- endbuild --> - - <!-- Google visualization library needs to be initialized for the timeline --> - <!-- Note that the terms of use forbid having a local copy of the code, so we're --> - <!-- stuck downloading it this way unfortunately. --> - <script type="text/javascript" src="http://www.google.com/jsapi"></script> - <script type="text/javascript">google.load("visualization", "1");</script> - - <!-- build:js(.) scripts/vendor.js --> - <!-- bower:js --> - <script src="bower_components/jquery/dist/jquery.js"></script> - <script src="bower_components/angular/angular.js"></script> - <script src="bower_components/json3/lib/json3.js"></script> - <script src="bower_components/bootstrap/dist/js/bootstrap.js"></script> - <script src="bower_components/angular-resource/angular-resource.js"></script> - <script src="bower_components/angular-cookies/angular-cookies.js"></script> - <script src="bower_components/angular-animate/angular-animate.js"></script> - <script src="bower_components/angular-route/angular-route.js"></script> - <script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script> - <script src="bower_components/leaflet/dist/leaflet.js"></script> - <script src="bower_components/leaflet/dist/leaflet-src.js"></script> - <script src="bower_components/chap-links-timeline/timeline-min.js"></script> - <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script> - <script src="bower_components/jquery-ui/jquery-ui.js"></script> - <script src="bower_components/angular-ui-date/ui-date.js"></script> - <!-- endbower --> - <!-- endbuild --> - - <!-- build:js({.tmp,app}) scripts/scripts.js --> - <script src="scripts/app.js"></script> - <script src="scripts/controllers/main.js"></script> - <script src="scripts/controllers/about.js"></script> - <script src="scripts/controllers/datasetdisplay.js"></script> - <script src="scripts/controllers/datasetselect.js"></script> - <script src="scripts/controllers/observationselect.js"></script> - <script src="scripts/controllers/parameterselect.js"></script> - <script src="scripts/controllers/rcmedselection.js"></script> - <script src="scripts/controllers/result.js"></script> - <script src="scripts/controllers/resultdetail.js"></script> - <script src="scripts/controllers/settings.js"></script> - <script src="scripts/controllers/timeline.js"></script> - <script src="scripts/controllers/worldmap.js"></script> - <script src="scripts/directives/bootstrapmodal.js"></script> - <script src="scripts/directives/bootstrapmodalopen.js"></script> - <script src="scripts/directives/leafletmap.js"></script> - <script src="scripts/directives/onblur.js"></script> - <script src="scripts/directives/predictivefilebrowserinput.js"></script> - <script src="scripts/directives/previewmap.js"></script> - <script src="scripts/directives/timeline.js"></script> - <script src="scripts/filters/isodatetomiddleendian.js"></script> - <script src="scripts/services/evaluationsettings.js"></script> - <script src="scripts/services/regionselectparams.js"></script> - <script src="scripts/services/selecteddatasetinformation.js"></script> - <!-- endbuild --> - - <!-- grunt wiredep wasn't properly linking this. Had to add manually --> - <script src="bower_components/angular-ui-date/src/date.js"></script> - </body> -</html> http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/robots.txt ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/robots.txt b/ocw-ui/frontend-new/app/robots.txt deleted file mode 100644 index 9417495..0000000 --- a/ocw-ui/frontend-new/app/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# robotstxt.org - -User-agent: * http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/scripts/app.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/scripts/app.js b/ocw-ui/frontend-new/app/scripts/app.js deleted file mode 100644 index 8dca2dc..0000000 --- a/ocw-ui/frontend-new/app/scripts/app.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -'use strict'; - -/** - * @ngdoc overview - * @name ocwUiApp - * @description - * # ocwUiApp - * - * Main module of the application. - */ -angular - .module('ocwUiApp', [ - 'ngAnimate', - 'ngCookies', - 'ngResource', - 'ngRoute', - 'ui.router', - 'ui.bootstrap', - 'ui.date', - ]) - .config(['$stateProvider', '$routeProvider', '$urlRouterProvider', - function ($stateProvider, $routeProvider, $urlRouterProvider) { - $urlRouterProvider - .when('/r?id', '/results/:id') - .otherwise('/evaluate'); - - $routeProvider - .when('/evaluation/:id', { - redirectTo: '/results/:id', - }) - .when('/', { - redirectTo: '/evaluate', - }); - - $stateProvider - .state('main',{ - url: '/evaluate', - templateUrl: 'views/main.html', - }) - .state('results', { - url: '/results', - abstract: true, - templateUrl: 'views/results.html', - controller: 'ResultCtrl' - }) - .state('results.list', { - // parent: 'results', - url: '', - templateUrl: 'views/resultslist.html', - }) - .state('results.detail', { - // parent: 'results', - url: '/{resultId}', - views: { - '': { - templateUrl: 'views/resultsdetail.html', - controller: 'ResultDetailCtrl' - }, - 'menu': { - templateProvider: - [ '$stateParams', - function ($stateParams){ - return '<hr><small class="muted">result ID: ' + $stateParams.resultId + '</small>'; - }], - }, - }, - }); - }]) - .run(['$rootScope', '$state', '$stateParams', - function ($rootScope, $state, $stateParams) { - $rootScope.$state = $state; - $rootScope.$stateParams = $stateParams; - $rootScope.evalResults = ''; - $rootScope.fillColors = ['#ff0000', '#00c90d', '#cd0074', '#f3fd00']; - $rootScope.surroundColors = ['#a60000', '#008209', '#8f004b', '#93a400']; - $rootScope.baseURL = 'http://localhost:8082'; - }]); http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/scripts/controllers/datasetdisplay.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/scripts/controllers/datasetdisplay.js b/ocw-ui/frontend-new/app/scripts/controllers/datasetdisplay.js deleted file mode 100644 index f7d2a77..0000000 --- a/ocw-ui/frontend-new/app/scripts/controllers/datasetdisplay.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -'use strict'; - -/** - * @ngdoc function - * @name ocwUiApp.controller:DatasetDisplayCtrl - * @description - * # DatasetDisplayCtrl - * Controller of the ocwUiApp - */ -angular.module('ocwUiApp') - .controller('DatasetDisplayCtrl', ['$rootScope', '$scope', 'selectedDatasetInformation', - function($rootScope, $scope, selectedDatasetInformation) { - $scope.datasets = selectedDatasetInformation.getDatasets(); - - $scope.removeDataset = function($index) { - selectedDatasetInformation.removeDataset($index); - }; - - $scope.setRegridBase = function(index) { - for (var i = 0; i < $scope.datasets.length; i++) { - $scope.datasets[i].regrid = ((i === index) ? $scope.datasets[i].regrid : false); - } - }; -}]); http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/scripts/controllers/datasetselect.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/scripts/controllers/datasetselect.js b/ocw-ui/frontend-new/app/scripts/controllers/datasetselect.js deleted file mode 100644 index b6b52ef..0000000 --- a/ocw-ui/frontend-new/app/scripts/controllers/datasetselect.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -'use strict'; - -/** - * @ngdoc function - * @name ocwUiApp.controller:DatasetSelectCtrl - * @description - * # DatasetSelectCtrl - * Controller of the ocwUiApp - */ -angular.module('ocwUiApp') - .controller('DatasetSelectCtrl', ['$scope', 'selectedDatasetInformation', - function($scope, selectedDatasetInformation) { - // Grab a copy of the datasets so we can display a count to the user! - $scope.datasetCount = selectedDatasetInformation.getDatasets(); - - $scope.shouldDisableClearButton = function() { - return (selectedDatasetInformation.getDatasetCount() === 0); - }; - - $scope.clearDatasets = function() { - selectedDatasetInformation.clearDatasets(); - }; - - $scope.open = function () { - $scope.datasetSelect = true; - }; - - $scope.close = function () { - $scope.datasetSelect = false; - }; - - $scope.opts = { - backdropFade: true, - dialogFade: true, - }; - - $scope.templates = [ - {title:'Local File', url: 'views/selectobservation.html'}, - {title:'RCMED', url: 'views/selectrcmed.html'}, - {title:'ESG', disabled: true} - ]; - - $scope.template = $scope.templates[0]; - } - ]); http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/scripts/controllers/main.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/scripts/controllers/main.js b/ocw-ui/frontend-new/app/scripts/controllers/main.js deleted file mode 100644 index 16008c0..0000000 --- a/ocw-ui/frontend-new/app/scripts/controllers/main.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -'use strict'; - -/** - * @ngdoc function - * @name ocwUiApp.controller:MainCtrl - * @description - * # MainCtrl - * Controller of the ocwUiApp - */ -angular.module('ocwUiApp') - .controller('MainCtrl', function ($scope) { - $scope.awesomeThings = [ - 'HTML5 Boilerplate', - 'AngularJS', - 'Karma' - ]; - }); http://git-wip-us.apache.org/repos/asf/climate/blob/652ea657/ocw-ui/frontend-new/app/scripts/controllers/observationselect.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend-new/app/scripts/controllers/observationselect.js b/ocw-ui/frontend-new/app/scripts/controllers/observationselect.js deleted file mode 100644 index 6dfbb57..0000000 --- a/ocw-ui/frontend-new/app/scripts/controllers/observationselect.js +++ /dev/null @@ -1,203 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -'use strict'; - -/** - * @ngdoc function - * @name ocwUiApp.controller:ObservationSelectCtrl - * @description - * # ObservationSelectCtrl - * Controller of the ocwUiApp - */ -angular.module('ocwUiApp') - .controller('ObservationSelectCtrl', ['$rootScope', '$scope', '$http', '$q', '$timeout', 'selectedDatasetInformation', - function($rootScope, $scope, $http, $q, $timeout, selectedDatasetInformation) { - // Grab a copy of the datasets so we can display a count to the user! - $scope.datasetCount = selectedDatasetInformation.getDatasets(); - - // Initalize the option arrays and default to the first element - $scope.params = ['Please select a file above']; - $scope.paramSelect = $scope.params[0]; - $scope.lats = ['Please select a file above']; - $scope.latsSelect = $scope.lats[0]; - $scope.lons = ['Please select a file above']; - $scope.lonsSelect = $scope.lons[0]; - $scope.times = ['Please select a file above']; - $scope.timeSelect = $scope.times[0]; - - // Grab the path leader information that the webserver is using to limit directory access. - $scope.pathLeader = false; - $http.jsonp($rootScope.baseURL + '/dir/path_leader/?callback=JSON_CALLBACK'). - success(function(data) { - $scope.pathLeader = data.leader; - }); - - // Toggle load button view depending on upload state of selected files - $scope.loadingFile = false; - - // Toggle display of a confirmation when loading a dataset - $scope.fileAdded = false; - - $scope.latLonVals = []; - $scope.timeVals = []; - $scope.localSelectForm = {}; - - $scope.uploadLocalFile = function() { - $scope.loadingFile = true; - - // TODO: Need to try to validate the input a bit. At least make sure we're not - // pointing at a directory perhaps? - - // TODO: Two-way binding with ng-model isn't being used here because it fails to update - // properly with the auto-complete that we're using on the input box. So we're doing - // it the wrong way temporarily... - var input = $('#observationFileInput').val(); - - // If the backend is limiting directory access we need to add that leader to our path - // so it remains valid! - if ($scope.pathLeader) { - input = $scope.pathLeader + input - } - - // TODO: We're not really handling the case where there is a failure here at all. - // Should check for fails and allow the user to make changes. - // - // Get model variables - var varsPromise = $http.jsonp($rootScope.baseURL + '/lfme/list_vars/' + input + '?callback=JSON_CALLBACK'); - // Get Lat and Lon variables - var latlonPromise = $http.jsonp($rootScope.baseURL + '/lfme/list_latlon/' + input + '?callback=JSON_CALLBACK'); - // Get Time variables - var timesPromise = $http.jsonp($rootScope.baseURL + '/lfme/list_time/' + input + '?callback=JSON_CALLBACK'); - - $q.all([varsPromise, latlonPromise, timesPromise]).then( - // Handle success fetches! - function(arrayOfResults) { - $scope.loadingFile = false; - - // Handle lat/lon results - var data = arrayOfResults[1].data; - $scope.lats = [data.lat_name]; - $scope.lons = [data.lon_name]; - $scope.latLonVals = [data.lat_min, data.lat_max, data.lon_min, data.lon_max]; - - // If there is more than one option for the user, tell them they need to pick one! - if ($scope.lats.length > 1) $scope.lats.splice(0, 0, 'Please select an option'); - if ($scope.lons.length > 1) $scope.lons.splice(0, 0, 'Please select an option'); - // Default the display to the first available option. - $scope.latsSelect = $scope.lats[0]; - $scope.lonsSelect = $scope.lons[0]; - - // Handle time results - var data = arrayOfResults[2].data - $scope.times = [data.time_name]; - $scope.timeVals = [data.start_time, data.end_time]; - - if ($scope.times.length > 1) $scope.times.splice(0, 0, 'Please select an option'); - $scope.timeSelect = $scope.times[0]; - - // Handle parameter results - var data = arrayOfResults[0].data.variables; - $scope.params = (data instanceof Array) ? data : [data]; - $scope.params = $.grep($scope.params, - function(val) { - return ($.inArray(val, $scope.lats) != 0 && - $.inArray(val, $scope.lons) != 0 && - $.inArray(val, $scope.times) != 0); - }); - - if ($scope.params.length > 1) $scope.params.splice(0, 0, 'Please select an option'); - $scope.paramSelect = $scope.params[0]; - }, - // Uh oh! AT LEAST on of our fetches failed - function(arrayOfFailure) { - $scope.loadingFile = false; - - $scope.params = ['Unable to load variable(s)']; - $scope.paramSelect = $scope.params[0]; - $scope.lats = ['Unable to load variable(s)']; - $scope.latsSelect = $scope.lats[0]; - $scope.lons = ['Unable to load variable(s)']; - $scope.lonsSelect = $scope.lons[0]; - $scope.times = ['Unable to load variable(s)']; - $scope.timeSelect = $scope.times[0]; - } - ); - }; - - $scope.addDataSet = function() { - // TODO: Need to verify that all the variables selected are correct!!! - // TODO: We shouldn't allow different parameters to match the same variables!! - - var newDataset = {}; - var input = $('#observationFileInput').val(); - - // If the backend is limiting directory access we need to add that leader to our path - // so it remains valid! - if ($scope.pathLeader != 'False') { - input = $scope.pathLeader + input - } - - newDataset['isObs'] = 0; - // Save the model path. Note that the path is effectively the "id" for the model. - newDataset['id'] = input; - // Grab the file name later for display purposes. - var splitFilePath = input.split('/'); - newDataset['name'] = splitFilePath[splitFilePath.length - 1]; - // Save the model parameter variable. We save it twice for consistency and display convenience. - newDataset['param'] = $scope.paramSelect; - newDataset['paramName'] = newDataset['param']; - // Save the lat/lon information - newDataset['lat'] = $scope.latsSelect; - newDataset['lon'] = $scope.lonsSelect; - - newDataset['latlonVals'] = {'latMin': $scope.latLonVals[0], 'latMax': $scope.latLonVals[1], - 'lonMin': $scope.latLonVals[2], 'lonMax': $scope.latLonVals[3]}; - // Get the time information - newDataset['time'] = $scope.timeSelect; - newDataset['timeVals'] = {'start': $scope.timeVals[0], 'end': $scope.timeVals[1]}; - - selectedDatasetInformation.addDataset(newDataset); - - // Reset all the fields!! - $scope.params = ['Please select a file above']; - $scope.paramSelect = $scope.params[0]; - $scope.lats = ['Please select a file above']; - $scope.latsSelect = $scope.lats[0]; - $scope.lons = ['Please select a file above']; - $scope.lonsSelect = $scope.lons[0]; - $scope.times = ['Please select a file above']; - $scope.timeSelect = $scope.times[0]; - $scope.latLonVals = []; - $scope.timeVals = []; - - // Clear the input box - $('#observationFileInput').val(''); - - // Display a confirmation message for a little bit - $scope.fileAdded = true; - $timeout(function() { - $scope.fileAdded = false; - }, 2000); - } - - $scope.shouldDisableLoadButton = function() { - return $scope.loadingFile; - } - }]);
