Created
March 23, 2012 23:05
-
-
Save nerd0/2176155 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var engage = new fyre.sp.app.Engage({app: 'livefyre-dev'}); | |
var profiles = new fyre.sp.app.Profile({}); | |
var delegates = { | |
'handle_auth_login': function() { | |
engage.signIn(); | |
}, | |
'handle_auth_logout': function() { | |
engage.signOut(); | |
}, | |
'handle_edit_profile': function(user) { | |
profiles.editProfile(); | |
}, | |
'handle_view_profile': function(user) { | |
var id = user.jid.split('@')[0]; | |
profiles.viewProfile(id); | |
}, | |
'handle_email_notifications': function(user) { | |
} | |
}; | |
fyre.sp.on('auth_logout_complete', function() { | |
LF.modules.Auth.logoutSuccess(); | |
}); | |
fyre.sp.on('profile_submit_complete', function(data) { | |
LF.Fyre.get('user').set({display_name: data.displayName}); | |
}); | |
fyre.sp.on('auth_login_complete', function(data) { | |
LF.ready(function() { | |
LF.login({ | |
token: (data.token || data.accessCredentials[0].value), | |
profile: {display_name: data.displayName} | |
}) | |
} | |
); | |
}); | |
var conv=LF({ | |
domain: 'techcrunch-0.fyre.co', | |
site_id: 293225, | |
article_id: '<article_id>' | |
}).ready(function() { | |
LF.Dispatcher.addListener(delegates); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment