diff --git a/Makefile b/Makefile index d03f35a..ee6201a 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,15 @@ JS := $(shell find lib -name '*.js' -print) PORT = 3000 +replace_symlinks: build + # Make a new client_no_symlinks directory, with symlinks replaced by + # copies, so we can upload to a server. Ed 2016-09-08 + rm -rf client_no_symlinks/ + mkdir -p client_no_symlinks/ + cp -a client/* client_no_symlinks/ + find client_no_symlinks/build -type l | (while read x; do l=$$(readlink $$x); rm $$x; cp -a $$l $$x; done) + rm client_no_symlinks/config.js # so we don't overwrite server's version. + build: components $(JS) @$(COMPONENT) build --dev --out client/build diff --git a/README.md b/README.md index cbe7b30..2870f0f 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ To get started with otp.js and the sample web client: 2. Install [npm](https://www.npmjs.org/) if needed. In the otp.js project directory, run `npm install` to install Component and set up the development environment (this in configured in package.json). -3. Run `make`, which invokes Component to download any required dependencies and package them together with the local otp.js code (a copy of the packaged code is put in `client/build/`). +3. Run `make`, which invokes Component to download any required dependencies and package them together with the local otp.js code (a copy of the packaged code is put in `client/build/`). Make also copies `client/` to `client_no_symlinks/`, replacing all symlinks with a copy of the files they point to. 4. Copy the client configuration template from `client/config.js.template` to `client/config.js`; update `client/config.js` to reflect your specific setup including OTP backend, Mapbox keys, geocoder endpoints, etc. -5. Deploy the client to the web by copying the `client` directory to your web server. +5. Deploy the client to the web by copying the `client_no_symlinks/` directory, and the client/config.js file to your web server. diff --git a/lib/request-form.js b/lib/request-form.js index 9eb4265..965da4a 100644 --- a/lib/request-form.js +++ b/lib/request-form.js @@ -245,8 +245,8 @@ var RequestView = Backbone.View.extend({ this.updatingForm = true var maxDistance = $('#mode').val().indexOf('WALK') !== -1 - ? $('#maxWalkDistance').val() - : $('#maxBikeDistance').val() + ? $("#maxWalkDistance option[selected]").val() + : $('#maxBikeDistance option[selected]').val() var data = { date: this.$('#date input').val(),