2012-08-27 03:53:30 +04:00
|
|
|
#= require_self
|
2012-09-10 03:47:36 +04:00
|
|
|
#= require_tree ./modules
|
2012-08-27 03:53:30 +04:00
|
|
|
#= require_tree ./templates
|
|
|
|
#= require_tree ./models
|
2012-09-10 03:47:36 +04:00
|
|
|
#= require_tree ./collections
|
2012-08-27 03:53:30 +04:00
|
|
|
#= require_tree ./views
|
|
|
|
#= require_tree ./routers
|
|
|
|
|
|
|
|
window.BeatHaven =
|
2012-09-09 20:37:05 +04:00
|
|
|
Modules: {}
|
2012-08-27 03:53:30 +04:00
|
|
|
Models: {}
|
|
|
|
Collections: {}
|
|
|
|
Routers: {}
|
|
|
|
Views: {}
|
2012-09-02 02:03:19 +04:00
|
|
|
|
|
|
|
Player: null
|
|
|
|
User: null
|
2012-09-09 20:37:05 +04:00
|
|
|
I18n: null
|
|
|
|
locales: {}
|
2012-08-27 03:53:30 +04:00
|
|
|
|
|
|
|
init: ->
|
2012-09-09 17:48:24 +04:00
|
|
|
new BeatHaven.Routers.Main()
|
2012-08-27 03:53:30 +04:00
|
|
|
new BeatHaven.Routers.Artist()
|
2012-09-01 21:55:01 +04:00
|
|
|
new BeatHaven.Routers.Album()
|
|
|
|
new BeatHaven.Routers.Search()
|
2012-09-02 02:03:19 +04:00
|
|
|
@Player = new BeatHaven.Models.Player()
|
|
|
|
@User = new BeatHaven.Models.User()
|
|
|
|
@VK = new BeatHaven.Models.VK()
|
2012-09-09 20:37:05 +04:00
|
|
|
@I18n = new BeatHaven.Modules.I18n()
|
2012-09-02 02:03:19 +04:00
|
|
|
|
2012-09-10 20:45:17 +04:00
|
|
|
@VK.init()
|
2012-09-01 21:55:01 +04:00
|
|
|
|
|
|
|
Backbone.history.start(pushState: true);
|
|
|
|
$("a").live "click", (e) ->
|
|
|
|
if $(this).attr("href").substr(0, 1) == "/"
|
|
|
|
e.preventDefault()
|
|
|
|
Backbone.history.navigate($(this).attr("href"), true)
|
2012-09-02 02:03:19 +04:00
|
|
|
false
|
|
|
|
|
2012-09-09 17:48:24 +04:00
|
|
|
# Backbone.history.navigate("/tour", true)
|
2012-09-09 20:37:05 +04:00
|
|
|
@I18n.init()
|
2012-09-09 17:48:24 +04:00
|
|
|
|
2012-09-02 02:03:19 +04:00
|
|
|
log: (data) ->
|
|
|
|
console.log data
|
2012-08-27 03:53:30 +04:00
|
|
|
|
|
|
|
$ ->
|
|
|
|
BeatHaven.init()
|
2012-09-02 02:03:19 +04:00
|
|
|
|
|
|
|
# Setup shortcut
|
|
|
|
window.BH = window.BeatHaven
|