Debug
This commit is contained in:
parent
589f0512bf
commit
6fa215cb2a
|
@ -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\//
|
||||
|
|
|
@ -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'))
|
||||
|
|
|
@ -30,6 +30,7 @@ class window.Session
|
|||
false
|
||||
|
||||
reloadSession: ->
|
||||
log "Reloading session ..."
|
||||
_session.query '/user/auth', {}, (ar) ->
|
||||
_session.setUser ar.user
|
||||
false
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) ->
|
||||
|
|
Loading…
Reference in New Issue