1sfFacebookConnect = function(api_key, signin_url) 2{ 3 this.xd_receiver_path = "/sfFacebookConnectPlugin/xd_receiver.htm"; 4 this.api_key = api_key; 5 this.signin_url = signin_url; 6 this.callback = ''; 7 this.forward = ''; 8 9 this.init(); 10}; 11sfFacebookConnect.prototype.init = function() 12{ 13 FB.init({appId: this.api_key, status: true, cookie: true, xfbml: true}); 14} 15sfFacebookConnect.prototype.getSigninUrl = function() 16{ 17 t_signin_url = this.signin_url; 18 if(this.forward != undefined && this.forward != '') 19 { 20 t_signin_url += '?forward=' + this.forward; 21 } 22 23 return t_signin_url; 24} 25sfFacebookConnect.prototype.gotoLoginPage = function() 26{ 27 //console.log(this.getSigninUrl()); 28 document.location.href= this.getSigninUrl(); 29}; 30sfFacebookConnect.prototype.requireSession = function(forward, callback) 31{ 32 this.forward = forward; 33 if (callback==undefined) 34 { 35 var current_obj = this; 36 callback = function(){current_obj.gotoLoginPage()}; 37 } 38 FB.login(function(response) { 39 if (response.session) { 40 callback(); 41 } else { 42 // user cancelled login 43 } 44 }); 45}; 46 47/* 48 * Show the feed form. This would be typically called in response to the 49 * onclick handler of a "Publish" button, or in the onload event after 50 * the user submits a form with info that should be published. 51 * 52 */ 53sfFacebookConnect.prototype.publishFeedStory = function(form_bundle_id, template_data) 54{ 55 // Load the feed form 56 FB.ensureInit( 57 function() 58 { 59 FB.Connect.showFeedDialog(form_bundle_id, template_data); 60 //FB.Connect.showFeedDialog(form_bundle_id, template_data, null, null, FB.FeedStorySize.shortStory, FB.RequireConnect.promptConnect); 61 62 // hide the "Loading feed story ..." div 63 //ge('feed_loading').style.visibility = "hidden"; 64 } 65 ); 66}; 67 68sfFacebookConnect.prototype.showPermissionsDialog = function (permissions, callback) 69{ 70 FB.ensureInit( 71 function() 72 { 73 FB.Connect.showPermissionDialog(permissions, callback); 74 } 75 ); 76} 77 78sfFacebookConnect.prototype.streamPublish = function (message, attachment, action_links) 79{ 80 FB.ensureInit( 81 function() 82 { 83 FB.Connect.streamPublish(message, attachment, action_links); 84 } 85 ); 86}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.