-
Notifications
You must be signed in to change notification settings - Fork 4
/
ui-search-box.htm
88 lines (65 loc) · 2.73 KB
/
ui-search-box.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
<!DOCTYPE html>
<html>
<head>
<title>UI Search Box</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<!-- LIBRARY FILES -->
<link rel="stylesheet" type="text/css" href="basic/basic.min.css">
<script src="basic/basic.min.js" type="text/javascript" charset="utf-8"></script>
<script src="components/ui-core.js" type="text/javascript" charset="utf-8"></script>
<script src="components/ui-search-box.js" type="text/javascript" charset="utf-8"></script>
<style>
.search-box::-webkit-input-placeholder {
color: rgba(0, 0, 0, 0.4);
}
</style>
<script>
var box1, box2;
var uiSearchBox1, uiSearchBox2;
window.onload = function() {
// BOX: Container for uiSearchBox1
box1 = createBox(0, 0, getDefaultContainerBox().width, getDefaultContainerBox().height / 2);
that.color = "#5ABB9F";
// BOX: Container for uiSearchBox2
box2 = createBox(0, 0, box1.width, box1.height);
that.color = "white";
that.top = box1.height;
// EXAMPLE 1
// UI SEARCH BOX 1:
uiSearchBox1 = UISearchBox.create({
width: 300,
height: 50,
searchIconFile: "components/ui-search-box/search.svg",
clearIconFile: "components/ui-search-box/clear.svg",
color: "rgba(0, 0, 0, 0.2)",
textColor: "rgba(0, 0, 0, 0.65)",
borderBottomStyle: "2px solid rgba(0, 0, 0, 0.2)",
});
box1.add(that);
uiSearchBox1.txtSearch.inputElement.classList.add('search-box');
uiSearchBox1.center();
uiSearchBox1.onSearch(function searched(searchText, uiSearchBox) {
console.log("uiSearchBox1 text: " + searchText);
});
// EXAMPLE 2
// UI SEARCH BOX 2:
uiSearchBox2 = UISearchBox.create({
width: 300,
height: 50,
searchIconFile: "components/ui-search-box/filter.png",
isCancelEnabled: 0,
placeholderText: "Filter",
});
box2.add(that);
that.center();
uiSearchBox2.onSearch(function searched(searchText, uiSearchBox) {
console.log("uiSearchBox2 text: " + searchText);
});
}
</script>
</head>
<body>
<!-- HTML content -->
</body>
</html>