forked from dojo/dijit-oldmirror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_Menu.html
476 lines (416 loc) · 24.1 KB
/
test_Menu.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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Menu System Test</title>
<style type="text/css">
@import "../themes/claro/document.css";
@import "css/dijitTests.css";
body { padding: 0; }
/* styling for left-hand-side navigation menu to become a column equal to length of page */
#formattingTable {
border: 0;
border-spacing: 0;
}
#contentContainer { padding: 2em; }
#navMenu {
/* make the sidebar menu blend in with the whole sidebar */
border: none;
}
</style>
<!-- required: a default dijit theme: -->
<link id="themeStyles" rel="stylesheet" href="../../dijit/themes/claro/claro.css"/>
<!-- required: dojo.js -->
<script type="text/javascript" src="../../dojo/dojo.js"
data-dojo-config="parseOnLoad: true, isDebug: true"></script>
<!-- not needed, for testing alternate themes -->
<script type="text/javascript" src="_testCommon.js"></script>
<script type="text/javascript">
dojo.require("dijit.dijit"); // optimize: load dijit layer
dojo.require("dijit.Menu");
dojo.require("dijit.MenuItem");
dojo.require("dijit.PopupMenuItem");
dojo.require("dijit.CheckedMenuItem");
dojo.require("dijit.MenuSeparator");
dojo.require("dijit.MenuBar");
dojo.require("dijit.MenuBarItem");
dojo.require("dijit.PopupMenuBarItem");
dojo.require("dijit.ColorPalette");
dojo.require("dijit.form.TextBox");
dojo.require("dojo.parser"); // scan page for widgets and instantiate them
</script>
<script type="text/javascript">
function createMenu(){
// create a menu programmatically
function fClick(){console.log("clicked!")}
pMenu = new dijit.Menu({targetNodeIds:["prog_menu"], id:"progMenu"});
pMenu.addChild(new dijit.MenuItem({label:"Programmatic Context Menu", disabled:true}));
pMenu.addChild(new dijit.MenuSeparator());
pMenu.addChild(new dijit.MenuItem({label:"Simple menu item", onClick:fClick, accelKey:"Shift+S"}));
pMenu.addChild(new dijit.MenuItem({label:"Another menu item", onClick:fClick, accelKey:"Ctrl+A"}));
pMenu.addChild(new dijit.MenuItem({label:"With an icon", iconClass:"dijitEditorIcon dijitEditorIconCut", onClick:fClick}));
var mItem = new dijit.MenuItem({label:"dojo.event clicking", accelKey: "Alt+D"});
dojo.connect(mItem, "onClick", function(){console.log("click! handler created via dojo.connect()")});
pMenu.addChild(mItem);
mItem = new dijit.CheckedMenuItem({label:"checkable menu item"});
pMenu.addChild(mItem);
var pSubMenu = new dijit.Menu({parentMenu:pMenu, id:"progSubMenu"});
pSubMenu.addChild(new dijit.MenuItem({label:"Submenu item", onClick:fClick}));
pSubMenu.addChild(new dijit.MenuItem({label:"Submenu item", onClick:fClick}));
var pSubSubMenu = new dijit.Menu({parentMenu:pSubMenu, id:"progSubSubMenu"});
pSubSubMenu.addChild(new dijit.MenuItem({label:"SubSubmenu item", onClick:fClick}));
pSubSubMenu.addChild(new dijit.MenuItem({label:"SubSubmenu item", onClick:fClick}));
pSubMenu.addChild(new dijit.PopupMenuItem({label:"SubSubmenu", popup:pSubSubMenu, id:"progPopupMenuItem2"}));
pMenu.addChild(new dijit.PopupMenuItem({label:"Submenu", popup:pSubMenu, id:"progPopupMenuItem"}));
pMenu.startup();
updateButtons(true);
dojo.byId("prog_menu").innerHTML="This div has a programmatic context menu on it that's different to the page menu.";
dojo.byId("createButton").disabled = true;
dojo.byId("destroyButton").disabled = false;
}
function destroyMenu(){
pMenu.destroyRecursive();
updateButtons(false);
}
function updateButtons(created){
dojo.byId("prog_menu").innerHTML=created?"This div has a programmatic context menu on it that's different to the page menu.":"No programmatic menu on this div, should get page level menu.";
dojo.byId("createButton").disabled = created;
dojo.byId("destroyButton").disabled = !created;
}
dojo.ready(function(){
// need to explicitly update our buttons states, otherwise the
// browser will remember the last states of them before reloading
// (so a programmatic menu is created, reload, and "the create
// programmatic menu" button is still in disabled state)
updateButtons(false);
});
</script>
</head>
<body class="claro">
<div id="windowContextMenu" data-dojo-type="dijit/Menu" data-dojo-props='contextMenuForWindow:true, style:"display: none;"'>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Hello world"); }'>Context Menu</div>
<div data-dojo-type="dijit/MenuSeparator"></div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='disabled:true, onClick:function(){ alert("this should NOT appear"); }'>Disabled Item</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCut",
onClick:function(){ console.log("not actually cutting anything, just a test!") }, accelKey:"Ctrl+X"'>Cut</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCopy",
onClick:function(){ console.log("not actually copying anything, just a test!") }, accelKey:"Ctrl+C"'>Copy</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
onClick:function(){ console.log("not actually pasting anything, just a test!") }, accelKey:"Ctrl+V"'>Paste</div>
<div data-dojo-type="dijit/MenuSeparator"></div>
<div id="enabledSubmenu" data-dojo-type="dijit/PopupMenuItem" >
<span>Enabled Submenu</span>
<div id="submenu2" data-dojo-type="dijit/Menu" >
<div id="submenu2_item1" data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
<div id="submenu2_item2" data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
<div id="deeperSubmenu" data-dojo-type="dijit/PopupMenuItem" >
<span>Deeper Submenu</span>
<div id="submenu4" data-dojo-type="dijit/Menu" >
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 1!") }'>Sub-sub-menu Item One</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 2!") }'>Sub-sub-menu Item Two</div>
</div>
</div>
</div>
</div>
<div data-dojo-type="dijit/PopupMenuItem" data-dojo-props='disabled:true'>
<span>Disabled Submenu</span>
<div id="submenu3" data-dojo-type="dijit/Menu" data-dojo-props='style:"display: none;"'>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
</div>
</div>
<div data-dojo-type="dijit/PopupMenuItem">
<span>Different popup</span>
<div data-dojo-type="dijit/ColorPalette"></div>
</div>
<div data-dojo-type="dijit/MenuSeparator"></div>
<div data-dojo-type="dijit/CheckedMenuItem" data-dojo-props='checked:true, onChange:function(val){ console.log("Now set to " + val); }'>Checked</div>
<div data-dojo-type="dijit/CheckedMenuItem">Not Checked</div>
<div data-dojo-type="dijit/CheckedMenuItem" data-dojo-props='checked:true, disabled:true'>Checked Disabled</div>
<div data-dojo-type="dijit/MenuSeparator"></div>
<div data-dojo-type="dijit/PopupMenuItem">
<span>Bigger Submenu</span>
<div id="bigsubmenu" data-dojo-type="dijit/Menu" data-dojo-props='style:"display: none;"'>
<div data-dojo-type="dijit/MenuItem">Item One</div>
<div data-dojo-type="dijit/MenuItem">Item Two</div>
<div data-dojo-type="dijit/MenuItem">Item Three</div>
<div data-dojo-type="dijit/MenuItem">Item Four</div>
<div data-dojo-type="dijit/MenuItem">Item Five</div>
<div data-dojo-type="dijit/MenuItem">Item Six</div>
<div data-dojo-type="dijit/MenuItem">Item Seven</div>
<div data-dojo-type="dijit/MenuItem">Item Eight</div>
<div data-dojo-type="dijit/MenuItem">Item Nine</div>
<div data-dojo-type="dijit/MenuItem">Item Ten</div>
</div>
</div>
</div>
<div id="leftClickContextMenu" data-dojo-type="dijit/Menu" data-dojo-props='leftClickToOpen:true, targetNodeIds:["input2"], style:"display: none;"'>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='disabled:true'>Left Click Menu</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Hello world"); }'>Enabled Item</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='disabled:true'>Disabled Item</div>
<div data-dojo-type="dijit/MenuSeparator"></div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCut",
onClick:function(){ console.log("not actually cutting anything, just a test!") }'>Cut</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCopy",
onClick:function(){ console.log("not actually copying anything, just a test!") }'>Copy</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
onClick:function(){ console.log("not actually pasting anything, just a test!") }'>Paste</div>
<div data-dojo-type="dijit/MenuSeparator"></div>
<div data-dojo-type="dijit/PopupMenuItem">
<span>Enabled Submenu</span>
<div id="leftsubmenu2" data-dojo-type="dijit/Menu" >
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
<div data-dojo-type="dijit/PopupMenuItem">
<span>Deeper Submenu</span>
<div id="leftsubmenu4" data-dojo-type="dijit/Menu" >
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 1!") }'>Sub-sub-menu Item One</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 2!") }'>Sub-sub-menu Item Two</div>
</div>
</div>
</div>
</div>
<div data-dojo-type="dijit/PopupMenuItem" data-dojo-props='disabled:true'>
<span>Disabled Submenu</span>
<div id="leftsubmenu3" data-dojo-type="dijit/Menu" data-dojo-props='style:"display: none;"'>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
</div>
</div>
<div data-dojo-type="dijit/PopupMenuItem">
<span>Different popup</span>
<div data-dojo-type="dijit/ColorPalette"></div>
</div>
</div>
<table id="formattingTable">
<tr>
<td style="width:0;">
<!-- This is here for tabIndex testing.
Use textarea since Chrome 1.0 likes it better for TABing and
because it has innerText property and because it doesn't mess
with the URL when clicked -->
<textarea id="link" tabIndex="0" readOnly class="dijitReset" style="font-family:monospace;font-size:12px;width:84px;text-decoration:underline;overflow:hidden;background-color:transparent;" rows=1>random link</textarea>
</td>
<td id="menuBarContainer" style="width:100%;">
<div id="menubar" data-dojo-type="dijit/MenuBar">
<div id="file" data-dojo-type="dijit/PopupMenuBarItem" >
<span>File</span>
<div id="fileMenu" data-dojo-type="dijit/Menu" >
<div id="new" data-dojo-type="dijit/MenuItem" >New</div>
<div id="open" data-dojo-type="dijit/MenuItem" >Open</div>
<div id="separator" data-dojo-type="dijit/MenuSeparator" ></div>
<div id="save" data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIconSave"'>Save</div>
<div id="saveas" data-dojo-type="dijit/MenuItem" >Save As...</div>
</div>
</div>
<div id="edit" data-dojo-type="dijit/PopupMenuBarItem" >
<span>Edit</span>
<div id="editMenu" data-dojo-type="dijit/Menu" >
<div id="cut" data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCut",
onClick:function(){ console.log("not actually cutting anything, just a test!"); }, accelKey:"Ctrl+X"'>Cut</div>
<div id="copy" data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCopy",
onClick:function(){ console.log("not actually copying anything, just a test!") }, accelKey:"Ctrl+C"'>Copy</div>
<div id="paste" data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
onClick:function(){ console.log("not actually pasting anything, just a test!") }, accelKey:"Ctrl+V"'>Paste</div>
</div>
</div>
<div id="view" data-dojo-type="dijit/PopupMenuBarItem" >
<span>View</span>
<div id="viewMenu" data-dojo-type="dijit/Menu" >
<div data-dojo-type="dijit/MenuItem">Normal</div>
<div data-dojo-type="dijit/MenuItem">Outline</div>
<div data-dojo-type="dijit/PopupMenuItem">
<span>Zoom</span>
<div id="zoomMenu" data-dojo-type="dijit/Menu" >
<div data-dojo-type="dijit/MenuItem">50%</div>
<div data-dojo-type="dijit/MenuItem">75%</div>
<div data-dojo-type="dijit/MenuItem">100%</div>
<div data-dojo-type="dijit/MenuItem">150%</div>
<div data-dojo-type="dijit/MenuItem">200%</div>
</div>
</div>
</div>
</div>
<div id="help" data-dojo-type="dijit/PopupMenuBarItem" >
<span>Help</span>
<div id="helpMenu" data-dojo-type="dijit/Menu" >
<div data-dojo-type="dijit/MenuItem">Help Topics</div>
<div data-dojo-type="dijit/MenuItem">About Dijit</div>
</div>
</div>
<div data-dojo-type="dijit/PopupMenuBarItem" data-dojo-props='disabled:true'>
<span>Disabled</span>
<div data-dojo-type="dijit/Menu">
<div data-dojo-type="dijit/MenuItem">You should not see this</div>
</div>
</div>
<div data-dojo-type="dijit/PopupMenuBarItem">
<span>Empty</span>
<div data-dojo-type="dijit/Menu">
</div>
</div>
<div data-dojo-type="dijit/MenuBarItem" data-dojo-id="noPopupMenuBarItem"
data-dojo-props='onClick:function(){ console.log("no submenu, just a clickable MenuItem"); }'>
Click me!
</div>
</div>
</td>
</tr>
<tr>
<td id="navMenuContainer" class="dijitMenu" style="vertical-align:top; width:0;">
<h3 style="margin-bottom: 2em;">Navigation menu:</h3>
<div id="navMenu" data-dojo-type="dijit/Menu" >
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
onClick:function(){ console.log("drama!"); }'>Drama</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCut",
onClick:function(){ console.log("comedy!") }'>Comedy</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCopy",
onClick:function(){ console.log("romance!") }'>Romance</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
onClick:function(){ console.log("documentary!") }'>Documentary</div>
<div data-dojo-type="dijit/MenuSeparator"></div>
<div id="navMenuPopupItem1" data-dojo-type="dijit/PopupMenuItem" >
<span>Enabled Submenu</span>
<div id="navMenuSub1" data-dojo-type="dijit/Menu" >
<div id="navMenuSub1_item1" data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
<div id="navMenuSub1_item2" data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
<div id="navMenuSub1_popup" data-dojo-type="dijit/PopupMenuItem" >
<span>Deeper Submenu</span>
<div id="navMenuSub2" data-dojo-type="dijit/Menu" >
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 1!") }'>Sub-sub-menu Item One</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 2!") }'>Sub-sub-menu Item Two</div>
</div>
</div>
</div>
</div>
<div id="navMenuDisabledItem" data-dojo-type="dijit/PopupMenuItem" data-dojo-props='disabled:true '>
<span>Disabled Submenu</span>
<div id="navMenuSub3" data-dojo-type="dijit/Menu" data-dojo-props='style:"display: none;"'>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
<div data-dojo-type="dijit/MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
</div>
</div>
<div data-dojo-type="dijit/PopupMenuItem">
<span>Different popup</span>
<div data-dojo-type="dijit/ColorPalette"></div>
</div>
<div data-dojo-type="dijit/MenuSeparator"></div>
<div data-dojo-type="dijit/CheckedMenuItem" data-dojo-props='checked:true, onChange:function(val){ console.log("Now set to " + val); }'>Checked</div>
<div id="checked2" data-dojo-type="dijit/CheckedMenuItem" >Not Checked</div>
<div data-dojo-type="dijit/CheckedMenuItem" data-dojo-props='checked:true, disabled:true'>Checked Disabled</div>
</div>
</td>
<td style="padding: 1em" id="contentContainer">
<h1 class="testTitle">Dijit Menu System Test</h1>
<p>This page contains:</p>
<ul>
<li>"Navigation bar" Menu widget on left, a.k.a vertical MenuBar
<li>MenuBar on top
<li>page level context menu (right-click anywhere on page)
<li>form widget context menu (right-click on textbox widget)</li>
<li>left click context menu (left click on input on far right)
<li>Example of programatically created menu
<li>Note: while some accelerator (shortcut) keys are displayed in the context menu, they are not actually hooked up to the corresponding actions (if any), they need to be setup explicitly by the user
</ul>
<h3>Form</h3>
<form>
<p style="float:right; text-align: right;">
left click to open the menu for this input:<br/>
Note: because of the window contextMenu, make sure you get<br/>
the right menu by verifying the left<br/>
click one starts with "Left Click Menu"<br/>
at the very top.
<input id=input2 value="top-right"/>
</p>
<input id=input1 value="top-left"/>
<textarea id=textarea>hello there!</textarea><br>
<select>
<option>check if i</option>
<option>bleed through</option>
<option>on IE6</option>
</select>
<button id=button>push me</button><br>
<input data-dojo-type="dijit/form/TextBox" id="formwidget" data-dojo-props='style:"width:25em;", value:"dijit.form._FormWidget focus test"'/>
</form>
<div id="prog_menu" style="clear: both; border:1px solid blue; padding:10px; margin:20px 0;">
Click button below to create special menu on this div.
</div>
<button id="createButton" onclick="createMenu();">create programmatic menu</button>
<button id="destroyButton" onclick="destroyMenu();" disabled>destroy programmatic menu</button>
<div style="height:500px"></div>
<p>(this space intentionally left blank to aid testing with controls
at the bottom of the browser window)</p>
<div style="height:500px"></div>
<input id=input3 value="bottom-left"/>
<p style="text-align:right"><input id=input4 value="bottom-right"/></p>
<p>See also: <a href="form/test_Button.html">form/test_Button</a>
(PopupMenu is used with DropDownButton and ComboButton)</p>
<h3>Mouse opening tests</h3>
<ul>
<li>Right click on the client area of the page (ctrl-click for Macintosh). Menu should open.</li>
<li>Right click on each of the form controls above. Menu should open.</li>
<li>Right click near the righthand window border. Menu should open to the left of the pointer.</li>
<li>Right click near the bottom window border. Menu should open above the pointer.</li>
</ul>
<h3>Mouse hover tests</h3>
<ul>
<li>Hover over the first item with the pointer. Item should highlight and get focus.</li>
<li>Hover over the second (disabled) item. Item should highlight and get focus.</li>
<li>Seperator items should not highlight on hover - no items should highlight in this case.</li>
</ul>
<h3>Mouse click tests</h3>
<ul>
<li>Click on the first menu item. console.log should log the message "Hello world". The menu should dissapear.</li>
<li>Click on the second menu item (disabled). Should not do anything - focus should remain on the disabled item.</li>
<li>Click anywhere outside the menu. Menu should close. Focus will be set by the browser based on where the user clicks.</li>
</ul>
<h3>Mouse submenu tests</h3>
<ul>
<li>Hover over the "Enabled Submenu" item. Item should highlight and then pop open a submenu after a short (500ms) delay.</li>
<li>Hover over any of the other menu items. Submenu should close immediately and deselect the submenu parent item. The newly hovered item should become selected.</li>
<li>Hover over the "Disabled Submenu" item. Item should highlight, but no submenu should appear.</li>
<li>Clicking on the "Enabled Submenu" item before the submenu has opened (you'll have to be quick!) should immediatley open the submenu.</li>
<li>Clicking on the "Enabled Submenu" item <i>after</i> the submenu has opened should have no effect - the item is still selected and the submenu still open.</li>
<li>Hover over submenu item 1. Should select it - the parent menu item should stay selected also.</li>
<li>Hover over submenu item 2. Should select it - the parent menu item should stay selected also.</li>
</ul>
<h3>Keyboard opening tests</h3>
<ul>
<li>On Windows: press shift-f10 with focus on any of the form controls. Should open the menu.</li>
<li>On Windows: press the context menu key (located on the right of the space bar on North American keyboards) with focus on any of the form controls. Should open the menu.</li>
<li>On Firefox on the Mac: press ctrl-space with focus on any of the form controls. Should open the menu.</li>
</ul>
<h3>Keyboard closing tests</h3>
<ul>
<li>Open the menu.</li>
<li>Press tab. Should close the menu and return focus to where it was before the menu was opened.</li>
<li>Open the menu.</li>
<li>Press escape. Should close the menu and return focus to where it was before the menu was opened.</li>
</ul>
<h3>Keyboard navigation tests</h3>
<ul>
<li>Open the menu.</li>
<li>Pressing up or down arrow should cycle focus through the items in that menu.</li>
<li>Pressing enter or space should invoke the menu item.</li>
<li>Disabled items receive focus but no action is taken upon pressing enter or space.</li>
</ul>
<h3>Keyboard submenu tests</h3>
<ul>
<li>Open the menu.</li>
<li>The first item should become selected.</li>
<li>Press the right arrow key. Nothing should happen.</li>
<li>Press the left arrow key. Nothing should happen.</li>
<li>Press the down arrow until "Enabled Submenu" is selected. The submenu should not appear.</li>
<li>Press enter. The submenu should appear with the first item selected.</li>
<li>Press escape. The submenu should vanish - "Enabled Submenu" should remain selected.</li>
<li>Press the right arrow key. The submenu should appear with the first item selected.</li>
<li>Press the right arrow key. Nothing should happen.</li>
<li>Press the left arrow key. The submenu should close - "Enabled Submenu" should remain selected.</li>
<li>Press the left arrow key. The menu should <i>not</i> close and "Enabled Submenu" should remain selected.</li>
<li>Press escape. The menu should close and focus should be returned to where it was before the menu was opened.</li>
</ul>
</td>
</tr>
</table>
</body>
</html>