blob: dfaa97f2d7ab440aaf82b8b63bb64ca4a609bbe4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#= require_self
#= require_tree ./initializers
#= require_tree ./lib
#= require_tree ./templates
#= require_tree ./models
#= require ./views
#= require_tree ./controllers
#= require_tree ./routers
#= require_tree ./service
window.csx =
Models: {}
Collections: {}
Routers: {}
Views: {}
Controllers: { My: {} }
initialize: (data) ->
$(document).ajaxSend (event, xhr) ->
if data.access_token
xhr.setRequestHeader "Authorization", "Token token=#{data.access_token}"
csx.Application = new Marionette.Application()
csx.Application.addRegions(content_region: '#backbone-content')
csx.Application.addInitializer (options) ->
new csx.Routers.CakesRouter(controller: new csx.Controllers.My.CakesController())
new csx.Routers.TutorialsRouter(controller: new csx.Controllers.My.TutorialsController())
new csx.Routers.DashboardRouter(controller: new csx.Controllers.My.DashboardController())
new csx.Routers.ProfileRouter(controller: new csx.Controllers.My.ProfileController())
csx.Application.on 'start', ->
if Backbone.history
Backbone.history.start()
csx.Application.start()
|