Sha256: a9d2eddcdf131568c3cca7380d6896b5a11daa59dac6ca1d672f6848b1bcc64b

Contents?: true

Size: 592 Bytes

Versions: 7

Compression:

Stored size: 592 Bytes

Contents

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

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

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

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

  slideshow: (string)->
    console.log 'slideshow', string
    @current = 'slideshow'
    @query = querystring.parse(string)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
carte-server-1.0.7 lib/carte/client/router.coffee
carte-server-1.0.6 lib/carte/client/router.coffee
carte-server-1.0.5 lib/carte/client/router.coffee
carte-server-1.0.4 lib/carte/client/router.coffee
carte-server-1.0.3 lib/carte/client/router.coffee
carte-server-1.0.2 lib/carte/client/router.coffee
carte-server-1.0.1 lib/carte/client/router.coffee