* fixing typo in @music_sessions variable

This commit is contained in:
Seth Call 2014-02-04 22:45:37 +00:00
parent 730c315589
commit a25ccf5ced
2 changed files with 73 additions and 1 deletions

View File

@ -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);

View File

@ -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) {