forked from Eskat0n/mutabor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
96 lines (78 loc) · 2.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
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
89
90
91
92
93
94
95
96
<!DOCTYPE HTML>
<html>
<head>
<title>Mutabor demo page</title>
<style>
html, body {
font-family: Arial, sans-serif;
font-size: 14px;
}
body { position: relative; }
.demo-element {
width: 400px;
}
.row {
margin-bottom: 6px;
}
.row label {
display: inline-block;
}
.row input[type=text], .row textarea {
display: block;
width: 100%;
}
.mutabor-filter {
position: absolute;
left: 430px;
top: 32px;
}
</style>
<script src="mutabor.js"></script>
<script src="http://yandex.st/jquery/1.7.1/jquery.min.js"></script>
<script>
$(function () {
$('#add-element').click(function () {
var tag = '<' + $('#element-tag').val() + '/>'
var props = eval('(function(){return{' + $('#element-props').val() + '};})()')
$(tag, props).appendTo('#demo-element-container')
return false
})
$('#clear-elements').click(function () {
$('#demo-element-container').empty()
return false
})
$('#apply-filter').click(function () {
mutabor.reset()
eval('(function () {' + $('#filter-script').val() + '})()')
return false;
})
})
</script>
</head>
<body>
<div class="demo-element">
<div class="row">
<label for="element-tag">Element tag</label>
<input id="element-tag" name="element-tag" />
</div>
<div class="row">
<label for="element-props">Element properties</label>
<textarea id="element-props" name="element-props" rows="10" cols="40"></textarea>
</div>
<div class="row">
<input id="add-element" type="submit" value="Add element" />
<input id="clear-elements" type="button" value="Clear elements" />
</div>
</div>
<div class="mutabor-filter">
<div class="row">
<label for="filter-script">Mutabor filter script</label>
<textarea id="filter-script" name="filter-script" rows="10" cols="70"></textarea>
</div>
<div class="row">
<input id="apply-filter" type="button" value="Apply filter" />
</div>
</div>
<div id="demo-element-container"></div>
</body>
</html>