-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.html
85 lines (80 loc) · 2.58 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
81
82
83
84
85
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Zendesk test</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" href="./dist/algoliasearch.zendesk-hc.css" />
<style>
html {
height: 100%;
}
body {
height: 100%;
}
input {
padding: 10px;
width: 100%;
margin-top: 10px;
}
input[name=master] {
width: 90%;
margin: auto;
display: block;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="row">
<input type="text" name="master" class="form-control" placeholder="Search here to trigger all of them" />
</div>
<hr />
<div class="row" style="height: 50%;">
<div class="col-sm-1 col-sm-offset-1">
<input type="text" name="autocomplete1" class="form-control" readonly />
</div>
<div class="col-sm-2 col-sm-offset-1">
<input type="text" name="autocomplete2" class="form-control" readonly />
</div>
<div class="col-sm-3">
<input type="text" name="autocomplete3" class="form-control" readonly />
</div>
<div class="col-sm-4">
<input type="text" name="autocomplete4" class="form-control" readonly />
</div>
</div>
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<input type="text" name="autocomplete5" class="form-control" readonly />
</div>
</div>
<script type="text/javascript" charset="utf-8" src="https://cdn.jsdelivr.net/momentjs/2.12.0/moment-with-locales.min.js"></script>
<script type="text/javascript" charset="utf-8" src="./dist/algoliasearch.zendesk-hc.js"></script>
<script>
var search = algoliasearchZendeskHC({
applicationId: 'latency',
apiKey: '88209bb425570ef10733c0ba3157bac3',
subdomain: 'algolia-test',
indexName: 'zendesk_algolia-test_articles',
color: '#158EC2',
highlightColor: '#F08',
autocomplete: {
inputSelector: 'input[name^=autocomplete]'
},
instantsearch: {
enabled: false
}
});
var $master = document.querySelector('input[name=master]');
console.log($master);
$master.addEventListener('input', function () {
search.search.autocompletes.forEach(function (autocomplete) {
autocomplete.autocomplete.setVal($master.value);
autocomplete.autocomplete.open();
});
});
</script>
</body>
</html>