Subversion Repositories SmartDukaan

Rev

Rev 3302 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3298 varun.gupt 1
window.fbAsyncInit = function() {
2
	FB.init({
3
		appId  : '190793234325400',	//186498998073288
4
		status : true, // check login status
5
		cookie : true, // enable cookies to allow the server to access the session
6
		xfbml  : true  // parse XFBML
7
	});
8
	FB.Canvas.setSize({ width: 640, height: 1080 });
9
};
10
 
11
function publishStream()	{
12
	FB.ui({
13
		method: 'feed',
14
		name: "Android Festival on Saholic.com",
15
		link: "http://www.facebook.com/mysaholic?sk=app_209449825766256",
16
		picture: "http://social.shop2020.in:8080/Social/images/saholic-android.jpg",
17
		caption: 'Android Festival @ Saholic.com',
18
		description: 'Saholic.com is offering huge discounts, upto Rs.1500, on a whole range of popular Android handsets starting from Rs.5,000 to Rs.30,000 including Samsung Galaxy S II and many more.',
19
		message: 'Massive Discounts on popular Android phones!'
20
	},
21
	function(response) {
22
		if (response && response.post_id) {
23
		} else {
24
		}
25
	});
26
}
27
 
28
function shareThis(id, name, price)	{
29
	FB.ui({
30
		method: 'feed',
31
		name: name + ' available at heavyly discounted price, ' + price,
32
		picture: 'http://static1.saholic.com/images/' + id + '/icon.jpg',
33
		link: 'http://www.facebook.com/mysaholic?sk=app_209449825766256',
34
		caption: 'Android Festival @ Saholic.com',
35
		description: 'Saholic.com is offering huge discounts on' + name + ' and a whole range of popular Android handsets starting from Rs.5,000 to Rs.35,999.'
36
	},
37
	function(response) {
38
		console.log(id, name, price);
39
		if (response && response.post_id) {
40
		} else {
41
		}
42
	});
43
}
44
 
45
$(function(){
46
    var e = document.createElement('script');
47
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
48
    e.async = true;
49
    document.getElementById('fb-root').appendChild(e);
50
	fbData = eval(json)
51
 
52
	if (fbData.page.liked)	{
53
    	$('#like').show();
54
    } else	{
55
    	$('#unlike').show();
56
    }
57
 
58
    $('.link-tell-a-friend').html('Tell a friend!')
59
    	.click(function(){
60
    		var descElement = $(this).parent().siblings('.desc');
61
    		var name = $(descElement).children('.name').html();
62
    		var price = $(descElement).children('.price').html();
63
    		var urlParts = $(descElement).children('.buynow').attr('href').split('-');
64
    		var entityId = urlParts[urlParts.length - 1];
65
    		shareThis(entityId, name, price);
66
    	});
67
 
68
	$('#share').click(function(){
69
		publishStream();
70
	});
71
 
72
	$('#select-friends').click(function(){
73
		FB.ui({
74
			method: 'apprequests',
75
			title: 'Invite Friends to Android Festival',
76
			message: 'Check out Android Festival on Saholic.com - Massive discounts on hot selling Android smart phones'
77
		});
78
	});
79
 
80
	$('.link-coupon').click(function(){
81
		$(this).hide().siblings('.coupon').show();
82
	});
83
});