forked from bitovi/syn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
150 lines (133 loc) · 4.33 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Demo Page</title>
<link type="text/css" href="../../mxui/smoothness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
<link type="text/css" href="../../mxui/resizable/resizable.css" rel="stylesheet" />
<style type='text/css'>
body {font-family: verdana}
.error {border: solid 1px red;}
.error_text { color: red; font-size: 10px;}
td {padding: 3px;}
#first {
border: solid 1px;
height: 200px;width: 200px;
}
.ui-widget {
font-size: 1em;
}
.ui-tabs .ui-tabs-nav li a {
padding: 0.1em 0.2em
}
.ui-tabs .ui-tabs-panel {
padding: 0.5em
}
#uitabs a:focus {
outline: dashed;
}
#submitform {
border-left: dotted 1px gray;
padding: 10px;
margin-left: 10px;
}
</style>
</head>
<body>
<div class='tabarea'>
<ul id="uitabs">
<li><a href="javascript://"><span>Instructions</span></a></li>
<li><a href="javascript://"><span>Drag Drop</span></a></li>
<li><a href="javascript://"><span>Typing</span></a></li>
<li><a href="javascript://"><span>Form</span></a></li>
</ul>
<div>
<p>Welcome to the Syn demo!</p>
<p>Click, drag, and type in this page.
Your actions will be recorded as a syn-script.
You can playback this script by pressing "Replay" below.
</p>
<p>Try clicking and tabbing between tab-buttons.</p>
<div>
<ul id='uitabs2'>
<li><a href="javascript://">Alpha</a></li>
<li><a href="javascript://">Beta</a></li>
<li><a href="javascript://">Gamma</a></li>
</ul>
<div>Content Alpha</div>
<div>Content Beta</div>
<div>Content Gamma</div>
</div>
</div>
<div>
<p>Drag the gray dot.</p>
<div class='wrap' id='first'>Here is some swell content</div>
</div>
<div>
<p>Test the numeric field. It only accepts numbers.
</p>
<p><input type='text' id='numeric' /></p>
<p>You can copy and paste if you select text with the keyboard like:
[shift][left][shift-up][ctrl]c[ctrl-up][right][ctrl]v[ctrl-up]. It's
possible to make mouse text selection work, but not with this recording demo.</p>
</div>
<div>
<form>
<form action='' id='submitform'>
<p id='indicator'>I turn green when this form is submitted.
</p>
<p id='changeIndicator'>I turn green when an element is changed.</p>
<div>
<label>Type enter to submit the form: </label>
<input type='text' id='clearme'/>
</div>
<div>
<label>Click to submit: </label>
<input type='submit'/>
</div>
<div>
<label>Click to toggle: </label>
<input type='checkbox' />
</div>
<div>
<label>Click to toggle: </label>
<input type='radio' name='radio' value='1'/>
<input type='radio' name='radio' value='2'/>
<input type='radio' name='radio' value='3'/>
</div>
<div>
<label>Click to change: </label>
<select>
<option>1</option><option>2</option><option>3</option>
</select>
</div>
</form>
</form>
</div>
</div>
<script type='text/javascript' src='../../steal/steal.js'></script>
<script type='text/javascript'>
steal('mxui/nav/tabs','mxui/layout/resize','mxui/form/key_validator').then(function(){
$("#first").mxui_layout_resize();
$("#uitabs, #uitabs2").mxui_ui_tabs();
$(window).bind('load', function(){
$("select")[0].selectedIndex = 0;
$("#numeric").mxui_key_validator({test: /^[-+]?[0-9]*\.?[0-9]*$/}).val("")
})
$("#submitform").submit(function(ev){
ev.preventDefault();
$("#indicator").css("backgroundColor","#00ff00")
setTimeout(function(){
$("#indicator").css("backgroundColor","")
},300)
}).change(function(ev){
$("#changeIndicator").css("backgroundColor","#00ff00")
setTimeout(function(){
$("#changeIndicator").css("backgroundColor","")
},300)
})
//this is to handle all click events in the form
})
</script>
</body>
</html>