-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
33 lines (33 loc) · 1.82 KB
/
test.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 lang="en">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
</head>
<body>
<div class="rule"></div>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="ruleWizard.js"></script>
<script type="text/javascript">
new RuleWizard(".rule", { "sections" : [
{ "type": "selector", "values": ["Include", "Exclude", "Promote", "Demote"], "id": "action" },
{ "type": "text", "values": ["products that have", { "id": "article", "value": "a" }]},
{ "type": "selector", "default": " ", "values": "getFields", "onChange": { "function": "updateArticle", "params": ["#article"]}, "id": "field" },
{ "type": "text", "values": ["field with value matching"]},
{ "type": "selector", "values": [
{ "value": "value", "action": "textfield", "id": "fieldValue"},
{ "value": "value with condition", "sections": [
{ "type": "textfield", "id": "fieldValue", "onChange": {"function": "autoComplete", "params": ["#field"]} },
{ "type": "text", "values": ["when current product's"] },
{ "type": "selector", "values": "getFields", "default": " ", "id": "anchorField" },
{ "type": "text", "values": "is"},
{ "type": "textfield", "id": "anchorFieldValue", "onChange": {"function": "autoComplete", "params": ["#anchorField"]}}
], "id": "fieldValue"},
{ "value": "current product's", "sections": [{ "type": "text", "values": ["field value"] }] }
]}
]});
</script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</body>
</html>