-
Notifications
You must be signed in to change notification settings - Fork 54
/
search-result.html
65 lines (63 loc) · 2.56 KB
/
search-result.html
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
<div id="page-content">
<div class='post-body entry-content'>
<div id="cse" style="width: 100%;">
<ul id="loadbar">
<li><div class="bar" id="layerFill1"></div></li>
<li><div class="bar" id="layerFill2"></div></li>
<li><div class="bar" id="layerFill3"></div></li>
<li><div class="bar" id="layerFill4"></div></li>
<li><div class="bar" id="layerFill5"></div></li>
<li><div class="bar" id="layerFill6"></div></li>
<li><div class="bar" id="layerFill7"></div></li>
<li><div class="bar" id="layerFill8"></div></li>
<li><div class="bar" id="layerFill9"></div></li>
<li><div class="bar" id="layerFill10"></div></li>
</ul>
</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en', style : google.loader.themes.V2_DEFAULT});
google.setOnLoadCallback(function()
{
var customSearchOptions = {};
var orderByOptions = {};
orderByOptions['keys'] = [{label: 'Relevance', key: ''},{label: 'Date', key: 'date'}];
customSearchOptions['enableOrderBy'] = true;
customSearchOptions['orderByOptions'] = orderByOptions;
var imageSearchOptions = {};
imageSearchOptions['layout'] = google.search.ImageSearch.LAYOUT_COLUMN;
customSearchOptions['enableImageSearch'] = true;
customSearchOptions['imageSearchOptions'] = imageSearchOptions;
var googleAnalyticsOptions = {};
googleAnalyticsOptions['queryParameter'] = 's';
googleAnalyticsOptions['categoryParameter'] = '';
customSearchOptions['googleAnalyticsOptions'] = googleAnalyticsOptions; var customSearchControl = new google.search.CustomSearchControl('013132401186084955638:hpvljajpulu', customSearchOptions);
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
var options = new google.search.DrawOptions();
options.setAutoComplete(true);
options.enableSearchResultsOnly();
customSearchControl.draw('cse', options);
function parseParamsFromUrl()
{
var params = {};
var parts = window.location.search.substr(1).split('\x26');
for (var i = 0; i < parts.length; i++)
{
var keyValuePair = parts[i].split('=');
var key = decodeURIComponent(keyValuePair[0]);
params[key] = keyValuePair[1] ?
decodeURIComponent(keyValuePair[1].replace(/\+/g, ' ')) :
keyValuePair[1];
}
return params;
}
var urlParams = parseParamsFromUrl();
var queryParamName = "s";
if (urlParams[queryParamName])
{
customSearchControl.execute(urlParams[queryParamName]);
}
}, true);
</script>
<div style='clear: both;'></div>
</div>