Subversion Repositories SmartDukaan

Rev

Rev 1736 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1736 Rev 2053
Line 2... Line 2...
2
	appId  : '179519275432255',
2
	appId  : '179519275432255',
3
	status : true, // check login status
3
	status : true, // check login status
4
	cookie : true, // enable cookies to allow the server to access the session
4
	cookie : true, // enable cookies to allow the server to access the session
5
	xfbml  : true  // parse XFBML
5
	xfbml  : true  // parse XFBML
6
});
6
});
7
 
7
 
-
 
8
function showFriendSelector()	{
-
 
9
	FB.ui({
-
 
10
		method: 'apprequests',
-
 
11
		title: 'Invite Friends to Phones I Own',
-
 
12
		message: 'This is a cool app to flaunt the phone you own to your friends.'
-
 
13
	});
8
 
14
}
-
 
15
 
9
function publishStream(productName, productURL, productImgURL, productDesc)	{
16
function publishStream(productName, productURL, productImgURL, productDesc)	{
10
FB.ui({
17
FB.ui({
11
		method: 'feed',
18
		method: 'feed',
12
		name: productName,
19
		name: productName,
13
		link: productURL,
20
		link: productURL,
Line 16... Line 23...
16
		description: productDesc,
23
		description: productDesc,
17
		message: 'Check out the phone I own!'
24
		message: 'Check out the phone I own!'
18
	},
25
	},
19
	function(response) {
26
	function(response) {
20
		if (response && response.post_id) {
27
		if (response && response.post_id) {
21
			// Post was published
28
			showFriendSelector();
22
		} else {
29
		} else {
23
			// Post was not published
30
			// Post was not published
24
		}
31
		}
25
	});
32
	});
26
}
33
}
-
 
34
 
27
$(function(){
35
$(function(){
-
 
36
	$('#friendInviter').live('click', function()	{
-
 
37
		showFriendSelector();
-
 
38
	});
-
 
39
	
28
	$('input.publish-button').click(function()	{
40
	$('input.publish-button').click(function()	{
29
		var id = $(this).attr('id').replace('post-badge-', '');
41
		var id = $(this).attr('id').replace('post-badge-', '');
30
		var productName = $('#' + id).html();
42
		var productName = $('#' + id).html();
31
		var productUrl = $('#url-' + id).html();
43
		var productUrl = $('#url-' + id).html();
32
		var imageUrl = $('#img-' + id).attr('src');
44
		var imageUrl = $('#img-' + id).attr('src');