* fixing typo in @music_sessions variable
This commit is contained in:
parent
730c315589
commit
a25ccf5ced
|
|
@ -0,0 +1,72 @@
|
|||
(function(context,$) {
|
||||
"use strict";
|
||||
|
||||
context.JK = context.JK || {};
|
||||
context.JK.FacebookHelper = function(app) {
|
||||
var logger = context.JK.logger;
|
||||
var loginStatusDeferred = null;
|
||||
var $self = $(this);
|
||||
var connected = false;
|
||||
|
||||
function promptLogin() {
|
||||
|
||||
if(connected) {
|
||||
// instantly return previous login info
|
||||
//return loginStatusDeferred;
|
||||
}
|
||||
|
||||
loginStatusDeferred = $.Deferred();
|
||||
|
||||
FB.login(function(response) {
|
||||
handle_fblogin_response(response);
|
||||
}, {scope:'publish_stream'});
|
||||
|
||||
return loginStatusDeferred;
|
||||
}
|
||||
|
||||
function handle_fblogin_response(response) {
|
||||
|
||||
if(response.status == "connected") {
|
||||
connected = true;
|
||||
}
|
||||
|
||||
$self.triggerHandler('fb.login_response', {response: response});
|
||||
|
||||
loginStatusDeferred.resolve(response);
|
||||
}
|
||||
|
||||
function initialize(fbAppID) {
|
||||
loginStatusDeferred = $.Deferred();
|
||||
var fbAppID_ = fbAppID;
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init({
|
||||
appId : fbAppID_,
|
||||
// channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html',
|
||||
status : true, // check the login status upon init?
|
||||
cookie : true, // set sessions cookies to allow server to access the session?
|
||||
xfbml : true, // parse XFBML tags on this page?
|
||||
oauth : true, // enable OAuth 2.0
|
||||
});
|
||||
|
||||
// listen to see if the user is known/logged in
|
||||
FB.getLoginStatus(function(response) {
|
||||
handle_fblogin_response(response);
|
||||
});
|
||||
};
|
||||
|
||||
// Load the SDK Asynchronously
|
||||
(function(d){
|
||||
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
|
||||
js = d.createElement('script'); js.id = id; js.async = true;
|
||||
js.src = "//connect.facebook.net/en_US/all.js";
|
||||
d.getElementsByTagName('head')[0].appendChild(js);
|
||||
}(document));
|
||||
}
|
||||
|
||||
this.initialize = initialize;
|
||||
this.promptLogin = promptLogin;
|
||||
};
|
||||
|
||||
|
||||
|
||||
})(window, jQuery);
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
JK.app = JK.JamKazam();
|
||||
JK.app.initialize({inClient: false, layoutOpts: {layoutFooter: false}});
|
||||
|
||||
var shareDialog = new JK.ShareDialog(JK.app, @music_session.id, "session");
|
||||
var shareDialog = new JK.ShareDialog(JK.app, "<%= @music_session.id %>", "session");
|
||||
shareDialog.initialize();
|
||||
|
||||
$("#btnShare").click(function(e) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue