Sha256: ae836834c1bada23a7af90fde596f280c78350a5a587b1e627a2f3d5f9137df2

Contents?: true

Size: 587 Bytes

Versions: 10

Compression:

Stored size: 587 Bytes

Contents

querystring = require('querystring')
Backbone = require('backbone')

module.exports = class Router extends Backbone.Router
  routes:
    ':title' : 'show'
    ''       : 'list'

  list: (string)->
    location.hash = '/' if location.hash == ''
    console.log 'list'
    @current = 'list'
    @query = querystring.parse(string)
    console.log @query

  new: ()->
    console.log 'new'
    @current = 'new'

  edit: (title)->
    console.log 'edit', title
    @current = 'edit'
    @title = title

  show: (title)->
    console.log 'show', title
    @current = 'show'
    @title = title

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
carte-server-0.0.11 lib/carte/client/router.coffee
carte-server-0.0.10 lib/carte/client/router.coffee
carte-server-0.0.9 lib/carte/client/router.coffee
carte-server-0.0.8 lib/carte/client/router.coffee
carte-server-0.0.7 lib/carte/client/router.coffee
carte-server-0.0.6 lib/carte/client/router.coffee
carte-server-0.0.5 lib/carte/client/router.coffee
carte-server-0.0.4 lib/carte/client/router.coffee
carte-server-0.0.3 lib/carte/client/router.coffee
carte-server-0.0.1 lib/carte/client/router.coffee