Subversion Repositories SmartDukaan

Rev

Rev 3117 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2580 varun.gupt 1
window.fbAsyncInit = function() {
2
	FB.init({
2956 varun.gupt 3
		appId  : '209449825766256',	//186498998073288
2580 varun.gupt 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
	});
3842 varun.gupt 8
	FB.Canvas.setSize({ width: 640, height: 3400 });
3117 varun.gupt 9
//    FB.Canvas.setAutoResize(20000);
2580 varun.gupt 10
};
11
 
12
function publishStream()	{
13
	FB.ui({
14
		method: 'feed',
15
		name: "Android Festival on Saholic.com",
16
		link: "http://www.facebook.com/mysaholic?sk=app_209449825766256",
2923 varun.gupt 17
		picture: "http://social.shop2020.in:8080/Social/images/saholic-android.jpg",
2580 varun.gupt 18
		caption: 'Android Festival @ Saholic.com',
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.',
20
		message: 'Massive Discounts on popular Android phones!'
21
	},
22
	function(response) {
23
		if (response && response.post_id) {
24
		} else {
25
		}
26
	});
27
}
28
 
2953 varun.gupt 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 {
42
		}
43
	});
2941 varun.gupt 44
}
45
 
2580 varun.gupt 46
$(function(){
47
    var e = document.createElement('script');
48
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
49
    e.async = true;
50
    document.getElementById('fb-root').appendChild(e);
51
 
2953 varun.gupt 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
    	});
61
 
2653 varun.gupt 62
	$('#share').click(function(){
63
		publishStream();
64
	});
65
 
66
	$('#select-friends').click(function(){
2580 varun.gupt 67
		FB.ui({
68
			method: 'apprequests',
69
			title: 'Invite Friends to Android Festival',
2653 varun.gupt 70
			message: 'Check out Android Festival on Saholic.com - Massive discounts on hot selling Android smart phones'
2580 varun.gupt 71
		});
72
	});
2939 varun.gupt 73
 
74
	$('.link-coupon').click(function(){
2953 varun.gupt 75
		$(this).hide().siblings('.coupon').show();
2939 varun.gupt 76
	});
2580 varun.gupt 77
});