-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
48 lines (46 loc) · 1.48 KB
/
demo.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Compleet Demo</title>
<style>
input {
margin-top: 100px;
margin-left: 100px;
border: none;
border-radius: 0;
background-color: #EEEEEE;
color: #141414;
border-bottom: 2px solid #212121;
padding: 10px;
background: url(https://storage.googleapis.com/material-icons/external-assets/v4/icons/svg/ic_search_black_24px.svg) no-repeat right;
}
</style>
<link href="./compleet.css" rel="stylesheet">
<script src="./compleet.js"></script>
</head>
<body>
<input type="search" id="search-bar">
<script>
var search = document.querySelector("#search-bar");
search.compleet({
maxResults: 4,
tags: function(cb) {
cb([
"a",
"ab",
"abc",
"abcd",
"abcde",
"abcdef"
]);
}
/*source: function(term, resp) {
var v = term.split(/\s+/).pop().trim();
var tags = ["a", "ab", "abc", "abcd", "abcde", "abcdef"];
resp(tags.filter(function (t) { return t.startsWith(v); }), v);
}*/
});
</script>
</body>
</html>