Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions lib/request-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down