-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.htm
93 lines (85 loc) · 3.46 KB
/
index.htm
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>other.erldocs.com - Documentation for Other Erlang Modules</title>
<script src="jquery.js"></script>
<script src="handlebars.runtime.min-v1.2.0.js"></script>
<script src="typeahead.bundle.min.js"></script>
<link href="typeahead-examples.css" type="text/css" rel="stylesheet"/>
<link href="repo.css" type="text/css" rel="stylesheet"/>
<link href="/search.xml" rel="search" type="application/opensearchdescription+xml" title="erldocs_other"/>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-54292016-1', 'auto');
ga('send', 'pageview');
$(document).ready(function () {
var Msg = $("#msg");
var Bar = $("form .typeahead");
Msg.html(apps.length);
var substringMatcher = function(strs) {
return function findMatches(q, cb) {
var matches = [];
var substrRegex = new RegExp(q, 'i');
$.each(strs, function(i, str) {
if (substrRegex.test(str)) {
matches.push({ value: str });
}
});
Msg.html(matches.length +' / '+ apps.length);
cb(matches);
};
};
Bar.typeahead({
hint: true,
highlight: true,
minLength: 3 }, {
name: 'apps',
displayKey: 'value',
source: substringMatcher(apps)
});
// http://stackoverflow.com/a/979995
var QueryString = function () {
var query_string = {};
var query = window.location.search.substring(1);
if (query === "")
return [];
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = pair[1];
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]], pair[1] ];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(pair[1]);
}
}
return query_string;
} ();
// http://stackoverflow.com/a/4458580
var query = decodeURIComponent((QueryString.q+'').replace(/\+/g, '%20'));
if (QueryString.q !== undefined && query.length > 2)
Bar.focus().typeahead('val', query.toLowerCase());
});
</script>
</head>
<body>
<div id="front_page">
<h1>other.erldocs.com</h1>
Documentation of other Erlang applications<br/><br/>
<span id="msg" style="color:#666;"></span>
<form method="GET" action="opensearch.html">
<input type="text" class="typeahead" name="q" placeholder="path/to/repo" size="50" autofocus/>
<input type="submit" style="display:none;"/>
</form>
<br/>
<p><a href="//github.com/erldocs/other.erldocs.com">about</a> | <a href="//erldocs.com">erldocs.com</a></p>
</div>
<script src="apps.js"></script>
</body>
</html>