diff --git a/app/assets/javascripts/ajax.coffee b/app/assets/javascripts/ajax.coffee index f82e5a4..434fedf 100644 --- a/app/assets/javascripts/ajax.coffee +++ b/app/assets/javascripts/ajax.coffee @@ -44,6 +44,8 @@ class window.Ajax return false if @previous_page == _ajax.getAnchor() @previous_page = _ajax.getAnchor() + log "Ajax controller is detecting page ..." + if m = _ajax.getAnchor().match /\/artist\/(.+)\// _search.loadArtistData m[1] else if _ajax.getAnchor().match /\/settings\// diff --git a/app/assets/javascripts/beathaven.coffee b/app/assets/javascripts/beathaven.coffee index ad42a50..7d879d0 100644 --- a/app/assets/javascripts/beathaven.coffee +++ b/app/assets/javascripts/beathaven.coffee @@ -9,11 +9,14 @@ window._search = null window._page = null window._settings = null -$ -> +jQuery -> l = document.location if l.hostname not in ['beathaven.org', 'dev.beathaven.org'] l.href = 'http://beathaven.org/'+ l.hash + window.log = (str) -> + console.log(str) if console? + $.ajaxSetup beforeSend: (xhr) -> xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')) diff --git a/app/assets/javascripts/session.coffee b/app/assets/javascripts/session.coffee index e8bdb57..ec347ad 100644 --- a/app/assets/javascripts/session.coffee +++ b/app/assets/javascripts/session.coffee @@ -30,6 +30,7 @@ class window.Session false reloadSession: -> + log "Reloading session ..." _session.query '/user/auth', {}, (ar) -> _session.setUser ar.user false diff --git a/app/assets/javascripts/settings.coffee b/app/assets/javascripts/settings.coffee index 2e94a48..ffad225 100644 --- a/app/assets/javascripts/settings.coffee +++ b/app/assets/javascripts/settings.coffee @@ -19,6 +19,7 @@ class window.Settings false updateLastfmLogin: -> + log "Updating Last.fm info ..." if window.lastfm_popup.closed _session.query '/user/auth', {}, (ar) -> _session.setUser ar.user diff --git a/app/assets/javascripts/vkontakte.coffee b/app/assets/javascripts/vkontakte.coffee index 1ad907f..7193cb5 100644 --- a/app/assets/javascripts/vkontakte.coffee +++ b/app/assets/javascripts/vkontakte.coffee @@ -18,9 +18,10 @@ class window.Vkontakte , 0 authInfo: (response) -> - if typeof response isnt 'undefined' and response.session + if typeof response isnt 'undefined' and response.session? _session = new Session(response.session) _session.query '/user/auth', {}, (ar) -> + log "Authenticating user ..." if ar.newbie VK.Api.call 'getVariable', key: 1281, (r) -> _session.query '/user/update', params: { name: r.response }, (ar2) ->