Green specs 😄

This commit is contained in:
2014-10-02 13:10:25 +02:00
parent faaa06f0dc
commit 7c03b4c32c
13 changed files with 46 additions and 25 deletions
@@ -13,14 +13,17 @@
obtain_token: (message)->
message ||= ''
auth_win = window.open $obtain_token_url, "_blank", "location=no"
auth_win.addEventListener "loadstart", (event)->
auth_win.addEventListener "loadstart", (event)=>
if event.url.match 'close_window'
user_id = event.url.match(/user_id=([\w+-]+)/)[1]
auth_token = event.url.match(/authentication_token=([\w-]+)/)[1]
Qstorage.setItem 'user_id', user_id
Qstorage.setItem 'auth_token', auth_token
@handleAuthInfo(user_id, auth_token)
auth_win.close()
true
handleAuthInfo: (user_id, auth_token)->
Qstorage.setItem 'user_id', user_id
Qstorage.setItem 'auth_token', auth_token
@__container__.lookup('controller:application').setCurrentList()
App.deferReadiness()
Ember.$.ajaxPrefilter (options) ->
if options.type.toUpperCase() == 'GET'