-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiphone.erb
153 lines (138 loc) · 7.87 KB
/
iphone.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title><%= (get_feature(:name) ? (@addr_street == '' ? get_feature(:price) : @addr_street ) : get_feature(:name)) %></title>
<link rel="stylesheet" href="jQTouch/themes/css/jqtouch.css" title="jQTouch">
<link rel="stylesheet" href="jQTouch//themes/css/apple.css" title="Apple">
<!-- Either, (1) Zepto: Un-comment these 2 lines (order matters) -->
<script src="jQTouch//lib/zepto/zepto.js" type="text/javascript" charset="utf-8"></script>
<script src="jQTouch//src/jqtouch.js" type="text/javascript" charset="utf-8"></script>
<!-- Or, (2) jQuery: Un-comment these 3 lines (order matters) -->
<!-- <script src="../../lib/jquery/jquery-1.7.min.js" type="application/x-javascript" charset="utf-8"></script> -->
<!-- <script src="../../src/jqtouch.js" type="text/javascript" charset="utf-8"></script> -->
<!-- <script src="../../src/jqtouch-jquery.js" type="application/x-javascript" charset="utf-8"></script> -->
<script src="jQTouch/extensions/jqt.themeswitcher.js" type="application/x-javascript" charset="utf-8"></script>
<script src="jQTouch/extensions/jqt.actionsheet.js" type="application/x-javascript" charset="utf-8"></script>
<script src="jQTouch/extensions/jqt.menusheet.js" type="application/x-javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var jQT = new $.jQTouch({
icon: 'jqtouch.png',
icon4: 'jqtouch4.png',
addGlossToIcon: false,
startupScreen: 'jqt_startup.png',
statusBar: 'black-translucent',
themeSelectionSelector: '#jqt #themes ul',
preloadImages: []
});
// Some sample Javascript functions:
$(function(){
// Show a swipe event on swipe test
$('#swipeme').swipe(function(evt, data) {
var details = !data ? '': '<strong>' + data.direction + '/' + data.deltaX +':' + data.deltaY + '</strong>!';
$(this).html('You swiped ' + details );
$(this).parent().after('<li>swiped!</li>')
});
$('#tapme').tap(function(){
$(this).parent().after('<li>tapped!</li>')
});
$('a[target="_blank"]').bind('click', function() {
return true;
});
// Page animation callback events
$('#pageevents').
bind('pageAnimationStart', function(e, info){
$(this).find('.info').append('Started animating ' + info.direction + '… And the link ' +
'had this custom data: ' + $(this).data('referrer').data('custom') + '<br>');
}).
bind('pageAnimationEnd', function(e, info){
$(this).find('.info').append('Finished animating ' + info.direction + '.<br><br>');
});
// Page animations end with AJAX callback event, example 1 (load remote HTML only first time)
$('#callback').bind('pageAnimationEnd', function(e, info){
// Make sure the data hasn't already been loaded (we'll set 'loaded' to true a couple lines further down)
if (!$(this).data('loaded')) {
// Append a placeholder in case the remote HTML takes its sweet time making it back
// Then, overwrite the "Loading" placeholder text with the remote HTML
$(this).append($('<div>Loading</div>').load('ajax.html .info', function() {
// Set the 'loaded' var to true so we know not to reload
// the HTML next time the #callback div animation ends
$(this).parent().data('loaded', true);
}));
}
});
// Orientation callback event
$('#jqt').bind('turn', function(e, data){
$('#orient').html('Orientation: ' + data.orientation);
});
});
<% if have_full_address? %>
$(document).ready(function($){
var deviceAgent = navigator.userAgent.toLowerCase();
var agentID = deviceAgent.match(/(iphone|ipod)/);
if (agentID) {
$('#address_link').attr('href', 'comgooglemaps://?q=<%= URI.escape(get_full_address) %>');
}else
{
$('#address_link').attr('href', 'http://maps.apple.com/?q=<%= URI.escape(get_full_address) %>');
}
});
<% end %>
</script>
<style type="text/css" media="screen">
#jqt.fullscreen #home .info {
display: none;
}
div#jqt #about {
padding: 100px 10px 40px;
text-shadow: rgba(0, 0, 0, 0.3) 0px -1px 0;
color: #999;
font-size: 13px;
text-align: center;
background: #161618;
}
div#jqt #about p {
margin-bottom: 8px;
}
div#jqt #about a {
color: #fff;
font-weight: bold;
text-decoration: none;
}
</style>
</head>
<body>
<div id="jqt" class="">
<div id="scoringlog">
<div class="toolbar">
<h1>Scoring Report</h1>
<a href="#" class="back">Back</a>
</div>
<ul class="edgetoedge scroll">
<% for log_entry in get_scoring_log %>
<li><%= HTMLEntities.new.encode(log_entry[:reason]) %> <small<%= ' style="color: red;"' if log_entry[:delta] < 0 %>><%= '+' if log_entry[:delta] > 0 %><%= log_entry[:delta] %></small></li>
<% end %>
</ul>
<ul class="edgetoedge info">
<li><a href="<%= get_feature(:posting_uri) %>" target="_blank">go to posting</a></li>
</ul>
</div>
<div id="home" class="current">
<div class="scroll">
<ul class="rounded">
<% if have_full_address? and not have_feature?(:address_was_reverse_geocoded) %><li class="forward"><a id="address_link" target="_blank" href=""><%= HTMLEntities.new.encode(get_full_address) %></a></li><% end %>
<% if get_feature(:bedrooms) %><li>Bedrooms <small class="counter"><%= get_feature(:bedrooms) %></small></li><% end %>
<% if get_feature(:rent_price) %><li>Price <small class="counter">$<%= get_feature(:rent_price) %></small></li><% end %>
<% if get_feature(:sqft) %><li>Area, sq. ft. <small class="counter"><%= get_feature(:sqft) %></small></li><% end %>
<% if get_feature(:name) %><li<% if get_feature(:uri) %> class="forward"><a href="<%= get_feature(:uri) %>" target="_blank"<% end %>>Matched as <small class="counter"><%= get_feature(:name) %></small><% if get_feature(:uri) %></a><% end %></li><% end %>
<% if get_feature(:neighborhood) %><li>Neighborhood <small class="counter"><%= get_feature(:neighborhood) %></small></li><% end %>
<li class="arrow"><a href="#scoringlog">Score <small class="counter"><%= get_score %></small></a></li>
</ul>
</div>
<ul class="edgetoedge info">
<li><a href="<%= get_feature(:posting_uri) %>" target="_blank">go to posting</a></li>
</ul>
</div>
</div>
</body>
</html>