Skip to content

Instantly share code, notes, and snippets.

@nerd0
Created March 23, 2012 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nerd0/2176155 to your computer and use it in GitHub Desktop.
Save nerd0/2176155 to your computer and use it in GitHub Desktop.
<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