diff --git a/.gitignore b/.gitignore index b1510c86..01686e0e 100755 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ app/js/templates.js build/ .tmp/ app/css/ +Gruntfile.js diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..2e96eb65 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,54 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [0.1.1] - 2017-10-12 + +### Added +- Build instructions +- Hide some controls on small screens (https://github.com/GIScience/openrouteservice-app/issues/169) +- Reduce HeiGIT on small screens (https://github.com/GIScience/openrouteservice-app/issues/170) +- Update angularjs-slider layout automatically with grunt (https://github.com/GIScience/openrouteservice-app/issues/172) +- Directly focus geocoding input field (https://github.com/GIScience/openrouteservice-app/issues/163) +- Gruntfile.js: using load-grunt-tasks (https://github.com/GIScience/openrouteservice-app/issues/173) + + +### Fixed +- What's Here Popup only shows coordinates (https://github.com/GIScience/openrouteservice-app/issues/176) +- Isochrones always using 'distance' method (https://github.com/GIScience/openrouteservice-app/issues/168) +- Share link not reproducing same Isochrones (https://github.com/GIScience/openrouteservice-app/issues/164) +- Sending geocoding requests for empty geocoding query (https://github.com/GIScience/openrouteservice-app/issues/167) + +## [0.1.0] - 2017-12-06 + +### Added +- Semantic Versioning (https://github.com/GIScience/openrouteservice-app/issues/165) +- loading Mapstyle from Cookies (https://github.com/GIScience/openrouteservice-app/issues/150) + +### Fixed +- hiding wrong Isochrones (https://github.com/GIScience/openrouteservice-app/issues/160) + + diff --git a/Gruntfile.js b/Gruntfile.default.js old mode 100755 new mode 100644 similarity index 52% rename from Gruntfile.js rename to Gruntfile.default.js index 62f9fdc6..f4953f4a --- a/Gruntfile.js +++ b/Gruntfile.default.js @@ -1,25 +1,45 @@ module.exports = function(grunt) { require('time-grunt')(grunt); + require('load-grunt-tasks')(grunt, { + pattern: ['grunt-*', '!grunt-cli*'] + }); var modRewrite = require('connect-modrewrite'); grunt.initConfig({ copy: { all: { + expand: true, cwd: 'app', src: ['**'], - dest: 'build', - expand: true + dest: 'build' }, build: { expand: true, cwd: 'app', - dest: 'build', - src: ['img/**/*.png', 'languages/**/*.json', 'css/*.css', '*.html', '*.js', 'favicon.ico'] + src: ['img/**/*.png', 'languages/**/*.json', 'css/*.css', '*.html', '*.js', 'favicon.ico', 'weathercheck.txt'], + dest: 'build' }, libs: { expand: true, cwd: './', - dest: 'build', - src: ['bower_components/font-awesome/**', 'bower_components/leaflet/**', 'bower_components/leaflet.heightgraph/**'] + src: ['bower_components/font-awesome/**', 'bower_components/leaflet/**', 'bower_components/leaflet.heightgraph/**'], + dest: 'build' + }, + // copies the slidervariables into the related bower_component + sliderLess: { + expand: true, + cwd: './', + src: ['app/less/angularjs-slider.variables.less'], + dest: 'bower_components/angularjs-slider/src/', + rename: function(dest) { + return dest + 'variables.less'; + }, + } + }, + // compiles slider less to css + grunt: { + sliderMakeCss: { + gruntfile: 'bower_components/angularjs-slider/Gruntfile.js', + task: 'css' } }, watch: { @@ -27,9 +47,13 @@ module.exports = function(grunt) { livereload: true, }, less: { - files: ['app/less/**/*.less'], + files: ['app/less/**/*.less', '!app/less/angularjs-slider.variables.less'], tasks: ['less:development'] }, + less_sliders: { + files: ['app/less/angularjs-slider.variables.less'], + tasks: ['copy:sliderLess', 'grunt:sliderMakeCss'] + }, js: { files: ['app/**/*.js'] }, @@ -38,10 +62,10 @@ module.exports = function(grunt) { tasks: ['ngtemplates'] } }, - // Clean stuff up + // Clean build folder up clean: { task_rm_build: { - src: ['build/*'] + src: ['build/*', 'build'] }, task_rm_build_unused: { src: ['build/components', 'build/infrastructure', 'build/languages', 'build/js/', 'build/constants', 'build/values', 'build/css'] @@ -87,16 +111,6 @@ module.exports = function(grunt) { html: ['build/index.html'], css: ['build/index.html'] }, - // uglify: { - // build: { - // options: { - // mangle: true - // }, - // files: { - // 'build/application.js': ['build/js/**/*.js', 'build/pages/**/*.js'] - // } - // } - // }, uglify: { options: { preserveComments: 'false', //"some", "all", @@ -140,7 +154,6 @@ module.exports = function(grunt) { files: [{ expand: true, cwd: 'app/', - //src: ['js/**/*.js'], src: ['components/**/*.js', 'constants/**/*.js', 'values/**/*.js', 'infrastructure/**/*.js', 'js/**/*.js'], dest: 'build/' }] @@ -156,7 +169,6 @@ module.exports = function(grunt) { open: true, middleware: function(connect, options, middlewares) { return [ - //modRewrite(['^[^\\.]*$ /index.html [L]']), modRewrite(['!\\.html|\\.js|\\.txt|\\.ico|\\.svg|\\.map|\\.woff2|\\.woff|\\.ttf|\\.css|\\.png$ /index.html [L]']), connect().use('/bower_components', connect.static('./bower_components')), connect().use('/node_modules', connect.static('./node_modules')), @@ -206,22 +218,6 @@ module.exports = function(grunt) { name: 'config', }, // Environment targets - development: { - options: { - dest: 'app/js/config.js' - }, - constants: { - ENV: { - name: 'development', - geocoding: 'http://129.206.7.188:8080/ors/geocode', - routing: 'http://129.206.7.188:8080/ors/routes', - tmc: 'http://129.206.228.188:8080/ors/routes?tmc', - analyse: 'http://129.206.7.188:8080/ors/isochrones', - places: 'http://129.206.7.188:8080/ors/locations', - shortenlink: 'https://api-ssl.bitly.com/v3/shorten' - } - }, - }, local: { options: { dest: 'app/js/config.js' @@ -229,58 +225,26 @@ module.exports = function(grunt) { constants: { ENV: { name: 'local', - geocoding: 'http://localhost:8082/openrouteservice-4.4.0/geocode', - routing: 'http://localhost:8082/openrouteservice-4.4.0/routes', - analyse: 'http://localhost:8082/openrouteservice-4.4.0/isochrones', - places: 'http://localhost:8082/openrouteservice-4.4.0/locations', - shortenlink: 'https://api-ssl.bitly.com/v3/shorten' - } - }, - }, - zugspitze: { - options: { - dest: 'app/js/config.js' - }, - constants: { - ENV: { - name: 'development', - geocoding: 'http://129.206.228.124:8080/ors/geocode', - routing: 'http://129.206.228.124:8080/ors/routes', - tmc: 'http://129.206.228.124:8080/ors/routes?tmc', - analyse: 'http://129.206.228.124:8080/ors/isochrones', - places: 'http://129.206.228.124:8080/ors/locations', + // change name_of_war_archive to the name of the ors backend war version you are using (e.g. openrouteservice-4.4.0) + geocoding: 'http://localhost:8082/name_of_war_archive/geocode', + routing: 'http://localhost:8082/name_of_war_archive/routes', + analyse: 'http://localhost:8082/name_of_war_archive/isochrones', + places: 'http://localhost:8082/name_of_war_archive/locations', shortenlink: 'https://api-ssl.bitly.com/v3/shorten' } }, }, - production: { + ors: { options: { dest: 'app/js/config.js' }, constants: { ENV: { name: 'production', - geocoding: 'https://api.openrouteservice.org/pgeocoding', - routing: 'https://api.openrouteservice.org/pdirections', - tmc: 'http://129.206.228.124/routing-test?tmc', - analyse: 'https://api.openrouteservice.org/pisochrones', - places: 'https://api.openrouteservice.org/pplaces', - shortenlink: 'https://api-ssl.bitly.com/v3/shorten' - } - } - }, - labs: { - options: { - dest: 'app/js/config.js' - }, - constants: { - ENV: { - name: 'labs', - geocoding: 'https://labs-api.openrouteservice.org/ors/geocode', - routing: 'https://labs-api.openrouteservice.org/ors/routes', - tmc: 'http://labs-api.openrouteservice.org/ors/routes?tmc', - analyse: 'https://labs-api.openrouteservice.org/ors/isochrones', - places: 'https://labs-api.openrouteservice.org/ors/locations', + geocoding: 'https://api.openrouteservice.org/geocoding', + routing: 'https://api.openrouteservice.org/directions', + analyse: 'https://api.openrouteservice.org/isochrones', + places: 'https://api.openrouteservice.org/places', shortenlink: 'https://api-ssl.bitly.com/v3/shorten' } } @@ -334,79 +298,8 @@ module.exports = function(grunt) { dest: 'app/js/templates.js' } } - // connect: { - // options: { - // port: 3000,öä - // // 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 [ - // modRewrite(['^[^\\.]*$ /index.html [L]']), - // connect().use('/bower_components', connect.static('./bower_components')), - // connect().use('/node_modules', connect.static('./node_modules')), - // connect.static('./app') - // ]; - // } - // } - // }, - // dist: { - // options: { - // open: true, - // base: './build' - // } - // } - // } - // connect: { - // app: { - // options: { - // port: 3000, - // //base: '/app', - // open: true, - // livereload: true, - // hostname: 'localhost', - // middleware: function(connect) { - // return [ - // modRewrite(['^[^\\.]*$ /index.html [L]']), - // connect().use('/bower_components', connect.static('./bower_components')), - // connect().use('/node_modules', connect.static('./node_modules')), - // connect.static('./app') - // ]; - // } - // } - // } - // } }); - grunt.loadNpmTasks('grunt-cache-bust'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-htmlhint'); - grunt.loadNpmTasks("grunt-contrib-copy"); - grunt.loadNpmTasks("grunt-contrib-concat"); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-cssmin'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-usemin'); - grunt.loadNpmTasks('grunt-preprocess'); - grunt.loadNpmTasks('grunt-jsdoc'); - grunt.loadNpmTasks("grunt-remove-logging"); - grunt.loadNpmTasks('grunt-traceur'); - grunt.loadNpmTasks('grunt-contrib-connect'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-script-link-tags'); - grunt.loadNpmTasks('grunt-browserify'); - grunt.loadNpmTasks('grunt-ng-constant'); - grunt.loadNpmTasks('grunt-strip-debug'); - grunt.loadNpmTasks('grunt-contrib-less'); - grunt.loadNpmTasks('grunt-angular-templates'); - grunt.registerTask('staging', 'Compiles all of the assets and copies the files to the build directory.', ['browserify:turf', 'less:development', 'ngtemplates', 'clean:task_rm_build', 'copy:build', 'ngconstant:development', 'traceur', 'useminPrepare', 'concat', 'copy:libs', 'uglify', 'cssmin', 'usemin', 'preprocess', 'tags', 'clean:task_rm_build_unused', 'stripDebug', 'cacheBust', 'connect:build:keepalive']); - grunt.registerTask('production', 'Compiles all of the assets and copies the files to the build directory.', ['browserify:turf', 'less:development', 'ngtemplates', 'clean:task_rm_build', 'copy:build', 'ngconstant:production', 'traceur', 'useminPrepare', 'concat', 'copy:libs', 'uglify', 'cssmin', 'usemin', 'preprocess', 'tags', 'ngconstant:development', 'clean:task_rm_build_unused', 'stripDebug', 'cacheBust', 'connect:build:keepalive']); - grunt.registerTask('zugspitze', 'Compiles all of the assets and copies the files to the build directory.', ['browserify:turf', 'less:development', 'ngtemplates', 'clean:task_rm_build', 'copy:build', 'ngconstant:zugspitze', 'traceur', 'useminPrepare', 'concat', 'copy:libs', 'uglify', 'cssmin', 'usemin', 'preprocess', 'tags', 'ngconstant:development', 'clean:task_rm_build_unused', 'stripDebug', 'cacheBust', 'connect:build:keepalive']); - grunt.registerTask('serve', 'Run local server', ['less:development', 'browserify:turf', 'ngtemplates', 'ngconstant:development', 'connect:dev', 'watch']); - grunt.registerTask('servelocal', 'Run local server on local tomcat', ['less:development', 'browserify:turf', 'ngtemplates', 'ngconstant:local', 'connect:dev', 'watch']); - grunt.registerTask('labs', 'Compiles all of the assets and copies the files to the build directory.', ['browserify:turf', 'less:development', 'clean:task_rm_build', 'copy:build', 'ngconstant:labs', 'traceur', 'useminPrepare', 'concat', 'copy:libs', 'uglify', 'cssmin', 'usemin', 'preprocess', 'tags', 'ngconstant:labs', 'clean:task_rm_build_unused', 'stripDebug', 'cacheBust', 'connect:build:keepalive']); - grunt.registerTask('local', 'Run local server', ['browserify:turf', 'less:development', 'ngconstant:local', 'connect:dev', 'watch']); -}; \ No newline at end of file + grunt.registerTask('ors', 'Compiles all of the assets and copies the files to the build directory.', ['browserify:turf', 'less:development', 'copy:sliderLess', 'grunt:sliderMakeCss', 'ngtemplates', 'clean:task_rm_build', 'copy:build', 'ngconstant:ors', 'traceur', 'useminPrepare', 'concat', 'copy:libs', 'uglify', 'cssmin', 'usemin', 'preprocess', 'tags', 'clean:task_rm_build_unused', 'stripDebug', 'cacheBust', 'connect:build:keepalive']); + grunt.registerTask('dev', 'Run local server for development purposes', ['less:development', 'copy:sliderLess', 'grunt:sliderMakeCss', 'browserify:turf', 'ngtemplates', 'ngconstant:ors', 'connect:dev', 'watch']); + grunt.registerTask('ors_local', 'Run local ors frontend server on local ors backend tomcat', ['less:development', 'copy:sliderLess', 'grunt:sliderMakeCss', 'browserify:turf', 'ngtemplates', 'ngconstant:local', 'connect:dev', 'watch']); +}; diff --git a/README.md b/README.md index 1ec2d47b..0091fe5e 100755 --- a/README.md +++ b/README.md @@ -4,6 +4,110 @@ Openrouteservice is a online route planning application that is based on open so ![preview](https://cloud.githubusercontent.com/assets/10322094/26202903/63ccd808-3bd9-11e7-9a89-f06ad50d583e.png) +## Installation + +The openrouteservice client requires **nodejs** and a valid **Api-Key** to access the openrouteservice API. Also make sure that **git** is installed. + +- [git](https://git-scm.com/downloads) +- [nodejs](https://nodejs.org/en/download/package-manager/) +- [Api-key](https://go.openrouteservice.org/sign-up/) + +### Permission Issues +If you encounter any [permission issues](https://github.com/npm/npm/issues/18380) during the installation: + +- *on Linux:* try running npm-commands with `sudo` : + +e.g.: +```sh +sudo npm install +``` +- *on Windows([GitBash](https://gitforwindows.org/) recommended):* try running npm-commands with the `--no-optional` flag: + +e.g.: +```sh +npm install --no-optional +``` + +### Step by Step instructions + +- Download openrouteservice repository: +```sh +# clone repository from github +git clone https://github.com/GIScience/openrouteservice-app.git + +# switch to repository folder +cd openrouteservice-app +``` + +- Install dependencies: +```sh +# install all modules listed as dependencies in package.json +npm install + +# install dependencies listed in bower.json +node_modules/bower/bin/bower install +``` + +- Install required modules for slider layout: + +*(This step is for layout purposes only. If you want to skip it remove `grunt:sliderMakeCss` from the task queue in the renamed `Gruntfile.js` [see next step])* +```sh +# Switch to bower_components/angular folder: +cd bower_components/angularjs-slider + +# install all modules listed as dependencies in package.json +npm install + +# switch back to openrouteservice-app folder: +cd ../.. +``` + +- Initiate default files: +```sh +# Copy `Gruntfile.default.js` to `Gruntfile.js` +cp Gruntfile.default.js Gruntfile.js + +# Copy `weathercheck.default.txt` to `weathercheck.txt`. +cp app/weathercheck.default.txt app/weathercheck.txt +``` + +- Replace weathercheck.txt content with your Api-Key: +```sh +# Finally open `app/weathercheck.txt` in your favorite text editor and replace the content with your Token. +# e.g.: +vim app/weathercheck.txt +``` + +## Run openrouteservice: + +For the standard openrouteservice version do: + + `grunt ors` + +If you want to use the openrouteservice client with a [local backend version of openrouteservice](https://github.com/GIScience/openrouteservice) you have to adjust the *endpoint paths* to the *backend war version* you are using in `Grunfile.js`. + +Afterwards do: + + `grunt ors_local` + +## Contribution + +If you would like to contribute, please note that we are using a [branching model](http://nvie.com/posts/a-successful-git-branching-model/) to structure our git workflow and are following [commit message guidelines](https://api.coala.io/en/latest/Developers/Writing_Good_Commits.html). + +For minor bugfixes use the development branch: + + `git checkout development` + +For new features, please create a new branch: + + `git chekout -b feature_branch` + +In every case do a [pull request](https://help.github.com/articles/creating-a-pull-request/) to our development branch. Be sure to pull the latest changes beforehand and fix any emerging conflicts. + +To enable console output information and logging for bugfixing and feature development do: + + `grunt dev` + ## Translations Help us to provide the openrouteservice in your language by translating some simple keywords! diff --git a/app/components/ors-map/directive-templates/ors-here-popup.html b/app/components/ors-map/directive-templates/ors-here-popup.html index a5e45e32..a6910b00 100755 --- a/app/components/ors-map/directive-templates/ors-here-popup.html +++ b/app/components/ors-map/directive-templates/ors-here-popup.html @@ -1,7 +1,11 @@