Ember initialize hooks
This commit is contained in:
@@ -12,19 +12,16 @@
|
||||
rootElement: '#ember-app-container'
|
||||
obtain_token: (message)->
|
||||
message ||= ''
|
||||
# frame = $('<iframe></iframe>').addClass('obtain-token-frame').attr 'src', $obtain_token_url
|
||||
# frame.css width: $('body').outerWidth(), height: $('body').outerHeight()
|
||||
# $('body').append frame
|
||||
# window.location = "#{$obtain_token_url}"
|
||||
auth_win = window.open $obtain_token_url, "_blank", "location=no"
|
||||
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(/auth_token=([\w-]+)/)[1]
|
||||
auth_token = event.url.match(/authentication_token=([\w-]+)/)[1]
|
||||
Qstorage.setItem 'user_id', user_id
|
||||
Qstorage.setItem 'auth_token', token
|
||||
Qstorage.setItem 'auth_token', auth_token
|
||||
auth_win.close()
|
||||
|
||||
true
|
||||
App.deferReadiness()
|
||||
Ember.$.ajaxPrefilter (options) ->
|
||||
if options.type.toUpperCase() == 'GET'
|
||||
if auth_token = Qstorage.getItem('auth_token')
|
||||
|
||||
@@ -31,5 +31,8 @@ html lang="en"
|
||||
var $platform = 'web'
|
||||
var $log = function(params){console.log('App log:'); console.log(params);console.log('=======================================')};
|
||||
= javascript_include_tag "user/flat/application"
|
||||
- unless Rails.env.user_app?
|
||||
javascript:
|
||||
App.advanceReadiness()
|
||||
body
|
||||
#ember-app-container
|
||||
|
||||
Reference in New Issue
Block a user