-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathindex.html
More file actions
121 lines (101 loc) · 5 KB
/
Copy pathindex.html
File metadata and controls
121 lines (101 loc) · 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{if eq .Search.Query ""}}
Common Search
{{else}}
{{ .Search.Query | html }} | Common Search
{{end}}</title>
<meta content="/apple-touch-icon-precomposed.png" itemprop="image">
<link href="/favicon.ico" rel="shortcut icon">
<!-- CSS: This will be replaced in templates.go:preprocessTemplate() by the inline, compiled CSS
if the file build/static/css/index.css exists -->
<link rel="stylesheet" href="/css/global.css"/>
<link rel="stylesheet" href="/css/header.css"/>
<link rel="stylesheet" href="/css/footer.css"/>
<link rel="stylesheet" href="/css/hits.css"/>
<link rel="stylesheet" href="/css/responsive.css"/>
<!-- ENDCSS -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Hide search terms from websites the users click on -->
<meta name="referrer" content="origin">
</head>
<body {{if eq .Type "home"}} class="full"{{else}}{{end}}>
<header id="h">
<div class="about">
<a href="https://about.commonsearch.org/" tabindex="1">About</a>
</div>
<form id="f" action="/" method="GET" data-init="{{ .Search | toJSON | html }}">
<a href="/" id="logo" tabindex="2">Common Search</a>
<div id="w">
<div id="qw">
<input id="q" name="q" type="text" size="60" value="{{ .Search.Query | html }}" {{if eq .Search.Query ""}}autofocus{{end}} tabindex="3"/>
</div>
<span id="g">
<select name="g" tabindex="4">
<option {{ if eq .Search.Lang "ar" }}selected{{end}} value="ar">AR</option>
<option {{ if eq .Search.Lang "de" }}selected{{end}} value="de">DE</option>
<option {{ if eq .Search.Lang "en" "" }}selected{{end}} value="en">EN</option>
<option {{ if eq .Search.Lang "es" }}selected{{end}} value="es">ES</option>
<option {{ if eq .Search.Lang "fr" }}selected{{end}} value="fr">FR</option>
<option {{ if eq .Search.Lang "it" }}selected{{end}} value="it">IT</option>
<option {{ if eq .Search.Lang "ja" }}selected{{end}} value="ja">JA</option>
<option {{ if eq .Search.Lang "ko" }}selected{{end}} value="ko">KO</option>
<option {{ if eq .Search.Lang "nl" }}selected{{end}} value="nl">NL</option>
<option {{ if eq .Search.Lang "pl" }}selected{{end}} value="pl">PL</option>
<option {{ if eq .Search.Lang "pt" }}selected{{end}} value="pt">PT</option>
<option {{ if eq .Search.Lang "ru" }}selected{{end}} value="ru">RU</option>
<option {{ if eq .Search.Lang "vi" }}selected{{end}} value="vi">VI</option>
<option {{ if eq .Search.Lang "zh" }}selected{{end}} value="zh">ZH</option>
<option {{ if eq .Search.Lang "all" }}selected{{end}} value="all">ALL</option>
</select>
</span>
<input id="s" type="submit" value="🔍" tabindex="5"/>
</div>
</form>
</header>
{{if getConfig.IsDemo}}
<div id="demowarning">
Welcome! This is a <b>demo</b> of the <a href="https://about.commonsearch.org" tabindex="-1">Common Search</a> interface.<br/><br/>
The search results are NOT complete/relevant. For this demo they are restricted to <b>some homepages</b> from the Web.<br/><br/>
Can you help us improve this interface? We are <a href="https://about.commonsearch.org/contributing" tabindex="-1">looking for contributors</a>!
<br/><br/>
<button onclick="document.getElementById('demowarning').style.display='none';" tabindex="-1">OK, I understand this is a demo.</button>
</div>
{{end}}
<div id="hits">
<div class="info">
{{if .Result.TotalCount}}
<div id="c">About {{.Result.TotalCount}} results</div>
{{end}}
</div>
{{range $index, $element := .Result.Hits}}
<div class="r">
<h3><a href="{{ .URL | html }}" tabIndex="{{add $index 6}}">{{ .Title }}</a></h3>
<div class="u"><a href="{{ .URL | html }}">{{ .URL | simplifyURL | html }}</a></div>
<div class='b'>{{ .Summary }}</div>
</div>
{{else}}
{{if ne .Type "home"}}
<div class='z'>We didn't find any results for this search, sorry!</div>
{{end}}
{{end}}
</div>
<div id="dbg">
{{if ne .Type "home"}}
Text: <span>{{.Result.Timing.TextQuery }} / {{.Result.Timing.TextRequest }}us</span><br/>
Docs: <span>{{.Result.Timing.DocsQuery }} / {{.Result.Timing.DocsRequest }}us</span><br/>
Total: <span>{{.Result.Timing.Total}}us</span>
{{end}}
</div>
<div id="pager" data-page="{{.Search.Page}}">
{{if gt .Search.Page 1}}
<a href="{{ .Search.PreviousPageHref }}">« Previous</a>
{{end}}
{{if .Result.HasMore}}
<a href="{{ .Search.NextPageHref }}">Next »</a>
{{end}}
</div>
<script src="/js/index.js" type="text/javascript"></script>
</body>
</html>