-
Notifications
You must be signed in to change notification settings - Fork 25
/
demo.html
241 lines (226 loc) · 5.34 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<!DOCTYPE html>
<html lang="en">
<head>
<title>MXUI Demo</title>
<link type="text/css" href="smoothness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
<link type="text/css" href="layout/resize/resize.css" rel="stylesheet" />
<style type='text/css'>
body {font-family: verdana}
#resize {
width: 600px; height: 300px;
border: solid 4px green;
}
.green, .red {font-weight: bold;}
.green {color: green;}
.red { color: red; }
#fill {
border: solid 4px red;
}
#slider-container {
border: solid 1px black;
}
#slider {
padding: 3px;
width: 165px;
border: solid 1px black;
text-align: center;
cursor: move;
}
#accordion {
width: 33%;
}
#right {
width: 66%;
}
.ui-state-active {
background-image: none;
background-color: #eeeeee;
font-weight: bold;
}
#modal {
display: none;
border: solid 4px orange;
background-color: yellow;
padding: 30px 10px;
}
#block {
background-color: green;
display: none;
}
ul, li {
margin: 0px; padding: 0px;
list-style: none;
}
#sortable li {
display: inline-block;
padding: 10px 3px;
border: dashed 1px blue;
}
#sortable {
background-color: #eeeeee;
overflow: auto;
white-space-collapse: collapse;
white-space: nowrap;
cursor: move;
}
td {
border: solid 2px white;
}
td.selected {
border: solid 2px orange;
}
td.activated {
background-color: yellow;
}
</style>
</head>
<body>
<div id='resize'>
The <span class='green'>green</span> div is a
<a href="#!Mxui.Layout.Resize">Resize</a>.
The <span class='red'>red</span> div is a
<a href='#!Mxui.Layout.Fill'>Fill</a>
and a <a href='#!Mxui.Layout.Split'>Split</a>.
<div id='fill'>
<div id='accordion'>
<h3>Accordion</h3>
<div>
This is a panel within an
<a href='#!Mxui.Nav.Accordion'>Accordion</a>.
</div>
<h3>Block</h3>
<div>
Click <a href="javascript://" id='cb'>this</a>
to create a
<a href='#!Mxui.Layout.Block'>Block</a>
on a hidden <code>#block</code> div.
</div>
<h3>Modal</h3>
<div>
Click <a href="javascript://" id='cm'>this</a>
to create a
<a href='#!Mxui.Layout.Modal'>Modal</a> on
a hidden <code>#modal</code> div.
</div>
</div>
<div id='right'>
<table id='table_scroll' cellpadding='0' cellspacing='0'>
<thead>
<tr>
<th>These</th>
<th>are table</th>
<th>headers</th>
</tr>
</thead>
<tbody>
<tr><td>This table</td>
<td>is a</td>
<td><a href="#!Mxui.Layout.TableScroll">
Table Scroll</a>.</td></tr>
<tr><td>It makes</td>
<td>a table</td>
<td>scrollable.</td></tr>
<tr><td>It is</td>
<td>useful for</td>
<td>making grids.</td></tr>
<tr><td>This table is</td>
<td>also a mxui</td>
<td><a href='#!Mxui.Nav.Selectable'>
Selectable</a>.</td></tr>
<tr><td>Selectable</td>
<td>handles key</td>
<td>and mouse events,</td></tr>
<tr><td>and mulit-</td>
<td>selection!</td>
<td>To try it,</td></tr>
<tr><td>click on</td>
<td>a table row.</td>
<td>Use the keyboard</td></tr>
<tr><td>to navigate.</td>
<td>Use SHIFT</td>
<td> and CTRL to</td></tr>
<tr><td>to multi-</td>
<td>select rows.</td>
<td></td></tr>
</tbody>
</table>
<ul id='sortable'><li>This</li><li>is</li><li>a</li><li>Mxui</li><li>
<a href='#!Mxui.Layout.Sortable'>Sortable</a></li></ul>
</div>
</div>
<div id='slider-container'>
<div id='slider'>
←<a href="!#Mxui.Nav.Slider">Slider</a>→
</div>
</div>
<div id='modal'>I am a modal.
<a href="javascript://" id='hm'>Hide the modal</a>.
</div>
</div>
<div id='block'>I am a block.
<a href="javascript://" id='hb'>Hide the block</a>.
</div>
<script type='text/javascript'
src='../steal/steal.js'>
</script>
<script type='text/javascript'>
steal("mxui/layout/resize",
"mxui/layout/fill",
"mxui/nav/slider",
"mxui/layout/split",
"mxui/nav/accordion",
"mxui/layout/modal",
"mxui/layout/block",
"mxui/layout/sortable",
"mxui/layout/table_scroll",
"mxui/nav/selectable",
function($){
$("#resize").mxui_layout_resize()
$("#fill").mxui_layout_fill()
.mxui_layout_split({direction: "vertical"});
$("#slider").mxui_nav_slider();
$("#accordion").mxui_nav_accordion();
// create a modal
$("#cm").click(function(){
$("#modal").mxui_layout_modal()
})
$("#hm").click(function(){
$("#modal").hide()
})
// create a block
$("#cb").click(function(){
$("#block").mxui_layout_block()
})
$("#hb").click(function(){
$("#block").hide()
})
$("#sortable").mxui_layout_sortable({
sortable: "li"
})
$('#table_scroll').mxui_layout_table_scroll();
$('tbody td').attr('tabindex',"0");
$('tbody').mxui_nav_selectable();
// make links change parent window
// first handle clicking the slider
var last;
$('#slider a').mousedown(function(ev){
ev.preventDefault()
last = ev;
}).click(function(ev){
if(last.pageX != ev.pageX ||
last.pageY != ev.pageY ){
ev.stopImmediatePropagation();
ev.preventDefault();
}
})
$('a').bind('click', function(ev){
var href = $(this).attr('href');
if(href.indexOf('#!') == 0){
ev.preventDefault();
parent.location.hash = href;
}
});
})
</script>
</body>
</html>