Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1720 varun.gupt 1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
	<title>Phones I Own | Saholic</title>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
6
 
7
	<!--link rel="stylesheet" href="/css/phonesiown.css" type="text/css" /-->
8
	<style>
9
div.productItem	{
10
	float:left;
11
	width: 250px;
12
	padding: 7px;
13
}
14
 
15
div.productImg	{
16
	float: left;
17
}
18
 
1725 varun.gupt 19
a	{
20
	color: #0066CC;
21
	outline: medium none;
22
	text-decoration: none;
23
}
24
 
25
.title	{
26
	font-weight: bold;
27
	line-height: 13px;
28
}
29
 
30
div.productItem div.productDesp	{
31
	font-size: 12px;
32
	line-height: 18px;
33
	margin-top: 5px;
34
}
35
 
1720 varun.gupt 36
.yellow-image {
37
    background: url("spriteme1.png") repeat-x scroll -10px -750px transparent;
38
    border: 1px solid #BFA864;
39
    color: #000000;
40
    cursor: pointer;
41
    float: left;
42
    font-size: 13px;
43
    font-weight: bold;
44
    height: 18px;
45
    padding: 4px 7px;
46
    text-align: center;
47
}
48
 
1725 varun.gupt 49
div.bigImgButton	{
50
	float: right;
51
}
52
 
1720 varun.gupt 53
.yellow-image input.button {
54
    background: none repeat scroll 0 0 transparent;
55
    border: medium none;
56
    cursor: pointer;
57
    font-size: 13px;
58
    font-weight: bold;
59
}
60
 
61
input, select, textarea {
62
    outline: medium none;
63
}
64
	</style>
65
</head>
66
<body>
67
	<img src="http://saholic.com/images/saholic-main.jpg" />
68
	<hr />
69
	<div>
1726 varun.gupt 70
		<form action="/fb/my-phones" method="post">
1720 varun.gupt 71
			Which phone do you own?&nbsp;&nbsp;&nbsp;
72
			<input type="text" name="q" />
73
			<input type="submit" value="Search" />
74
		</form>
75
	</div>
76
	<hr />
77
#set($resultCount = $action.getResultCount())
78
 
79
#if($resultCount > 0)
80
	<div>
81
		<p>We found following phones matching with your search query:</p>
82
	#set($results = $action.getResults())
83
	#set($snippets =  $action.getSnippets())
84
 
85
	#foreach($entityId in $results)
86
		$snippets.get($entityId)
87
	#end
88
	</div>
89
#end
90
	<div id="fb-root"></div>
91
	<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script> 
92
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script> 
93
	<script type="text/javascript"> 
94
 
95
FB.init({
96
	appId  : '179519275432255',
97
	status : true, // check login status
98
	cookie : true, // enable cookies to allow the server to access the session
99
	xfbml  : true  // parse XFBML
100
});
101
 
102
 
103
function publishStream(productName, productURL, productImgURL, productDesc)	{
104
FB.ui({
105
		method: 'feed',
106
		name: productName,
107
		link: productURL,
108
		picture: productImgURL,
109
		caption: 'Phones I Own | Saholic.com',
110
		description: productDesc,
111
		message: 'Check out the phone I own!'
112
	},
113
	function(response) {
114
		if (response && response.post_id) {
115
			// Post was published
116
		} else {
117
			// Post was not published
118
		}
119
	});
120
}
121
$(function(){
122
	$('input.publish-button').click(function()	{
123
		var id = $(this).attr('id').replace('post-badge-', '');
124
		var productName = $(this).html();
125
		var productUrl = $('#url-' + id).html();
126
		var imageUrl = $('#img-' + id).attr('src');
127
		var desc = "";
128
 
129
		$('#desc-' + id).children().each(function(i, item){
130
			desc += $(item).html() + ', ';
131
		});
132
		desc = jQuery.trim(desc);
133
 
134
		publishStream(productName, productUrl, imageUrl, desc);
135
	});
136
});
137
	</script>
138
</body>
139
</html>