|
1 |
| -<!DOCTYPE html> |
| 1 | +<!doctype html> |
2 | 2 | <html lang="en">
|
3 | 3 | <head>
|
4 | 4 | <meta charset="utf-8">
|
5 | 5 | <title>Tooltip Visual Test: Default</title>
|
6 |
| - <link rel="stylesheet" href="../visual.css" type="text/css" /> |
7 |
| - <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css"> |
8 |
| - <script type="text/javascript" src="../../../jquery-1.7.2.js"></script> |
9 |
| - <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> |
10 |
| - <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> |
11 |
| - <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script> |
12 |
| - <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script> |
13 |
| - <script type="text/javascript" src="../../../ui/jquery.ui.tooltip.js"></script> |
14 |
| - <!-- |
15 |
| - <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script> |
16 |
| - --> |
17 |
| - <script type="text/javascript"> |
| 6 | + <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css"> |
| 7 | + <script src="../../../jquery-1.7.2.js"></script> |
| 8 | + <script src="../../../ui/jquery.ui.core.js"></script> |
| 9 | + <script src="../../../ui/jquery.ui.widget.js"></script> |
| 10 | + <script src="../../../ui/jquery.ui.position.js"></script> |
| 11 | + <script src="../../../ui/jquery.ui.button.js"></script> |
| 12 | + <script src="../../../ui/jquery.ui.tooltip.js"></script> |
| 13 | + <style> |
| 14 | + .group { |
| 15 | + margin-top: 2em; |
| 16 | + } |
| 17 | + </style> |
| 18 | + <script> |
18 | 19 | $(function() {
|
19 |
| - $.fn.themeswitcher && $('<div/>').css({ |
20 |
| - position: "absolute", |
21 |
| - right: 10, |
22 |
| - top: 10 |
23 |
| - }).appendTo(document.body).themeswitcher(); |
24 |
| - |
25 |
| - function enable() { |
26 |
| - // default |
27 |
| - $("#context1, form, #childish, #nested-input").tooltip(); |
28 |
| - |
29 |
| - // custom class, replaces ui-widget-content |
30 |
| - $("#context2").tooltip({ |
31 |
| - tooltipClass: "ui-widget-header" |
32 |
| - }); |
33 |
| - $("#right1").tooltip({ |
34 |
| - tooltipClass: "ui-state-error" |
35 |
| - }); |
36 |
| - |
37 |
| - // synchronous content |
38 |
| - $("#footnotes").tooltip({ |
39 |
| - items: "[href^='#']", |
40 |
| - content: function() { |
41 |
| - return $($(this).attr("href")).html(); |
42 |
| - } |
43 |
| - }); |
44 |
| - // asynchronous content |
45 |
| - $("#ajax").tooltip({ |
46 |
| - content: function(response) { |
47 |
| - $.get("ajaxcontent.php", response); |
48 |
| - return "Loading..."; |
49 |
| - } |
50 |
| - }); |
51 |
| - // asynchronous content with caching |
52 |
| - var content; |
53 |
| - $("#ajax2").tooltip({ |
54 |
| - content: function(response) { |
55 |
| - if (content) { |
56 |
| - return content; |
57 |
| - } |
58 |
| - $.ajax({ |
59 |
| - url: "ajaxcontent.php", |
60 |
| - cache: false, |
61 |
| - success: function(result) { |
62 |
| - content = result; |
63 |
| - response(result); |
64 |
| - } |
65 |
| - }); |
66 |
| - return "Loading..."; |
67 |
| - } |
68 |
| - }); |
69 |
| - |
70 |
| - // custom position |
71 |
| - $("#right2").tooltip({ |
72 |
| - tooltipClass: "ui-state-highlight", |
73 |
| - position: { |
74 |
| - my: "center top", |
75 |
| - at: "center bottom", |
76 |
| - offset: "0 10" |
77 |
| - } |
78 |
| - }); |
| 20 | + // default |
| 21 | + $( "#context1, form, #childish, #nested-input" ).tooltip(); |
79 | 22 |
|
80 |
| - $("#button1").button(); |
81 |
| - $("#button2").button({ |
82 |
| - icons: { |
83 |
| - primary: "ui-icon-wrench" |
84 |
| - } |
85 |
| - }); |
86 |
| - $("#button3, #button4").button({ |
87 |
| - icons: { |
88 |
| - primary: "ui-icon-wrench" |
89 |
| - }, |
90 |
| - text: false |
91 |
| - }); |
92 |
| - $("#buttons").tooltip({ |
93 |
| - position: { |
94 |
| - my: "center bottom", |
95 |
| - at: "center top", |
96 |
| - offset: "0 -5" |
| 23 | + // custom class, replaces ui-widget-content |
| 24 | + $( "#context2" ).tooltip({ |
| 25 | + tooltipClass: "ui-widget-header" |
| 26 | + }); |
| 27 | + $( "#right1" ).tooltip({ |
| 28 | + tooltipClass: "ui-state-error" |
| 29 | + }); |
| 30 | + |
| 31 | + // synchronous content |
| 32 | + $( "#footnotes" ).tooltip({ |
| 33 | + items: "[href^='#']", |
| 34 | + content: function() { |
| 35 | + return $( $( this ).attr( "href" ) ).html(); |
| 36 | + } |
| 37 | + }); |
| 38 | + |
| 39 | + // asynchronous content |
| 40 | + $( "#async" ).tooltip({ |
| 41 | + content: function( response ) { |
| 42 | + setTimeout(function() { |
| 43 | + response( "I loaded <strong>asyncrhonously</strong>!" ); |
| 44 | + }, 1000 ); |
| 45 | + return "Loading..."; |
| 46 | + } |
| 47 | + }); |
| 48 | + |
| 49 | + // asynchronous content with caching |
| 50 | + var content; |
| 51 | + $( "#async2" ).tooltip({ |
| 52 | + content: function( response ) { |
| 53 | + if ( content ) { |
| 54 | + return content; |
97 | 55 | }
|
98 |
| - }); |
99 |
| - } |
100 |
| - enable(); |
101 |
| - |
102 |
| - $("#disable").toggle(function() { |
103 |
| - $(":ui-tooltip").tooltip("disable"); |
104 |
| - }, function() { |
105 |
| - $(":ui-tooltip").tooltip("enable"); |
| 56 | + setTimeout(function() { |
| 57 | + content = "<strong>Hello</strong> world!"; |
| 58 | + response( content ); |
| 59 | + }, 1000 ); |
| 60 | + return "Loading..."; |
| 61 | + } |
| 62 | + }); |
| 63 | + |
| 64 | + // custom position |
| 65 | + $( "#right2" ).tooltip({ |
| 66 | + tooltipClass: "ui-state-highlight", |
| 67 | + position: { |
| 68 | + my: "center top", |
| 69 | + at: "center bottom", |
| 70 | + offset: "0 10" |
| 71 | + } |
| 72 | + }); |
| 73 | + |
| 74 | + $( "#button1" ).button(); |
| 75 | + $( "#button2" ).button({ |
| 76 | + icons: { |
| 77 | + primary: "ui-icon-wrench" |
| 78 | + } |
| 79 | + }); |
| 80 | + $( "#button3, #button4" ).button({ |
| 81 | + icons: { |
| 82 | + primary: "ui-icon-wrench" |
| 83 | + }, |
| 84 | + text: false |
106 | 85 | });
|
107 |
| - $("#toggle").toggle(function() { |
108 |
| - $(":ui-tooltip").tooltip("destroy"); |
109 |
| - }, function() { |
110 |
| - enable(); |
| 86 | + $( "#buttons" ).tooltip({ |
| 87 | + position: { |
| 88 | + my: "center bottom", |
| 89 | + at: "center top", |
| 90 | + offset: "0 -5" |
| 91 | + } |
111 | 92 | });
|
112 | 93 | });
|
113 | 94 | </script>
|
114 | 95 | </head>
|
115 | 96 | <body>
|
116 | 97 |
|
117 |
| -<div style="width:300px"> |
118 |
| - <ul id="context1" class="ui-widget ui-widget-header"> |
| 98 | +<div> |
| 99 | + <p>Lots of tooltipped elements close together.<br> |
| 100 | + Mouse through them quickly and slowly.</p> |
| 101 | + <ul id="context1"> |
119 | 102 | <li><a href="#" title="Tooltip text 1">Anchor 1</a></li>
|
120 | 103 | <li><a href="#" title="Tooltip text 2">Anchor 2</a></li>
|
121 | 104 | <li><a href="#" title="Tooltip text 3">Anchor 3</a></li>
|
|
124 | 107 | <li><a href="#" title="Tooltip text 6 more Tooltip text Tooltip text ">Anchor 6</a></li>
|
125 | 108 | </ul>
|
126 | 109 |
|
127 |
| - <div id="right1" style="position: absolute; right: 1em" title="right aligned element"> |
128 |
| - collision detection should kick in around here |
129 |
| - </div> |
130 |
| - |
131 |
| - <div id="footnotes" style="margin: 2em 0"> |
132 |
| - <a href="#footnote1">I'm a link to a footnote.</a> |
133 |
| - <a href="#footnote2">I'm another link to a footnote.</a> |
| 110 | + <div class="group" style="position: absolute; right: 1em; text-align: right;"> |
| 111 | + <p>These elements are right aligned.<br> |
| 112 | + One collides and one uses custom position.</p> |
| 113 | + <p id="right1" title="right aligned element"> |
| 114 | + collision detection should kick in around here |
| 115 | + </p> |
| 116 | + <p id="right2" title="right aligned element with custom position"> |
| 117 | + right aligned with custom position |
| 118 | + </p> |
134 | 119 | </div>
|
135 | 120 |
|
136 |
| - <div id="right2" style="position: absolute; right: 1em" title="right aligned element with custom position"> |
137 |
| - right aligned with custom position |
138 |
| - </div> |
139 |
| - |
140 |
| - <div id="ajax" style="width: 100px;" class="ui-widget-content" title="never be seen"> |
141 |
| - gets its content via ajax |
142 |
| - </div> |
143 |
| - <div id="ajax2" style="width: 100px;" class="ui-widget-content" title="never be seen"> |
144 |
| - gets its content via ajax, caches the response |
| 121 | + <div class="group"> |
| 122 | + <p>These footnotes pull content form the elements they link to.</p> |
| 123 | + <div id="footnotes"> |
| 124 | + <a href="#footnote1">I'm a link to a footnote.</a> |
| 125 | + <a href="#footnote2">I'm another link to a footnote.</a> |
| 126 | + </div> |
145 | 127 | </div>
|
146 | 128 |
|
147 |
| - <div id="context2" class="ui-widget ui-widget-content"> |
148 |
| - <span title="something" style="border:1px solid blue">span</span> |
149 |
| - <div title="something else" style="border:1px solid red;"> |
150 |
| - div |
151 |
| - <span title="something more" style="border:1px solid green;">nested span</span> |
| 129 | + <div class="group"> |
| 130 | + <p>These elements load their content asynchronously.<br> |
| 131 | + There should be a loading message while the content is retrieved.</p> |
| 132 | + <div id="async" style="width: 100px;" class="ui-widget-content" title="never be seen"> |
| 133 | + async |
| 134 | + </div> |
| 135 | + <div id="async2" style="width: 100px;" class="ui-widget-content" title="never be seen"> |
| 136 | + async + cache |
152 | 137 | </div>
|
153 | 138 | </div>
|
154 | 139 |
|
155 |
| - <div id="childish" class="ui-widget ui-widget-content" style="margin: 2em 0; border: 1px solid black;" title="element with child elements"> |
156 |
| - Text in <strong>bold</strong>. |
| 140 | + <div class="group" style="width: 300px;"> |
| 141 | + <p>Nested elements.</p> |
| 142 | + <div id="context2"> |
| 143 | + <div title="something else" style="border:1px solid red;"> |
| 144 | + tooltipped |
| 145 | + <span title="something more" style="border:1px solid green; padding-left: 50px;">nested tooltipped</span> |
| 146 | + </div> |
| 147 | + </div> |
| 148 | + <div id="childish" style="border: 1px solid black;" title="element with child elements"> |
| 149 | + Text in <strong>bold</strong>. |
| 150 | + </div> |
157 | 151 | </div>
|
158 | 152 |
|
159 |
| - <form style="margin: 2em 0;"> |
160 |
| - <div> |
161 |
| - <label for="first">First Name:</label> |
162 |
| - <input id="first" title="Your first name is optional" /> |
163 |
| - </div> |
164 |
| - <div> |
165 |
| - <label for="last">Last Name:</label> |
166 |
| - <input id="last" title="Your last name is optional" /> |
| 153 | + <div class="group"> |
| 154 | + <p>Play around with focusing and hovering of form elements.</p> |
| 155 | + <form> |
| 156 | + <div> |
| 157 | + <label for="first">First Name:</label> |
| 158 | + <input id="first" title="Your first name is optional"> |
| 159 | + </div> |
| 160 | + <div> |
| 161 | + <label for="last">Last Name:</label> |
| 162 | + <input id="last" title="Your last name is optional"> |
| 163 | + </div> |
| 164 | + </form> |
| 165 | + |
| 166 | + <p>Some inputs nested inside labels:</p> |
| 167 | + <div id="nested-input"> |
| 168 | + <label title="test"><input type="checkbox">This is a test</label> |
| 169 | + <label title="test2"><input type="checkbox">This is a test</label> |
| 170 | + <label><input type="checkbox" title="test3">This is a test</label> |
| 171 | + <label><input type="checkbox" title="test4">This is a test</label> |
167 | 172 | </div>
|
168 |
| - </form> |
169 | 173 |
|
170 |
| - <div id="nested-input"> |
171 |
| - <label title="test"><input type="checkbox">This is a test</label> |
172 |
| - <label title="test2"><input type="checkbox">This is a test</label> |
173 |
| - <label><input type="checkbox" title="test3">This is a test</label> |
174 |
| - <label><input type="checkbox" title="test4">This is a test</label> |
| 174 | + <p>Some button widgets:</p> |
| 175 | + <div id="buttons"> |
| 176 | + <button id="button1" title="Button Tooltip">Button Label</button> |
| 177 | + <button id="button2" title="Icon Button">Button with Icon</button> |
| 178 | + <button id="button3">Icon Only Button 1</button> |
| 179 | + <button id="button4">Icon Only Button 2</button> |
| 180 | + </div> |
175 | 181 | </div>
|
176 | 182 |
|
177 |
| - <div id="buttons"> |
178 |
| - <button id="button1" title="Button Tooltip">Button Label</button> |
179 |
| - <button id="button2" title="Icon Button">Button with Icon</button> |
180 |
| - <button id="button3">Icon Only Button 1</button> |
181 |
| - <button id="button4">Icon Only Button 2</button> |
| 183 | + <div class="group"> |
| 184 | + <div id="footnote1">This is <strong>the</strong> footnote, including other elements</div> |
| 185 | + <div id="footnote2">This is <strong>the other</strong> footnote, including other elements</div> |
182 | 186 | </div>
|
183 |
| - |
184 |
| - <div id="footnote1">This is <strong>the</strong> footnote, including other elements</div> |
185 |
| - <div id="footnote2">This is <strong>the other</strong> footnote, including other elements</div> |
186 |
| - |
187 |
| - <button id="disable">Toggle disabled</button> |
188 |
| - <button id="toggle">Toggle widget</button> |
189 | 187 | </div>
|
190 | 188 |
|
191 | 189 | <div style="height: 2000px"></div>
|
|
0 commit comments