Subversion Repositories SmartDukaan

Rev

Rev 1729 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1729 varun.gupt 1
FB.init({
2
	appId  : '179519275432255',
3
	status : true, // check login status
4
	cookie : true, // enable cookies to allow the server to access the session
5
	xfbml  : true  // parse XFBML
6
});
7
 
8
 
9
function publishStream(productName, productURL, productImgURL, productDesc)	{
10
FB.ui({
11
		method: 'feed',
12
		name: productName,
13
		link: productURL,
14
		picture: productImgURL,
15
		caption: 'Phones I Own | Saholic.com',
16
		description: productDesc,
17
		message: 'Check out the phone I own!'
18
	},
19
	function(response) {
20
		if (response && response.post_id) {
21
			// Post was published
22
		} else {
23
			// Post was not published
24
		}
25
	});
26
}
27
$(function(){
28
	$('input.publish-button').click(function()	{
29
		var id = $(this).attr('id').replace('post-badge-', '');
1736 varun.gupt 30
		var productName = $('#' + id).html();
1729 varun.gupt 31
		var productUrl = $('#url-' + id).html();
32
		var imageUrl = $('#img-' + id).attr('src');
33
		var desc = "";
34
 
35
		$('#desc-' + id).children().each(function(i, item){
36
			desc += $(item).html() + ', ';
37
		});
38
		desc = jQuery.trim(desc);
1736 varun.gupt 39
//		console.log(productName, productUrl, imageUrl, desc);
1729 varun.gupt 40
		publishStream(productName, productUrl, imageUrl, desc);
41
	});
42
});