Add prettier and reformat code

This commit is contained in:
Gautier Pelloux-Prayer 2019-05-16 21:31:06 +02:00
parent 68eb00bae9
commit 970a34981f
37 changed files with 3459 additions and 1969 deletions

9
.prettierignore Normal file
View file

@ -0,0 +1,9 @@
LICENSE
dist/
*.zip
yarn.lock
.idea
.gitignore
.prettierignore
.tx/
layers/

4
.prettierrc Normal file
View file

@ -0,0 +1,4 @@
{
"singleQuote": true,
"tabWidth": 4
}

View file

@ -1,5 +1,4 @@
BRouter-Web Changelog # BRouter-Web Changelog
=====================
## 0.8.0 (2019-05-04) ## 0.8.0 (2019-05-04)
@ -7,25 +6,25 @@ See also [milestone 0.8.0](https://github.com/nrenner/brouter-web/milestone/6?cl
### New Features ### New Features
* Optional layers tree ([#146](https://github.com/nrenner/brouter-web/issues/146)) - Optional layers tree ([#146](https://github.com/nrenner/brouter-web/issues/146))
* Let user upload GeoJSON file of nogos - by [@Phyks](https://github.com/Phyks) ([#161](https://github.com/nrenner/brouter-web/pull/161)) - Let user upload GeoJSON file of nogos - by [@Phyks](https://github.com/Phyks) ([#161](https://github.com/nrenner/brouter-web/pull/161))
* Translations: make website localizable (i18n) - by [@bagage](https://github.com/bagage) ([#63](https://github.com/nrenner/brouter-web/issues/63)) - Translations: make website localizable (i18n) - by [@bagage](https://github.com/bagage) ([#63](https://github.com/nrenner/brouter-web/issues/63))
* Fix polygon edition - by [@Phyks](https://github.com/Phyks) ([#158](https://github.com/nrenner/brouter-web/pull/158)) - Fix polygon edition - by [@Phyks](https://github.com/Phyks) ([#158](https://github.com/nrenner/brouter-web/pull/158))
* Render polygons from URL hash and pass it to BRouter server - by [@Phyks](https://github.com/Phyks) ([#157](https://github.com/nrenner/brouter-web/pull/157)) - Render polygons from URL hash and pass it to BRouter server - by [@Phyks](https://github.com/Phyks) ([#157](https://github.com/nrenner/brouter-web/pull/157))
* Start support of nogos polylines/polygons - by [@Phyks](https://github.com/Phyks) ([#148](https://github.com/nrenner/brouter-web/pull/148)) - Start support of nogos polylines/polygons - by [@Phyks](https://github.com/Phyks) ([#148](https://github.com/nrenner/brouter-web/pull/148))
### Improvements ### Improvements
* Show line numbers in profile editor to help locating error message line ([81f2c08](https://github.com/nrenner/brouter-web/commit/81f2c0863f2569fa9079e5c96f4c9b09ef4c26e2)) - Show line numbers in profile editor to help locating error message line ([81f2c08](https://github.com/nrenner/brouter-web/commit/81f2c0863f2569fa9079e5c96f4c9b09ef4c26e2))
* Hide StravaSegments control when layer is not active ([eaba5a0](https://github.com/nrenner/brouter-web/commit/eaba5a08217fd026fb7f83ec7beb7c1f1fdc2d69)) - Hide StravaSegments control when layer is not active ([eaba5a0](https://github.com/nrenner/brouter-web/commit/eaba5a08217fd026fb7f83ec7beb7c1f1fdc2d69))
* Show strava error + update translations - by [@bagage](https://github.com/bagage) ([#163](https://github.com/nrenner/brouter-web/pull/163)) - Show strava error + update translations - by [@bagage](https://github.com/bagage) ([#163](https://github.com/nrenner/brouter-web/pull/163))
* Replace Bower with Yarn/npm - by [@bagage](https://github.com/bagage) ([#116](https://github.com/nrenner/brouter-web/issues/116)) - Replace Bower with Yarn/npm - by [@bagage](https://github.com/bagage) ([#116](https://github.com/nrenner/brouter-web/issues/116))
* Add strava layer in overlays - by [@bagage](https://github.com/bagage) ([#152](https://github.com/nrenner/brouter-web/pull/152)) - Add strava layer in overlays - by [@bagage](https://github.com/bagage) ([#152](https://github.com/nrenner/brouter-web/pull/152))
* Fix release script - by [@bagage](https://github.com/bagage) ([#150](https://github.com/nrenner/brouter-web/pull/150)) - Fix release script - by [@bagage](https://github.com/bagage) ([#150](https://github.com/nrenner/brouter-web/pull/150))
### Bugfixes ### Bugfixes
* Overlays hidden under custom layer ([#143](https://github.com/nrenner/brouter-web/issues/143)) - Overlays hidden under custom layer ([#143](https://github.com/nrenner/brouter-web/issues/143))
## 0.7.0 (2018-10-10) ## 0.7.0 (2018-10-10)
@ -33,34 +32,34 @@ See also [milestone 0.7.0](https://github.com/nrenner/brouter-web/milestone/4?cl
### New Features ### New Features
* Redesign of the user interface to also support mobile devices - by [@bagage](https://github.com/bagage) and [@RoPP](https://github.com/RoPP) ([#34](https://github.com/nrenner/brouter-web/issues/34), [#66](https://github.com/nrenner/brouter-web/issues/66)) - Redesign of the user interface to also support mobile devices - by [@bagage](https://github.com/bagage) and [@RoPP](https://github.com/RoPP) ([#34](https://github.com/nrenner/brouter-web/issues/34), [#66](https://github.com/nrenner/brouter-web/issues/66))
* Permalink replaced with auto-updating URL address bar - by [@bagage](https://github.com/bagage) ([#62](https://github.com/nrenner/brouter-web/issues/62)) - Permalink replaced with auto-updating URL address bar - by [@bagage](https://github.com/bagage) ([#62](https://github.com/nrenner/brouter-web/issues/62))
* Allow user to add custom layers - by [@bagage](https://github.com/bagage) ([#77](https://github.com/nrenner/brouter-web/pull/77)) - Allow user to add custom layers - by [@bagage](https://github.com/bagage) ([#77](https://github.com/nrenner/brouter-web/pull/77))
* Profile and data table now in a collapsible, full-height sidebar ([#90](https://github.com/nrenner/brouter-web/issues/90), [#114](https://github.com/nrenner/brouter-web/issues/114)) - Profile and data table now in a collapsible, full-height sidebar ([#90](https://github.com/nrenner/brouter-web/issues/90), [#114](https://github.com/nrenner/brouter-web/issues/114))
* No-go areas individually editable and deletable ([#100](https://github.com/nrenner/brouter-web/issues/100)) - No-go areas individually editable and deletable ([#100](https://github.com/nrenner/brouter-web/issues/100))
### Improvements ### Improvements
* New gulp debug task and watch CSS folder - by [@bagage](https://github.com/bagage) ([#58](https://github.com/nrenner/brouter-web/pull/58)) - New gulp debug task and watch CSS folder - by [@bagage](https://github.com/bagage) ([#58](https://github.com/nrenner/brouter-web/pull/58))
* Locate button not shown when no https ([#60](https://github.com/nrenner/brouter-web/issues/60)) - Locate button not shown when no https ([#60](https://github.com/nrenner/brouter-web/issues/60))
* Support Leaflet 1.0 ([#65](https://github.com/nrenner/brouter-web/issues/65), [#69](https://github.com/nrenner/brouter-web/issues/69)) - Support Leaflet 1.0 ([#65](https://github.com/nrenner/brouter-web/issues/65), [#69](https://github.com/nrenner/brouter-web/issues/69))
* Add a gulp command for release - by [@RoPP](https://github.com/RoPP) ([#85](https://github.com/nrenner/brouter-web/pull/85)) - Add a gulp command for release - by [@RoPP](https://github.com/RoPP) ([#85](https://github.com/nrenner/brouter-web/pull/85))
* Use https scheme whenever possible, to avoid mixed content issues - by [@bagage](https://github.com/bagage) ([#87](https://github.com/nrenner/brouter-web/pull/87)) - Use https scheme whenever possible, to avoid mixed content issues - by [@bagage](https://github.com/bagage) ([#87](https://github.com/nrenner/brouter-web/pull/87))
* Add car-eco/fast profiles + display energy/time - by [@abrensch](https://github.com/abrensch) ([#95](https://github.com/nrenner/brouter-web/pull/95)) - Add car-eco/fast profiles + display energy/time - by [@abrensch](https://github.com/abrensch) ([#95](https://github.com/nrenner/brouter-web/pull/95))
* Improve error message if no route found - by [@bagage](https://github.com/bagage) ([#99](https://github.com/nrenner/brouter-web/issues/99)) - Improve error message if no route found - by [@bagage](https://github.com/bagage) ([#99](https://github.com/nrenner/brouter-web/issues/99))
* Support zoom 19 for German style - by [@giggls](https://github.com/giggls) ([#128](https://github.com/nrenner/brouter-web/pull/128)) - Support zoom 19 for German style - by [@giggls](https://github.com/giggls) ([#128](https://github.com/nrenner/brouter-web/pull/128))
## 0.6.3 (2017-03-16) ## 0.6.3 (2017-03-16)
* Fix data tab showing only two rows (regression from v0.6.2) ([#72](https://github.com/nrenner/brouter-web/issues/72)) - Fix data tab showing only two rows (regression from v0.6.2) ([#72](https://github.com/nrenner/brouter-web/issues/72))
## 0.6.2 (2017-03-14) ## 0.6.2 (2017-03-14)
* Fix "API Key Required" in OpenCycleMap & Outdoors by registering for Thunderforest "Hobby Project" plan ([#70](https://github.com/nrenner/brouter-web/issues/70)) - Fix "API Key Required" in OpenCycleMap & Outdoors by registering for Thunderforest "Hobby Project" plan ([#70](https://github.com/nrenner/brouter-web/issues/70))
## 0.6.1 (2016-12-12) ## 0.6.1 (2016-12-12)
* Add Esri World Imagery layer (DigitalGlobe is now also blocked because monthly usage limit is exceeded) - Add Esri World Imagery layer (DigitalGlobe is now also blocked because monthly usage limit is exceeded)
## 0.6.0 (2016-10-11) ## 0.6.0 (2016-10-11)
@ -68,66 +67,65 @@ See also [milestone 0.6.0](https://github.com/nrenner/brouter-web/milestone/1?cl
### Features/Improvements ### Features/Improvements
* Update OpenTopoMap zoom range to 0-17 - Update OpenTopoMap zoom range to 0-17
* [local installation] Option to remove default base layers ([#27](https://github.com/nrenner/brouter-web/issues/27)) - [local installation] Option to remove default base layers ([#27](https://github.com/nrenner/brouter-web/issues/27))
* Add tooltip to display length in meter precision (3 digits) ([#38](https://github.com/nrenner/brouter-web/issues/38)) - Add tooltip to display length in meter precision (3 digits) ([#38](https://github.com/nrenner/brouter-web/issues/38))
* Add "mean cost" to route statistics ([#39](https://github.com/nrenner/brouter-web/issues/39)) - Add "mean cost" to route statistics ([#39](https://github.com/nrenner/brouter-web/issues/39))
* Set route transparency slider to partially transparent by default ([#36](https://github.com/nrenner/brouter-web/issues/36)) - Set route transparency slider to partially transparent by default ([#36](https://github.com/nrenner/brouter-web/issues/36))
* Show position in elevation diagram when hovering path on map ([#29](https://github.com/nrenner/brouter-web/issues/29)) - Show position in elevation diagram when hovering path on map ([#29](https://github.com/nrenner/brouter-web/issues/29))
* [local installation] Added ability to specify custom overlays in configuration - by [@saesh](https://github.com/saesh) ([#46](https://github.com/nrenner/brouter-web/pull/46)) - [local installation] Added ability to specify custom overlays in configuration - by [@saesh](https://github.com/saesh) ([#46](https://github.com/nrenner/brouter-web/pull/46))
* Add button to get/follow the current location (leaflet.locatecontrol plugin) - by [@bagage](https://github.com/bagage) ([#49](https://github.com/nrenner/brouter-web/pull/49)) - Add button to get/follow the current location (leaflet.locatecontrol plugin) - by [@bagage](https://github.com/bagage) ([#49](https://github.com/nrenner/brouter-web/pull/49))
* Save and restore last map position (leaflet.restoreview.js plugin) - by [@bagage](https://github.com/bagage) ([#49](https://github.com/nrenner/brouter-web/pull/49)) - Save and restore last map position (leaflet.restoreview.js plugin) - by [@bagage](https://github.com/bagage) ([#49](https://github.com/nrenner/brouter-web/pull/49))
* Toggle drawing mode via panel button - by [@bagage](https://github.com/bagage) ([#50](https://github.com/nrenner/brouter-web/pull/50)) - Toggle drawing mode via panel button - by [@bagage](https://github.com/bagage) ([#50](https://github.com/nrenner/brouter-web/pull/50))
* [local installation] add keys.js to configure API keys instead of bingkey request - [local installation] add keys.js to configure API keys instead of bingkey request
* Switch to new icon set (Font Awesome) with more options - Switch to new icon set (Font Awesome) with more options
### Bugfixes ### Bugfixes
* Replace Bing (usage limit exceeded) with DigitalGlobe Recent Imagery layer (newer images, but sometimes cloudy) - Replace Bing (usage limit exceeded) with DigitalGlobe Recent Imagery layer (newer images, but sometimes cloudy)
* [local installation] Show error message for invalid server response with custom profiles on Windows (still needs to be fixed) ([#53](https://github.com/nrenner/brouter-web/issues/53)) - [local installation] Show error message for invalid server response with custom profiles on Windows (still needs to be fixed) ([#53](https://github.com/nrenner/brouter-web/issues/53))
* Restrictive Cookie settings caused app to stop responding ([#47](https://github.com/nrenner/brouter-web/issues/47)) - Restrictive Cookie settings caused app to stop responding ([#47](https://github.com/nrenner/brouter-web/issues/47))
## 0.5.2 (2015-08-27) ## 0.5.2 (2015-08-27)
* switch search from MapQuest to Nominatim (MapQuest licensing change) - switch search from MapQuest to Nominatim (MapQuest licensing change)
## 0.5.1 (2015-07-24) ## 0.5.1 (2015-07-24)
* config option ``baseLayers`` to add custom base layers locally (#24) - config option `baseLayers` to add custom base layers locally (#24)
* reset slider on page load to minimum opacity (#22), - reset slider on page load to minimum opacity (#22),
customizable locally with config setting ``minOpacity`` customizable locally with config setting `minOpacity`
* set OpenTopoMap max zoom back to z15 while on fallback server (#21), - set OpenTopoMap max zoom back to z15 while on fallback server (#21),
also fix max zoom of other services also fix max zoom of other services
* overscale tiles to common max zoom (avoids gray screen when switching) - overscale tiles to common max zoom (avoids gray screen when switching)
## 0.5.0 (2015-07-01) ## 0.5.0 (2015-07-01)
### Features ### Features
* Load profile content for selected profile (needs extra server locally) - Load profile content for selected profile (needs extra server locally)
* Bing maps aerial layer (not working locally) - Bing maps aerial layer (not working locally)
* track color magenta instead of blue + white casing, for better contrast - track color magenta instead of blue + white casing, for better contrast
with background map (esp. OpenCycleMap) with background map (esp. OpenCycleMap)
* transparency slider for route track and markers - transparency slider for route track and markers
* button to delete route (#10) - button to delete route (#10)
* map scale - map scale
* download all dependencies in a bundle, instead using CDNs and separate files (#18) - download all dependencies in a bundle, instead using CDNs and separate files (#18)
* switch search plugin for result-dependent zoom - switch search plugin for result-dependent zoom
* "about" popup with a bit more infos and links - "about" popup with a bit more infos and links
* closable error/warning messages, profile messages in place - closable error/warning messages, profile messages in place
### Bugfixes ### Bugfixes
* keys to enable/disable drawing (d, q/esc) now always work, not only when map is focused - keys to enable/disable drawing (d, q/esc) now always work, not only when map is focused
* fix adding new waypoint after deleting the last (#11) - fix adding new waypoint after deleting the last (#11)
* fix profile/data scrolling on Firefox - fix profile/data scrolling on Firefox
* hide trailer over controls and outside map - hide trailer over controls and outside map
## BRouter 1.2 ## BRouter 1.2
* data/CSV aggregated over segments with same tags (for better performance) - data/CSV aggregated over segments with same tags (for better performance)
## 0.4.0 (2015-03-08) ## 0.4.0 (2015-03-08)
* data tab (slow with long routes, exp. on Firefox) - data tab (slow with long routes, exp. on Firefox)

113
README.md
View file

@ -1,11 +1,11 @@
brouter-web # brouter-web
===========
Web client (by [@nrenner](https://github.com/nrenner) and [contributors](https://github.com/nrenner/brouter-web/graphs/contributors)) for the BRouter routing engine (by [@abrensch](https://github.com/abrensch)). *Work in progress*. Web client (by [@nrenner](https://github.com/nrenner) and [contributors](https://github.com/nrenner/brouter-web/graphs/contributors)) for the BRouter routing engine (by [@abrensch](https://github.com/abrensch)). _Work in progress_.
Instances: Instances:
* [brouter.de/brouter-web](http://brouter.de/brouter-web/) *(provided by [@abrensch](https://github.com/abrensch))*
* [brouter.damsy.net](http://brouter.damsy.net) *(provided by [@bagage](https://github.com/bagage))* - [brouter.de/brouter-web](http://brouter.de/brouter-web/) _(provided by [@abrensch](https://github.com/abrensch))_
- [brouter.damsy.net](http://brouter.damsy.net) _(provided by [@bagage](https://github.com/bagage))_
This repository is only about the frontend. For the server/backend, BRouter routing engine, Android app, profiles, brouter.de site, see: This repository is only about the frontend. For the server/backend, BRouter routing engine, Android app, profiles, brouter.de site, see:
https://github.com/abrensch/brouter https://github.com/abrensch/brouter
@ -31,7 +31,7 @@ As an alternative to the above online version, the standalone server of BRouter
### Install BRouter (server with routing engine) ### Install BRouter (server with routing engine)
1. download and unzip latest [BRouter revision](http://brouter.de/brouter/revisions.html) 1. download and unzip latest [BRouter revision](http://brouter.de/brouter/revisions.html)
e.g. for Linux (replace ``~/opt/`` with your preferred install dir and ``1_4_11`` with latest version): e.g. for Linux (replace `~/opt/` with your preferred install dir and `1_4_11` with latest version):
mkdir ~/opt/brouter mkdir ~/opt/brouter
cd ~/opt/brouter cd ~/opt/brouter
@ -39,43 +39,44 @@ e.g. for Linux (replace ``~/opt/`` with your preferred install dir and ``1_4_11`
unzip brouter_1_4_11.zip unzip brouter_1_4_11.zip
chmod +x ./standalone/server.sh chmod +x ./standalone/server.sh
2. download one or more [data file(s)](http://brouter.de/brouter/segments4/) (rd5) into ``segments4`` dir 2. download one or more [data file(s)](http://brouter.de/brouter/segments4/) (rd5) into `segments4` dir
### Install BRouter-Web (client) ### Install BRouter-Web (client)
1. download BRouter-Web as subdirectory ``brouter-web`` of the ``brouter`` directory 1. download BRouter-Web as subdirectory `brouter-web` of the `brouter` directory
* using the latest stable release - adjust to current version number - from
- using the latest stable release - adjust to current version number - from
https://github.com/nrenner/brouter-web/releases: https://github.com/nrenner/brouter-web/releases:
wget https://github.com/nrenner/brouter-web/releases/download/0.7.0/brouter-web-0.7.0.zip wget https://github.com/nrenner/brouter-web/releases/download/0.7.0/brouter-web-0.7.0.zip
unzip brouter-web-0.7.0.zip -d brouter-web unzip brouter-web-0.7.0.zip -d brouter-web
* OR the current development state (potentially instable and without runtime distributables): - OR the current development state (potentially instable and without runtime distributables):
wget https://github.com/nrenner/brouter-web/archive/master.zip wget https://github.com/nrenner/brouter-web/archive/master.zip
unzip master.zip unzip master.zip
mv brouter-web-master brouter-web mv brouter-web-master brouter-web
* build the distributable files required for runtime (only for development state), see section [Build](#build) - build the distributable files required for runtime (only for development state), see section [Build](#build)
2. copy ``config.template.js`` to ``config.js`` 2. copy `config.template.js` to `config.js`
3. configure URL to ``profiles2`` directory 3. configure URL to `profiles2` directory
set ``BR.conf.profilesUrl`` in config.js, e.g. uncomment: set `BR.conf.profilesUrl` in config.js, e.g. uncomment:
BR.conf.profilesUrl = 'http://localhost:8000/profiles2/'; BR.conf.profilesUrl = 'http://localhost:8000/profiles2/';
4. add your API keys (optional) 4. add your API keys (optional)
copy ``keys.template.js`` to ``keys.js`` and edit to add your keys copy `keys.template.js` to `keys.js` and edit to add your keys
### Run ### Run
1. start BRouter server in the ``standalone`` directory with ``./server.sh`` or ``server.cmd`` (Windows) 1. start BRouter server in the `standalone` directory with `./server.sh` or `server.cmd` (Windows)
2. serve the ``brouter`` directory for BRouter-Web 2. serve the `brouter` directory for BRouter-Web
This is needed for pre-loading the selected profile (unless you allowed local file access in the Browser). Depending on your setup (see [How to run things locally](https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally)), start a web server in the ``brouter`` directory, e.g.: This is needed for pre-loading the selected profile (unless you allowed local file access in the Browser). Depending on your setup (see [How to run things locally](https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally)), start a web server in the `brouter` directory, e.g.:
python -m SimpleHTTPServer python -m SimpleHTTPServer
2. open http://localhost:8000/brouter-web/ 3. open http://localhost:8000/brouter-web/
## Build ## Build
@ -102,75 +103,75 @@ Copyright (c) 2018 Norbert Renner and [contributors](https://github.com/nrenner/
## Credits and Licenses ## Credits and Licenses
* [BRouter](https://github.com/abrensch/brouter) (not included) - [BRouter](https://github.com/abrensch/brouter) (not included)
by abrensch; [GNU General Public License, version 3.0 (GPLv3)](https://github.com/abrensch/brouter/blob/master/LICENSE) by abrensch; [GNU General Public License, version 3.0 (GPLv3)](https://github.com/abrensch/brouter/blob/master/LICENSE)
* [Leaflet](http://leafletjs.com/) - [Leaflet](http://leafletjs.com/)
Copyright (c) 2010-2014, Vladimir Agafonkin; Copyright (c) 2010-2011, CloudMade; [2-clause BSD License](https://github.com/Leaflet/Leaflet/blob/master/LICENSE) Copyright (c) 2010-2014, Vladimir Agafonkin; Copyright (c) 2010-2011, CloudMade; [2-clause BSD License](https://github.com/Leaflet/Leaflet/blob/master/LICENSE)
* [leaflet-routing](https://github.com/Turistforeningen/leaflet-routing) - [leaflet-routing](https://github.com/Turistforeningen/leaflet-routing)
Copyright (c) 2013, Turistforeningen, Hans Kristian Flaatten. All rights reserved. [2-clause BSD License](https://github.com/Turistforeningen/leaflet-routing/blob/gh-pages/LICENSE) Copyright (c) 2013, Turistforeningen, Hans Kristian Flaatten. All rights reserved. [2-clause BSD License](https://github.com/Turistforeningen/leaflet-routing/blob/gh-pages/LICENSE)
* [Leaflet.Elevation](https://github.com/MrMufflon/Leaflet.Elevation) - [Leaflet.Elevation](https://github.com/MrMufflon/Leaflet.Elevation)
Copyright (c) 2013 Felix Bache; [MIT License](https://github.com/MrMufflon/Leaflet.Elevation/blob/master/LICENSE) Copyright (c) 2013 Felix Bache; [MIT License](https://github.com/MrMufflon/Leaflet.Elevation/blob/master/LICENSE)
* [D3.js](https://github.com/mbostock/d3) - [D3.js](https://github.com/mbostock/d3)
Copyright (c) 2013, Michael Bostock. All rights reserved.; [3-clause BSD License](https://github.com/mbostock/d3/blob/master/LICENSE) Copyright (c) 2013, Michael Bostock. All rights reserved.; [3-clause BSD License](https://github.com/mbostock/d3/blob/master/LICENSE)
* [Leaflet.Editable](https://github.com/Leaflet/Leaflet.Editable) - [Leaflet.Editable](https://github.com/Leaflet/Leaflet.Editable)
Yohan Boniface; WTFPL licence Yohan Boniface; WTFPL licence
* [Leaflet Control Geocoder](https://github.com/perliedman/leaflet-control-geocoder) - [Leaflet Control Geocoder](https://github.com/perliedman/leaflet-control-geocoder)
Copyright (c) 2012 [sa3m](https://github.com/sa3m), Copyright (c) 2013 Per Liedman; [2-clause BSD License](https://github.com/perliedman/leaflet-control-geocoder/blob/master/LICENSE) Copyright (c) 2012 [sa3m](https://github.com/sa3m), Copyright (c) 2013 Per Liedman; [2-clause BSD License](https://github.com/perliedman/leaflet-control-geocoder/blob/master/LICENSE)
* [leaflet-plugins](https://github.com/shramov/leaflet-plugins) - [leaflet-plugins](https://github.com/shramov/leaflet-plugins)
Copyright (c) 2011-2012, Pavel Shramov; [2-clause BSD License](https://github.com/shramov/leaflet-plugins/blob/master/LICENSE) Copyright (c) 2011-2012, Pavel Shramov; [2-clause BSD License](https://github.com/shramov/leaflet-plugins/blob/master/LICENSE)
* [Async.js](https://github.com/caolan/async) - [Async.js](https://github.com/caolan/async)
Copyright (c) 2010-2014 Caolan McMahon; [MIT License](https://github.com/caolan/async/blob/master/LICENSE) Copyright (c) 2010-2014 Caolan McMahon; [MIT License](https://github.com/caolan/async/blob/master/LICENSE)
* [Bootstrap](https://getbootstrap.com/) - [Bootstrap](https://getbootstrap.com/)
Copyright (c) 2011-2014 Twitter, Inc; [MIT License](https://github.com/twbs/bootstrap/blob/master/LICENSE) Copyright (c) 2011-2014 Twitter, Inc; [MIT License](https://github.com/twbs/bootstrap/blob/master/LICENSE)
* [jQuery](https://github.com/jquery/jquery) - [jQuery](https://github.com/jquery/jquery)
Copyright 2005, 2014 jQuery Foundation and other contributors; [MIT License](https://github.com/jquery/jquery/blob/master/LICENSE.txt) Copyright 2005, 2014 jQuery Foundation and other contributors; [MIT License](https://github.com/jquery/jquery/blob/master/LICENSE.txt)
* [DataTables](https://github.com/DataTables/DataTables) - [DataTables](https://github.com/DataTables/DataTables)
Copyright (C) 2008-2014, SpryMedia Ltd.; [MIT License](https://www.datatables.net/license/MIT-LICENCE) Copyright (C) 2008-2014, SpryMedia Ltd.; [MIT License](https://www.datatables.net/license/MIT-LICENCE)
* [Leaflet.EasyButton](https://github.com/CliffCloud/Leaflet.EasyButton) - [Leaflet.EasyButton](https://github.com/CliffCloud/Leaflet.EasyButton)
Copyright (C) 2014 Daniel Montague; [MIT License](https://github.com/CliffCloud/Leaflet.EasyButton/blob/master/LICENSE) Copyright (C) 2014 Daniel Montague; [MIT License](https://github.com/CliffCloud/Leaflet.EasyButton/blob/master/LICENSE)
* [Bootbox](https://github.com/makeusabrew/bootbox) - [Bootbox](https://github.com/makeusabrew/bootbox)
Copyright (C) 2011-2014 by Nick Payne; [MIT License](https://github.com/makeusabrew/bootbox/blob/master/LICENSE.md) Copyright (C) 2011-2014 by Nick Payne; [MIT License](https://github.com/makeusabrew/bootbox/blob/master/LICENSE.md)
* [bootstrap-slider](https://github.com/seiyria/bootstrap-slider) - [bootstrap-slider](https://github.com/seiyria/bootstrap-slider)
Copyright (c) 2015 Kyle Kemp, Rohit Kalkur, and contributors; [MIT License](https://github.com/seiyria/bootstrap-slider/blob/master/LICENSE.md) Copyright (c) 2015 Kyle Kemp, Rohit Kalkur, and contributors; [MIT License](https://github.com/seiyria/bootstrap-slider/blob/master/LICENSE.md)
* [Leaflet.RestoreView](https://github.com/makinacorpus/Leaflet.RestoreView) - [Leaflet.RestoreView](https://github.com/makinacorpus/Leaflet.RestoreView)
Copyright (c) 2012 Makina Corpus, [MIT License](https://github.com/makinacorpus/Leaflet.RestoreView/blob/master/LICENSE) Copyright (c) 2012 Makina Corpus, [MIT License](https://github.com/makinacorpus/Leaflet.RestoreView/blob/master/LICENSE)
* [Leaflet.Locate](https://github.com/domoritz/leaflet-locatecontrol) - [Leaflet.Locate](https://github.com/domoritz/leaflet-locatecontrol)
Copyright (c) 2014 Dominik Moritz, [MIT License](https://github.com/domoritz/leaflet-locatecontrol/blob/gh-pages/LICENSE) Copyright (c) 2014 Dominik Moritz, [MIT License](https://github.com/domoritz/leaflet-locatecontrol/blob/gh-pages/LICENSE)
* [Font Awesome](http://fontawesome.io/license/) - [Font Awesome](http://fontawesome.io/license/)
by Dave Gandy; [SIL OFL 1.1](https://scripts.sil.org/OFL) (Font), MIT License (Code), CC BY 3.0 (Documentation) by Dave Gandy; [SIL OFL 1.1](https://scripts.sil.org/OFL) (Font), MIT License (Code), CC BY 3.0 (Documentation)
* [url-search-params](https://github.com/WebReflection/url-search-params) - [url-search-params](https://github.com/WebReflection/url-search-params)
Copyright (C) 2015-2017 Andrea Giammarchi - @WebReflection; [MIT License](https://github.com/WebReflection/url-search-params/blob/master/LICENSE.txt) Copyright (C) 2015-2017 Andrea Giammarchi - @WebReflection; [MIT License](https://github.com/WebReflection/url-search-params/blob/master/LICENSE.txt)
* [bootstrap-select](https://github.com/snapappointments/bootstrap-select) - [bootstrap-select](https://github.com/snapappointments/bootstrap-select)
Copyright (c) 2012-2018 SnapAppointments, LLC; [MIT License](https://github.com/snapappointments/bootstrap-select/blob/v1.13.0-dev/LICENSE) Copyright (c) 2012-2018 SnapAppointments, LLC; [MIT License](https://github.com/snapappointments/bootstrap-select/blob/v1.13.0-dev/LICENSE)
* [leaflet-sidebar-v2](https://github.com/nickpeihl/leaflet-sidebar-v2) - [leaflet-sidebar-v2](https://github.com/nickpeihl/leaflet-sidebar-v2)
Copyright (c) 2013 Tobias Bieniek; [MIT License](https://github.com/nickpeihl/leaflet-sidebar-v2/blob/master/LICENSE) Copyright (c) 2013 Tobias Bieniek; [MIT License](https://github.com/nickpeihl/leaflet-sidebar-v2/blob/master/LICENSE)
* [CodeMirror](https://github.com/codemirror/CodeMirror) - [CodeMirror](https://github.com/codemirror/CodeMirror)
Copyright (C) 2017 by Marijn Haverbeke <marijnh@gmail.com> and others; [MIT License](https://github.com/codemirror/CodeMirror/blob/master/LICENSE) Copyright (C) 2017 by Marijn Haverbeke <marijnh@gmail.com> and others; [MIT License](https://github.com/codemirror/CodeMirror/blob/master/LICENSE)
* [Map BBCode](https://github.com/MapBBCode/mapbbcode) - [Map BBCode](https://github.com/MapBBCode/mapbbcode)
Ilya Zverev; [Do What The F*ck You Want To Public License](https://github.com/MapBBCode/mapbbcode/blob/master/LICENSE) Ilya Zverev; [Do What The F\*ck You Want To Public License](https://github.com/MapBBCode/mapbbcode/blob/master/LICENSE)
* [Leafet.StravaSegments](https://gitlab.com/bagage/leaflet.stravasegments) - [Leafet.StravaSegments](https://gitlab.com/bagage/leaflet.stravasegments)
Copyright (c) 2018 Gautier Pelloux-Prayer; [MIT License](https://gitlab.com/bagage/leaflet.stravasegments/blob/master/LICENSE) Copyright (c) 2018 Gautier Pelloux-Prayer; [MIT License](https://gitlab.com/bagage/leaflet.stravasegments/blob/master/LICENSE)
* [polyline](https://github.com/mapbox/polyline) - [polyline](https://github.com/mapbox/polyline)
Copyright (c), Development Seed; [BSD 3-Clause License](https://github.com/mapbox/polyline/blob/master/LICENSE) Copyright (c), Development Seed; [BSD 3-Clause License](https://github.com/mapbox/polyline/blob/master/LICENSE)
* [leaflet-fullHash](https://github.com/KoGor/leaflet-fullHash) - [leaflet-fullHash](https://github.com/KoGor/leaflet-fullHash)
Copyright (c) 2014 KoGor; [MIT License](https://github.com/KoGor/leaflet-fullHash/blob/master/LICENSE) Copyright (c) 2014 KoGor; [MIT License](https://github.com/KoGor/leaflet-fullHash/blob/master/LICENSE)
* [Turf.js](https://github.com/Turfjs/turf) - [Turf.js](https://github.com/Turfjs/turf)
Copyright (c) 2019 Morgan Herlocker; [MIT License](https://github.com/Turfjs/turf/blob/master/LICENSE) Copyright (c) 2019 Morgan Herlocker; [MIT License](https://github.com/Turfjs/turf/blob/master/LICENSE)
* [i18next](https://github.com/i18next/i18next), [i18next-browser-languageDetector](https://github.com/i18next/i18next-browser-languageDetector), [i18next-xhr-backend](https://github.com/i18next/i18next-xhr-backend), [jquery-i18next](https://github.com/i18next/jquery-i18next/blob/master/LICENSE) - [i18next](https://github.com/i18next/i18next), [i18next-browser-languageDetector](https://github.com/i18next/i18next-browser-languageDetector), [i18next-xhr-backend](https://github.com/i18next/i18next-xhr-backend), [jquery-i18next](https://github.com/i18next/jquery-i18next/blob/master/LICENSE)
Copyright (c) 2017 i18next; [MIT License](https://github.com/i18next/i18next/blob/master/LICENSE) Copyright (c) 2017 i18next; [MIT License](https://github.com/i18next/i18next/blob/master/LICENSE)
* [Leaflet TriangleMarker](https://github.com/themeler/leaflet-triangle-marker) - [Leaflet TriangleMarker](https://github.com/themeler/leaflet-triangle-marker)
Copyright (c) 2018 Przemysław Melnarowicz; [MIT License](https://github.com/themeler/leaflet-triangle-marker/blob/master/LICENSE) Copyright (c) 2018 Przemysław Melnarowicz; [MIT License](https://github.com/themeler/leaflet-triangle-marker/blob/master/LICENSE)
* [jsTree ](https://github.com/vakata/jstree) - [jsTree ](https://github.com/vakata/jstree)
Copyright (c) 2014 Ivan Bozhanov; [MIT License](https://github.com/vakata/jstree/blob/master/LICENSE-MIT) Copyright (c) 2014 Ivan Bozhanov; [MIT License](https://github.com/vakata/jstree/blob/master/LICENSE-MIT)
* [Leaflet.snogylop](https://github.com/ebrelsford/leaflet.snogylop) - [Leaflet.snogylop](https://github.com/ebrelsford/leaflet.snogylop)
Copyright (c) 2014 Eric Brelsford; [MIT License](https://github.com/ebrelsford/Leaflet.snogylop/blob/master/LICENSE) Copyright (c) 2014 Eric Brelsford; [MIT License](https://github.com/ebrelsford/Leaflet.snogylop/blob/master/LICENSE)
* [JOSM maps](https://josm.openstreetmap.de/wiki/Maps) - [JOSM maps](https://josm.openstreetmap.de/wiki/Maps)
imagery database is licensed under [CC-BY-SA](https://creativecommons.org/licenses/by-sa/3.0/) imagery database is licensed under [CC-BY-SA](https://creativecommons.org/licenses/by-sa/3.0/)
* [LayersCollection](https://github.com/Edward17/LayersCollection/tree/gh-pages) - [LayersCollection](https://github.com/Edward17/LayersCollection/tree/gh-pages)
Copyright (c) 2016 Eduard &lt;edward17&gt;; [MIT License](https://github.com/Edward17/LayersCollection/blob/gh-pages/LICENSE.md) Copyright (c) 2016 Eduard &lt;edward17&gt;; [MIT License](https://github.com/Edward17/LayersCollection/blob/gh-pages/LICENSE.md)
* [Leaflet-providers](https://github.com/leaflet-extras/leaflet-providers) - [Leaflet-providers](https://github.com/leaflet-extras/leaflet-providers)
Copyright (c) 2013 Leaflet Providers contributors All rights reserved.; [2-clause BSD License](https://github.com/leaflet-extras/leaflet-providers/blob/master/license.md) Copyright (c) 2013 Leaflet Providers contributors All rights reserved.; [2-clause BSD License](https://github.com/leaflet-extras/leaflet-providers/blob/master/license.md)
* [Fetch polyfill](https://github.com/Github/fetch) - [Fetch polyfill](https://github.com/Github/fetch)
Copyright (c) 2014-2016 GitHub, Inc.; [MIT License](https://github.com/github/fetch/blob/master/LICENSE) Copyright (c) 2014-2016 GitHub, Inc.; [MIT License](https://github.com/github/fetch/blob/master/LICENSE)
* [Promise Polyfill](https://github.com/taylorhakes/promise-polyfill) - [Promise Polyfill](https://github.com/taylorhakes/promise-polyfill)
Copyright (c) 2014 Taylor Hakes, Copyright (c) 2014 Forbes Lindesay; [MIT License](https://github.com/taylorhakes/promise-polyfill/blob/master/LICENSE) Copyright (c) 2014 Taylor Hakes, Copyright (c) 2014 Forbes Lindesay; [MIT License](https://github.com/taylorhakes/promise-polyfill/blob/master/LICENSE)

View file

@ -1,5 +1,4 @@
(function() { (function() {
var hostname = window.location.hostname; var hostname = window.location.hostname;
var params = new URLSearchParams(window.location.search.slice(1)); var params = new URLSearchParams(window.location.search.slice(1));
@ -13,7 +12,6 @@
//BR.conf.transit = params.has('transit') && (params.get('transit') === 'true'); //BR.conf.transit = params.has('transit') && (params.get('transit') === 'true');
if (hostname === 'brouter.de' || hostname === 'h2096617.stratoserver.net') { if (hostname === 'brouter.de' || hostname === 'h2096617.stratoserver.net') {
// online service (brouter.de) configuration // online service (brouter.de) configuration
BR.conf.profiles = [ BR.conf.profiles = [
@ -39,9 +37,7 @@
BR.conf.host = 'http://h2096617.stratoserver.net:443'; BR.conf.host = 'http://h2096617.stratoserver.net:443';
BR.conf.profilesUrl = 'http://brouter.de/brouter/profiles2/'; BR.conf.profilesUrl = 'http://brouter.de/brouter/profiles2/';
} else { } else {
// desktop configuration // desktop configuration
BR.conf.profiles = [ BR.conf.profiles = [
@ -114,7 +110,6 @@
// transit (intermodal routing) demo config // transit (intermodal routing) demo config
if (BR.conf.transit) { if (BR.conf.transit) {
BR.conf.profiles = [ BR.conf.profiles = [
'../im/bike', '../im/bike',
'../im/foot', '../im/foot',
@ -126,6 +121,5 @@
'moped', 'moped',
'car-test' 'car-test'
]; ];
} }
})(); })();

View file

@ -1,11 +1,14 @@
html, body, #map { html,
body,
#map {
height: 100%; height: 100%;
} }
/* This is important so that bootstrap-select list goes over leaflet buttons /* This is important so that bootstrap-select list goes over leaflet buttons
Since the list is in navbar and leaflet buttons within map, we create a Since the list is in navbar and leaflet buttons within map, we create a
stacking context on their common ancestor */ stacking context on their common ancestor */
body, #content { body,
#content {
position: relative; position: relative;
z-index: 1; z-index: 1;
} }
@ -60,7 +63,7 @@ table.dataTable {
.navbar { .navbar {
/* align with leaflet-control */ /* align with leaflet-control */
padding: .5rem 10px; padding: 0.5rem 10px;
} }
.navbar-brand { .navbar-brand {
float: right; float: right;
@ -118,7 +121,7 @@ footer {
} }
.form-group { .form-group {
margin-bottom: 0 margin-bottom: 0;
} }
/* /*
@ -152,7 +155,6 @@ footer {
margin-right: 0.5rem; margin-right: 0.5rem;
} }
.routing-draw-enabled { .routing-draw-enabled {
cursor: crosshair; cursor: crosshair;
} }
@ -182,7 +184,8 @@ footer {
} }
/* track messages (data tab) */ /* track messages (data tab) */
#tab_data, .CodeMirror { #tab_data,
.CodeMirror {
font-size: x-small; font-size: x-small;
} }
@ -237,7 +240,8 @@ https://css-tricks.com/svg-line-animation-works/
width: 8px; width: 8px;
margin-left: 1px; margin-left: 1px;
background-image: linear-gradient(to right, #f0f0f0 0%, #e9e9e9 100%); background-image: linear-gradient(to right, #f0f0f0 0%, #e9e9e9 100%);
box-shadow: inset -1px -0px 1px rgba(55, 55, 55, 0.3), inset 1px 0px 1px rgba(230, 230, 230, 1); box-shadow: inset -1px -0px 1px rgba(55, 55, 55, 0.3),
inset 1px 0px 1px rgba(230, 230, 230, 1);
} }
.control-slider:hover .slider-track, .control-slider:hover .slider-track,
@ -246,7 +250,7 @@ https://css-tricks.com/svg-line-animation-works/
} }
.slider-selection { .slider-selection {
background-color: #C6C6C6; background-color: #c6c6c6;
background-image: none; background-image: none;
box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.6); box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.6);
} }
@ -261,15 +265,19 @@ https://css-tricks.com/svg-line-animation-works/
/* bootstrap .btn-default */ /* bootstrap .btn-default */
background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%); background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%);
background-repeat: repeat-x; background-repeat: repeat-x;
box-shadow: inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),
0 1px 1px rgba(0, 0, 0, 0.075);
border: 1px solid #adadad; border: 1px solid #adadad;
} }
/* activated Font Awesome icon and Bootstrap button /* activated Font Awesome icon and Bootstrap button
(for EasyButton add ' active' to icon class property) */ (for EasyButton add ' active' to icon class property) */
.fa.active, .btn.active, .btn.active:hover, .btn.active:focus { .fa.active,
.btn.active,
.btn.active:hover,
.btn.active:focus {
/* use same color as leaflet-locatecontrol */ /* use same color as leaflet-locatecontrol */
color: #2074B6; color: #2074b6;
} }
.leaflet-bar button { .leaflet-bar button {
@ -424,19 +432,19 @@ table.dataTable.display tbody tr.even:hover {
} }
.tree-code { .tree-code {
font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console,
monospace;
margin-right: 7px; margin-right: 7px;
color: #666; /* like root nodes, jstree-disabled */ color: #666; /* like root nodes, jstree-disabled */
} }
/* hide currently unused bottom tabs container because of touch border artefacts */ /* hide currently unused bottom tabs container because of touch border artefacts */
.leaflet-sidebar-tabs > ul:last-child { .leaflet-sidebar-tabs > ul:last-child {
display: none; display: none;
} }
/* layers svg icon not properly centered */ /* layers svg icon not properly centered */
.leaflet-sidebar-tabs > ul > li > a[href="#tab_layers_control"] { .leaflet-sidebar-tabs > ul > li > a[href='#tab_layers_control'] {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -454,7 +462,8 @@ table.dataTable.display tbody tr.even:hover {
border: 1px solid #ddd; border: 1px solid #ddd;
font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console,
monospace;
line-height: 1.2em; line-height: 1.2em;
} }

View file

@ -24,22 +24,29 @@ var modifyCssUrls = require('gulp-modify-css-urls');
var sort = require('gulp-sort'); var sort = require('gulp-sort');
var scanner = require('i18next-scanner'); var scanner = require('i18next-scanner');
var jsonConcat = require('gulp-json-concat'); var jsonConcat = require('gulp-json-concat');
var rename = require("gulp-rename"); var rename = require('gulp-rename');
var debug = false; var debug = false;
var paths = { var paths = {
// see overrides in package.json // see overrides in package.json
scriptsConfig: mainNpmFiles().filter(f => RegExp('url-search-params/.*\\.js', 'i').test(f)), scriptsConfig: mainNpmFiles().filter(f =>
RegExp('url-search-params/.*\\.js', 'i').test(f)
),
scripts: [ scripts: [
'node_modules/jquery/dist/jquery.js', 'node_modules/jquery/dist/jquery.js',
'node_modules/tether/dist/js/tether.js', 'node_modules/tether/dist/js/tether.js',
'node_modules/async/lib/async.js' 'node_modules/async/lib/async.js'
].concat(mainNpmFiles().filter(f => ]
.concat(
mainNpmFiles().filter(
f =>
RegExp('.*\\.js', 'i').test(f) && RegExp('.*\\.js', 'i').test(f) &&
!RegExp('.*\\.min\\.js', 'i').test(f) && !RegExp('.*\\.min\\.js', 'i').test(f) &&
!RegExp('url-search-params/.*\\.js', 'i').test(f) !RegExp('url-search-params/.*\\.js', 'i').test(f)
)).concat([ )
)
.concat([
'js/Browser.js', 'js/Browser.js',
'js/Util.js', 'js/Util.js',
'js/Map.js', 'js/Map.js',
@ -49,12 +56,19 @@ var paths = {
'js/control/*.js', 'js/control/*.js',
'js/index.js' 'js/index.js'
]), ]),
styles: mainNpmFiles().filter(f => styles: mainNpmFiles()
.filter(
f =>
RegExp('.*\\.css', 'i').test(f) && RegExp('.*\\.css', 'i').test(f) &&
!RegExp('.*\\.min\\.css', 'i').test(f) !RegExp('.*\\.min\\.css', 'i').test(f)
).concat('css/*.css'), )
images: mainNpmFiles().filter(f => RegExp('.*.+(png|gif|svg)', 'i').test(f)), .concat('css/*.css'),
fonts: mainNpmFiles().filter(f => RegExp('font-awesome/fonts/.*', 'i').test(f)), images: mainNpmFiles().filter(f =>
RegExp('.*.+(png|gif|svg)', 'i').test(f)
),
fonts: mainNpmFiles().filter(f =>
RegExp('font-awesome/fonts/.*', 'i').test(f)
),
locales: 'locales/*.json', locales: 'locales/*.json',
layers: 'layers/**/*.geojson', layers: 'layers/**/*.geojson',
layersDestName: 'layers.js', layersDestName: 'layers.js',
@ -72,17 +86,15 @@ var paths = {
// libs that require loading before config.js // libs that require loading before config.js
gulp.task('scripts_config', ['clean'], function() { gulp.task('scripts_config', ['clean'], function() {
// just copy for now // just copy for now
return gulp.src(paths.scriptsConfig) return gulp.src(paths.scriptsConfig).pipe(gulp.dest(paths.dest));
.pipe(gulp.dest(paths.dest));
}); });
gulp.task('scripts', function() { gulp.task('scripts', function() {
if (debug) if (debug) gutil.log(gutil.colors.yellow('Running in Debug mode'));
gutil.log( gutil.colors.yellow('Running in Debug mode') ); else gutil.log(gutil.colors.green('Running in Release mode'));
else
gutil.log( gutil.colors.green('Running in Release mode') );
return gulp.src(paths.scripts, { base: '.' }) return gulp
.src(paths.scripts, { base: '.' })
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(cached('scripts')) .pipe(cached('scripts'))
.pipe(gulpif(!debug, uglify())) .pipe(gulpif(!debug, uglify()))
@ -94,14 +106,17 @@ gulp.task('scripts', function() {
// separate, fallback task for debugging (switch manually in index.html) // separate, fallback task for debugging (switch manually in index.html)
gulp.task('concat', function() { gulp.task('concat', function() {
return gulp.src(paths.scripts) return gulp
.src(paths.scripts)
.pipe(concat(paths.destName + '.src.js')) .pipe(concat(paths.destName + '.src.js'))
.pipe(gulp.dest(paths.dest)); .pipe(gulp.dest(paths.dest));
}); });
gulp.task('styles', function() { gulp.task('styles', function() {
return gulp.src(paths.styles) return gulp
.pipe(modifyCssUrls({ .src(paths.styles)
.pipe(
modifyCssUrls({
modify(url, filePath) { modify(url, filePath) {
var distUrl = url; var distUrl = url;
var imageExt = ['.png', '.gif', '.svg']; var imageExt = ['.png', '.gif', '.svg'];
@ -114,28 +129,28 @@ gulp.task('styles', function() {
return distUrl; return distUrl;
} }
})) })
)
.pipe(concat(paths.destName + '.css')) .pipe(concat(paths.destName + '.css'))
.pipe(cleanCSS({ .pipe(
cleanCSS({
rebase: false rebase: false
})) })
)
.pipe(postcss([autoprefixer({ remove: false })])) .pipe(postcss([autoprefixer({ remove: false })]))
.pipe(gulp.dest(paths.dest)); .pipe(gulp.dest(paths.dest));
}); });
gulp.task('images', ['clean'], function() { gulp.task('images', ['clean'], function() {
return gulp.src(paths.images) return gulp.src(paths.images).pipe(gulp.dest(paths.dest + '/images'));
.pipe(gulp.dest(paths.dest + '/images'));
}); });
gulp.task('fonts', ['clean'], function() { gulp.task('fonts', ['clean'], function() {
return gulp.src(paths.fonts) return gulp.src(paths.fonts).pipe(gulp.dest(paths.dest + '/fonts'));
.pipe(gulp.dest(paths.dest + '/fonts'));
}); });
gulp.task('locales', ['clean'], function() { gulp.task('locales', ['clean'], function() {
return gulp.src(paths.locales) return gulp.src(paths.locales).pipe(gulp.dest(paths.dest + '/locales'));
.pipe(gulp.dest(paths.dest + '/locales'));
}); });
gulp.task('clean', function(cb) { gulp.task('clean', function(cb) {
@ -162,20 +177,38 @@ gulp.task('log', function() {
//return gulp.src(paths.styles) //return gulp.src(paths.styles)
//return gulp.src(paths.images) //return gulp.src(paths.images)
// return gulp.src(paths.locales) // return gulp.src(paths.locales)
return gulp.src(paths.scripts.concat(paths.styles).concat(paths.images).concat(paths.locales)) return gulp
.src(
paths.scripts
.concat(paths.styles)
.concat(paths.images)
.concat(paths.locales)
)
.pipe(gulpDebug()); .pipe(gulpDebug());
}); });
gulp.task('inject', function() { gulp.task('inject', function() {
var target = gulp.src('index.html'); var target = gulp.src('index.html');
var sources = gulp.src(paths.scripts.concat(paths.styles), { base: '.', read: false }); var sources = gulp.src(paths.scripts.concat(paths.styles), {
base: '.',
read: false
});
return target.pipe(inject(sources, { relative: true })) return target
.pipe(inject(sources, { relative: true }))
.pipe(gulp.dest('.')); .pipe(gulp.dest('.'));
}); });
gulp.task('default', ['clean', 'scripts_config', 'layers', 'scripts', 'styles', 'images', 'fonts', 'locales']); gulp.task('default', [
'clean',
'scripts_config',
'layers',
'scripts',
'styles',
'images',
'fonts',
'locales'
]);
gulp.task('debug', function() { gulp.task('debug', function() {
debug = true; debug = true;
@ -199,7 +232,11 @@ gulp.task('release:init', function() {
} }
ghToken = gutil.env.token; ghToken = gutil.env.token;
if (!ghToken) { if (!ghToken) {
gutil.log(gutil.colors.red('--token is required (github personnal access token)')); gutil.log(
gutil.colors.red(
'--token is required (github personnal access token)'
)
);
process.exit(3); process.exit(3);
} }
if (ghToken.length != 40) { if (ghToken.length != 40) {
@ -209,7 +246,11 @@ gulp.task('release:init', function() {
git.status({ args: '--porcelain', quiet: true }, function(err, stdout) { git.status({ args: '--porcelain', quiet: true }, function(err, stdout) {
if (err) throw err; if (err) throw err;
if (stdout.length > 0) { if (stdout.length > 0) {
gutil.log(gutil.colors.red('Repository is not clean. Please commit or stash your pending modification')); gutil.log(
gutil.colors.red(
'Repository is not clean. Please commit or stash your pending modification'
)
);
process.exit(5); process.exit(5);
} }
}); });
@ -221,26 +262,34 @@ gulp.task('bump', ['bump:json', 'bump:html']);
gulp.task('bump:json', ['release:init'], function() { gulp.task('bump:json', ['release:init'], function() {
gutil.log(gutil.colors.green('Bump to ' + nextVersion)); gutil.log(gutil.colors.green('Bump to ' + nextVersion));
return(gulp.src(['./package.json']) return gulp
.src(['./package.json'])
.pipe(bump({ version: nextVersion })) .pipe(bump({ version: nextVersion }))
.pipe(gulp.dest('./'))); .pipe(gulp.dest('./'));
}); });
gulp.task('bump:html', ['release:init'], function() { gulp.task('bump:html', ['release:init'], function() {
return(gulp.src('./index.html') return gulp
.pipe(replace(/<sup class="version">(.*)<\/sup>/, '<sup class="version">'+nextVersion+'</sup>')) .src('./index.html')
.pipe(gulp.dest('.'))); .pipe(
replace(
/<sup class="version">(.*)<\/sup>/,
'<sup class="version">' + nextVersion + '</sup>'
)
)
.pipe(gulp.dest('.'));
}); });
gulp.task('release:commit', ['bump'], function() { gulp.task('release:commit', ['bump'], function() {
return gulp.src(['./index.html', './package.json']) return gulp
.src(['./index.html', './package.json'])
.pipe(git.commit('release: ' + nextVersion)); .pipe(git.commit('release: ' + nextVersion));
}); });
gulp.task('release:tag', ['release:commit'], function() { gulp.task('release:tag', ['release:commit'], function() {
return(git.tag(nextVersion, '', function(err) { return git.tag(nextVersion, '', function(err) {
if (err) throw err; if (err) throw err;
})); });
}); });
gulp.task('release:push', ['release:tag'], function() { gulp.task('release:push', ['release:tag'], function() {
@ -251,27 +300,48 @@ gulp.task('release:push', ['release:tag'], function() {
gulp.task('release:zip', ['release:tag', 'default'], function() { gulp.task('release:zip', ['release:tag', 'default'], function() {
gutil.log(gutil.colors.green('Build brouter-web.' + nextVersion + '.zip')); gutil.log(gutil.colors.green('Build brouter-web.' + nextVersion + '.zip'));
return(gulp.src(['dist/**', 'index.html', 'config.template.js', 'keys.template.js'], {'base': '.'}) return gulp
.src(
['dist/**', 'index.html', 'config.template.js', 'keys.template.js'],
{
base: '.'
}
)
.pipe(zip('brouter-web.' + nextVersion + '.zip')) .pipe(zip('brouter-web.' + nextVersion + '.zip'))
.pipe(gulp.dest('.'))); .pipe(gulp.dest('.'));
}); });
gulp.task('release:publish', ['release:zip'], function() { gulp.task('release:publish', ['release:zip'], function() {
gulp.src('./brouter-web.'+nextVersion+'.zip') gulp.src('./brouter-web.' + nextVersion + '.zip').pipe(
.pipe(release({ release({
tag: nextVersion, tag: nextVersion,
token: ghToken, token: ghToken,
manifest: pkg, manifest: pkg
})) })
);
}); });
gulp.task('release', ['release:init', 'bump', 'release:commit', 'release:tag', gulp.task('release', [
'release:push', 'release:zip', 'release:publish']); 'release:init',
'bump',
'release:commit',
'release:tag',
'release:push',
'release:zip',
'release:publish'
]);
gulp.task('i18next', function() { gulp.task('i18next', function() {
return gulp.src(['index.html', 'locales/keys.js', 'layers/config/overrides.js', 'js/**/*.js']) return gulp
.src([
'index.html',
'locales/keys.js',
'layers/config/overrides.js',
'js/**/*.js'
])
.pipe(sort()) .pipe(sort())
.pipe(scanner({ .pipe(
scanner({
lngs: ['en'], // we only generate English version, other languages are handled by transifex via yarn transifex-pull/push lngs: ['en'], // we only generate English version, other languages are handled by transifex via yarn transifex-pull/push
removeUnusedKeys: true, removeUnusedKeys: true,
sort: true, sort: true,
@ -282,26 +352,39 @@ gulp.task('i18next', function() {
// the destination path is relative to your `gulp.dest()` path // the destination path is relative to your `gulp.dest()` path
savePath: 'locales/{{lng}}.json' savePath: 'locales/{{lng}}.json'
} }
}))
.pipe(gulp.dest('.'));
}) })
)
.pipe(gulp.dest('.'));
});
gulp.task('layers_config', function() { gulp.task('layers_config', function() {
return gulp.src(paths.layersConfig) return gulp
.src(paths.layersConfig)
.pipe(concat(paths.layersConfigDestName)) .pipe(concat(paths.layersConfigDestName))
.pipe(gulp.dest(paths.dest)); .pipe(gulp.dest(paths.dest));
}); });
// Bundles layer files. To download and extract run "yarn layers" // Bundles layer files. To download and extract run "yarn layers"
gulp.task('layers', ['layers_config'], function() { gulp.task('layers', ['layers_config'], function() {
return gulp.src(paths.layers) return (
gulp
.src(paths.layers)
// Workaround to get file extension removed from the dictionary key // Workaround to get file extension removed from the dictionary key
.pipe(rename({ extname: ".json" })) .pipe(rename({ extname: '.json' }))
.pipe(jsonConcat(paths.layersDestName, function(data){ .pipe(
var header = '// Licensed under the MIT License (https://github.com/nrenner/brouter-web#license + Credits and Licenses),\n' jsonConcat(paths.layersDestName, function(data) {
+ '// except JOSM imagery database (dataSource=JOSM) is licensed under Creative Commons (CC-BY-SA),\n' var header =
+ '// see https://josm.openstreetmap.de/wiki/Maps#Otherimportantinformation\n'; '// Licensed under the MIT License (https://github.com/nrenner/brouter-web#license + Credits and Licenses),\n' +
return Buffer.from(header + 'BR.layerIndex = ' + JSON.stringify(data, null, 2) + ';'); '// except JOSM imagery database (dataSource=JOSM) is licensed under Creative Commons (CC-BY-SA),\n' +
})) '// see https://josm.openstreetmap.de/wiki/Maps#Otherimportantinformation\n';
.pipe(gulp.dest(paths.dest)); return Buffer.from(
header +
'BR.layerIndex = ' +
JSON.stringify(data, null, 2) +
';'
);
})
)
.pipe(gulp.dest(paths.dest))
);
}); });

File diff suppressed because it is too large Load diff

View file

@ -1,18 +1,22 @@
(function() { (function() {
var touchScreen = (function() { var touchScreen = (function() {
var result = null; var result = null;
if ('maxTouchPoints' in navigator) { if ('maxTouchPoints' in navigator) {
result = navigator.maxTouchPoints > 0; result = navigator.maxTouchPoints > 0;
} else if (window.matchMedia && window.matchMedia('(any-pointer:coarse),(any-pointer:fine),(any-pointer:none)').matches) { } else if (
result = window.matchMedia("(any-pointer:coarse)").matches; window.matchMedia &&
window.matchMedia(
'(any-pointer:coarse),(any-pointer:fine),(any-pointer:none)'
).matches
) {
result = window.matchMedia('(any-pointer:coarse)').matches;
} else if ('msMaxTouchPoints' in navigator) { } else if ('msMaxTouchPoints' in navigator) {
result = navigator.msMaxTouchPoints > 0; result = navigator.msMaxTouchPoints > 0;
}; }
return result; return result;
}()), })(),
touchScreenDetectable = touchScreen !== null, touchScreenDetectable = touchScreen !== null,
touch = touchScreenDetectable ? touchScreen : L.Browser.touch; touch = touchScreenDetectable ? touchScreen : L.Browser.touch;
@ -21,5 +25,4 @@
touchScreenDetectable: touchScreenDetectable, touchScreenDetectable: touchScreenDetectable,
touch: touch touch: touch
}; };
})();
}());

View file

@ -13,7 +13,7 @@ BR.LayersConfig = L.Class.extend({
loadDefaultLayers: function() { loadDefaultLayers: function() {
if (BR.Util.localStorageAvailable()) { if (BR.Util.localStorageAvailable()) {
var item = localStorage.getItem("map/defaultLayers"); var item = localStorage.getItem('map/defaultLayers');
if (item) { if (item) {
var defaultLayers = JSON.parse(item); var defaultLayers = JSON.parse(item);
this.defaultBaseLayers = defaultLayers.baseLayers; this.defaultBaseLayers = defaultLayers.baseLayers;
@ -28,7 +28,10 @@ BR.LayersConfig = L.Class.extend({
baseLayers: baseLayers, baseLayers: baseLayers,
overlays: overlays overlays: overlays
}; };
localStorage.setItem("map/defaultLayers", JSON.stringify(defaultLayers)); localStorage.setItem(
'map/defaultLayers',
JSON.stringify(defaultLayers)
);
} }
}, },
@ -44,7 +47,7 @@ BR.LayersConfig = L.Class.extend({
name: id.replace('.', ' '), name: id.replace('.', ' '),
dataSource: 'leaflet-providers' dataSource: 'leaflet-providers'
}, },
type: "Feature" type: 'Feature'
}; };
BR.layerIndex[id] = obj; BR.layerIndex[id] = obj;
} }
@ -71,7 +74,8 @@ BR.LayersConfig = L.Class.extend({
BR.layerIndex['MtbMap'].geometry = BR.confLayers.europeGeofabrik; BR.layerIndex['MtbMap'].geometry = BR.confLayers.europeGeofabrik;
BR.layerIndex['1069'].geometry = BR.confLayers.europeGeofabrik; BR.layerIndex['1069'].geometry = BR.confLayers.europeGeofabrik;
BR.layerIndex['OpenStreetMap.CH'].geometry = BR.confLayers.switzerlandPadded; BR.layerIndex['OpenStreetMap.CH'].geometry =
BR.confLayers.switzerlandPadded;
}, },
isDefaultLayer: function(id, overlay) { isDefaultLayer: function(id, overlay) {
@ -167,7 +171,12 @@ BR.LayersConfig = L.Class.extend({
if (attr.html) { if (attr.html) {
result = attr.html; result = attr.html;
} else if (attr.url && attr.text) { } else if (attr.url && attr.text) {
result = '<a href="' + attr.url + '" target="_blank" rel="noopener">' + attr.text + '</a>'; result =
'<a href="' +
attr.url +
'" target="_blank" rel="noopener">' +
attr.text +
'</a>';
} else if (attr.text) { } else if (attr.text) {
result = attr.text; result = attr.text;
} }
@ -179,13 +188,20 @@ BR.LayersConfig = L.Class.extend({
return result; return result;
} }
var options = { var options = {
maxZoom: this._map.getMaxZoom(), maxZoom: this._map.getMaxZoom(),
bounds: layerData.geometry && !props.worldTiles ? L.geoJson(layerData.geometry).getBounds() : null bounds:
layerData.geometry && !props.worldTiles
? L.geoJson(layerData.geometry).getBounds()
: null
}; };
if (props.mapUrl) { if (props.mapUrl) {
options.mapLink = '<a target="_blank" href="' + props.mapUrl + '">' + (props.nameShort || props.name) + '</a>'; options.mapLink =
'<a target="_blank" href="' +
props.mapUrl +
'">' +
(props.nameShort || props.name) +
'</a>';
} }
if (props.attribution) { if (props.attribution) {
options.attribution = props.attribution; options.attribution = props.attribution;
@ -200,15 +216,17 @@ BR.LayersConfig = L.Class.extend({
layer = L.tileLayer.provider(props.id); layer = L.tileLayer.provider(props.id);
var layerOptions = L.Util.extend(options, { var layerOptions = L.Util.extend(options, {
maxNativeZoom: layer.options.maxZoom, maxNativeZoom: layer.options.maxZoom
}); });
L.setOptions(layer, layerOptions); L.setOptions(layer, layerOptions);
} else if (props.dataSource === 'LayersCollection') { } else if (props.dataSource === 'LayersCollection') {
layer = L.tileLayer(url, L.Util.extend(options, { layer = L.tileLayer(
url,
L.Util.extend(options, {
minZoom: props.minZoom || 0, minZoom: props.minZoom || 0,
maxNativeZoom: props.maxZoom maxNativeZoom: props.maxZoom
})); })
);
if (props.subdomains) { if (props.subdomains) {
layer.subdomains = props.subdomains; layer.subdomains = props.subdomains;
} }
@ -225,10 +243,13 @@ BR.LayersConfig = L.Class.extend({
}); });
if (props.type && props.type === 'wms') { if (props.type && props.type === 'wms') {
layer = L.tileLayer.wms(url, L.Util.extend(josmOptions, { layer = L.tileLayer.wms(
url,
L.Util.extend(josmOptions, {
layers: props.layers, layers: props.layers,
format: props.format format: props.format
})); })
);
} else { } else {
layer = L.tileLayer(url, josmOptions); layer = L.tileLayer(url, josmOptions);
} }
@ -239,7 +260,7 @@ BR.LayersConfig = L.Class.extend({
// Copyright attribution in index.html #credits // Copyright attribution in index.html #credits
var getAttribution = function() { var getAttribution = function() {
return this.options.mapLink; return this.options.mapLink;
} };
layer.getAttribution = getAttribution; layer.getAttribution = getAttribution;
layer.id = props.id; layer.id = props.id;

View file

@ -1,8 +1,6 @@
BR.Map = { BR.Map = {
initMap: function() { initMap: function() {
var map, var map, layersControl;
layersControl;
BR.keys = BR.keys || {}; BR.keys = BR.keys || {};
@ -14,21 +12,33 @@ BR.Map = {
minZoom: 0, minZoom: 0,
maxZoom: maxZoom maxZoom: maxZoom
}); });
L.control.zoom({ L.control
.zoom({
zoomInTitle: i18next.t('map.zoomInTitle'), zoomInTitle: i18next.t('map.zoomInTitle'),
zoomOutTitle: i18next.t('map.zoomOutTitle'), zoomOutTitle: i18next.t('map.zoomOutTitle')
}).addTo(map); })
.addTo(map);
if (!map.restoreView()) { if (!map.restoreView()) {
map.setView([50.99, 9.86], 6); map.setView([50.99, 9.86], 6);
} }
// two attribution lines by adding two controls, prevents ugly wrapping on // two attribution lines by adding two controls, prevents ugly wrapping on
// small screens, better separates static from layer-specific attribution // small screens, better separates static from layer-specific attribution
var osmAttribution = $(map.getContainer()).outerWidth() >= 400 ? i18next.t('map.attribution-osm-long') : i18next.t('map.attribution-osm-short'); var osmAttribution =
$(map.getContainer()).outerWidth() >= 400
? i18next.t('map.attribution-osm-long')
: i18next.t('map.attribution-osm-short');
map.attributionControl.setPrefix( map.attributionControl.setPrefix(
'&copy; <a target="_blank" href="https://www.openstreetmap.org/copyright">' + osmAttribution + '</a>' + '&copy; <a target="_blank" href="https://www.openstreetmap.org/copyright">' +
' &middot; <a href="" data-toggle="modal" data-target="#credits">' + i18next.t('map.copyright') + '</a>' + osmAttribution +
' &middot; <a target="_blank" href="http://brouter.de/privacypolicy.html">' + i18next.t('map.privacy') + '</a>'); '</a>' +
' &middot; <a href="" data-toggle="modal" data-target="#credits">' +
i18next.t('map.copyright') +
'</a>' +
' &middot; <a target="_blank" href="http://brouter.de/privacypolicy.html">' +
i18next.t('map.privacy') +
'</a>'
);
$('#credits').on('show.bs.modal', function(event) { $('#credits').on('show.bs.modal', function(event) {
BR.Map._renderLayerCredits(layersControl._layers); BR.Map._renderLayerCredits(layersControl._layers);
@ -42,15 +52,22 @@ BR.Map = {
var overlays = layersConfig.getOverlays(); var overlays = layersConfig.getOverlays();
if (BR.keys.bing) { if (BR.keys.bing) {
baseLayers[i18next.t('map.layer.bing')] = new BR.BingLayer(BR.keys.bing); baseLayers[i18next.t('map.layer.bing')] = new BR.BingLayer(
BR.keys.bing
);
} }
if (BR.keys.digitalGlobe) { if (BR.keys.digitalGlobe) {
var recent = new L.tileLayer('https://{s}.tiles.mapbox.com/v4/digitalglobe.nal0g75k/{z}/{x}/{y}.png?access_token=' + BR.keys.digitalGlobe, { var recent = new L.tileLayer(
'https://{s}.tiles.mapbox.com/v4/digitalglobe.nal0g75k/{z}/{x}/{y}.png?access_token=' +
BR.keys.digitalGlobe,
{
minZoom: 1, minZoom: 1,
maxZoom: 19, maxZoom: 19,
attribution: '&copy; <a href=\"https://www.digitalglobe.com/platforms/mapsapi\">DigitalGlobe</a> (<a href=\"https://bit.ly/mapsapiview\">Terms of Use</a>)' attribution:
}); '&copy; <a href="https://www.digitalglobe.com/platforms/mapsapi">DigitalGlobe</a> (<a href="https://bit.ly/mapsapiview">Terms of Use</a>)'
}
);
baseLayers[i18next.t('map.layer.digitalglobe')] = recent; baseLayers[i18next.t('map.layer.digitalglobe')] = recent;
} }
@ -69,17 +86,24 @@ BR.Map = {
} }
} }
layersControl = BR.layersTab(layersConfig, baseLayers, overlays).addTo(map); layersControl = BR.layersTab(layersConfig, baseLayers, overlays).addTo(
map
);
var secureContext = 'isSecureContext' in window ? isSecureContext : location.protocol === 'https:'; var secureContext =
'isSecureContext' in window
? isSecureContext
: location.protocol === 'https:';
if (secureContext) { if (secureContext) {
L.control.locate({ L.control
.locate({
strings: { strings: {
title: i18next.t('map.locate-me') title: i18next.t('map.locate-me')
}, },
icon: 'fa fa-location-arrow', icon: 'fa fa-location-arrow',
iconLoading: 'fa fa-spinner fa-pulse', iconLoading: 'fa fa-spinner fa-pulse'
}).addTo(map); })
.addTo(map);
} }
L.control.scale().addTo(map); L.control.scale().addTo(map);

View file

@ -1,5 +1,4 @@
BR.Util = { BR.Util = {
get: function(url, cb) { get: function(url, cb) {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
@ -46,8 +45,7 @@ BR.Util = {
storage.setItem(x, x); storage.setItem(x, x);
storage.removeItem(x); storage.removeItem(x);
return true; return true;
} } catch (e) {
catch(e) {
return false; return false;
} }
} }

View file

@ -1,5 +1,4 @@
BR.ControlLayers = L.Control.Layers.extend({ BR.ControlLayers = L.Control.Layers.extend({
getActiveLayers: function() { getActiveLayers: function() {
var result = []; var result = [];
@ -95,5 +94,4 @@ BR.ControlLayers = L.Control.Layers.extend({
} }
} }
} }
}); });

View file

@ -6,7 +6,7 @@ BR.Download = L.Class.extend({
a.setAttribute('href', urls[e]); a.setAttribute('href', urls[e]);
a.setAttribute('download', 'brouter.' + e); a.setAttribute('download', 'brouter.' + e);
a.removeAttribute('disabled'); a.removeAttribute('disabled');
}) });
} }
} }
}); });

View file

@ -1,19 +1,19 @@
BR.Itinerary = L.Class.extend({ BR.Itinerary = L.Class.extend({
initialize: function() { initialize: function() {
this._content = document.getElementById('itinerary'); this._content = document.getElementById('itinerary');
this.update(); this.update();
}, },
update: function(polyline, segments) { update: function(polyline, segments) {
var i, j, iter, html = ''; var i,
j,
iter,
html = '';
html += '<pre class="flexgrow">'; html += '<pre class="flexgrow">';
for (i = 0; segments && i < segments.length; i++) for (i = 0; segments && i < segments.length; i++) {
{
iter = segments[i].feature.iternity; iter = segments[i].feature.iternity;
for (j = 0; iter && j < iter.length; j++) for (j = 0; iter && j < iter.length; j++) {
{
html += iter[j] + '\n'; html += iter[j] + '\n';
} }
} }

View file

@ -1,10 +1,9 @@
BR.Layers = L.Class.extend({ BR.Layers = L.Class.extend({
_loadLayers: function() { _loadLayers: function() {
this._customLayers = {}; this._customLayers = {};
if (BR.Util.localStorageAvailable()) { if (BR.Util.localStorageAvailable()) {
var layers = JSON.parse(localStorage.getItem("map/customLayers")); var layers = JSON.parse(localStorage.getItem('map/customLayers'));
for (a in layers) { for (a in layers) {
this._addLayer(a, layers[a].layer, layers[a].isOverlay); this._addLayer(a, layers[a].layer, layers[a].isOverlay);
} }
@ -14,7 +13,11 @@ BR.Layers = L.Class.extend({
_loadTable: function() { _loadTable: function() {
var layersData = []; var layersData = [];
for (layer in this._customLayers) { for (layer in this._customLayers) {
layersData.push([layer, this._customLayers[layer].layer._url, this._customLayers[layer].isOverlay ? "Overlay" : "Layer"]); layersData.push([
layer,
this._customLayers[layer].layer._url,
this._customLayers[layer].isOverlay ? 'Overlay' : 'Layer'
]);
} }
if (this._layersTable != null) { if (this._layersTable != null) {
this._layersTable.destroy(); this._layersTable.destroy();
@ -26,12 +29,12 @@ BR.Layers = L.Class.extend({
searching: false, searching: false,
paging: false, paging: false,
language: { language: {
emptyTable: i18next.t("sidebar.layers.table.empty") emptyTable: i18next.t('sidebar.layers.table.empty')
}, },
columns: [ columns: [
{ title: i18next.t("sidebar.layers.table.name") }, { title: i18next.t('sidebar.layers.table.name') },
{ title: i18next.t("sidebar.layers.table.URL") }, { title: i18next.t('sidebar.layers.table.URL') },
{ title: i18next.t("sidebar.layers.table.type") } { title: i18next.t('sidebar.layers.table.type') }
] ]
}); });
}, },
@ -39,15 +42,22 @@ BR.Layers = L.Class.extend({
init: function(map, layersControl, baseLayers, overlays) { init: function(map, layersControl, baseLayers, overlays) {
this._layersControl = layersControl; this._layersControl = layersControl;
this._map = map; this._map = map;
this._layers = {} this._layers = {};
for (var l in overlays) for (var l in overlays) this._layers[l] = [overlays[l], true];
this._layers[l] = [overlays[l], true]; for (var l in baseLayers) this._layers[l] = [baseLayers[l], false];
for (var l in baseLayers)
this._layers[l] = [baseLayers[l], false];
L.DomUtil.get('custom_layers_add_base').onclick = L.bind(this._addBaseLayer, this); L.DomUtil.get('custom_layers_add_base').onclick = L.bind(
L.DomUtil.get('custom_layers_add_overlay').onclick = L.bind(this._addOverlay, this); this._addBaseLayer,
L.DomUtil.get('custom_layers_remove').onclick = L.bind(this._remove, this); this
);
L.DomUtil.get('custom_layers_add_overlay').onclick = L.bind(
this._addOverlay,
this
);
L.DomUtil.get('custom_layers_remove').onclick = L.bind(
this._remove,
this
);
this._loadLayers(); this._loadLayers();
this._loadTable(); this._loadTable();
@ -74,7 +84,10 @@ BR.Layers = L.Class.extend({
this._layersControl.removeLayer(this._customLayers[name].layer); this._layersControl.removeLayer(this._customLayers[name].layer);
this._map.removeLayer(this._customLayers[name].layer); this._map.removeLayer(this._customLayers[name].layer);
delete this._customLayers[name]; delete this._customLayers[name];
this._layersTable.row('.selected').remove().draw( false ); this._layersTable
.row('.selected')
.remove()
.draw(false);
this._sync(); this._sync();
} }
}, },
@ -94,16 +107,17 @@ BR.Layers = L.Class.extend({
}, },
_addLayer: function(layerName, layerUrl, isOverlay) { _addLayer: function(layerName, layerUrl, isOverlay) {
if (layerName in this._layers) if (layerName in this._layers) return;
return
if (layerName in this._customLayers) if (layerName in this._customLayers) return;
return
try { try {
var layer = L.tileLayer(layerUrl); var layer = L.tileLayer(layerUrl);
this._customLayers[layerName] = {layer: layer, isOverlay: isOverlay}; this._customLayers[layerName] = {
layer: layer,
isOverlay: isOverlay
};
if (isOverlay) { if (isOverlay) {
this._layersControl.addOverlay(layer, layerName); this._layersControl.addOverlay(layer, layerName);
@ -114,17 +128,20 @@ BR.Layers = L.Class.extend({
this._sync(); this._sync();
return layer; return layer;
} catch (e) { } catch (e) {
console.warn("Oops:", e); console.warn('Oops:', e);
return return;
} }
}, },
_sync: function() { _sync: function() {
if (BR.Util.localStorageAvailable()) { if (BR.Util.localStorageAvailable()) {
localStorage.setItem("map/customLayers", JSON.stringify(this._customLayers, function(k, v) { localStorage.setItem(
'map/customLayers',
JSON.stringify(this._customLayers, function(k, v) {
// dont write Leaflet.Layer in localStorage; simply keep the URL // dont write Leaflet.Layer in localStorage; simply keep the URL
return v._url || v; return v._url || v;
})); })
);
} }
} }
}); });

View file

@ -4,7 +4,12 @@ BR.LayersTab = BR.ControlLayers.extend({
saveLayers: [], saveLayers: [],
initialize: function(layersConfig, baseLayers, overlays, options) { initialize: function(layersConfig, baseLayers, overlays, options) {
L.Control.Layers.prototype.initialize.call(this, baseLayers, overlays, options); L.Control.Layers.prototype.initialize.call(
this,
baseLayers,
overlays,
options
);
this.layersConfig = layersConfig; this.layersConfig = layersConfig;
}, },
@ -44,9 +49,15 @@ BR.LayersTab = BR.ControlLayers.extend({
}; };
L.DomUtil.get('expand_tree_button').onclick = L.bind(expandTree, this); L.DomUtil.get('expand_tree_button').onclick = L.bind(expandTree, this);
L.DomUtil.get('collapse_tree_button').onclick = L.bind(collapseTree, this); L.DomUtil.get('collapse_tree_button').onclick = L.bind(
collapseTree,
this
);
L.DomUtil.get('optional_layers_button').onclick = L.bind(toggleOptionalLayers, this); L.DomUtil.get('optional_layers_button').onclick = L.bind(
toggleOptionalLayers,
this
);
}, },
initJsTree: function() { initJsTree: function() {
@ -117,12 +128,12 @@ BR.LayersTab = BR.ControlLayers.extend({
tie_selection: false tie_selection: false
}, },
core: { core: {
'multiple': false, multiple: false,
'themes': { themes: {
'icons': false, icons: false,
dots: false dots: false
}, },
'data' : treeData data: treeData
} }
}); });
this.jstree = $('#optional-layers-tree').jstree(true); this.jstree = $('#optional-layers-tree').jstree(true);
@ -136,11 +147,11 @@ BR.LayersTab = BR.ControlLayers.extend({
function createRootNode(name) { function createRootNode(name) {
var rootNode = { var rootNode = {
'text': i18next.t('sidebar.layers.category.' + name, name), text: i18next.t('sidebar.layers.category.' + name, name),
'state': { state: {
'disabled': true disabled: true
}, },
'children': [] children: []
}; };
return rootNode; return rootNode;
} }
@ -163,12 +174,15 @@ BR.LayersTab = BR.ControlLayers.extend({
var childNode = null; var childNode = null;
// when key required only add if configured // when key required only add if configured
if (!keyObj || keyObj && BR.keys[keyObj.name]) { if (!keyObj || (keyObj && BR.keys[keyObj.name])) {
childNode = { childNode = {
'id': id, id: id,
'text': getText(props, parent), text: getText(props, parent),
'state': { state: {
'checked': self.layersConfig.isDefaultLayer(id, props.overlay) checked: self.layersConfig.isDefaultLayer(
id,
props.overlay
)
} }
}; };
} }
@ -179,7 +193,7 @@ BR.LayersTab = BR.ControlLayers.extend({
function walkObject(obj) { function walkObject(obj) {
for (name in obj) { for (name in obj) {
var value = obj[name]; var value = obj[name];
var rootNode = createRootNode(name) var rootNode = createRootNode(name);
outTree.children.push(rootNode); outTree.children.push(rootNode);
walkTree(value, rootNode); walkTree(value, rootNode);
@ -336,12 +350,15 @@ BR.LayersTab = BR.ControlLayers.extend({
onBaselayerchange: function() { onBaselayerchange: function() {
// execute after current input click handler, // execute after current input click handler,
// otherwise added overlay checkbox state doesn't update // otherwise added overlay checkbox state doesn't update
setTimeout(L.Util.bind(function () { setTimeout(
L.Util.bind(function() {
this.removePreviewBounds(); this.removePreviewBounds();
this.removePreviewLayer(); this.removePreviewLayer();
this.restoreActiveLayers(true); this.restoreActiveLayers(true);
this.deselectNode(); this.deselectNode();
}, this), 0); }, this),
0
);
}, },
showPreview: function(layerData) { showPreview: function(layerData) {

View file

@ -12,19 +12,26 @@ BR.Message = L.Class.extend({
_show: function(msg, type) { _show: function(msg, type) {
var ele = L.DomUtil.get(this.id), var ele = L.DomUtil.get(this.id),
iconClass = (type === 'warning') ? 'fa-exclamation-triangle' : 'fa-times-circle', iconClass =
alertClass = (type === 'warning') ? 'alert-warning' : 'alert-danger'; type === 'warning'
? 'fa-exclamation-triangle'
: 'fa-times-circle',
alertClass = type === 'warning' ? 'alert-warning' : 'alert-danger';
L.DomEvent.disableClickPropagation(ele); L.DomEvent.disableClickPropagation(ele);
ele.innerHTML = ele.innerHTML =
'<div class="alert ' + alertClass + ' alert-dismissible fade in" role="alert">' '<div class="alert ' +
+ ' <button type="button" class="close" data-dismiss="alert" aria-label="Close">' alertClass +
+ ' <span aria-hidden="true">&times;</span>' ' alert-dismissible fade in" role="alert">' +
+ ' </button>' ' <button type="button" class="close" data-dismiss="alert" aria-label="Close">' +
+ ' <span class="fa ' + iconClass + '" aria-hidden="true"/></span>' ' <span aria-hidden="true">&times;</span>' +
+ msg ' </button>' +
+ '</div>'; ' <span class="fa ' +
iconClass +
'" aria-hidden="true"/></span>' +
msg +
'</div>';
if (this.options.alert) { if (this.options.alert) {
$('#' + this.id + ' .alert').alert(); $('#' + this.id + ' .alert').alert();

View file

@ -7,7 +7,9 @@ BR.OpacitySlider = L.Control.extend({
onAdd: function(map) { onAdd: function(map) {
var container = L.DomUtil.create('div', 'leaflet-bar control-slider'), var container = L.DomUtil.create('div', 'leaflet-bar control-slider'),
input = $('<input id="slider" type="text"/>'), input = $('<input id="slider" type="text"/>'),
item = BR.Util.localStorageAvailable() ? localStorage.opacitySliderValue : null, item = BR.Util.localStorageAvailable()
? localStorage.opacitySliderValue
: null,
value = item ? parseInt(item) : BR.conf.defaultOpacity * 100, value = item ? parseInt(item) : BR.conf.defaultOpacity * 100,
minOpacity = (BR.conf.minOpacity || 0) * 100; minOpacity = (BR.conf.minOpacity || 0) * 100;
@ -24,13 +26,18 @@ BR.OpacitySlider = L.Control.extend({
}; };
var removeStopClickListeners = function() { var removeStopClickListeners = function() {
document.removeEventListener('click', stopClickAfterSlide, true); document.removeEventListener('click', stopClickAfterSlide, true);
document.removeEventListener('mousedown', removeStopClickListeners, true); document.removeEventListener(
'mousedown',
removeStopClickListeners,
true
);
}; };
$(container).html(input); $(container).html(input);
$(container).attr('title', i18next.t('map.opacity-slider')); $(container).attr('title', i18next.t('map.opacity-slider'));
input.slider({ input
.slider({
min: 0, min: 0,
max: 100, max: 100,
step: 1, step: 1,
@ -39,12 +46,15 @@ BR.OpacitySlider = L.Control.extend({
reversed: true, reversed: true,
selection: 'before', // inverted, serves as track style, see css selection: 'before', // inverted, serves as track style, see css
tooltip: 'hide' tooltip: 'hide'
}).on('slideStart', function (evt) { })
.on('slideStart', function(evt) {
// dragging beyond slider control selects zoom control +/- text in Firefox // dragging beyond slider control selects zoom control +/- text in Firefox
L.DomUtil.disableTextSelection(); L.DomUtil.disableTextSelection();
}).on('slide slideStop', { self: this }, function (evt) { })
.on('slide slideStop', { self: this }, function(evt) {
evt.data.self.options.callback(evt.value / 100); evt.data.self.options.callback(evt.value / 100);
}).on('slideStop', function (evt) { })
.on('slideStop', function(evt) {
if (BR.Util.localStorageAvailable()) { if (BR.Util.localStorageAvailable()) {
localStorage.opacitySliderValue = evt.value; localStorage.opacitySliderValue = evt.value;
} }
@ -57,7 +67,11 @@ BR.OpacitySlider = L.Control.extend({
document.addEventListener('click', stopClickAfterSlide, true); document.addEventListener('click', stopClickAfterSlide, true);
// Firefox does not fire click event in this case, so make sure stop listener // Firefox does not fire click event in this case, so make sure stop listener
// is always removed on next mousedown. // is always removed on next mousedown.
document.addEventListener('mousedown', removeStopClickListeners, true); document.addEventListener(
'mousedown',
removeStopClickListeners,
true
);
}); });
this.options.callback(value / 100); this.options.callback(value / 100);

View file

@ -19,7 +19,7 @@ BR.Profile = L.Evented.extend({
var button = evt.target || evt.srcElement; var button = evt.target || evt.srcElement;
evt.preventDefault(); evt.preventDefault();
this._setValue(""); this._setValue('');
this.fire('clear'); this.fire('clear');
button.blur(); button.blur();
@ -35,19 +35,30 @@ BR.Profile = L.Evented.extend({
if (profileName && BR.conf.profilesUrl && (empty || clean)) { if (profileName && BR.conf.profilesUrl && (empty || clean)) {
if (!(profileName in this.cache)) { if (!(profileName in this.cache)) {
profileUrl = BR.conf.profilesUrl + profileName + '.brf'; profileUrl = BR.conf.profilesUrl + profileName + '.brf';
BR.Util.get(profileUrl, L.bind(function(err, profileText) { BR.Util.get(
profileUrl,
L.bind(function(err, profileText) {
if (err) { if (err) {
console.warn('Error getting profile from "' + profileUrl + '": ' + err); console.warn(
'Error getting profile from "' +
profileUrl +
'": ' +
err
);
return; return;
} }
this.cache[profileName] = profileText; this.cache[profileName] = profileText;
// don't set when option has changed while loading // don't set when option has changed while loading
if (!this.profileName || this.profileName === profileName) { if (
!this.profileName ||
this.profileName === profileName
) {
this._setValue(profileText); this._setValue(profileText);
} }
}, this)); }, this)
);
} else { } else {
this._setValue(this.cache[profileName]); this._setValue(this.cache[profileName]);
} }

View file

@ -1,19 +1,21 @@
BR.RoutingOptions = L.Evented.extend({ BR.RoutingOptions = L.Evented.extend({
initialize: function() { initialize: function() {
$('#profile-alternative').on('changed.bs.select', this._getChangeHandler()); $('#profile-alternative').on(
'changed.bs.select',
this._getChangeHandler()
);
// build option list from config // build option list from config
var profiles = BR.conf.profiles; var profiles = BR.conf.profiles;
var profiles_list = L.DomUtil.get('profile'); var profiles_list = L.DomUtil.get('profile');
for (var i = 0; i < profiles.length; i++) { for (var i = 0; i < profiles.length; i++) {
var option = document.createElement("option"); var option = document.createElement('option');
option.value = profiles[i]; option.value = profiles[i];
option.text = i18next.t("navbar.profile." + profiles[i]); option.text = i18next.t('navbar.profile.' + profiles[i]);
profiles_list.appendChild(option); profiles_list.appendChild(option);
} }
// set default value, used as indicator for empty custom profile // set default value, used as indicator for empty custom profile
profiles_list.children[0].value = "Custom"; profiles_list.children[0].value = 'Custom';
// <custom> profile is empty at start, select next one // <custom> profile is empty at start, select next one
profiles_list.children[1].selected = true; profiles_list.children[1].selected = true;
}, },
@ -21,19 +23,23 @@ BR.RoutingOptions = L.Evented.extend({
refreshUI: function() { refreshUI: function() {
// we do not allow to select more than one profile and/or alternative at a time // we do not allow to select more than one profile and/or alternative at a time
// so we disable the current selected items // so we disable the current selected items
$('#profile-alternative').find('option:disabled').each(function(index) { $('#profile-alternative')
.find('option:disabled')
.each(function(index) {
$(this).prop('disabled', false); $(this).prop('disabled', false);
}); });
$('#profile-alternative').find('option:selected').each(function(index) { $('#profile-alternative')
.find('option:selected')
.each(function(index) {
$(this).prop('disabled', true); $(this).prop('disabled', true);
}); });
// disable custom option if it has no value yet (default value is "Custom") // disable custom option if it has no value yet (default value is "Custom")
var custom = L.DomUtil.get('profile').children[0]; var custom = L.DomUtil.get('profile').children[0];
if (custom.value === "Custom") { if (custom.value === 'Custom') {
custom.disabled = true; custom.disabled = true;
} }
$('.selectpicker').selectpicker('refresh') $('.selectpicker').selectpicker('refresh');
}, },
getOptions: function() { getOptions: function() {
@ -49,8 +55,12 @@ BR.RoutingOptions = L.Evented.extend({
setOptions: function(options) { setOptions: function(options) {
var values = [ var values = [
options.profile ? options.profile : $('#profile option:selected').val(), options.profile
options.alternative ? options.alternative : $('#alternative option:selected').val() ? options.profile
: $('#profile option:selected').val(),
options.alternative
? options.alternative
: $('#alternative option:selected').val()
]; ];
$('.selectpicker').selectpicker('val', values); $('.selectpicker').selectpicker('val', values);
this.refreshUI(); this.refreshUI();
@ -64,16 +74,17 @@ BR.RoutingOptions = L.Evented.extend({
}, },
setCustomProfile: function(profile, noUpdate) { setCustomProfile: function(profile, noUpdate) {
var profiles_grp, var profiles_grp, option;
option;
profiles_grp = L.DomUtil.get('profile'); profiles_grp = L.DomUtil.get('profile');
option = profiles_grp.children[0]; option = profiles_grp.children[0];
option.value = profile || "Custom"; option.value = profile || 'Custom';
option.disabled = !profile; option.disabled = !profile;
if (profile) { if (profile) {
$('#profile').find('option:selected').each(function(index) { $('#profile')
.find('option:selected')
.each(function(index) {
$(this).prop('selected', false); $(this).prop('selected', false);
}); });
} else if (option.selected) { } else if (option.selected) {
@ -93,7 +104,7 @@ BR.RoutingOptions = L.Evented.extend({
option = profiles_grp.children[0], option = profiles_grp.children[0],
profile = null; profile = null;
if (option.value !== "Custom") { if (option.value !== 'Custom') {
profile = option.value; profile = option.value;
} }
return profile; return profile;

View file

@ -1,5 +1,4 @@
BR.TrackMessages = L.Class.extend({ BR.TrackMessages = L.Class.extend({
options: { options: {
edgeStyle: { edgeStyle: {
color: 'yellow', color: 'yellow',
@ -12,15 +11,15 @@ BR.TrackMessages = L.Class.extend({
active: false, active: false,
columnOptions: { columnOptions: {
'Longitude': { visible: false }, Longitude: { visible: false },
'Latitude': { visible: false }, Latitude: { visible: false },
'Elevation': { title: 'elev.', className: 'dt-body-right' }, Elevation: { title: 'elev.', className: 'dt-body-right' },
'Distance': { title: 'dist.', className: 'dt-body-right' }, Distance: { title: 'dist.', className: 'dt-body-right' },
'CostPerKm': { title: '$/km', className: 'dt-body-right' }, CostPerKm: { title: '$/km', className: 'dt-body-right' },
'ElevCost': { title: 'elev$', className: 'dt-body-right' }, ElevCost: { title: 'elev$', className: 'dt-body-right' },
'TurnCost': { title: 'turn$', className: 'dt-body-right' }, TurnCost: { title: 'turn$', className: 'dt-body-right' },
'NodeCost': { title: 'node$', className: 'dt-body-right' }, NodeCost: { title: 'node$', className: 'dt-body-right' },
'InitialCost': { title: 'initial$', className: 'dt-body-right' } InitialCost: { title: 'initial$', className: 'dt-body-right' }
}, },
initialize: function(map, options) { initialize: function(map, options) {
@ -33,7 +32,10 @@ BR.TrackMessages = L.Class.extend({
}, },
update: function(polyline, segments) { update: function(polyline, segments) {
var i, messages, columns, headings, var i,
messages,
columns,
headings,
data = []; data = [];
if (!this.active) { if (!this.active) {
@ -72,7 +74,10 @@ BR.TrackMessages = L.Class.extend({
// highlight track segment (graph edge) on row hover // highlight track segment (graph edge) on row hover
this._setEdges(polyline, segments); this._setEdges(polyline, segments);
$('#datatable tbody tr').hover(L.bind(this._handleHover, this), L.bind(this._handleHoverOut, this)); $('#datatable tbody tr').hover(
L.bind(this._handleHover, this),
L.bind(this._handleHoverOut, this)
);
}, },
show: function() { show: function() {
@ -89,7 +94,9 @@ BR.TrackMessages = L.Class.extend({
if ($.fn.DataTable.isDataTable('#datatable')) { if ($.fn.DataTable.isDataTable('#datatable')) {
// destroy option too slow on update, really remove elements with destroy method // destroy option too slow on update, really remove elements with destroy method
$('#datatable').DataTable().destroy(true); $('#datatable')
.DataTable()
.destroy(true);
// recreate original table element, destroy removes all // recreate original table element, destroy removes all
ele = document.createElement('table'); ele = document.createElement('table');
@ -143,7 +150,14 @@ BR.TrackMessages = L.Class.extend({
}, },
_setEdges: function(polyline, segments) { _setEdges: function(polyline, segments) {
var messages, segLatLngs, length, si, mi, latLng, i, segIndex, var messages,
segLatLngs,
length,
si,
mi,
latLng,
i,
segIndex,
baseIndex = 0; baseIndex = 0;
// track latLngs index for end node of edge // track latLngs index for end node of edge
@ -184,7 +198,10 @@ BR.TrackMessages = L.Class.extend({
endIndex = this._edges[row.index()], endIndex = this._edges[row.index()],
edgeLatLngs = trackLatLngs.slice(startIndex, endIndex + 1); edgeLatLngs = trackLatLngs.slice(startIndex, endIndex + 1);
this._selectedEdge = L.polyline(edgeLatLngs, this.options.edgeStyle).addTo(this._map); this._selectedEdge = L.polyline(
edgeLatLngs,
this.options.edgeStyle
).addTo(this._map);
}, },
_handleHoverOut: function(evt) { _handleHoverOut: function(evt) {

View file

@ -3,21 +3,34 @@ BR.TrackStats = L.Class.extend({
var stats = this.calcStats(polyline, segments), var stats = this.calcStats(polyline, segments),
length1 = L.Util.formatNum(stats.trackLength / 1000, 1), length1 = L.Util.formatNum(stats.trackLength / 1000, 1),
length3 = L.Util.formatNum(stats.trackLength / 1000, 3), length3 = L.Util.formatNum(stats.trackLength / 1000, 3),
meanCostFactor = stats.trackLength ? L.Util.formatNum(stats.cost / stats.trackLength, 2) : '', meanCostFactor = stats.trackLength
formattedTime = L.Util.formatNum(stats.totalTime / 60., 1), ? L.Util.formatNum(stats.cost / stats.trackLength, 2)
formattedEnergy = L.Util.formatNum(stats.totalEnergy / 3600000., 2), : '',
meanEnergy = stats.trackLength ? L.Util.formatNum(stats.totalEnergy / 36. / stats.trackLength, 2) : ''; formattedTime = L.Util.formatNum(stats.totalTime / 60, 1),
formattedEnergy = L.Util.formatNum(stats.totalEnergy / 3600000, 2),
meanEnergy = stats.trackLength
? L.Util.formatNum(
stats.totalEnergy / 36 / stats.trackLength,
2
)
: '';
$('#distance').html(length1); $('#distance').html(length1);
// alternative 3-digit format down to meters as tooltip // alternative 3-digit format down to meters as tooltip
$('#distance').attr('title', length3 + ' km'); $('#distance').attr('title', length3 + ' km');
$('#ascend').html(stats.filteredAscend + ' (' + stats.plainAscend +')'); $('#ascend').html(
stats.filteredAscend + ' (' + stats.plainAscend + ')'
);
$('#cost').html(stats.cost + ' (' + meanCostFactor + ')'); $('#cost').html(stats.cost + ' (' + meanCostFactor + ')');
$('#totaltime').html(formattedTime); $('#totaltime').html(formattedTime);
$('#totalenergy').html(formattedEnergy + ' (' + meanEnergy + ')'); $('#totalenergy').html(formattedEnergy + ' (' + meanEnergy + ')');
document.getElementById('totaltime').parentElement.parentElement.hidden = !stats.totalTime; document.getElementById(
document.getElementById('totalenergy').parentElement.parentElement.hidden = !stats.totalEnergy; 'totaltime'
).parentElement.parentElement.hidden = !stats.totalTime;
document.getElementById(
'totalenergy'
).parentElement.parentElement.hidden = !stats.totalEnergy;
}, },
calcStats: function(polyline, segments) { calcStats: function(polyline, segments) {

View file

@ -5,14 +5,20 @@
*/ */
(function() { (function() {
var mapContext; var mapContext;
function verifyTouchStyle(mapContext) { function verifyTouchStyle(mapContext) {
// revert touch style (large icons) when touch screen detection is available and negative // revert touch style (large icons) when touch screen detection is available and negative
// see https://github.com/nrenner/brouter-web/issues/69 // see https://github.com/nrenner/brouter-web/issues/69
if (L.Browser.touch && BR.Browser.touchScreenDetectable && !BR.Browser.touchScreen) { if (
L.DomUtil.removeClass(mapContext.map.getContainer(), 'leaflet-touch'); L.Browser.touch &&
BR.Browser.touchScreenDetectable &&
!BR.Browser.touchScreen
) {
L.DomUtil.removeClass(
mapContext.map.getContainer(),
'leaflet-touch'
);
} }
} }
@ -52,7 +58,8 @@
router = L.bRouter(); //brouterCgi dummyRouter router = L.bRouter(); //brouterCgi dummyRouter
drawButton = L.easyButton({ drawButton = L.easyButton({
states: [{ states: [
{
stateName: 'deactivate-draw', stateName: 'deactivate-draw',
icon: 'fa-pencil active', icon: 'fa-pencil active',
onClick: function(control) { onClick: function(control) {
@ -60,7 +67,8 @@
control.state('activate-draw'); control.state('activate-draw');
}, },
title: i18next.t('map.draw-route-stop') title: i18next.t('map.draw-route-stop')
}, { },
{
stateName: 'activate-draw', stateName: 'activate-draw',
icon: 'fa-pencil', icon: 'fa-pencil',
onClick: function(control) { onClick: function(control) {
@ -68,7 +76,8 @@
control.state('deactivate-draw'); control.state('deactivate-draw');
}, },
title: i18next.t('map.draw-route-start') title: i18next.t('map.draw-route-start')
}] }
]
}); });
reverseRouteButton = L.easyButton( reverseRouteButton = L.easyButton(
@ -82,7 +91,10 @@
deletePointButton = L.easyButton( deletePointButton = L.easyButton(
'<span><i class="fa fa-caret-left"></i><i class="fa fa-map-marker" style="margin-left: 1px; color: gray;"></i></span>', '<span><i class="fa fa-caret-left"></i><i class="fa fa-map-marker" style="margin-left: 1px; color: gray;"></i></span>',
function() { function() {
routing.removeWaypoint(routing.getLast(), function(err, data) {}); routing.removeWaypoint(routing.getLast(), function(
err,
data
) {});
}, },
i18next.t('map.delete-last-point') i18next.t('map.delete-last-point')
); );
@ -138,11 +150,11 @@
profile.update(evt.options); profile.update(evt.options);
}); });
BR.NogoAreas.MSG_BUTTON = i18next.t("map.nogo.draw"); BR.NogoAreas.MSG_BUTTON = i18next.t('map.nogo.draw');
BR.NogoAreas.MSG_BUTTON_CANCEL = i18next.t("map.nogo.cancel"); BR.NogoAreas.MSG_BUTTON_CANCEL = i18next.t('map.nogo.cancel');
BR.NogoAreas.MSG_CREATE = i18next.t("map.nogo.click-drag"); BR.NogoAreas.MSG_CREATE = i18next.t('map.nogo.click-drag');
BR.NogoAreas.MSG_DISABLED = i18next.t("map.nogo.edit"); BR.NogoAreas.MSG_DISABLED = i18next.t('map.nogo.edit');
BR.NogoAreas.MSG_ENABLED = i18next.t("map.nogo.help"); BR.NogoAreas.MSG_ENABLED = i18next.t('map.nogo.help');
nogos = new BR.NogoAreas(); nogos = new BR.NogoAreas();
nogos.on('update', updateRoute); nogos.on('update', updateRoute);
@ -159,14 +171,19 @@
profile.on('update', function(evt) { profile.on('update', function(evt) {
BR.message.hide(); BR.message.hide();
var profileId = routingOptions.getCustomProfile(); var profileId = routingOptions.getCustomProfile();
router.uploadProfile(profileId, evt.profileText, function(err, profileId) { router.uploadProfile(profileId, evt.profileText, function(
err,
profileId
) {
if (!err) { if (!err) {
routingOptions.setCustomProfile(profileId, true); routingOptions.setCustomProfile(profileId, true);
updateRoute({ updateRoute({
options: routingOptions.getOptions() options: routingOptions.getOptions()
}); });
if (!saveWarningShown) { if (!saveWarningShown) {
profile.message.showWarning(i18next.t('warning.temporary-profile')); profile.message.showWarning(
i18next.t('warning.temporary-profile')
);
saveWarningShown = true; saveWarningShown = true;
} }
} else { } else {
@ -197,7 +214,9 @@
styles: BR.conf.routingStyles styles: BR.conf.routingStyles
}); });
routing.on('routing:routeWaypointEnd routing:setWaypointsEnd', function(evt) { routing.on('routing:routeWaypointEnd routing:setWaypointsEnd', function(
evt
) {
search.clear(); search.clear();
onUpdate(evt && evt.err); onUpdate(evt && evt.err);
}); });
@ -240,7 +259,7 @@
} }
download.update(urls); download.update(urls);
}; }
routing.addTo(map); routing.addTo(map);
elevation.addBelow(map); elevation.addBelow(map);
@ -248,8 +267,8 @@
sidebar = BR.sidebar({ sidebar = BR.sidebar({
defaultTabId: BR.conf.transit ? 'tab_itinerary' : 'tab_profile', defaultTabId: BR.conf.transit ? 'tab_itinerary' : 'tab_profile',
listeningTabs: { listeningTabs: {
'tab_profile': profile, tab_profile: profile,
'tab_data': trackMessages tab_data: trackMessages
} }
}).addTo(map); }).addTo(map);
if (BR.conf.transit) { if (BR.conf.transit) {
@ -257,16 +276,24 @@
} }
nogos.addTo(map); nogos.addTo(map);
drawToolbar = L.easyBar([drawButton, reverseRouteButton, nogos.getButton(), deletePointButton, deleteRouteButton]).addTo(map); drawToolbar = L.easyBar([
drawButton,
reverseRouteButton,
nogos.getButton(),
deletePointButton,
deleteRouteButton
]).addTo(map);
nogos.preventRoutePointOnCreate(routing); nogos.preventRoutePointOnCreate(routing);
if (BR.keys.strava) { if (BR.keys.strava) {
BR.stravaSegments(map, layersControl); BR.stravaSegments(map, layersControl);
} }
map.addControl(new BR.OpacitySlider({ map.addControl(
new BR.OpacitySlider({
callback: L.bind(routing.setOpacity, routing) callback: L.bind(routing.setOpacity, routing)
})); })
);
// initial option settings (after controls are added and initialized with onAdd) // initial option settings (after controls are added and initialized with onAdd)
router.setOptions(nogos.getOptions()); router.setOptions(nogos.getOptions());
@ -278,8 +305,7 @@
s = s.replace(/;/g, '|'); s = s.replace(/;/g, '|');
var p = {}; var p = {};
var sep = '&'; var sep = '&';
if (s.search('&amp;') !== -1) if (s.search('&amp;') !== -1) sep = '&amp;';
sep = '&amp;';
var params = s.split(sep); var params = s.split(sep);
for (var i = 0; i < params.length; i++) { for (var i = 0; i < params.length; i++) {
var tmp = params[i].split('='); var tmp = params[i].split('=');
@ -287,7 +313,7 @@
p[tmp[0]] = decodeURIComponent(tmp[1]); p[tmp[0]] = decodeURIComponent(tmp[1]);
} }
return p; return p;
} };
if (url == null) return; if (url == null) return;
var opts = router.parseUrlParams(url2params(url)); var opts = router.parseUrlParams(url2params(url));
router.setOptions(opts); router.setOptions(opts);
@ -313,7 +339,9 @@
// do not initialize immediately // do not initialize immediately
urlHash = new L.Hash(null, null); urlHash = new L.Hash(null, null);
urlHash.additionalCb = function() { urlHash.additionalCb = function() {
var url = router.getUrl(routing.getWaypoints(), null).substr('brouter?'.length+1); var url = router
.getUrl(routing.getWaypoints(), null)
.substr('brouter?'.length + 1);
url = url.replace(/\|/g, ';'); url = url.replace(/\|/g, ';');
return url.length > 0 ? '&' + url : null; return url.length > 0 ? '&' + url : null;
}; };
@ -334,12 +362,16 @@
// waypoint add, move, delete (but last) // waypoint add, move, delete (but last)
routing.on('routing:routeWaypointEnd', urlHash.onMapMove, urlHash); routing.on('routing:routeWaypointEnd', urlHash.onMapMove, urlHash);
// delete last waypoint // delete last waypoint
routing.on('waypoint:click', function (evt) { routing.on(
'waypoint:click',
function(evt) {
var r = evt.marker._routing; var r = evt.marker._routing;
if (!r.prevMarker && !r.nextMarker) { if (!r.prevMarker && !r.nextMarker) {
urlHash.onMapMove(); urlHash.onMapMove();
} }
}, urlHash); },
urlHash
);
$(window).resize(function() { $(window).resize(function() {
elevation.addBelow(map); elevation.addBelow(map);
@ -354,7 +386,6 @@
map._onResize(); map._onResize();
}); });
var onHide = function() { var onHide = function() {
if (this.id && BR.Util.localStorageAvailable()) { if (this.id && BR.Util.localStorageAvailable()) {
localStorage.removeItem(this.id); localStorage.removeItem(this.id);
@ -366,10 +397,15 @@
} }
}; };
// on page load, we want to restore collapsible elements from previous usage // on page load, we want to restore collapsible elements from previous usage
$('.collapse').on('hidden.bs.collapse', onHide) $('.collapse')
.on('hidden.bs.collapse', onHide)
.on('shown.bs.collapse', onShow) .on('shown.bs.collapse', onShow)
.each(function() { .each(function() {
if (this.id && BR.Util.localStorageAvailable() && localStorage[this.id] === 'true') { if (
this.id &&
BR.Util.localStorageAvailable() &&
localStorage[this.id] === 'true'
) {
$(this).collapse('show'); $(this).collapse('show');
} }
}); });
@ -388,11 +424,12 @@
var reader = new FileReader(); var reader = new FileReader();
reader.onload = function() { reader.onload = function() {
resolve(reader.result); resolve(reader.result);
} };
reader.readAsText(nogoFile); reader.readAsText(nogoFile);
}).then(function (response) { return JSON.parse(response); }); }).then(function(response) {
} return JSON.parse(response);
else { });
} else {
$('#nogoError').text('Error: Missing file or URL.'); $('#nogoError').text('Error: Missing file or URL.');
$('#nogoError').css('display', 'block'); $('#nogoError').css('display', 'block');
return false; return false;
@ -418,25 +455,31 @@
geoJSONPromise.then(function(response) { geoJSONPromise.then(function(response) {
// Iterate on features in order to discard features without geometry // Iterate on features in order to discard features without geometry
var cleanedGeoJSONFeatures = [] var cleanedGeoJSONFeatures = [];
turf.featureEach(response, function(feature) { turf.featureEach(response, function(feature) {
if (turf.getGeom(feature)) { if (turf.getGeom(feature)) {
var maybeBufferedFeature = feature; var maybeBufferedFeature = feature;
// Eventually buffer GeoJSON // Eventually buffer GeoJSON
if (nogoBuffer != 0) { if (nogoBuffer != 0) {
maybeBufferedFeature = turf.buffer( maybeBufferedFeature = turf.buffer(
maybeBufferedFeature, nogoBuffer, { units: 'meters' } maybeBufferedFeature,
nogoBuffer,
{ units: 'meters' }
); );
} }
cleanedGeoJSONFeatures.push(maybeBufferedFeature); cleanedGeoJSONFeatures.push(maybeBufferedFeature);
} }
}); });
var geoJSON = L.geoJson(turf.featureCollection(cleanedGeoJSONFeatures), { var geoJSON = L.geoJson(
turf.featureCollection(cleanedGeoJSONFeatures),
{
onEachFeature: function(feature, layer) { onEachFeature: function(feature, layer) {
layer.options.nogoWeight = feature.properties.nogoWeight || nogoWeight; layer.options.nogoWeight =
feature.properties.nogoWeight || nogoWeight;
} }
}); }
);
var nogosPoints = geoJSON.getLayers().filter(function(e) { var nogosPoints = geoJSON.getLayers().filter(function(e) {
return e.feature.geometry.type === 'Point'; return e.feature.geometry.type === 'Point';
}); });
@ -447,7 +490,9 @@
} }
return null; return null;
}); });
nogosPoints = nogosPoints.filter(function (e) { return e; }); nogosPoints = nogosPoints.filter(function(e) {
return e;
});
nogos.setOptions({ nogos.setOptions({
nogos: nogosPoints, nogos: nogosPoints,
polygons: geoJSON.getLayers().filter(function(e) { polygons: geoJSON.getLayers().filter(function(e) {
@ -455,7 +500,7 @@
}), }),
polylines: geoJSON.getLayers().filter(function(e) { polylines: geoJSON.getLayers().filter(function(e) {
return e.feature.geometry.type === 'LineString'; return e.feature.geometry.type === 'LineString';
}), })
}); });
updateRoute({ updateRoute({
options: nogos.getOptions() options: nogos.getOptions()
@ -472,17 +517,20 @@
i18next i18next
.use(window.i18nextXHRBackend) .use(window.i18nextXHRBackend)
.use(window.i18nextBrowserLanguageDetector) .use(window.i18nextBrowserLanguageDetector)
.init({ .init(
{
fallbackLng: 'en', fallbackLng: 'en',
backend: { backend: {
loadPath: 'dist/locales/{{lng}}.json', loadPath: 'dist/locales/{{lng}}.json'
} }
}, function(err, t) { },
function(err, t) {
jqueryI18next.init(i18next, $); jqueryI18next.init(i18next, $);
$('html').localize(); $('html').localize();
mapContext = BR.Map.initMap(); mapContext = BR.Map.initMap();
verifyTouchStyle(mapContext); verifyTouchStyle(mapContext);
initApp(mapContext); initApp(mapContext);
}); }
);
})(); })();

View file

@ -1,8 +1,9 @@
BR.BingLayer = L.BingLayer.extend({ BR.BingLayer = L.BingLayer.extend({
options: { options: {
maxZoom: 19, maxZoom: 19,
attribution: '<a target="_blank" href="https://www.bing.com/maps/">Bing Maps</a>' attribution:
+ ' (<a target="_blank" href="https://go.microsoft.com/?linkid=9710837">TOU</a>)' '<a target="_blank" href="https://www.bing.com/maps/">Bing Maps</a>' +
' (<a target="_blank" href="https://go.microsoft.com/?linkid=9710837">TOU</a>)'
}, },
initialize: function(key, options) { initialize: function(key, options) {
@ -11,7 +12,8 @@ BR.BingLayer = L.BingLayer.extend({
this._logo = L.control({ position: 'bottomleft' }); this._logo = L.control({ position: 'bottomleft' });
this._logo.onAdd = function(map) { this._logo.onAdd = function(map) {
this._div = L.DomUtil.create('div', 'bing-logo'); this._div = L.DomUtil.create('div', 'bing-logo');
this._div.innerHTML = '<img src="https://www.microsoft.com/maps/images/branding/Bing%20logo%20white_50px-19px.png">'; this._div.innerHTML =
'<img src="https://www.microsoft.com/maps/images/branding/Bing%20logo%20white_50px-19px.png">';
return this._div; return this._div;
}; };
}, },

View file

@ -7,7 +7,7 @@ BR.Elevation = L.Control.Elevation.extend({
bottom: 30, bottom: 30,
left: 60 left: 60
}, },
theme: "steelblue-theme" theme: 'steelblue-theme'
}, },
onAdd: function(map) { onAdd: function(map) {
@ -15,19 +15,33 @@ BR.Elevation = L.Control.Elevation.extend({
// revert registering touch events when touch screen detection is available and negative // revert registering touch events when touch screen detection is available and negative
// see https://github.com/MrMufflon/Leaflet.Elevation/issues/67 // see https://github.com/MrMufflon/Leaflet.Elevation/issues/67
if (L.Browser.touch && BR.Browser.touchScreenDetectable && !BR.Browser.touchScreen) { if (
L.Browser.touch &&
this._background.on("touchmove.drag", null). BR.Browser.touchScreenDetectable &&
on("touchstart.drag", null). !BR.Browser.touchScreen
on("touchstart.focus", null); ) {
L.DomEvent.off(this._container, 'touchend', this._dragEndHandler, this); this._background
.on('touchmove.drag', null)
this._background.on("mousemove.focus", this._mousemoveHandler.bind(this)). .on('touchstart.drag', null)
on("mouseout.focus", this._mouseoutHandler.bind(this)). .on('touchstart.focus', null);
on("mousedown.drag", this._dragStartHandler.bind(this)). L.DomEvent.off(
on("mousemove.drag", this._dragHandler.bind(this)); this._container,
L.DomEvent.on(this._container, 'mouseup', this._dragEndHandler, this); 'touchend',
this._dragEndHandler,
this
);
this._background
.on('mousemove.focus', this._mousemoveHandler.bind(this))
.on('mouseout.focus', this._mouseoutHandler.bind(this))
.on('mousedown.drag', this._dragStartHandler.bind(this))
.on('mousemove.drag', this._dragHandler.bind(this));
L.DomEvent.on(
this._container,
'mouseup',
this._dragEndHandler,
this
);
} }
return container; return container;
@ -47,7 +61,10 @@ BR.Elevation = L.Control.Elevation.extend({
} }
this.addTo(map); this.addTo(map);
// move elevation graph outside of the map // move elevation graph outside of the map
setParent(this.getContainer(), document.getElementById('elevation-chart')); setParent(
this.getContainer(),
document.getElementById('elevation-chart')
);
}, },
update: function(track, layer) { update: function(track, layer) {
@ -62,7 +79,7 @@ BR.Elevation = L.Control.Elevation.extend({
if (track && track.getLatLngs().length > 0) { if (track && track.getLatLngs().length > 0) {
this.addData(track.toGeoJSON(), layer); this.addData(track.toGeoJSON(), layer);
layer.on("mouseout", this._hidePositionMarker.bind(this)); layer.on('mouseout', this._hidePositionMarker.bind(this));
} }
} }
}); });

View file

@ -4,7 +4,8 @@ BR.NogoAreas = L.Control.extend({
MSG_BUTTON_CANCEL: 'Cancel drawing no-go area', MSG_BUTTON_CANCEL: 'Cancel drawing no-go area',
MSG_CREATE: 'Click and drag to draw circle', MSG_CREATE: 'Click and drag to draw circle',
MSG_DISABLED: 'Click to edit', MSG_DISABLED: 'Click to edit',
MSG_ENABLED: '&square; = move / resize, <span class="fa fa-trash-o"></span> = delete,<br>click nogo to quit editing', MSG_ENABLED:
'&square; = move / resize, <span class="fa fa-trash-o"></span> = delete,<br>click nogo to quit editing',
STATE_CREATE: 'no-go-create', STATE_CREATE: 'no-go-create',
STATE_CANCEL: 'cancel-no-go-create' STATE_CANCEL: 'cancel-no-go-create'
}, },
@ -38,15 +39,16 @@ BR.NogoAreas = L.Control.extend({
e.layer.toggleEdit(); e.layer.toggleEdit();
}); });
var editTools = this.editTools = map.editTools = new L.Editable(map, { var editTools = (this.editTools = map.editTools = new L.Editable(map, {
circleEditorClass: BR.DeletableCircleEditor, circleEditorClass: BR.DeletableCircleEditor,
// FeatureGroup instead of LayerGroup to propagate events to members // FeatureGroup instead of LayerGroup to propagate events to members
editLayer: new L.FeatureGroup().addTo(map), editLayer: new L.FeatureGroup().addTo(map),
featuresLayer: this.drawnItems featuresLayer: this.drawnItems
}); }));
this.button = L.easyButton({ this.button = L.easyButton({
states: [{ states: [
{
stateName: BR.NogoAreas.STATE_CREATE, stateName: BR.NogoAreas.STATE_CREATE,
icon: 'fa-ban', icon: 'fa-ban',
title: BR.NogoAreas.MSG_BUTTON, title: BR.NogoAreas.MSG_BUTTON,
@ -57,7 +59,8 @@ BR.NogoAreas = L.Control.extend({
control.state('cancel-no-go-create'); control.state('cancel-no-go-create');
} }
}, { },
{
stateName: BR.NogoAreas.STATE_CANCEL, stateName: BR.NogoAreas.STATE_CANCEL,
icon: 'fa-ban active', icon: 'fa-ban active',
title: BR.NogoAreas.MSG_BUTTON_CANCEL, title: BR.NogoAreas.MSG_BUTTON_CANCEL,
@ -65,28 +68,48 @@ BR.NogoAreas = L.Control.extend({
editTools.stopDrawing(); editTools.stopDrawing();
control.state('no-go-create'); control.state('no-go-create');
} }
}] }
]
}); });
this.editTools.on('editable:drawing:end', function (e) { this.editTools.on(
'editable:drawing:end',
function(e) {
self.button.state(BR.NogoAreas.STATE_CREATE); self.button.state(BR.NogoAreas.STATE_CREATE);
setTimeout(L.bind(function () { setTimeout(
L.bind(function() {
// turn editing off after create; async to still fire 'editable:vertex:dragend' // turn editing off after create; async to still fire 'editable:vertex:dragend'
e.layer.disableEdit(); e.layer.disableEdit();
}, this), 0); }, this),
}, this); 0
);
},
this
);
this.editTools.on('editable:vertex:dragend editable:deleted', function (e) { this.editTools.on(
'editable:vertex:dragend editable:deleted',
function(e) {
this._fireUpdate(); this._fireUpdate();
}, this); },
this
);
this.editTools.on('editable:enable', function (e) { this.editTools.on(
'editable:enable',
function(e) {
e.layer.setStyle(this.editStyle); e.layer.setStyle(this.editStyle);
}, this); },
this.editTools.on('editable:disable', function (e) { this
);
this.editTools.on(
'editable:disable',
function(e) {
e.layer.setStyle(this.style); e.layer.setStyle(this.style);
}, this); },
this
);
this.tooltip = new BR.EditingTooltip(map, editTools, this.button); this.tooltip = new BR.EditingTooltip(map, editTools, this.button);
this.tooltip.enable(); this.tooltip.enable();
@ -97,28 +120,40 @@ BR.NogoAreas = L.Control.extend({
// prevent route waypoint added after circle create (map click after up) // prevent route waypoint added after circle create (map click after up)
preventRoutePointOnCreate: function(routing) { preventRoutePointOnCreate: function(routing) {
this.editTools.on('editable:drawing:start', function (e) { this.editTools.on(
'editable:drawing:start',
function(e) {
this._wasRouteDrawing = routing.isDrawing(); this._wasRouteDrawing = routing.isDrawing();
routing.draw(false); routing.draw(false);
}, this); },
this
);
// after create // after create
this.editTools.on('editable:drawing:end', function (e) { this.editTools.on(
'editable:drawing:end',
function(e) {
if (this._wasRouteDrawing) { if (this._wasRouteDrawing) {
setTimeout(function() { setTimeout(function() {
routing.draw(true); routing.draw(true);
}, 0); }, 0);
} }
}, this); },
this
);
}, },
getOptions: function() { getOptions: function() {
return { return {
nogos: this.drawnItems.getLayers().filter(function (e) { return e instanceof L.Circle; }), nogos: this.drawnItems.getLayers().filter(function(e) {
polygons: this.drawnItems.getLayers().filter(function (e) { return e instanceof L.Polygon; }), return e instanceof L.Circle;
polylines: this.drawnItems.getLayers().filter(function (e) {
return (e instanceof L.Polyline) && !(e instanceof L.Polygon);
}), }),
polygons: this.drawnItems.getLayers().filter(function(e) {
return e instanceof L.Polygon;
}),
polylines: this.drawnItems.getLayers().filter(function(e) {
return e instanceof L.Polyline && !(e instanceof L.Polygon);
})
}; };
}, },
@ -175,12 +210,12 @@ BR.NogoAreas = L.Control.extend({
BR.NogoAreas.include(L.Evented.prototype); BR.NogoAreas.include(L.Evented.prototype);
L.Editable.prototype.createVertexIcon = function(options) { L.Editable.prototype.createVertexIcon = function(options) {
return BR.Browser.touch ? new L.Editable.TouchVertexIcon(options) : new L.Editable.VertexIcon(options); return BR.Browser.touch
? new L.Editable.TouchVertexIcon(options)
: new L.Editable.VertexIcon(options);
}; };
BR.EditingTooltip = L.Handler.extend({ BR.EditingTooltip = L.Handler.extend({
options: { options: {
closeTimeout: 2000 closeTimeout: 2000
@ -195,7 +230,12 @@ BR.EditingTooltip = L.Handler.extend({
addHooks: function() { addHooks: function() {
// hack: listen to EasyButton click (instead of editable:drawing:start), // hack: listen to EasyButton click (instead of editable:drawing:start),
// to get mouse position from event for initial tooltip location // to get mouse position from event for initial tooltip location
L.DomEvent.addListener(this.button.button, 'click', this._addCreate, this); L.DomEvent.addListener(
this.button.button,
'click',
this._addCreate,
this
);
this.editTools.featuresLayer.on('layeradd', this._bind, this); this.editTools.featuresLayer.on('layeradd', this._bind, this);
@ -205,7 +245,12 @@ BR.EditingTooltip = L.Handler.extend({
}, },
removeHooks: function() { removeHooks: function() {
L.DomEvent.removeListener(this.button.button, 'click', this._addCreate, this); L.DomEvent.removeListener(
this.button.button,
'click',
this._addCreate,
this
);
this.editTools.featuresLayer.off('layeradd', this._bind, this); this.editTools.featuresLayer.off('layeradd', this._bind, this);
@ -230,7 +275,9 @@ BR.EditingTooltip = L.Handler.extend({
if (!latlng && layer instanceof L.Layer) { if (!latlng && layer instanceof L.Layer) {
latlng = L.latLng( latlng = L.latLng(
layer.getBounds().getSouth(), layer.getBounds().getSouth(),
0.5 * (layer.getBounds().getWest() + layer.getBounds().getEast()) 0.5 *
(layer.getBounds().getWest() +
layer.getBounds().getEast())
); );
} }
L.Layer.prototype.openTooltip.call(this, layer, latlng); L.Layer.prototype.openTooltip.call(this, layer, latlng);
@ -256,9 +303,9 @@ BR.EditingTooltip = L.Handler.extend({
// simulate sticky feature (follow mouse) for map tooltip without layer // simulate sticky feature (follow mouse) for map tooltip without layer
var onOffMove = function(e) { var onOffMove = function(e) {
var onOff = (e.type === 'tooltipclose') ? 'off' : 'on'; var onOff = e.type === 'tooltipclose' ? 'off' : 'on';
this._map[onOff]('mousemove', this._moveTooltip, this); this._map[onOff]('mousemove', this._moveTooltip, this);
} };
this.map.on('tooltipopen', onOffMove, tooltip); this.map.on('tooltipopen', onOffMove, tooltip);
this.map.on('tooltipclose', onOffMove, tooltip); this.map.on('tooltipclose', onOffMove, tooltip);
@ -267,7 +314,7 @@ BR.EditingTooltip = L.Handler.extend({
this.map.off('tooltipclose', onOffMove, e.tooltip); this.map.off('tooltipclose', onOffMove, e.tooltip);
this.map.off('tooltipclose', onTooltipRemove, this); this.map.off('tooltipclose', onTooltipRemove, this);
e.tooltip._tooltip = null; e.tooltip._tooltip = null;
} };
this.map.on('tooltipclose', onTooltipRemove, this); this.map.on('tooltipclose', onTooltipRemove, this);
tooltip.setTooltipContent(BR.NogoAreas.MSG_CREATE); tooltip.setTooltipContent(BR.NogoAreas.MSG_CREATE);
@ -276,7 +323,11 @@ BR.EditingTooltip = L.Handler.extend({
var closeTooltip = function() { var closeTooltip = function() {
this.map.closeTooltip(tooltip); this.map.closeTooltip(tooltip);
}; };
this.editTools.once('editable:editing editable:drawing:cancel', closeTooltip, this); this.editTools.once(
'editable:editing editable:drawing:cancel',
closeTooltip,
this
);
if (BR.Browser.touch) { if (BR.Browser.touch) {
// can't move with cursor on touch devices, so show at start pos for a few seconds // can't move with cursor on touch devices, so show at start pos for a few seconds
@ -297,20 +348,27 @@ BR.EditingTooltip = L.Handler.extend({
_postCreate: function() { _postCreate: function() {
// editing is disabled by another handler, tooltip won't stay open before // editing is disabled by another handler, tooltip won't stay open before
this.editTools.once('editable:disable', function (e) { this.editTools.once(
'editable:disable',
function(e) {
// show for a few seconds, as mouse often not hovering circle after create // show for a few seconds, as mouse often not hovering circle after create
e.layer.openTooltip(e.layer); e.layer.openTooltip(e.layer);
this._setCloseTimeout(e.layer); this._setCloseTimeout(e.layer);
}, this); },
this
);
}, },
_enable: function(e) { _enable: function(e) {
e.layer.setTooltipContent(BR.NogoAreas.MSG_ENABLED); e.layer.setTooltipContent(BR.NogoAreas.MSG_ENABLED);
this.editTools.once('editable:editing', function(e) { this.editTools.once(
'editable:editing',
function(e) {
e.layer.closeTooltip(); e.layer.closeTooltip();
}, this); },
this
);
}, },
_disable: function(e) { _disable: function(e) {
@ -319,12 +377,12 @@ BR.EditingTooltip = L.Handler.extend({
} }
}); });
BR.DeletableCircleEditor = L.Editable.CircleEditor.extend({ BR.DeletableCircleEditor = L.Editable.CircleEditor.extend({
_computeDeleteLatLng: function() { _computeDeleteLatLng: function() {
// While circle is not added to the map, _radius is not set. // While circle is not added to the map, _radius is not set.
var delta = (this.feature._radius || this.feature._mRadius) * Math.cos(Math.PI / 4), var delta =
(this.feature._radius || this.feature._mRadius) *
Math.cos(Math.PI / 4),
point = this.map.project(this.feature._latlng); point = this.map.project(this.feature._latlng);
return this.map.unproject([point.x - delta, point.y - delta]); return this.map.unproject([point.x - delta, point.y - delta]);
}, },
@ -351,7 +409,12 @@ BR.DeletableCircleEditor = L.Editable.CircleEditor.extend({
}, },
initialize: function(map, feature, options) { initialize: function(map, feature, options) {
L.Editable.CircleEditor.prototype.initialize.call(this, map, feature, options); L.Editable.CircleEditor.prototype.initialize.call(
this,
map,
feature,
options
);
this._deleteLatLng = this._computeDeleteLatLng(); this._deleteLatLng = this._computeDeleteLatLng();
// FeatureGroup instead of LayerGroup to propagate events to members // FeatureGroup instead of LayerGroup to propagate events to members
@ -394,16 +457,15 @@ BR.DeletableCircleEditor = L.Editable.CircleEditor.extend({
this._updateDeleteLatLng(); this._updateDeleteLatLng();
L.Editable.CircleEditor.prototype.onVertexMarkerDrag.call(this, e); L.Editable.CircleEditor.prototype.onVertexMarkerDrag.call(this, e);
} }
}); });
BR.DeleteMarker = L.Marker.extend({ BR.DeleteMarker = L.Marker.extend({
options: { options: {
draggable: false, draggable: false,
icon: L.divIcon({ icon: L.divIcon({
iconSize: BR.Browser.touch ? new L.Point(24, 24) : new L.Point(16, 16), iconSize: BR.Browser.touch
? new L.Point(24, 24)
: new L.Point(16, 16),
className: 'leaflet-div-icon fa fa-trash-o nogo-delete-marker' className: 'leaflet-div-icon fa fa-trash-o nogo-delete-marker'
}) })
}, },

View file

@ -31,35 +31,50 @@ BR.Routing = L.Routing.extend({
this._waypoints.on('layeradd', this._setMarkerOpacity, this); this._waypoints.on('layeradd', this._setMarkerOpacity, this);
// turn line mouse marker off while over waypoint marker // turn line mouse marker off while over waypoint marker
this.on('waypoint:mouseover', function(e) { this.on(
'waypoint:mouseover',
function(e) {
// L.Routing.Edit._segmentOnMouseout without firing 'segment:mouseout' (enables draw) // L.Routing.Edit._segmentOnMouseout without firing 'segment:mouseout' (enables draw)
if (this._dragging) { return; } if (this._dragging) {
return;
}
this._mouseMarker.setOpacity(0.0); this._mouseMarker.setOpacity(0.0);
this._map.off('mousemove', this._segmentOnMousemove, this); this._map.off('mousemove', this._segmentOnMousemove, this);
this._suspended = true; this._suspended = true;
}, this._edit); },
this._edit
);
this.on('waypoint:mouseout', function(e) { this.on(
'waypoint:mouseout',
function(e) {
this._segmentOnMouseover(e); this._segmentOnMouseover(e);
this._suspended = false; this._suspended = false;
}, this._edit); },
this._edit
);
this._edit._mouseMarker.setIcon(L.divIcon({ this._edit._mouseMarker.setIcon(
className: 'line-mouse-marker' L.divIcon({
,iconAnchor: [8, 8] // size/2 + border/2 className: 'line-mouse-marker',
,iconSize: [16, 16] iconAnchor: [8, 8], // size/2 + border/2
})); iconSize: [16, 16]
})
);
// Forward mousemove event to snapped feature (for Leaflet.Elevation to // Forward mousemove event to snapped feature (for Leaflet.Elevation to
// update indicator), see also L.Routing.Edit._segmentOnMousemove // update indicator), see also L.Routing.Edit._segmentOnMousemove
this._edit._mouseMarker.on('move', L.bind(function(e) { this._edit._mouseMarker.on(
'move',
L.bind(function(e) {
var latLng = e.latlng; var latLng = e.latlng;
if (latLng._feature) { if (latLng._feature) {
this._mouseMarker._feature = latLng._feature; this._mouseMarker._feature = latLng._feature;
latLng._feature.fire('mousemove', e, true); latLng._feature.fire('mousemove', e, true);
} }
}, this._edit)); }, this._edit)
);
var mouseoutHandler = function(e) { var mouseoutHandler = function(e) {
if (this._mouseMarker._feature) { if (this._mouseMarker._feature) {
this._mouseMarker._feature.fire('mouseout', e, true); this._mouseMarker._feature.fire('mouseout', e, true);
@ -79,12 +94,20 @@ BR.Routing = L.Routing.extend({
// intercept listener: only re-show draw trailer after marker hover // intercept listener: only re-show draw trailer after marker hover
// when edit is not active (i.e. wasn't also supended) // when edit is not active (i.e. wasn't also supended)
this._parent.off('waypoint:mouseout' , this._catchWaypointEvent, this); this._parent.off(
this.on('waypoint:mouseout' , function(e) { 'waypoint:mouseout',
this._catchWaypointEvent,
this
);
this.on(
'waypoint:mouseout',
function(e) {
if (!this._parent._edit._suspended) { if (!this._parent._edit._suspended) {
this._catchWaypointEvent(e); this._catchWaypointEvent(e);
} }
}, this); },
this
);
}); });
this._draw.on('disabled', function() { this._draw.on('disabled', function() {
L.DomUtil.removeClass(map.getContainer(), 'routing-draw-enabled'); L.DomUtil.removeClass(map.getContainer(), 'routing-draw-enabled');
@ -111,7 +134,12 @@ BR.Routing = L.Routing.extend({
this._map.off('mouseout', hide, this); this._map.off('mouseout', hide, this);
this._map.off('mouseover', show, this); this._map.off('mouseover', show, this);
L.DomEvent.off(this._map._controlContainer, 'mouseout', show, this); L.DomEvent.off(this._map._controlContainer, 'mouseout', show, this);
L.DomEvent.off(this._map._controlContainer, 'mouseover', hide, this); L.DomEvent.off(
this._map._controlContainer,
'mouseover',
hide,
this
);
}); });
// Call show after deleting last waypoint, but hide trailer. // Call show after deleting last waypoint, but hide trailer.
@ -119,35 +147,46 @@ BR.Routing = L.Routing.extend({
// mouseout to show again never fires when deleted. Click handler // mouseout to show again never fires when deleted. Click handler
// _onMouseClick aborts when hidden, so no waypoint can be added // _onMouseClick aborts when hidden, so no waypoint can be added
// although enabled. // although enabled.
this.on('waypoint:click', function() { this.on(
'waypoint:click',
function() {
if (this._hidden && !this._parent._waypoints._first) { if (this._hidden && !this._parent._waypoints._first) {
this._show(); this._show();
this._hideTrailer(); this._hideTrailer();
} }
}, this._draw); },
this._draw
);
// keys not working when map container does not have focus, use document instead // keys not working when map container does not have focus, use document instead
L.DomEvent.removeListener(this._container, 'keyup', this._keyupListener); L.DomEvent.removeListener(
this._container,
'keyup',
this._keyupListener
);
L.DomEvent.addListener(document, 'keyup', this._keyupListener, this); L.DomEvent.addListener(document, 'keyup', this._keyupListener, this);
// enable drawing mode // enable drawing mode
this.draw(true); this.draw(true);
return container; return container;
} },
,_addSegmentCasing: function(e) { _addSegmentCasing: function(e) {
var casing = L.polyline(e.layer.getLatLngs(), this.options.styles.trackCasing); var casing = L.polyline(
e.layer.getLatLngs(),
this.options.styles.trackCasing
);
this._segmentsCasing.addLayer(casing); this._segmentsCasing.addLayer(casing);
e.layer._casing = casing; e.layer._casing = casing;
this._segments.bringToFront(); this._segments.bringToFront();
} },
,_removeSegmentCasing: function(e) { _removeSegmentCasing: function(e) {
this._segmentsCasing.removeLayer(e.layer._casing); this._segmentsCasing.removeLayer(e.layer._casing);
} },
,setOpacity: function(opacity) { setOpacity: function(opacity) {
// Due to the second Polyline layer for casing, the combined opacity is less // Due to the second Polyline layer for casing, the combined opacity is less
// transparent than with a single layer and the slider is non-linear. The // transparent than with a single layer and the slider is non-linear. The
// inverted formula is used to get the same result as with a single layer. // inverted formula is used to get the same result as with a single layer.
@ -168,34 +207,36 @@ BR.Routing = L.Routing.extend({
this._waypoints.eachLayer(function(marker) { this._waypoints.eachLayer(function(marker) {
marker.setOpacity(opacity); marker.setOpacity(opacity);
}); });
} },
,_setMarkerOpacity: function(e) { _setMarkerOpacity: function(e) {
e.layer.setOpacity(this.options.icons.opacity); e.layer.setOpacity(this.options.icons.opacity);
} },
,_removeMarkerEvents: function(marker) { _removeMarkerEvents: function(marker) {
marker.off('mouseover', this._fireWaypointEvent, this); marker.off('mouseover', this._fireWaypointEvent, this);
marker.off('mouseout', this._fireWaypointEvent, this); marker.off('mouseout', this._fireWaypointEvent, this);
marker.off('dragstart', this._fireWaypointEvent, this); marker.off('dragstart', this._fireWaypointEvent, this);
marker.off('dragend', this._fireWaypointEvent, this); marker.off('dragend', this._fireWaypointEvent, this);
marker.off('drag', this._fireWaypointEvent, this); marker.off('drag', this._fireWaypointEvent, this);
marker.off('click', this._fireWaypointEvent, this); marker.off('click', this._fireWaypointEvent, this);
} },
,clear: function() { clear: function() {
var drawEnabled = this._draw._enabled; var drawEnabled = this._draw._enabled;
var current = this._waypoints._first; var current = this._waypoints._first;
this.draw(false); this.draw(false);
if (current === null) { return; } if (current === null) {
return;
}
this._removeMarkerEvents(current); this._removeMarkerEvents(current);
while (current._routing.nextMarker) { while (current._routing.nextMarker) {
var marker = current._routing.nextMarker; var marker = current._routing.nextMarker;
this._removeMarkerEvents(marker); this._removeMarkerEvents(marker);
current = marker; current = marker;
}; }
this._waypoints._first = null; this._waypoints._first = null;
this._waypoints._last = null; this._waypoints._last = null;
@ -205,9 +246,9 @@ BR.Routing = L.Routing.extend({
if (drawEnabled) { if (drawEnabled) {
this.draw(true); this.draw(true);
} }
} },
,setWaypoints: function(latLngs, cb) { setWaypoints: function(latLngs, cb) {
var i; var i;
var callbackCount = 0; var callbackCount = 0;
var firstErr; var firstErr;
@ -228,11 +269,11 @@ BR.Routing = L.Routing.extend({
for (i = 0; latLngs && i < latLngs.length; i++) { for (i = 0; latLngs && i < latLngs.length; i++) {
this.addWaypoint(latLngs[i], this._waypoints._last, null, callback); this.addWaypoint(latLngs[i], this._waypoints._last, null, callback);
} }
} },
// patch to fix error when line is null or error line // patch to fix error when line is null or error line
// (when called while still segments to calculate, e.g. permalink or fast drawing) // (when called while still segments to calculate, e.g. permalink or fast drawing)
,toPolyline: function() { toPolyline: function() {
var latLngs = []; var latLngs = [];
this._eachSegment(function(m1, m2, line) { this._eachSegment(function(m1, m2, line) {
@ -244,9 +285,9 @@ BR.Routing = L.Routing.extend({
}); });
return L.polyline(latLngs); return L.polyline(latLngs);
} },
,_routeSegment: function(m1, m2, cb) { _routeSegment: function(m1, m2, cb) {
var loadingTrailer; var loadingTrailer;
// change segment color before request to indicate recalculation (mark old) // change segment color before request to indicate recalculation (mark old)
@ -265,15 +306,20 @@ BR.Routing = L.Routing.extend({
loadingTrailer.addTo(this._map); loadingTrailer.addTo(this._map);
} }
L.Routing.prototype._routeSegment.call(this, m1, m2, L.bind(function(err, data) { L.Routing.prototype._routeSegment.call(
this,
m1,
m2,
L.bind(function(err, data) {
if (loadingTrailer) { if (loadingTrailer) {
this._map.removeLayer(loadingTrailer); this._map.removeLayer(loadingTrailer);
} }
cb(err, data); cb(err, data);
}, this)); }, this)
} );
},
,getSegments: function() { getSegments: function() {
var segments = []; var segments = [];
this._eachSegment(function(m1, m2, line) { this._eachSegment(function(m1, m2, line) {
@ -285,22 +331,22 @@ BR.Routing = L.Routing.extend({
}); });
return segments; return segments;
} },
// add 'esc' to disable drawing // add 'esc' to disable drawing
,_keyupListener: function (e) { _keyupListener: function(e) {
if (e.keyCode === 27) { if (e.keyCode === 27) {
this._draw.disable(); this._draw.disable();
} else { } else {
L.Routing.prototype._keyupListener.call(this, e); L.Routing.prototype._keyupListener.call(this, e);
} }
} },
,isDrawing: function () { isDrawing: function() {
return this._draw._enabled; return this._draw._enabled;
} },
,reverse: function() { reverse: function() {
var waypoints = this.getWaypoints(); var waypoints = this.getWaypoints();
waypoints.reverse(); waypoints.reverse();
this.clear(); this.clear();

View file

@ -26,13 +26,21 @@ BR.Sidebar = L.Control.Sidebar.extend({
this.on('closing', this._notifyOnClose, this); this.on('closing', this._notifyOnClose, this);
this.on('toggleExpand', this._notifyOnResize, this); this.on('toggleExpand', this._notifyOnResize, this);
this.on('closing', function () { this.on(
'closing',
function() {
this._map.getContainer().focus(); this._map.getContainer().focus();
}, this); },
this
);
this._rememberTabState(); this._rememberTabState();
if (L.Browser.touch && BR.Browser.touchScreenDetectable && !BR.Browser.touchScreen) { if (
L.Browser.touch &&
BR.Browser.touchScreenDetectable &&
!BR.Browser.touchScreen
) {
L.DomUtil.removeClass(this._container, 'leaflet-touch'); L.DomUtil.removeClass(this._container, 'leaflet-touch');
L.DomUtil.removeClass(this._tabContainer, 'leaflet-touch'); L.DomUtil.removeClass(this._tabContainer, 'leaflet-touch');
} }

View file

@ -1,8 +1,9 @@
(function(window) { (function(window) {
var HAS_HASHCHANGE = (function() { var HAS_HASHCHANGE = (function() {
var doc_mode = window.documentMode; var doc_mode = window.documentMode;
return ('onhashchange' in window) && return (
(doc_mode === undefined || doc_mode > 7); 'onhashchange' in window && (doc_mode === undefined || doc_mode > 7)
);
})(); })();
L.Hash = function(map, options) { L.Hash = function(map, options) {
@ -18,7 +19,7 @@
hash = hash.substr(5); hash = hash.substr(5);
} }
var args = hash.split(/\&(.+)/); var args = hash.split(/\&(.+)/);
var mapsArgs = args[0].split("/"); var mapsArgs = args[0].split('/');
if (mapsArgs.length == 4) { if (mapsArgs.length == 4) {
var zoom = parseInt(mapsArgs[0], 10), var zoom = parseInt(mapsArgs[0], 10),
lat = parseFloat(mapsArgs[1]), lat = parseFloat(mapsArgs[1]),
@ -40,7 +41,7 @@
} }
}; };
L.Hash.formatHash = function(map) { (L.Hash.formatHash = function(map) {
var center = map.getCenter(), var center = map.getCenter(),
zoom = map.getZoom(), zoom = map.getZoom(),
precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2)), precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2)),
@ -52,7 +53,7 @@
center.lng.toFixed(precision), center.lng.toFixed(precision),
layers layers
]; ];
url = "#map=" + params.join("/"); url = '#map=' + params.join('/');
if (this.additionalCb != null) { if (this.additionalCb != null) {
var additional = this.additionalCb(); var additional = this.additionalCb();
if (additional != null) { if (additional != null) {
@ -60,9 +61,8 @@
} }
} }
return url; return url;
}, }),
(L.Hash.prototype = {
L.Hash.prototype = {
options: { options: {
layerSeparator: ',' layerSeparator: ','
}, },
@ -86,7 +86,8 @@
}, },
_parseLayers: function(layersParam, layerSeparator) { _parseLayers: function(layersParam, layerSeparator) {
var layers = layersParam.split(layerSeparator).map(L.bind(function (layerEncoded) { var layers = layersParam.split(layerSeparator).map(
L.bind(function(layerEncoded) {
var obj = null; var obj = null;
var layerString = decodeURIComponent(layerEncoded); var layerString = decodeURIComponent(layerEncoded);
@ -95,7 +96,8 @@
} }
return obj; return obj;
}, this)); }, this)
);
return layers; return layers;
}, },
@ -108,7 +110,10 @@
return count; return count;
}; };
var layers = this._parseLayers(layersParam, this.options.layerSeparator); var layers = this._parseLayers(
layersParam,
this.options.layerSeparator
);
var found = layers.reduce(countFoundLayers, 0); var found = layers.reduce(countFoundLayers, 0);
if (found < layers.length) { if (found < layers.length) {
@ -130,14 +135,16 @@
layersControl.removeActiveLayers(); layersControl.removeActiveLayers();
layers.forEach(L.bind(function(obj, index, array) { layers.forEach(
L.bind(function(obj, index, array) {
if (obj) { if (obj) {
layersControl.activateLayer(obj.layer); layersControl.activateLayer(obj.layer);
if (obj && !obj.overlay) { if (obj && !obj.overlay) {
added = true; added = true;
} }
} }
}, this)); }, this)
);
if (!added) { if (!added) {
// if we couldn't add layers (removed or invalid name), add the default one // if we couldn't add layers (removed or invalid name), add the default one
@ -147,11 +154,13 @@
formatLayers: function() { formatLayers: function() {
var objList = this.options.layersControl.getActiveLayers(); var objList = this.options.layersControl.getActiveLayers();
var layerList = objList.map(L.bind(function (obj) { var layerList = objList.map(
L.bind(function(obj) {
return encodeURIComponent(this._toLayerString(obj)); return encodeURIComponent(this._toLayerString(obj));
}, this)); }, this)
);
return layerList.join(this.options.layerSeparator) return layerList.join(this.options.layerSeparator);
}, },
_toLayerString: function(obj) { _toLayerString: function(obj) {
@ -254,22 +263,41 @@
isListening: false, isListening: false,
hashChangeInterval: null, hashChangeInterval: null,
startListening: function() { startListening: function() {
this.map.on("moveend layeradd layerremove", this.onMapMove, this); this.map.on(
'moveend layeradd layerremove',
this.onMapMove,
this
);
if (HAS_HASHCHANGE) { if (HAS_HASHCHANGE) {
L.DomEvent.addListener(window, "hashchange", this.onHashChange); L.DomEvent.addListener(
window,
'hashchange',
this.onHashChange
);
} else { } else {
clearInterval(this.hashChangeInterval); clearInterval(this.hashChangeInterval);
this.hashChangeInterval = setInterval(this.onHashChange, 50); this.hashChangeInterval = setInterval(
this.onHashChange,
50
);
} }
this.isListening = true; this.isListening = true;
}, },
stopListening: function() { stopListening: function() {
this.map.off("moveend layeradd layerremove", this.onMapMove, this); this.map.off(
'moveend layeradd layerremove',
this.onMapMove,
this
);
if (HAS_HASHCHANGE) { if (HAS_HASHCHANGE) {
L.DomEvent.removeListener(window, "hashchange", this.onHashChange); L.DomEvent.removeListener(
window,
'hashchange',
this.onHashChange
);
} else { } else {
clearInterval(this.hashChangeInterval); clearInterval(this.hashChangeInterval);
} }
@ -281,11 +309,13 @@
if (obj.hasOwnProperty(key)) { if (obj.hasOwnProperty(key)) {
if (obj[key] === value) { if (obj[key] === value) {
return key; return key;
} else { return null; }; } else {
}; return null;
};
} }
}; }
}
}
});
L.hash = function(map, options) { L.hash = function(map, options) {
return new L.Hash(map, options); return new L.Hash(map, options);
}; };

View file

@ -1,15 +1,23 @@
BR.stravaSegments = function(map, layersControl) { BR.stravaSegments = function(map, layersControl) {
const stravaControl = L.control.stravaSegments({ const stravaControl = L.control
.stravaSegments({
runningTitle: i18next.t('map.strava-running'), runningTitle: i18next.t('map.strava-running'),
bikingTitle: i18next.t('map.strava-biking'), bikingTitle: i18next.t('map.strava-biking'),
loadingTitle: i18next.t('map.loading'), loadingTitle: i18next.t('map.loading'),
stravaToken: BR.keys.strava stravaToken: BR.keys.strava
}) })
.addTo(map); .addTo(map);
layersControl.addOverlay(stravaControl.stravaLayer, i18next.t('map.layer.strava-segments')); layersControl.addOverlay(
stravaControl.stravaLayer,
i18next.t('map.layer.strava-segments')
);
stravaControl.onError = function(err) { stravaControl.onError = function(err) {
BR.message.showError(i18next.t('warning.strava-error', {error: err && err.message ? err.message : err})); BR.message.showError(
} i18next.t('warning.strava-error', {
error: err && err.message ? err.message : err
})
);
};
// hide strava buttons when layer is inactive // hide strava buttons when layer is inactive
var toggleStravaControl = function() { var toggleStravaControl = function() {

View file

@ -2,7 +2,8 @@ L.BRouter = L.Class.extend({
statics: { statics: {
// NOTE: the routing API used here is not public! // NOTE: the routing API used here is not public!
// /brouter?lonlats=1.1,1.2|2.1,2.2|3.1,3.2|4.1,4.2&nogos=-1.1,-1.2,1|-2.1,-2.2,2&profile=shortest&alternativeidx=1&format=kml // /brouter?lonlats=1.1,1.2|2.1,2.2|3.1,3.2|4.1,4.2&nogos=-1.1,-1.2,1|-2.1,-2.2,2&profile=shortest&alternativeidx=1&format=kml
URL_TEMPLATE: '/brouter?lonlats={lonlats}&nogos={nogos}&polylines={polylines}&polygons={polygons}&profile={profile}&alternativeidx={alternativeidx}&format={format}', URL_TEMPLATE:
'/brouter?lonlats={lonlats}&nogos={nogos}&polylines={polylines}&polygons={polygons}&profile={profile}&alternativeidx={alternativeidx}&format={format}',
URL_PROFILE_UPLOAD: BR.conf.host + '/brouter/profile', URL_PROFILE_UPLOAD: BR.conf.host + '/brouter/profile',
PRECISION: 6, PRECISION: 6,
NUMBER_SEPARATOR: ',', NUMBER_SEPARATOR: ',',
@ -10,15 +11,17 @@ L.BRouter = L.Class.extend({
ABORTED_ERROR: 'aborted' ABORTED_ERROR: 'aborted'
}, },
options: { options: {},
},
initialize: function(options) { initialize: function(options) {
L.setOptions(this, options); L.setOptions(this, options);
this.queue = async.queue(L.bind(function (task, callback) { this.queue = async.queue(
L.bind(function(task, callback) {
this.getRoute(task.segment, callback); this.getRoute(task.segment, callback);
}, this), 1); }, this),
1
);
// patch to call callbacks on kill for cleanup (loadingTrailer) // patch to call callbacks on kill for cleanup (loadingTrailer)
this.queue.kill = function() { this.queue.kill = function() {
@ -41,17 +44,29 @@ L.BRouter = L.Class.extend({
if (this._getLonLatsString(latLngs) != null) if (this._getLonLatsString(latLngs) != null)
params.lonlats = this._getLonLatsString(latLngs); params.lonlats = this._getLonLatsString(latLngs);
if (this.options.nogos && this._getNogosString(this.options.nogos).length > 0) if (
this.options.nogos &&
this._getNogosString(this.options.nogos).length > 0
)
params.nogos = this._getNogosString(this.options.nogos); params.nogos = this._getNogosString(this.options.nogos);
if (this.options.polylines && this._getNogosPolylinesString(this.options.polylines).length > 0) if (
params.polylines = this._getNogosPolylinesString(this.options.polylines); this.options.polylines &&
this._getNogosPolylinesString(this.options.polylines).length > 0
)
params.polylines = this._getNogosPolylinesString(
this.options.polylines
);
if (this.options.polygons && this._getNogosPolygonsString(this.options.polygons).length > 0) if (
params.polygons = this._getNogosPolygonsString(this.options.polygons); this.options.polygons &&
this._getNogosPolygonsString(this.options.polygons).length > 0
)
params.polygons = this._getNogosPolygonsString(
this.options.polygons
);
if (this.options.profile != null) if (this.options.profile != null) params.profile = this.options.profile;
params.profile = this.options.profile;
params.alternativeidx = this.options.alternative; params.alternativeidx = this.options.alternative;
@ -59,13 +74,14 @@ L.BRouter = L.Class.extend({
params.format = format; params.format = format;
} else { } else {
// do not put values in URL if this is the default value (format===null) // do not put values in URL if this is the default value (format===null)
if (params.profile === BR.conf.profiles[0]) if (params.profile === BR.conf.profiles[0]) delete params.profile;
delete params.profile; if (params.alternativeidx == 0) delete params.alternativeidx;
if (params.alternativeidx == 0)
delete params.alternativeidx;
// don't add custom profile, as these are only stored temporarily // don't add custom profile, as these are only stored temporarily
if (params.profile && params.profile.substring(0, 7) === 'custom_') { if (
params.profile &&
params.profile.substring(0, 7) === 'custom_'
) {
delete params.profile; delete params.profile;
} }
} }
@ -99,7 +115,7 @@ L.BRouter = L.Class.extend({
getUrl: function(latLngs, format) { getUrl: function(latLngs, format) {
var urlParams = this.getUrlParams(latLngs, format); var urlParams = this.getUrlParams(latLngs, format);
var args = [] var args = [];
if (urlParams.lonlats != null && urlParams.lonlats.length > 0) if (urlParams.lonlats != null && urlParams.lonlats.length > 0)
args.push(L.Util.template('lonlats={lonlats}', urlParams)); args.push(L.Util.template('lonlats={lonlats}', urlParams));
if (urlParams.nogos != null) if (urlParams.nogos != null)
@ -111,13 +127,17 @@ L.BRouter = L.Class.extend({
if (urlParams.profile != null) if (urlParams.profile != null)
args.push(L.Util.template('profile={profile}', urlParams)); args.push(L.Util.template('profile={profile}', urlParams));
if (urlParams.alternativeidx != null) if (urlParams.alternativeidx != null)
args.push(L.Util.template('alternativeidx={alternativeidx}', urlParams)); args.push(
L.Util.template('alternativeidx={alternativeidx}', urlParams)
);
if (urlParams.format != null) if (urlParams.format != null)
args.push(L.Util.template('format={format}', urlParams)); args.push(L.Util.template('format={format}', urlParams));
var prepend_host = (format != null); var prepend_host = format != null;
return (prepend_host ? BR.conf.host : '') + '/brouter?' + args.join('&'); return (
(prepend_host ? BR.conf.host : '') + '/brouter?' + args.join('&')
);
}, },
getRoute: function(latLngs, cb) { getRoute: function(latLngs, cb) {
@ -130,21 +150,27 @@ L.BRouter = L.Class.extend({
xhr.open('GET', url, true); xhr.open('GET', url, true);
xhr.onload = L.bind(this._handleRouteResponse, this, xhr, cb); xhr.onload = L.bind(this._handleRouteResponse, this, xhr, cb);
xhr.onerror = L.bind(function(xhr, cb) { xhr.onerror = L.bind(
function(xhr, cb) {
cb(BR.Util.getError(xhr)); cb(BR.Util.getError(xhr));
}, this, xhr, cb); },
this,
xhr,
cb
);
xhr.send(); xhr.send();
}, },
_handleRouteResponse: function(xhr, cb) { _handleRouteResponse: function(xhr, cb) {
var layer, var layer, geojson;
geojson;
if (xhr.status === 200 if (
&& xhr.responseText xhr.status === 200 &&
xhr.responseText &&
// application error when not GeoJSON format (text/plain for errors) // application error when not GeoJSON format (text/plain for errors)
&& xhr.getResponseHeader('Content-Type').split(';')[0] === 'application/vnd.geo+json') { xhr.getResponseHeader('Content-Type').split(';')[0] ===
'application/vnd.geo+json'
) {
// leaflet.spin // leaflet.spin
//gpxLayer.fire('data:loaded'); //gpxLayer.fire('data:loaded');
@ -189,7 +215,11 @@ L.BRouter = L.Class.extend({
_handleProfileResponse: function(xhr, cb) { _handleProfileResponse: function(xhr, cb) {
var response; var response;
if (xhr.status === 200 && xhr.responseText && xhr.responseText.length > 0) { if (
xhr.status === 200 &&
xhr.responseText &&
xhr.responseText.length > 0
) {
response = JSON.parse(xhr.responseText); response = JSON.parse(xhr.responseText);
cb(response.error, response.profileid); cb(response.error, response.profileid);
} else { } else {
@ -201,7 +231,7 @@ L.BRouter = L.Class.extend({
var s = ''; var s = '';
for (var i = 0; i < latLngs.length; i++) { for (var i = 0; i < latLngs.length; i++) {
s += this._formatLatLng(latLngs[i]); s += this._formatLatLng(latLngs[i]);
if (i < (latLngs.length - 1)) { if (i < latLngs.length - 1) {
s += L.BRouter.GROUP_SEPARATOR; s += L.BRouter.GROUP_SEPARATOR;
} }
} }
@ -235,11 +265,14 @@ L.BRouter = L.Class.extend({
s += L.BRouter.NUMBER_SEPARATOR; s += L.BRouter.NUMBER_SEPARATOR;
s += Math.round(circle.getRadius()); s += Math.round(circle.getRadius());
// -1 is default nogo exclusion, it should not be passed as a URL parameter. // -1 is default nogo exclusion, it should not be passed as a URL parameter.
if (circle.options.nogoWeight !== null && circle.options.nogoWeight !== -1) { if (
circle.options.nogoWeight !== null &&
circle.options.nogoWeight !== -1
) {
s += L.BRouter.NUMBER_SEPARATOR; s += L.BRouter.NUMBER_SEPARATOR;
s += circle.options.nogoWeight; s += circle.options.nogoWeight;
} }
if (i < (nogos.length - 1)) { if (i < nogos.length - 1) {
s += L.BRouter.GROUP_SEPARATOR; s += L.BRouter.GROUP_SEPARATOR;
} }
} }
@ -284,11 +317,14 @@ L.BRouter = L.Class.extend({
s += this._formatLatLng(vertices[j]); s += this._formatLatLng(vertices[j]);
} }
// -1 is default nogo exclusion, it should not be passed as a URL parameter. // -1 is default nogo exclusion, it should not be passed as a URL parameter.
if (polyline.options.nogoWeight !== null && polyline.options.nogoWeight !== -1) { if (
polyline.options.nogoWeight !== null &&
polyline.options.nogoWeight !== -1
) {
s += L.BRouter.NUMBER_SEPARATOR; s += L.BRouter.NUMBER_SEPARATOR;
s += polyline.options.nogoWeight; s += polyline.options.nogoWeight;
} }
if (i < (nogos.length - 1)) { if (i < nogos.length - 1) {
s += L.BRouter.GROUP_SEPARATOR; s += L.BRouter.GROUP_SEPARATOR;
} }
} }
@ -302,14 +338,11 @@ L.BRouter = L.Class.extend({
nogos = []; nogos = [];
groups = s.split(L.BRouter.GROUP_SEPARATOR); groups = s.split(L.BRouter.GROUP_SEPARATOR);
for (var i = 0; i < groups.length; i++) for (var i = 0; i < groups.length; i++) {
{
numbers = groups[i].split(L.BRouter.NUMBER_SEPARATOR); numbers = groups[i].split(L.BRouter.NUMBER_SEPARATOR);
if (numbers.length > 1) if (numbers.length > 1) {
{
latlngs = []; latlngs = [];
for (var j = 0; j < numbers.length - 1;) for (var j = 0; j < numbers.length - 1; ) {
{
var lng = Number.parseFloat(numbers[j++]); var lng = Number.parseFloat(numbers[j++]);
var lat = Number.parseFloat(numbers[j++]); var lat = Number.parseFloat(numbers[j++]);
latlngs.push([lat, lng]); latlngs.push([lat, lng]);
@ -336,11 +369,14 @@ L.BRouter = L.Class.extend({
s += this._formatLatLng(vertices[j]); s += this._formatLatLng(vertices[j]);
} }
// -1 is default nogo exclusion, it should not be passed as a URL parameter. // -1 is default nogo exclusion, it should not be passed as a URL parameter.
if (polygon.options.nogoWeight !== null && polygon.options.nogoWeight !== -1) { if (
polygon.options.nogoWeight !== null &&
polygon.options.nogoWeight !== -1
) {
s += L.BRouter.NUMBER_SEPARATOR; s += L.BRouter.NUMBER_SEPARATOR;
s += polygon.options.nogoWeight; s += polygon.options.nogoWeight;
} }
if (i < (nogos.length - 1)) { if (i < nogos.length - 1) {
s += L.BRouter.GROUP_SEPARATOR; s += L.BRouter.GROUP_SEPARATOR;
} }
} }
@ -354,14 +390,11 @@ L.BRouter = L.Class.extend({
nogos = []; nogos = [];
groups = s.split(L.BRouter.GROUP_SEPARATOR); groups = s.split(L.BRouter.GROUP_SEPARATOR);
for (var i = 0; i < groups.length; i++) for (var i = 0; i < groups.length; i++) {
{
numbers = groups[i].split(L.BRouter.NUMBER_SEPARATOR); numbers = groups[i].split(L.BRouter.NUMBER_SEPARATOR);
if (numbers.length > 1) if (numbers.length > 1) {
{
latlngs = []; latlngs = [];
for (var j = 0; j < numbers.length - 1;) for (var j = 0; j < numbers.length - 1; ) {
{
var lng = Number.parseFloat(numbers[j++]); var lng = Number.parseFloat(numbers[j++]);
var lat = Number.parseFloat(numbers[j++]); var lat = Number.parseFloat(numbers[j++]);
latlngs.push([lat, lng]); latlngs.push([lat, lng]);

View file

@ -3,7 +3,9 @@
var brouterCgi = (function() { var brouterCgi = (function() {
// http://h2096617.stratoserver.net/cgi-bin/brouter.sh?coords=13.404681_52.520185_13.340278_52.512356_trekking_0 // http://h2096617.stratoserver.net/cgi-bin/brouter.sh?coords=13.404681_52.520185_13.340278_52.512356_trekking_0
//var URL_TEMPLATE = '/cgi-bin/proxy.cgi?url=' + 'http://h2096617.stratoserver.net/cgi-bin/brouter.sh?coords={fromLng}_{fromLat}_{toLng}_{toLat}_{profile}_{alt}'; //var URL_TEMPLATE = '/cgi-bin/proxy.cgi?url=' + 'http://h2096617.stratoserver.net/cgi-bin/brouter.sh?coords={fromLng}_{fromLat}_{toLng}_{toLat}_{profile}_{alt}';
var URL_TEMPLATE = '/proxy.php?url=' + 'cgi-bin/brouter.sh?coords={fromLng}_{fromLat}_{toLng}_{toLat}_{profile}_{alt}'; var URL_TEMPLATE =
'/proxy.php?url=' +
'cgi-bin/brouter.sh?coords={fromLng}_{fromLat}_{toLng}_{toLat}_{profile}_{alt}';
var PRECISION = 6; var PRECISION = 6;
function getUrl(polyline) { function getUrl(polyline) {
@ -24,6 +26,5 @@ var brouterCgi = (function() {
return { return {
getUrl: getUrl getUrl: getUrl
} };
})(); })();

View file

@ -1,5 +1,4 @@
(function() { (function() {
// COPYING: Please get your own API keys from the sites listed below // COPYING: Please get your own API keys from the sites listed below
BR.keys = { BR.keys = {
@ -18,5 +17,4 @@
// OpenMapSurfer (OpenRouteService API), https://openrouteservice.org/plans/ // OpenMapSurfer (OpenRouteService API), https://openrouteservice.org/plans/
openrouteservice: '' openrouteservice: ''
}; };
})(); })();

View file

@ -21,8 +21,14 @@ i18next.t('navbar.profile.vm-forum-liegerad-schnell');
i18next.t('navbar.profile.vm-forum-velomobil-schnell'); i18next.t('navbar.profile.vm-forum-velomobil-schnell');
i18next.t('sidebar.layers.category.base-layers', 'Base layers'); i18next.t('sidebar.layers.category.base-layers', 'Base layers');
i18next.t('sidebar.layers.category.worldwide-international', 'Worldwide international'); i18next.t(
i18next.t('sidebar.layers.category.worldwide-monolingual', 'Worldwide monolingual'); 'sidebar.layers.category.worldwide-international',
'Worldwide international'
);
i18next.t(
'sidebar.layers.category.worldwide-monolingual',
'Worldwide monolingual'
);
i18next.t('sidebar.layers.category.europe', 'Europe'); i18next.t('sidebar.layers.category.europe', 'Europe');
i18next.t('sidebar.layers.category.europe-monolingual', 'Europe monolingual'); i18next.t('sidebar.layers.category.europe-monolingual', 'Europe monolingual');
i18next.t('sidebar.layers.category.country', 'Country'); i18next.t('sidebar.layers.category.country', 'Country');

View file

@ -8,7 +8,13 @@
"transifex-push": "gulp i18next && tx push --source", "transifex-push": "gulp i18next && tx push --source",
"transifex-pull": "tx pull --all --minimum-perc 1 --force && (git add locales/*.json && git commit locales/*.json -m 'Update translations' || true)", "transifex-pull": "tx pull --all --minimum-perc 1 --force && (git add locales/*.json && git commit locales/*.json -m 'Update translations' || true)",
"layers": "node layers/josm/extract.js && node layers/collection/extract.js", "layers": "node layers/josm/extract.js && node layers/collection/extract.js",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1",
"prettier": "prettier --write '**/*'"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --bail"
}
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -78,9 +84,12 @@
"gulp-uglify": "^1.1.0", "gulp-uglify": "^1.1.0",
"gulp-util": "^3.0.7", "gulp-util": "^3.0.7",
"gulp-zip": "^4.0.0", "gulp-zip": "^4.0.0",
"husky": "^2.3.0",
"i18next-scanner": "^2.9.1", "i18next-scanner": "^2.9.1",
"node-fetch": "^2.3.0", "node-fetch": "^2.3.0",
"npmfiles": "^0.1.1" "npmfiles": "^0.1.1",
"prettier": "^1.17.1",
"pretty-quick": "^1.10.0"
}, },
"overrides": { "overrides": {
"leaflet": { "leaflet": {

403
yarn.lock
View file

@ -1194,6 +1194,11 @@
"@turf/invariant" "^5.1.5" "@turf/invariant" "^5.1.5"
d3-voronoi "1.1.2" d3-voronoi "1.1.2"
"@types/normalize-package-data@^2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==
JSV@^4.0.x: JSV@^4.0.x:
version "4.0.2" version "4.0.2"
resolved "https://registry.yarnpkg.com/JSV/-/JSV-4.0.2.tgz#d077f6825571f82132f9dffaed587b4029feff57" resolved "https://registry.yarnpkg.com/JSV/-/JSV-4.0.2.tgz#d077f6825571f82132f9dffaed587b4029feff57"
@ -1403,6 +1408,11 @@ array-differ@^1.0.0:
resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031"
integrity sha1-7/UuN1gknTO+QCuLuOVkuytdQDE= integrity sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=
array-differ@^2.0.3:
version "2.1.0"
resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-2.1.0.tgz#4b9c1c3f14b906757082925769e8ab904f4801b1"
integrity sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==
array-each@^1.0.1: array-each@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f"
@ -1423,7 +1433,7 @@ array-slice@^1.0.0:
resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4"
integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==
array-union@^1.0.1: array-union@^1.0.1, array-union@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=
@ -1440,6 +1450,11 @@ array-unique@^0.3.2:
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=
arrify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=
asn1@~0.2.3: asn1@~0.2.3:
version "0.2.4" version "0.2.4"
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
@ -1630,6 +1645,13 @@ cache-base@^1.0.1:
union-value "^1.0.0" union-value "^1.0.0"
unset-value "^1.0.0" unset-value "^1.0.0"
caller-callsite@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"
integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=
dependencies:
callsites "^2.0.0"
caller-id@^0.1.0: caller-id@^0.1.0:
version "0.1.0" version "0.1.0"
resolved "https://registry.yarnpkg.com/caller-id/-/caller-id-0.1.0.tgz#59bdac0893d12c3871408279231f97458364f07b" resolved "https://registry.yarnpkg.com/caller-id/-/caller-id-0.1.0.tgz#59bdac0893d12c3871408279231f97458364f07b"
@ -1637,6 +1659,18 @@ caller-id@^0.1.0:
dependencies: dependencies:
stack-trace "~0.0.7" stack-trace "~0.0.7"
caller-path@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4"
integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=
dependencies:
caller-callsite "^2.0.0"
callsites@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50"
integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=
camelcase-keys@^2.0.0: camelcase-keys@^2.0.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7"
@ -1684,7 +1718,7 @@ chalk@^1.0.0, chalk@^1.1.1:
strip-ansi "^3.0.0" strip-ansi "^3.0.0"
supports-color "^2.0.0" supports-color "^2.0.0"
chalk@^2.4.1: chalk@^2.3.0, chalk@^2.4.1:
version "2.4.2" version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@ -1702,6 +1736,11 @@ chalk@~0.4.0:
has-color "~0.1.0" has-color "~0.1.0"
strip-ansi "~0.1.0" strip-ansi "~0.1.0"
ci-info@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
class-utils@^0.3.5: class-utils@^0.3.5:
version "0.3.6" version "0.3.6"
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
@ -1886,6 +1925,36 @@ cosmiconfig@^2.1.0, cosmiconfig@^2.1.1:
parse-json "^2.2.0" parse-json "^2.2.0"
require-from-string "^1.1.0" require-from-string "^1.1.0"
cosmiconfig@^5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a"
integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==
dependencies:
import-fresh "^2.0.0"
is-directory "^0.3.1"
js-yaml "^3.13.1"
parse-json "^4.0.0"
cross-spawn@^5.0.1:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=
dependencies:
lru-cache "^4.0.1"
shebang-command "^1.2.0"
which "^1.2.9"
cross-spawn@^6.0.0:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
dependencies:
nice-try "^1.0.4"
path-key "^2.0.1"
semver "^5.5.0"
shebang-command "^1.2.0"
which "^1.2.9"
css@2.X, css@^2.0.0: css@2.X, css@^2.0.0:
version "2.2.4" version "2.2.4"
resolved "https://registry.yarnpkg.com/css/-/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929" resolved "https://registry.yarnpkg.com/css/-/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929"
@ -2158,7 +2227,7 @@ errlop@^1.1.1:
dependencies: dependencies:
editions "^2.1.2" editions "^2.1.2"
error-ex@^1.2.0: error-ex@^1.2.0, error-ex@^1.3.1:
version "1.3.2" version "1.3.2"
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
@ -2188,6 +2257,32 @@ event-stream@^3.1.0:
stream-combiner "^0.2.2" stream-combiner "^0.2.2"
through "^2.3.8" through "^2.3.8"
execa@^0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da"
integrity sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=
dependencies:
cross-spawn "^5.0.1"
get-stream "^3.0.0"
is-stream "^1.1.0"
npm-run-path "^2.0.0"
p-finally "^1.0.0"
signal-exit "^3.0.0"
strip-eof "^1.0.0"
execa@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
dependencies:
cross-spawn "^6.0.0"
get-stream "^4.0.0"
is-stream "^1.1.0"
npm-run-path "^2.0.0"
p-finally "^1.0.0"
signal-exit "^3.0.0"
strip-eof "^1.0.0"
expand-brackets@^2.1.4: expand-brackets@^2.1.4:
version "2.1.4" version "2.1.4"
resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622"
@ -2310,6 +2405,20 @@ find-up@^1.0.0:
path-exists "^2.0.0" path-exists "^2.0.0"
pinkie-promise "^2.0.0" pinkie-promise "^2.0.0"
find-up@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c=
dependencies:
locate-path "^2.0.0"
find-up@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==
dependencies:
locate-path "^3.0.0"
findup-sync@^2.0.0: findup-sync@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc"
@ -2455,11 +2564,23 @@ get-stdin@^4.0.1:
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=
get-stdin@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6"
integrity sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==
get-stream@^3.0.0: get-stream@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=
get-stream@^4.0.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
dependencies:
pump "^3.0.0"
get-value@^2.0.3, get-value@^2.0.6: get-value@^2.0.3, get-value@^2.0.6:
version "2.0.6" version "2.0.6"
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
@ -3001,6 +3122,22 @@ http-signature@~1.2.0:
jsprim "^1.2.2" jsprim "^1.2.2"
sshpk "^1.7.0" sshpk "^1.7.0"
husky@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/husky/-/husky-2.3.0.tgz#8b78ed24d763042df7fd899991985d65a976dd13"
integrity sha512-A/ZQSEILoq+mQM3yC3RIBSaw1bYXdkKnyyKVSUiJl+iBjVZc5LQEXdGY1ZjrDxC4IzfRPiJ0IqzEQGCN5TQa/A==
dependencies:
cosmiconfig "^5.2.0"
execa "^1.0.0"
find-up "^3.0.0"
get-stdin "^7.0.0"
is-ci "^2.0.0"
pkg-dir "^4.1.0"
please-upgrade-node "^3.1.1"
read-pkg "^5.1.1"
run-node "^1.0.0"
slash "^3.0.0"
hyperquest@~1.2.0: hyperquest@~1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/hyperquest/-/hyperquest-1.2.0.tgz#39e1fef66888dc7ce0dec6c0dd814f6fc8944ad5" resolved "https://registry.yarnpkg.com/hyperquest/-/hyperquest-1.2.0.tgz#39e1fef66888dc7ce0dec6c0dd814f6fc8944ad5"
@ -3056,6 +3193,19 @@ i18next@^15.0.4:
dependencies: dependencies:
"@babel/runtime" "^7.3.1" "@babel/runtime" "^7.3.1"
ignore@^3.3.7:
version "3.3.10"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043"
integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==
import-fresh@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546"
integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY=
dependencies:
caller-path "^2.0.0"
resolve-from "^3.0.0"
indent-string@^2.1.0: indent-string@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80"
@ -3142,6 +3292,13 @@ is-buffer@^1.1.5:
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
is-ci@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==
dependencies:
ci-info "^2.0.0"
is-data-descriptor@^0.1.4: is-data-descriptor@^0.1.4:
version "0.1.4" version "0.1.4"
resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
@ -3270,6 +3427,11 @@ is-relative@^1.0.0:
dependencies: dependencies:
is-unc-path "^1.0.0" is-unc-path "^1.0.0"
is-stream@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ=
is-typedarray@~1.0.0: is-typedarray@~1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
@ -3357,6 +3519,14 @@ jquery@3.4.1:
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"
integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw== integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==
js-yaml@^3.13.1:
version "3.13.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847"
integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"
js-yaml@^3.4.3: js-yaml@^3.4.3:
version "3.12.1" version "3.12.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600"
@ -3370,6 +3540,11 @@ jsbn@~0.1.0:
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
json-parse-better-errors@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==
json-schema-traverse@^0.4.1: json-schema-traverse@^0.4.1:
version "0.4.1" version "0.4.1"
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
@ -3572,6 +3747,22 @@ load-json-file@^1.0.0:
pinkie-promise "^2.0.0" pinkie-promise "^2.0.0"
strip-bom "^2.0.0" strip-bom "^2.0.0"
locate-path@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=
dependencies:
p-locate "^2.0.0"
path-exists "^3.0.0"
locate-path@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==
dependencies:
p-locate "^3.0.0"
path-exists "^3.0.0"
lodash._basecopy@^3.0.0: lodash._basecopy@^3.0.0:
version "3.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
@ -3724,6 +3915,14 @@ lru-cache@2:
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
integrity sha1-bUUk6LlV+V1PW1iFHOId1y+06VI= integrity sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=
lru-cache@^4.0.1:
version "4.1.5"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==
dependencies:
pseudomap "^1.0.2"
yallist "^2.1.2"
make-iterator@^1.0.0: make-iterator@^1.0.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6"
@ -3870,11 +4069,26 @@ monotone-convex-hull-2d@^1.0.1:
dependencies: dependencies:
robust-orientation "^1.1.3" robust-orientation "^1.1.3"
mri@^1.1.0:
version "1.1.4"
resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.4.tgz#7cb1dd1b9b40905f1fac053abe25b6720f44744a"
integrity sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==
ms@2.0.0: ms@2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
multimatch@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-3.0.0.tgz#0e2534cc6bc238d9ab67e1b9cd5fcd85a6dbf70b"
integrity sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==
dependencies:
array-differ "^2.0.3"
array-union "^1.0.2"
arrify "^1.0.1"
minimatch "^3.0.4"
multipipe@^0.1.2: multipipe@^0.1.2:
version "0.1.2" version "0.1.2"
resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b"
@ -3914,6 +4128,11 @@ natives@^1.1.0:
resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.6.tgz#a603b4a498ab77173612b9ea1acdec4d980f00bb" resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.6.tgz#a603b4a498ab77173612b9ea1acdec4d980f00bb"
integrity sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA== integrity sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA==
nice-try@^1.0.4:
version "1.0.5"
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
node-fetch@^2.3.0: node-fetch@^2.3.0:
version "2.3.0" version "2.3.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5"
@ -3927,7 +4146,7 @@ nomnom@^1.5.x:
chalk "~0.4.0" chalk "~0.4.0"
underscore "~1.6.0" underscore "~1.6.0"
normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.5.0:
version "2.5.0" version "2.5.0"
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==
@ -3956,6 +4175,13 @@ now-and-later@^2.0.0:
dependencies: dependencies:
once "^1.3.2" once "^1.3.2"
npm-run-path@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=
dependencies:
path-key "^2.0.0"
npmfiles@^0.1.1: npmfiles@^0.1.1:
version "0.1.1" version "0.1.1"
resolved "https://registry.yarnpkg.com/npmfiles/-/npmfiles-0.1.1.tgz#081f51f98c9a4d488e6e15acc5989870c94db77b" resolved "https://registry.yarnpkg.com/npmfiles/-/npmfiles-0.1.1.tgz#081f51f98c9a4d488e6e15acc5989870c94db77b"
@ -4100,6 +4326,49 @@ os-homedir@^1.0.0, os-homedir@^1.0.1:
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
p-finally@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=
p-limit@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==
dependencies:
p-try "^1.0.0"
p-limit@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2"
integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==
dependencies:
p-try "^2.0.0"
p-locate@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=
dependencies:
p-limit "^1.1.0"
p-locate@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4"
integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==
dependencies:
p-limit "^2.0.0"
p-try@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=
p-try@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
parse-filepath@^1.0.1: parse-filepath@^1.0.1:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891"
@ -4116,6 +4385,14 @@ parse-json@^2.2.0:
dependencies: dependencies:
error-ex "^1.2.0" error-ex "^1.2.0"
parse-json@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0"
integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=
dependencies:
error-ex "^1.3.1"
json-parse-better-errors "^1.0.1"
parse-node-version@^1.0.0: parse-node-version@^1.0.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b"
@ -4148,6 +4425,11 @@ path-exists@^2.0.0:
dependencies: dependencies:
pinkie-promise "^2.0.0" pinkie-promise "^2.0.0"
path-exists@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
path-is-absolute@^1.0.0: path-is-absolute@^1.0.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
@ -4158,6 +4440,11 @@ path-is-inside@^1.0.1:
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=
path-key@^2.0.0, path-key@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
path-parse@^1.0.6: path-parse@^1.0.6:
version "1.0.6" version "1.0.6"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
@ -4213,11 +4500,25 @@ pinkie@^2.0.0:
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA=
pkg-dir@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.1.0.tgz#aaeb91c0d3b9c4f74a44ad849f4de34781ae01de"
integrity sha512-55k9QN4saZ8q518lE6EFgYiu95u3BWkSajCifhdQjvLvmr8IpnRbhI+UGpWJQfa0KzDguHeeWT1ccO1PmkOi3A==
dependencies:
find-up "^3.0.0"
pkginfo@^0.3.0: pkginfo@^0.3.0:
version "0.3.1" version "0.3.1"
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21"
integrity sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE= integrity sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE=
please-upgrade-node@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac"
integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ==
dependencies:
semver-compare "^1.0.0"
plugin-error@1.0.1, plugin-error@^1.0.1: plugin-error@1.0.1, plugin-error@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c"
@ -4304,6 +4605,11 @@ postcss@^6.0.0, postcss@^6.0.23:
source-map "^0.6.1" source-map "^0.6.1"
supports-color "^5.4.0" supports-color "^5.4.0"
prettier@^1.17.1:
version "1.17.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.1.tgz#ed64b4e93e370cb8a25b9ef7fef3e4fd1c0995db"
integrity sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==
pretty-bytes@^1.0.4: pretty-bytes@^1.0.4:
version "1.0.4" version "1.0.4"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84"
@ -4317,6 +4623,18 @@ pretty-hrtime@^1.0.0:
resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1"
integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=
pretty-quick@^1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-1.10.0.tgz#d86cc46fe92ed8cfcfba6a082ec5949c53858198"
integrity sha512-uNvm2N3UWmnZRZrClyQI45hIbV20f5BpSyZY51Spbvn4APp9+XLyX4bCjWRGT3fGyVyQ/2/iw7dbQq1UUaq7SQ==
dependencies:
chalk "^2.3.0"
execa "^0.8.0"
find-up "^2.1.0"
ignore "^3.3.7"
mri "^1.1.0"
multimatch "^3.0.0"
process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: process-nextick-args@^2.0.0, process-nextick-args@~2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
@ -4335,6 +4653,11 @@ promise-polyfill@^8.1.0:
resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.1.0.tgz#30059da54d1358ce905ac581f287e184aedf995d" resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.1.0.tgz#30059da54d1358ce905ac581f287e184aedf995d"
integrity sha512-OzSf6gcCUQ01byV4BgwyUCswlaQQ6gzXc23aLQWhicvfX9kfsUiUhgt3CCQej8jDnl8/PhGF31JdHX2/MzF3WA== integrity sha512-OzSf6gcCUQ01byV4BgwyUCswlaQQ6gzXc23aLQWhicvfX9kfsUiUhgt3CCQej8jDnl8/PhGF31JdHX2/MzF3WA==
pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=
psl@^1.1.24: psl@^1.1.24:
version "1.1.31" version "1.1.31"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184"
@ -4367,6 +4690,14 @@ pump@^2.0.0:
end-of-stream "^1.1.0" end-of-stream "^1.1.0"
once "^1.3.1" once "^1.3.1"
pump@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
dependencies:
end-of-stream "^1.1.0"
once "^1.3.1"
pumpify@^1.3.5: pumpify@^1.3.5:
version "1.5.1" version "1.5.1"
resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce"
@ -4420,6 +4751,16 @@ read-pkg@^1.0.0:
normalize-package-data "^2.3.2" normalize-package-data "^2.3.2"
path-type "^1.0.0" path-type "^1.0.0"
read-pkg@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.1.1.tgz#5cf234dde7a405c90c88a519ab73c467e9cb83f5"
integrity sha512-dFcTLQi6BZ+aFUaICg7er+/usEoqFdQxiEBsEMNGoipenihtxxtdrQuBXvyANCEI8VuUIVYFgeHGx9sLLvim4w==
dependencies:
"@types/normalize-package-data" "^2.4.0"
normalize-package-data "^2.5.0"
parse-json "^4.0.0"
type-fest "^0.4.1"
read@~1.0.5: read@~1.0.5:
version "1.0.7" version "1.0.7"
resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4"
@ -4612,6 +4953,11 @@ resolve-dir@^1.0.0, resolve-dir@^1.0.1:
expand-tilde "^2.0.0" expand-tilde "^2.0.0"
global-modules "^1.0.0" global-modules "^1.0.0"
resolve-from@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748"
integrity sha1-six699nWiBvItuZTM17rywoYh0g=
resolve-options@^1.1.0: resolve-options@^1.1.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131"
@ -4698,6 +5044,11 @@ robust-sum@^1.0.0:
resolved "https://registry.yarnpkg.com/robust-sum/-/robust-sum-1.0.0.tgz#16646e525292b4d25d82757a286955e0bbfa53d9" resolved "https://registry.yarnpkg.com/robust-sum/-/robust-sum-1.0.0.tgz#16646e525292b4d25d82757a286955e0bbfa53d9"
integrity sha1-FmRuUlKStNJdgnV6KGlV4Lv6U9k= integrity sha1-FmRuUlKStNJdgnV6KGlV4Lv6U9k=
run-node@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e"
integrity sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==
rx@^2.4.3: rx@^2.4.3:
version "2.5.3" version "2.5.3"
resolved "https://registry.yarnpkg.com/rx/-/rx-2.5.3.tgz#21adc7d80f02002af50dae97fd9dbf248755f566" resolved "https://registry.yarnpkg.com/rx/-/rx-2.5.3.tgz#21adc7d80f02002af50dae97fd9dbf248755f566"
@ -4724,6 +5075,11 @@ seiyria-bootstrap-slider@seiyria/bootstrap-slider#^9.8.1:
version "9.10.0" version "9.10.0"
resolved "https://codeload.github.com/seiyria/bootstrap-slider/tar.gz/92612ee5971257631c1d70347806253faad37be4" resolved "https://codeload.github.com/seiyria/bootstrap-slider/tar.gz/92612ee5971257631c1d70347806253faad37be4"
semver-compare@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0, semver@^5.6.0: "semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0, semver@^5.6.0:
version "5.6.0" version "5.6.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
@ -4734,6 +5090,11 @@ semver@^4.1.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da"
integrity sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto= integrity sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=
semver@^5.5.0:
version "5.7.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
sequencify@~0.0.7: sequencify@~0.0.7:
version "0.0.7" version "0.0.7"
resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c" resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c"
@ -4771,6 +5132,18 @@ shallow-clone@^3.0.0:
dependencies: dependencies:
kind-of "^6.0.2" kind-of "^6.0.2"
shebang-command@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=
dependencies:
shebang-regex "^1.0.0"
shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
sigmund@~1.0.0: sigmund@~1.0.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
@ -4791,6 +5164,11 @@ skmeans@0.9.7:
resolved "https://registry.yarnpkg.com/skmeans/-/skmeans-0.9.7.tgz#72670cebb728508f56e29c0e10d11e623529ce5d" resolved "https://registry.yarnpkg.com/skmeans/-/skmeans-0.9.7.tgz#72670cebb728508f56e29c0e10d11e623529ce5d"
integrity sha512-hNj1/oZ7ygsfmPZ7ZfN5MUBRoGg1gtpnImuJBgLO0ljQ67DtJuiQaiYdS4lUA6s0KCwnPhGivtC/WRwIZLkHyg== integrity sha512-hNj1/oZ7ygsfmPZ7ZfN5MUBRoGg1gtpnImuJBgLO0ljQ67DtJuiQaiYdS4lUA6s0KCwnPhGivtC/WRwIZLkHyg==
slash@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
snapdragon-node@^2.0.1: snapdragon-node@^2.0.1:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
@ -5038,6 +5416,11 @@ strip-bom@^1.0.0:
first-chunk-stream "^1.0.0" first-chunk-stream "^1.0.0"
is-utf8 "^0.2.0" is-utf8 "^0.2.0"
strip-eof@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=
strip-indent@^1.0.1: strip-indent@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2"
@ -5241,6 +5624,11 @@ two-sum@^1.0.0:
resolved "https://registry.yarnpkg.com/two-sum/-/two-sum-1.0.0.tgz#31d3f32239e4f731eca9df9155e2b297f008ab64" resolved "https://registry.yarnpkg.com/two-sum/-/two-sum-1.0.0.tgz#31d3f32239e4f731eca9df9155e2b297f008ab64"
integrity sha1-MdPzIjnk9zHsqd+RVeKyl/AIq2Q= integrity sha1-MdPzIjnk9zHsqd+RVeKyl/AIq2Q=
type-fest@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8"
integrity sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw==
uglify-js@2.6.4: uglify-js@2.6.4:
version "2.6.4" version "2.6.4"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.6.4.tgz#65ea2fb3059c9394692f15fed87c2b36c16b9adf" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.6.4.tgz#65ea2fb3059c9394692f15fed87c2b36c16b9adf"
@ -5468,7 +5856,7 @@ whatwg-fetch@^3.0.0:
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
which@^1.2.14: which@^1.2.14, which@^1.2.9:
version "1.3.1" version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
@ -5507,6 +5895,11 @@ xtend@~3.0.0:
resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a" resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a"
integrity sha1-XM50B7r2Qsunvs2laBEcST9ZZlo= integrity sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=
yallist@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=
yargs@~3.10.0: yargs@~3.10.0:
version "3.10.0" version "3.10.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"