-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsearch.html
More file actions
420 lines (287 loc) · 13.5 KB
/
search.html
File metadata and controls
420 lines (287 loc) · 13.5 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
<title>Search Results | Android Developers</title>
<link href="./assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<script src="./assets/search_autocomplete.js" type="text/javascript"></script>
<script src="./assets/jquery-resizable.min.js" type="text/javascript"></script>
<script src="./assets/android-developer-docs.js" type="text/javascript"></script>
<script src="./assets/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
setToRoot("./");
</script>
<noscript>
<style type="text/css">
html,body{overflow:auto;}
#body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;}
</style>
</noscript>
</head>
<body class="gc-documentation">
<a name="top"></a>
<div id="header">
<div id="headerLeft">
<a href="./index.html" tabindex="-1"><img
src="./assets/images/bg_logo.png" alt="Android Developers" /></a>
<ul id="header-tabs" class="">
<li id="home-link"><a href="./offline.html">
<span class="en">Home</span>
<span style="display:none" class="de">Startseite</span>
<span style="display:none" class="es"></span>
<span style="display:none" class="fr"></span>
<span style="display:none" class="it"></span>
<span style="display:none" class="ja">ホーム</span>
<span style="display:none" class="zh-CN">主页</span>
<span style="display:none" class="zh-TW">首頁</span>
</a></li>
<li id="sdk-link"><a href="./sdk/index.html">
<span class="en">SDK</span>
</a></li>
<li id="guide-link"><a href="./guide/index.html" onClick="return loadLast('guide')">
<span class="en">Dev Guide</span>
<span style="display:none" class="de">Handbuch</span>
<span style="display:none" class="es">Guía</span>
<span style="display:none" class="fr">Guide</span>
<span style="display:none" class="it">Guida</span>
<span style="display:none" class="ja">開発ガイド</span>
<span style="display:none" class="zh-CN">开发人员指南</span>
<span style="display:none" class="zh-TW">開發指南</span>
</a></li>
<li id="reference-link"><a href="./reference/packages.html" onClick="return loadLast('reference')">
<span class="en">Reference</span>
<span style="display:none" class="de">Referenz</span>
<span style="display:none" class="es">Referencia</span>
<span style="display:none" class="fr">Référence</span>
<span style="display:none" class="it">Riferimento</span>
<span style="display:none" class="ja">リファレンス</span>
<span style="display:none" class="zh-CN">参考</span>
<span style="display:none" class="zh-TW">參考資料</span>
</a></li>
<li id="resources-link"><a href="./resources/index.html" onClick="return loadLast('resources')">
<span class="en">Resources</span>
<span style="display:none" class="de"></span>
<span style="display:none" class="es"></span>
<span style="display:none" class="fr"></span>
<span style="display:none" class="it"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
</a></li>
<li id="videos-link"><a href="./videos/index.html" onClick="return loadLast('videos')">
<span class="en">Videos</span>
<span style="display:none" class="de"></span>
<span style="display:none" class="es"></span>
<span style="display:none" class="fr"></span>
<span style="display:none" class="it"></span>
<span style="display:none" class="ja">ビデオ</span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
</a></li>
<li><a href="http://android-developers.blogspot.com" onClick="return requestAppendHL(this.href)">
<span class="en">Blog</span>
<span style="display:none" class="de"></span>
<span style="display:none" class="es"></span>
<span style="display:none" class="fr"></span>
<span style="display:none" class="it"></span>
<span style="display:none" class="ja">ブログ</span>
<span style="display:none" class="zh-CN">博客</span>
<span style="display:none" class="zh-TW">網誌</span>
</a></li>
</ul>
</div>
<div id="headerRight">
<div id="headerLinks">
<a href="./design/index.html">Android Design</a>
<a href="http://www.android.com">Android.com</a>
</div>
<div id="search" >
<div id="searchForm">
<form accept-charset="utf-8" class="gsc-search-box"
onsubmit="return submit_search()">
<table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
<tr>
<td class="gsc-input">
<input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
title="search developer docs" name="q"
value="search developer docs"
onFocus="search_focus_changed(this, true)"
onBlur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, './')"
onkeyup="return search_changed(event, false, './')" />
<div id="search_filtered_div" class="no-display">
<table id="search_filtered" cellspacing=0>
</table>
</div>
</td>
<td class="gsc-search-button">
<input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />
</td>
<td class="gsc-clear-button">
<div title="clear results" class="gsc-clear-button"> </div>
</td>
</tr></tbody>
</table>
</form>
</div><!-- searchForm -->
</div><!-- search -->
</div><!-- headerRight -->
<script type="text/javascript">
<!--
changeTabLang(getLangPref());
//-->
</script>
</div><!-- header -->
<div id="body-content">
<div id="doc-content" style="position:relative;">
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script src="./assets/jquery-history.js" type="text/javascript"></script>
<script type="text/javascript">
var tabIndex = 0;
google.load('search', '1');
function OnLoad() {
document.getElementById("search_autocomplete").style.color = "#000";
// create search control
searchControl = new google.search.SearchControl();
// use our existing search form and use tabs when multiple searchers are used
drawOptions = new google.search.DrawOptions();
drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
drawOptions.setInput(document.getElementById("search_autocomplete"));
// configure search result options
searchOptions = new google.search.SearcherOptions();
searchOptions.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
// configure each of the searchers, for each tab
devSiteSearcher = new google.search.WebSearch();
devSiteSearcher.setUserDefinedLabel("All");
devSiteSearcher.setSiteRestriction("001482626316274216503:zu90b7s047u");
devGuideSearcher = new google.search.WebSearch();
devGuideSearcher.setUserDefinedLabel("Dev Guide");
devGuideSearcher.setSiteRestriction("http://developer.android.com/guide/");
referenceSearcher = new google.search.WebSearch();
referenceSearcher.setUserDefinedLabel("Reference");
referenceSearcher.setSiteRestriction("http://developer.android.com/reference/");
blogSearcher = new google.search.WebSearch();
blogSearcher.setUserDefinedLabel("Blog");
blogSearcher.setSiteRestriction("http://android-developers.blogspot.com");
groupsSearcher = new google.search.WebSearch();
groupsSearcher.setUserDefinedLabel("Developer Groups");
groupsSearcher.setSiteRestriction("001283715400630100512:ggqrtvkztwm");
sourceSiteSearcher = new google.search.WebSearch();
sourceSiteSearcher.setUserDefinedLabel("Android Source");
sourceSiteSearcher.setSiteRestriction("http://source.android.com");
// add each searcher to the search control
searchControl.addSearcher(devSiteSearcher, searchOptions);
searchControl.addSearcher(devGuideSearcher, searchOptions);
searchControl.addSearcher(referenceSearcher, searchOptions);
searchControl.addSearcher(groupsSearcher, searchOptions);
searchControl.addSearcher(sourceSiteSearcher, searchOptions);
searchControl.addSearcher(blogSearcher, searchOptions);
// configure result options
searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
searchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);
searchControl.setTimeoutInterval(google.search.SearchControl.TIMEOUT_LONG);
searchControl.setNoResultsString(google.search.SearchControl.NO_RESULTS_DEFAULT_STRING);
// upon ajax search, refresh the url and search title
searchControl.setSearchStartingCallback(this, function(control, searcher, query) {
$("#searchTitle").html("search results for <em>" + escapeHTML(query) + "</em>");
// save the tab index from the hash
tabIndex = location.hash.split("&t=")[1];
$.history.add('q=' + query + '&t=' + tabIndex);
});
searchControl.setSearchCompleteCallback(this, function(control, searcher) {
openTab();
});
// draw the search results box
searchControl.draw(document.getElementById("leftSearchControl"), drawOptions);
// get query and execute the search
if (location.hash.indexOf("&t=") != -1) {
searchControl.execute(decodeURI(getQuery(location.hash)));
}
document.getElementById("search_autocomplete").focus();
addTabListeners();
}
// End of OnLoad
google.setOnLoadCallback(OnLoad, true);
// when an event on the browser history occurs (back, forward, load) perform a search
$(window).history(function(e, hash) {
var query = decodeURI(getQuery(hash));
searchControl.execute(query);
$("#searchTitle").html("search results for <em>" + escapeHTML(query) + "</em>");
});
// forcefully regain key-up event control (previously jacked by search api)
$("#search_autocomplete").keyup(function(event) {
return search_changed(event, false, '/');
});
// open a tab, specified by its array position
function openTab() {
tabIndex = location.hash.split("&t=")[1];
// show the appropriate tab
var tabHeaders = $(".gsc-tabHeader");
$(tabHeaders[tabIndex]).click();
}
// add event listeners to each tab so we can track the browser history
function addTabListeners() {
var tabHeaders = $(".gsc-tabHeader");
for (var i = 0; i < tabHeaders.length; i++) {
$(tabHeaders[i]).attr("id",i).click(function() {
var tabHeaders = $(".gsc-tabHeader");
var tabIndex = $(this).attr("id");
$.history.add('q=' + getQuery(location.hash) + '&t=' + tabIndex); // update the hash with the new tab
});
}
}
function getQuery(hash) {
var hashParts = hash.split('&t=');
var queryParts = hashParts[0].split('=');
return queryParts[1];
}
/* returns the given string with all HTML brackets converted to entities
TODO: move this to the site's JS library */
function escapeHTML(string) {
return string.replace(/</g,"<")
.replace(/>/g,">");
}
</script>
<div id="mainBodyFixed" style="width:auto; margin:20px">
<h2 id="searchTitle">search results</h2>
<img src="./assets/images/hr_gray_main.jpg" />
<div><br /></div>
<div id="leftSearchControl" class="search-control">Loading...</div>
</div>
<div id="footer">
<div id="copyright">
Except as noted, this content is
licensed under <a href="http://creativecommons.org/licenses/by/2.5/">
Creative Commons Attribution 2.5</a>. For details and
restrictions, see the <a href="./license.html">Content
License</a>.
</div>
<div id="footerlinks">
<p>
<a href="http://www.google.com/intl/en/policies/" target="_blank">Privacy & Terms</a> -
<a href="http://www.android.com/branding.html" target="_blank">Brand Guidelines</a> -
<a
href="http://code.google.com/p/android/issues/entry?template=Developer%20Documentation"
target="_blank">Report Document Issues</a>
</p>
</div>
</div> <!-- end footer -->
</div><!-- end doc-content -->
</div> <!-- end body-content -->
<script type="text/javascript">
init(); /* initialize android-developer-docs.js */
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-5831155-1");
pageTracker._trackPageview();
</script>
</body>
</html>