aboutsummaryrefslogtreecommitdiffstats
path: root/tests/visual/menu/popup.html
blob: de27208b48e5b6f9de7840523f5703df3608eeb2 (plain)
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
<!DOCTYPE html>
<html>
<head>
	<title>Visual Test for Popup Utility</title>
	<link rel="stylesheet" href="../visual.css" type="text/css" />
	<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
	<script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
	<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
	<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
	<script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
	<script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
	<script type="text/javascript" src="../../../ui/jquery.ui.popup.js"></script>
	<!--
	<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
	-->
	<script type="text/javascript">
	$(function() {
		$.fn.themeswitcher && $('<div/>').css({
			position: "absolute",
			right: 10,
			top: 10
		}).appendTo(document.body).themeswitcher();
		
		var selected = {
			select: function( event, ui ) {
				$( "<div/>" ).text( "Selected: " + ui.item.text() ).appendTo( "#log" );
				$(this).popup("close");
			}
		};

		$("#members-popup").popup();

		$("#button1").button();
		$("#menu1").menu(selected).popup();
		
		$( "#rerun" )
			.button()
			.click(function() {
				alert( "Running the last action" );
			})
			.next()
				.button({
					text: false,
					icons: {
						primary: "ui-icon-triangle-1-s"
					}
				})
				.parent()
					.buttonset()
					.next()
						.menu(selected)
						.popup({
							trigger: $("#select")
						});
		
		$("td:has(.menubar)").clone().appendTo("tbody tr:not(:first)");
		$("table .menubar > ul").menu(selected).popup().prev().button();
	});
	</script>
	<style type="text/css">
		body { font-size:62.5%; }
		
		.ui-popup { position: absolute; z-index: 5000; }
		.ui-menu { width: 200px; }
		
		table {
			border-collapse: collapse;
		}
		th, td {
			padding: 0.5em;
			border: 1px solid black;
		}

		#members-popup {
			width: 200px; height: 150px; border: 1px solid gray; border-radius: 5px;
			box-shadow: 3px 3px 5px -1px rgba(0, 0, 0, 0.5);
			background: lightgray; background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#ddd));
			font-size: 120%; text-align: center; line-height: 150px; outline: none;
		}
 	</style>
</head>
<body>

<div>
	<a href="#members-popup">Project members</a>
	<div id="members-popup" tabIndex="0">
		some form controls in here
	</div>
</div>

<button id="button1">Show context menu 1</button>
<ul id="menu1">
	<li><a href="#">Amsterdam</a></li>
	<li><a href="#">Anaheim</a></li>
	<li><a href="#">Cologne</a></li>
	<li><a href="#">Frankfurt</a></li>
	<li><a href="#">Magdeburg</a></li>
	<li><a href="#">Munich</a></li>
	<li><a href="#">Utrecht</a></li>
	<li><a href="#">Zurich</a></li>
</ul>


<div>
	<div>
		<button id="rerun">Run last action</button>
		<button id="select">Select an action</button>
	</div>
	<ul>
		<li><a href="#">Open...</a></li>
		<li><a href="#">Save</a></li>
		<li><a href="#">Delete</a></li>
	</ul>
</div>

<table id="movies" class="ui-widget">
	<thead>
		<tr>
			<th data-field="Name" class="ui-widget-header">Name</th>
			<th data-field="ReleaseYear" class="ui-widget-header">Release Year</th>
			<th data-field="AverageRating" class="ui-widget-header">Average Rating</th>
			<th class="ui-widget-header"></th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td class="ui-widget-content">Red Hot Chili Peppers: Funky Monks</td>
			<td class="ui-widget-content">1993</td>
			<td class="ui-widget-content">3.6</td>
			<td class="ui-widget-content">
				<div class="menubar">
					<a href="#">Options</a>
					<ul>
						<li><a href="#">Order...</a></li>
						<li class="ui-state-disabled">Write a Review...</li>
						<li><a href="#">Find Similar Movies...</a></li>
						<li>
							<a href="#">Rate</a>
							<ul>
								<li><a href="#">5 stars</a></li>
								<li><a href="#">4 stars</a></li>
								<li><a href="#">3 stars</a></li>
								<li><a href="#">2 stars</a></li>
								<li><a href="#">1 stars</a></li>
							</ul>
						</li>
					</ul>
				</div>
			</td>
		</tr>
		<tr>
			<td class="ui-widget-content">Rod Stewart: Storyteller 1984-1991</td>
			<td class="ui-widget-content">1991</td>
			<td class="ui-widget-content">3.1</td>
		</tr>
		<tr>
			<td class="ui-widget-content">Stevie Ray Vaughan and Double Trouble: Live at the El Mocambo 1983</td>
			<td class="ui-widget-content">1991</td>
			<td class="ui-widget-content">3.9</td>
		</tr>
		<tr>
			<td class="ui-widget-content">Spike and Mike's Sick &amp; Twisted Festival of Animation</td>
			<td class="ui-widget-content">1997</td>
			<td class="ui-widget-content">2.6</td>
		</tr>
	</tbody>
</table>

<div class="ui-widget" style="margin-top:2em; font-family:Arial">
	Log:
	<div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
</div>

</body>
</html>