2014-06-15 17:19:37 -04:00
|
|
|
module.exports = initializeGoogle = ->
|
2014-06-24 14:29:43 -04:00
|
|
|
window.onGPlusLoaded = ->
|
2014-08-27 15:24:03 -04:00
|
|
|
Backbone.Mediator.publish 'auth:gplus-api-loaded', {}
|
2014-06-15 17:19:37 -04:00
|
|
|
return
|
2014-06-24 14:29:43 -04:00
|
|
|
window.signinCallback = (authResult) ->
|
2014-08-27 15:24:03 -04:00
|
|
|
Backbone.Mediator.publish 'auth:logged-in-with-gplus', authResult if authResult.access_token
|
2014-06-15 17:19:37 -04:00
|
|
|
return
|
|
|
|
(->
|
2014-06-30 22:16:26 -04:00
|
|
|
po = document.createElement('script')
|
|
|
|
po.type = 'text/javascript'
|
2014-06-15 17:19:37 -04:00
|
|
|
po.async = true
|
2014-06-30 22:16:26 -04:00
|
|
|
po.src = 'https://apis.google.com/js/client:plusone.js?onload=onGPlusLoaded'
|
|
|
|
s = document.getElementsByTagName('script')[0]
|
2014-06-15 17:19:37 -04:00
|
|
|
s.parentNode.insertBefore po, s
|
|
|
|
return
|
|
|
|
)()
|