-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
80 lines (70 loc) · 2.05 KB
/
index.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Index</title>
<style>
body {
margin-left: 30px;
font-family: "Helvetica Neue", sans-serif;
}
input#search {
font-size: 18px;
width: 400px;
}
.spacer {
margin-top: 120px;
}
</style>
<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<script src="typeahead.bundle.min.js"></script>
<script>
$(document).ready(function() {
$.getJSON('ctags.json', null, function(data) {
var substringMatcher = function findMatches(q, cb) {
var matches, substringRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring `q`
substrRegex = new RegExp(q, 'i');
// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
$.each(data, function(i, datum) {
if (substrRegex.test(datum.s)) {
matches.push(datum);
}
});
cb(matches);
};
$('#search').typeahead({
minLength: 3,
highlight: true,
hint: false
}, {
name: 'fixed-json',
source: substringMatcher,
display: function (datum) {
return datum.s
},
templates: {
suggestion: function(datum) {
var link = '/python-xr/' + datum.f + '.html#line-' + datum.l;
return '<div><a onclick="history.pushState(null, \'\', \'' + link + '\'); return true;" target="i" href="' + link + '">' + datum.s + '</a></div>';
}
}
});
});
});
</script>
</head>
<body>
<h1>Python 2.7.11 source code</h1>
<h2>Search symbols</h2>
<input type="text" id="search"></input>
<div class="spacer"></div>
<h3>Source</h3>
<p>All source is subject to the <a href="https://github.com/python/cpython/blob/master/LICENSE">Python Software Foundation License</a>.
<p>The rest of the code is public domain.</p>
<iframe width="100%" height="600px" src="filelist.html" name="i"></iframe>
</body>
</html>