-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
33 lines (33 loc) · 1.42 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
<!DOCTYPE html>
<html>
<head>
<title>Predicate Editor Demo</title>
<link href="external/jquery-ui-1.8.20.custom.css" type="text/css" rel="stylesheet" />
<link href="ui/jquery.ui.predicate.css" type="text/css" rel="stylesheet" />
<script src="external/jquery-1.7.2.min.js"></script>
<script src="external/jquery-ui-1.8.20.custom.min.js"></script>
<script src="external/peg-0.7.0.min.js"></script>
<script src="ui/jquery.ui.predicate.js"></script>
<script>
$(function() {
$("input").predicate({
title: "Predicate Builder",
operators: [{title: "Any", value: "|"}, {title: "All", value: "&"}, {title: "None", value: "!"}],
values: [{title: "Mac OS", value: 1}, {title: "Linux", value: 2}, {title: "Windows", value: 3}],
notation: "prefix",
// Колбек, вызываемый после добавления селекта значения, element — HTMLElement селекта
onLeafAdded: function(element) {},
// Колбек, вызываемый после добавления селекта оператора, element — HTMLElement селекта
onNodeAdded: function(element) {}
});
});
</script>
</head>
<body>
<form action="#">
<input type="text"/>
<input type="text" value="2">
<input type="text" value="(&,(|,1,2),3)">
</form>
</body>
</html>