Subversion Repositories SmartDukaan

Rev

Rev 2941 | Rev 2956 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2941 Rev 2953
Line 1... Line 1...
1
window.fbAsyncInit = function() {
1
window.fbAsyncInit = function() {
2
	FB.init({
2
	FB.init({
3
		appId  : '209449825766256',	// 186498998073288
3
		appId  : '186498998073288',	//209449825766256 
4
		status : true, // check login status
4
		status : true, // check login status
5
		cookie : true, // enable cookies to allow the server to access the session
5
		cookie : true, // enable cookies to allow the server to access the session
6
		xfbml  : true  // parse XFBML
6
		xfbml  : true  // parse XFBML
7
	});
7
	});
-
 
8
 
-
 
9
    FB.Canvas.setAutoResize();
8
};
10
};
9
 
11
 
10
function publishStream()	{
12
function publishStream()	{
11
	FB.ui({
13
	FB.ui({
12
		method: 'feed',
14
		method: 'feed',
Line 17... Line 19...
17
		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
		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.',
18
		message: 'Massive Discounts on popular Android phones!'
20
		message: 'Massive Discounts on popular Android phones!'
19
	},
21
	},
20
	function(response) {
22
	function(response) {
21
		if (response && response.post_id) {
23
		if (response && response.post_id) {
22
//			showFriendSelector();
-
 
23
		} else {
24
		} else {
24
			// Post was not published
-
 
25
		}
25
		}
26
	});
26
	});
27
}
27
}
28
 
28
 
29
function tellAFriend(id, name, price)	{
29
function shareThis(id, name, price)	{
-
 
30
	FB.ui({
-
 
31
		method: 'feed',
-
 
32
		name: name + ' available at heavyly discounted price, ' + price,
-
 
33
		picture: 'http://static1.saholic.com/images/' + id + '/icon.jpg',
-
 
34
		link: 'http://www.facebook.com/mysaholic?sk=app_209449825766256',
-
 
35
		caption: 'Android Festival @ Saholic.com',
-
 
36
		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.'
-
 
37
	},
-
 
38
	function(response) {
-
 
39
		console.log(id, name, price);
-
 
40
		if (response && response.post_id) {
-
 
41
		} else {
30
	
42
		}
-
 
43
	});
31
}
44
}
32
 
45
 
33
$(function(){
46
$(function(){
34
    var e = document.createElement('script');
47
    var e = document.createElement('script');
35
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
48
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
36
    e.async = true;
49
    e.async = true;
37
    document.getElementById('fb-root').appendChild(e);
50
    document.getElementById('fb-root').appendChild(e);
38
	
51
	
-
 
52
    $('.link-tell-a-friend').html('Tell a friend!')
-
 
53
    	.click(function(){
-
 
54
    		var descElement = $(this).parent().siblings('.desc');
-
 
55
    		var name = $(descElement).children('.name').html();
-
 
56
    		var price = $(descElement).children('.price').html();
-
 
57
    		var urlParts = $(descElement).children('.buynow').attr('href').split('-');
-
 
58
    		var entityId = urlParts[urlParts.length - 1];
-
 
59
    		shareThis(entityId, name, price);
-
 
60
//    		console.log(name, price, entityId);
-
 
61
    	});
-
 
62
    
39
	$('#share').click(function(){
63
	$('#share').click(function(){
40
		publishStream();
64
		publishStream();
41
	});
65
	});
42
	
66
	
43
	$('#select-friends').click(function(){
67
	$('#select-friends').click(function(){
Line 47... Line 71...
47
			message: 'Check out Android Festival on Saholic.com - Massive discounts on hot selling Android smart phones'
71
			message: 'Check out Android Festival on Saholic.com - Massive discounts on hot selling Android smart phones'
48
		});
72
		});
49
	});
73
	});
50
	
74
	
51
	$('.link-coupon').click(function(){
75
	$('.link-coupon').click(function(){
52
		$(this).hide().siblings('span.coupon').show();
76
		$(this).hide().siblings('.coupon').show();
53
	});
77
	});
54
});
78
});
55
79