Created
May 31, 2012 22:40
-
-
Save mrobers1982/2846878 to your computer and use it in GitHub Desktop.
FoxSports - Livefyre custom delegates
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
var fyre = LF({ | |
domain: "foxsports-0.fyre.co", | |
site_id: "3000012", | |
article_id: lf_articleId, | |
backplane: Backplane | |
}); | |
var auth_delegate = { | |
handle_auth_login: function () { | |
CAPTURE.startModalLogin(); | |
Backplane.expectMessages("identity/login"); | |
return false; | |
}, | |
handle_auth_logout: function () { | |
CAPTURE.invalidateSession(); | |
CAPTURE.util.delCookie("backplane-channel"); | |
document.location.reload(); | |
return false; | |
} | |
}; | |
// If you want Livefyre to handle sharing of comments, do not attach this delegate | |
var social_delegate = { | |
handle_share_comment: function (b, a) { | |
a.preventDefault(); | |
// Add code to handle sharing of comments | |
} | |
}; | |
var profile_delegate = { | |
handle_view_profile: function (b, a) { | |
a.preventDefault(); | |
// Add code to route client to user profile page | |
// If you need the current user's uuid, uncomment below | |
// var uuid=data.jid.split('@')[0]; | |
}, | |
handle_edit_profile: function (b, a) { | |
a.preventDefault(); | |
// Add code to route client to edit user profile page | |
// If you need the current user's uuid, uncomment below | |
// var uuid=data.jid.split('@')[0]; | |
} | |
}; | |
LF.ready(function () { | |
LF.Dispatcher.addListener(auth_delegate); | |
LF.Dispatcher.addListener(social_delegate); | |
LF.Dispatcher.addListener(profile_delegate); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment