Start by cloning the project using git.
git clone [email protected]:linjekoll/web-client.git
Navigate to the downloaded folder and run bundler.
cd web-client && bundle install
Run foreman start
in the application folder, foreman
will do the following.
- Watch and compile files1 on-the-fly.
Models extend Backbone.Model if no other information is given
- Extends: Collection
- Just a collection of stops
- Arguments: line id, colours (foreground, background)
- Contains a collection of stops
- Fetches stops from the server using paths like
/lines/:line_id/stops
- Arguments: journey id, vehicle type
- Takes trip information in the following format:
{destX: 123, destY: 123, time: 123}
- Trips have a custom setter-method which sets the
this.time
andthis.destination
attributes, otherwise it wouldn't be possible to have separatechange
events fortime
anddestination
- Receives updates from the websocket server and triggers events for the view.
- Contains a canvas for Raphael and info like end stations and line name
- Iterates through the Line collection to find typical travel times and calculates relative pixel distances
- NEEDS:
- In the line model:
- id, name, totalTime, stops
- In the stop model:
- time
- In the line model:
- Currently renders it self when, and only when, the stops collection in the line model fires the
reset
event.
- Draws itself as a dot and a text.
- Params: needs a shape and a reference to its paper/canvas
- Reacts to events in the Vehicle model:
- change:time: if vehicle is moving, change animation to reflect new time. Otherwise, do nothing?
- trainLeftStation: starts the vehicle moving towards the current destination.
compile
Compresses assets files1.
If you want to use the YUI compressor, pass ENV=production
on startup.
1 sass
, scss
, css
and js
files.