Skip to content

Commit 6204e1a

Browse files
committed
The accidental merge of tooltip into master was reverted in master, that revert got merged back into tooltip; now reverting that revert to get the tooltip stuff back, should then make it easy to merge into master once tooltip is done
1 parent 9230b72 commit 6204e1a

File tree

14 files changed

+774
-3
lines changed

14 files changed

+774
-3
lines changed

demos/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<script type="text/javascript" src="../ui/jquery.ui.slider.js"></script>
2626
<script type="text/javascript" src="../ui/jquery.ui.sortable.js"></script>
2727
<script type="text/javascript" src="../ui/jquery.ui.tabs.js"></script>
28+
<script type="text/javascript" src="../ui/jquery.ui.tooltip.js"></script>
2829
<script type="text/javascript" src="../ui/jquery.effects.core.js"></script>
2930
<script type="text/javascript" src="../ui/jquery.effects.blind.js"></script>
3031
<script type="text/javascript" src="../ui/jquery.effects.bounce.js"></script>
@@ -268,6 +269,7 @@
268269
<dd><a href="progressbar/index.html">Progressbar</a></dd>
269270
<dd><a href="slider/index.html">Slider</a></dd>
270271
<dd><a href="tabs/index.html">Tabs</a></dd>
272+
<dd><a href="tooltip/index.html">Tooltip</a></dd>
271273
<dt>Effects</dt>
272274
<dd><a href="animate/index.html">Color Animation</a></dd>
273275
<dd><a href="toggleClass/index.html">Toggle Class</a></dd>

demos/tooltip/default.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>jQuery UI Tooltip - Default demo</title>
5+
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
6+
<script type="text/javascript" src="../../jquery-1.4.2.js"></script>
7+
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
8+
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
9+
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
10+
<script type="text/javascript" src="../../ui/jquery.ui.tooltip.js"></script>
11+
<link type="text/css" href="../demos.css" rel="stylesheet" />
12+
<script type="text/javascript">
13+
$(function() {
14+
$("a, input").tooltip();
15+
});
16+
</script>
17+
<style>
18+
label { display: inline-block; width: 5em; }
19+
</style>
20+
</head>
21+
<body>
22+
23+
<div class="demo">
24+
25+
<p><a href="#" title="That's what this widget is">Tooltips</a> can be attached to any element. When you hover
26+
the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
27+
</p>
28+
<p>But as it's not a native tooltip, it can be styled. Any themes built with
29+
<a href="http://themeroller.com" title="ThemeRoller, jQuery UI's theme builder application">ThemeRoller</a>
30+
will also style tooltip's accordingly.</p>
31+
<p>Tooltip's are also useful for form elements, to show some additional information in the context of each field.</p>
32+
<p><label for="age">Your age:</label><input id="age" title="We ask for your age only for statistical purposes." /></p>
33+
<p>Click the field to see the tooltip; when you tab out of the field, it gets hidden.</p>
34+
35+
</div><!-- End demo -->
36+
37+
38+
39+
<div class="demo-description">
40+
41+
<p>Hover the links above or use the tab key to cycle the focus on each element.</p>
42+
43+
</div><!-- End demo-description -->
44+
45+
46+
47+
</body>
48+
</html>

demos/tooltip/forms.html

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>jQuery UI Tooltip - Default demo</title>
5+
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
6+
<script type="text/javascript" src="../../jquery-1.4.2.js"></script>
7+
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
8+
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
9+
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
10+
<script type="text/javascript" src="../../ui/jquery.ui.tooltip.js"></script>
11+
<script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
12+
<link type="text/css" href="../demos.css" rel="stylesheet" />
13+
<script type="text/javascript">
14+
$(function() {
15+
$("[title]").tooltip();
16+
$("<button/>").text("Show help").button().toggle(function() {
17+
$(":ui-tooltip").tooltip("open");
18+
}, function() {
19+
$(":ui-tooltip").tooltip("close");
20+
}).appendTo("form");
21+
});
22+
</script>
23+
<style>
24+
label { display: inline-block; width: 5em; }
25+
.ui-icon { display: inline-block; }
26+
fieldset div {
27+
margin-bottom: 2em;
28+
}
29+
.ui-tooltip { width: 200px; }
30+
</style>
31+
</head>
32+
<body>
33+
34+
<div class="demo">
35+
36+
<form>
37+
<fieldset>
38+
<div>
39+
<label for="firstname">Firstname</label>
40+
<input id="firstname" name="firstname" />
41+
<span title="Please provide your firstname." class="ui-state-default ui-corner-all ui-icon ui-icon-help">?</span>
42+
</div>
43+
<div>
44+
<label for="lastname">Lastname</label>
45+
<input id="lastname" name="lastname" />
46+
<span title="Please provide also your lastname." class="ui-state-default ui-corner-all ui-icon ui-icon-help">?</span>
47+
</div>
48+
<div>
49+
<label for="address">Address</label>
50+
<input id="address" name="address" />
51+
<span title="Your home or work address." class="ui-state-default ui-corner-all ui-icon ui-icon-help">?</span>
52+
</div>
53+
</fieldset>
54+
</form>
55+
56+
</div><!-- End demo -->
57+
58+
59+
60+
<div class="demo-description">
61+
62+
<p>Hover the questionmark-buttons or use the button below to display the help texts all at once. Click again to hide them.</p>
63+
64+
</div><!-- End demo-description -->
65+
66+
67+
68+
</body>
69+
</html>

demos/tooltip/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>jQuery UI Tooltip Demos</title>
5+
<link type="text/css" href="../demos.css" rel="stylesheet" />
6+
</head>
7+
<body>
8+
9+
<div class="demos-nav">
10+
<h4>Examples</h4>
11+
<ul>
12+
<li class="demo-config-on"><a href="default.html">Default functionality</a></li>
13+
<!--
14+
<li><a href="foo.html">Foo</a></li>
15+
<li><a href="bar.html">Bar</a></li>
16+
-->
17+
</ul>
18+
</div>
19+
20+
</body>
21+
</html>

demos/tooltip/tracking.html

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>jQuery UI Tooltip - Default demo</title>
5+
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
6+
<script type="text/javascript" src="../../jquery-1.4.2.js"></script>
7+
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
8+
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
9+
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
10+
<script type="text/javascript" src="../../ui/jquery.ui.tooltip.js"></script>
11+
<link type="text/css" href="../demos.css" rel="stylesheet" />
12+
<script type="text/javascript">
13+
$(function() {
14+
$("a, input").tooltip({
15+
open: function() {
16+
var tooltip = $(this).tooltip("widget");
17+
$(document).mousemove(function(event) {
18+
tooltip.position({
19+
my: "left center",
20+
at: "right center",
21+
offset: "25 25",
22+
of: event
23+
});
24+
})
25+
// trigger once to override element-relative positioning
26+
.mousemove();
27+
},
28+
close: function() {
29+
$(document).unbind("mousemove");
30+
}
31+
});
32+
});
33+
</script>
34+
<style>
35+
label { display: inline-block; width: 5em; }
36+
</style>
37+
</head>
38+
<body>
39+
40+
<div class="demo">
41+
42+
<p><a href="#" title="That's what this widget is">Tooltips</a> can be attached to any element. When you hover
43+
the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
44+
</p>
45+
<p>But as it's not a native tooltip, it can be styled. Any themes built with
46+
<a href="http://themeroller.com" title="ThemeRoller, jQuery UI's theme builder application">ThemeRoller</a>
47+
will also style tooltip's accordingly.</p>
48+
<p>Tooltip's are also useful for form elements, to show some additional information in the context of each field.</p>
49+
<p><label for="age">Your age:</label><input id="age" title="We ask for your age only for statistical purposes." /></p>
50+
<p>Click the field to see the tooltip; when you tab out of the field, it gets hidden.</p>
51+
52+
</div><!-- End demo -->
53+
54+
55+
56+
<div class="demo-description">
57+
58+
<p>Here the tooltips are positioned relative to the mouse, and follow the mouse while it moves above the element.</p>
59+
60+
</div><!-- End demo-description -->
61+
62+
63+
64+
</body>
65+
</html>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Compound Visual Test : Tabs in Tabs</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.4.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.tooltip.js"></script>
13+
<script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script>
14+
<script type="text/javascript">
15+
$(function() {
16+
$("#tabs").tabs();
17+
$("a").tooltip();
18+
});
19+
</script>
20+
</head>
21+
<body>
22+
23+
<div id="tabs">
24+
<ul>
25+
<li><a href="#tabs-1" title="first tab tooltip">First</a></li>
26+
<li><a href="#tabs-2" title="second tab tooltip">Second</a></li>
27+
</ul>
28+
<div id="tabs-1">
29+
<a href="#" title="title content">label</a>
30+
</div>
31+
<div id="tabs-2">
32+
<a href="#" title="other title content">other label</a>
33+
</div>
34+
</div>
35+
36+
</body>
37+
</html>

tests/visual/compound/widgets_in_dialog.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
<script type="text/javascript" src="../../../ui/jquery.ui.progressbar.js"></script>
2121
<script type="text/javascript" src="../../../ui/jquery.ui.slider.js"></script>
2222
<script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script>
23+
<script type="text/javascript" src="../../../ui/jquery.ui.tooltip.js"></script>
2324
<script type="text/javascript">
2425
$(function() {
26+
$("[title]").tooltip();
27+
2528
$("#accordion").accordion();
2629
$("#autocomplete").autocomplete({
2730
source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"]
@@ -50,7 +53,7 @@
5053
width: 100,
5154
height: 75,
5255
modal: true
53-
})
56+
});
5457
});
5558
</script>
5659
</head>
@@ -76,11 +79,11 @@ <h3><a href="#">Accordion Header 3</a></h3>
7679
<input id="datepicker">
7780
<button>Another button</button>
7881
<div>
79-
<label for="progress">Progress: <input id="progress" /></label>
82+
<label for="progress">Progress: <input title="The progress we made so far" id="progress" /></label>
8083
</div>
8184
<div id="progressbar">
8285
</div>
83-
<div id="slider"></div>
86+
<div id="slider" title="Sliding progress..."></div>
8487
<div id="tabs">
8588
<ul>
8689
<li><a href="#tabs-1">First</a></li>

tests/visual/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ <h2>Composites</h2>
2020
<li><a href="compound/draggable_accordion.html">Draggable Accordion</a></li>
2121
<li><a href="compound/sortable_accordion_sortable_tabs.html">Accordion within Tabs, both Sortable</a></li>
2222
<li><a href="compound/tabs_tabs.html">Tabs contains Tabs</a></li>
23+
<li><a href="compound/tabs_tooltips.html">Tabs with Tooltips</a></li>
2324
<li><a href="compound/widgets_in_dialog.html">All Widgets within a Dialog</a></li>
2425
</ul>
2526

@@ -43,6 +44,7 @@ <h2>Widgets</h2>
4344
<li><a href="progressbar/progressbar.html">Progressbar</a></li>
4445
<li><a href="slider/slider.html">Slider</a></li>
4546
<li><a href="tabs/tabs.html">Tabs</a></li>
47+
<li><a href="tooltip/tooltip.html">Tooltip</a></li>
4648
</ul>
4749

4850
</body>

tests/visual/tooltip/ajaxcontent.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php sleep(1); ?>
2+
<strong>Hello</strong> world!

0 commit comments

Comments
 (0)