Skip to content
Permalink
Browse files

Merge remote branch 'origin/tooltip'

Conflicts:
	demos/autocomplete/combobox.html
	demos/index.html
	tests/unit/index.html
  • Loading branch information
jzaefferer committed Dec 22, 2010
2 parents 3552947 + 1fd3419 commit 0479ab6af6414c7a8e779c3cab3e7e8406f9eb62
@@ -271,6 +271,7 @@
<get src="${url}Dialog" dest="${docs.dir}dialog.html" />
<get src="${url}Progressbar" dest="${docs.dir}progressbar.html" />
<get src="${url}Slider" dest="${docs.dir}slider.html" />
<get src="${url}Tooltip" dest="${docs.dir}tooltip.html" />
<get src="${url}Tabs" dest="${docs.dir}tabs.html" />

<get src="${url}Position" dest="${docs.dir}position.html" />
@@ -11,6 +11,7 @@
<script src="../../ui/jquery.ui.position.js"></script>
<script src="../../ui/jquery.ui.menu.js"></script>
<script src="../../ui/jquery.ui.autocomplete.js"></script>
<script src="../../ui/jquery.ui.tooltip.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.ui-button { margin-left: -1px; }
@@ -66,8 +67,10 @@
});
if ( !valid ) {
// remove invalid value, as it didn't match anything
$( this ).val( "" );
select.val( "" );
$(this).val( "").attr( "title", value + " didn't match any item" ).tooltip( "open" );
setTimeout( function() {
input.tooltip( "close" ).attr( "title", "" );
}, 2500 );
input.data( "autocomplete" ).term = "";
return false;
}
@@ -106,6 +109,12 @@
input.autocomplete( "search", "" );
input.focus();
});
input.tooltip( {
position: {
offset: (this.button.width() + 5) + " 0"
}
}).tooltip( "widget" ).addClass( "ui-state-highlight" );
},
destroy: function() {
@@ -28,6 +28,7 @@
<script src="../ui/jquery.ui.sortable.js"></script>
<script src="../ui/jquery.ui.spinner.js"></script>
<script src="../ui/jquery.ui.tabs.js"></script>
<script src="../ui/jquery.ui.tooltip.js"></script>
<script src="../ui/jquery.effects.core.js"></script>
<script src="../ui/jquery.effects.blind.js"></script>
<script src="../ui/jquery.effects.bounce.js"></script>
@@ -276,6 +277,7 @@
<dd><a href="slider/index.html">Slider</a></dd>
<dd><a href="spinner/index.html">Spinner</a></dd>
<dd><a href="tabs/index.html">Tabs</a></dd>
<dd><a href="tooltip/index.html">Tooltip</a></dd>
<dt>Effects</dt>
<dd><a href="animate/index.html">Color Animation</a></dd>
<dd><a href="toggleClass/index.html">Toggle Class</a></dd>
@@ -0,0 +1 @@
<p><strong>This content was loaded via ajax.</strong></p>
@@ -0,0 +1 @@
<p><strong>This other content was loaded via ajax.</strong></p>
@@ -0,0 +1,55 @@
<!doctype html>
<html lang="en">
<head>
<title>jQuery UI Tooltip - Custom animation demo</title>
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery-1.4.4.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.tooltip.js"></script>
<link type="text/css" href="../demos.css" rel="stylesheet" />
<script type="text/javascript">
$(function() {
$(".demo").tooltip({
open: function() {
$(this).tooltip("widget").stop(false, true).hide().slideDown();
},
close: function() {
$(this).tooltip("widget").stop(false, true).show().slideUp();
}
});
});
</script>
<style>
label { display: inline-block; width: 5em; }
</style>
</head>
<body>

<div class="demo">

<p><a href="#" title="That's what this widget is">Tooltips</a> can be attached to any element. When you hover
the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
</p>
<p>But as it's not a native tooltip, it can be styled. Any themes built with
<a href="http://themeroller.com" title="ThemeRoller, jQuery UI's theme builder application">ThemeRoller</a>
will also style tooltip's accordingly.</p>
<p>Tooltip's are also useful for form elements, to show some additional information in the context of each field.</p>
<p><label for="age">Your age:</label><input id="age" title="We ask for your age only for statistical purposes." /></p>
<p>Click the field to see the tooltip; when you tab out of the field, it gets hidden.</p>

</div><!-- End demo -->



<div class="demo-description">

<p>Here the tooltips are positioned relative to the mouse, and follow the mouse while it moves above the element.</p>

</div><!-- End demo-description -->



</body>
</html>
@@ -0,0 +1,48 @@
<!doctype html>
<html lang="en">
<head>
<title>jQuery UI Tooltip - Default demo</title>
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery-1.4.4.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.tooltip.js"></script>
<link type="text/css" href="../demos.css" rel="stylesheet" />
<script type="text/javascript">
$(function() {
$(".demo").tooltip();
});
</script>
<style>
label { display: inline-block; width: 5em; }
</style>
</head>
<body>

<div class="demo">

<p><a href="#" title="That's what this widget is">Tooltips</a> can be attached to any element. When you hover
the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
</p>
<p>But as it's not a native tooltip, it can be styled. Any themes built with
<a href="http://themeroller.com" title="ThemeRoller, jQuery UI's theme builder application">ThemeRoller</a>
will also style tooltip's accordingly.</p>
<p>Tooltip's are also useful for form elements, to show some additional information in the context of each field.</p>
<p><label for="age">Your age:</label><input id="age" title="We ask for your age only for statistical purposes." /></p>
<p>Click the field to see the tooltip; when you tab out of the field, it gets hidden.</p>

</div><!-- End demo -->



<div class="demo-description">

<p>Hover the links above or use the tab key to cycle the focus on each element.</p>

</div><!-- End demo-description -->



</body>
</html>
@@ -0,0 +1,73 @@
<!doctype html>
<html lang="en">
<head>
<title>jQuery UI Tooltip - Default demo</title>
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery-1.4.4.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.tooltip.js"></script>
<link type="text/css" href="../demos.css" rel="stylesheet" />
<script type="text/javascript">
$(function() {
$(".demo").tooltip({
items: "[href], [title]",
content: function(response) {
var href = $(this).attr("href");
if (/^#/.test(href)) {
return $(href).html();
} else if (href) {
$.get(href, response);
return "loading...";
}
return this.title;
}
});
$("#footnotes").hide();
});
</script>
<style>
label { display: inline-block; width: 5em; }
</style>
</head>
<body>

<div class="demo">
<ul>
<li>
<a href="#footnote1">I'm a link to a footnote.</a>
</li>
<li>
<a href="#footnote2">I'm another link to a footnote.</a>
</li>
</ul>
<input title="This is just an input, nothing special" />

<ul>
<li>
<a href="ajax/content1.html">Link to ajax content, with tooltip preview!</a>
</li>
<li>
<a href="ajax/content2.html">Another link to ajax content, with tooltip preview!</a>
</li>
</ul>

<div id="footnotes">
<div id="footnote1">This is <strong>the</strong> footnote, including other elements</div>
<div id="footnote2">This is <strong>the other</strong> footnote, including other elements</div>
</div>
</div><!-- End demo -->



<div class="demo-description">

<p>Show how to combine different event delegated tooltips into a single instance, by customizing the items and content options.</p>

</div><!-- End demo-description -->



</body>
</html>
@@ -0,0 +1,71 @@
<!doctype html>
<html lang="en">
<head>
<title>jQuery UI Tooltip - Default demo</title>
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery-1.4.4.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.tooltip.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
<link type="text/css" href="../demos.css" rel="stylesheet" />
<script type="text/javascript">
$(function() {
$("[title]").tooltip().unbind(".tooltip");
$("<button/>").text("Show help").button().toggle(function() {
$(":ui-tooltip").tooltip("open");
}, function() {
$(":ui-tooltip").tooltip("close");
}).appendTo("form");
});
</script>
<style>
label { display: inline-block; width: 5em; }
.ui-icon { display: inline-block; }
fieldset div {
margin-bottom: 2em;
}
.ui-tooltip { width: 210px; }
</style>
</head>
<body>

<div class="demo">

<form>
<fieldset>
<div>
<label for="firstname">Firstname</label>
<input id="firstname" name="firstname" />
<span title="Please provide your firstname." class="ui-state-default ui-corner-all ui-icon ui-icon-help">?</span>
</div>
<div>
<label for="lastname">Lastname</label>
<input id="lastname" name="lastname" />
<span title="Please provide also your lastname." class="ui-state-default ui-corner-all ui-icon ui-icon-help">?</span>
</div>
<div>
<label for="address">Address</label>
<input id="address" name="address" />
<span title="Your home or work address." class="ui-state-default ui-corner-all ui-icon ui-icon-help">?</span>
</div>
</fieldset>
</form>

</div><!-- End demo -->



<div class="demo-description">

<p>Use the button below to display the help texts. Click again to hide them. Default hover and focus events are removed to show tooltip only programmatically.</p>

<p>A fixed width is defined in CSS to make the tooltips look consistent when displayed all at once.</p>

</div><!-- End demo-description -->



</body>
</html>
@@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<title>jQuery UI Tooltip Demos</title>
<link type="text/css" href="../demos.css" rel="stylesheet" />
</head>
<body>

<div class="demos-nav">
<h4>Examples</h4>
<ul>
<li class="demo-config-on"><a href="default.html">Default functionality</a></li>
<li><a href="forms.html">Forms with tooltips</a></li>
<li><a href="tracking.html">Track the mouse</a></li>
<li><a href="custom-animation.html">Custom animation</a></li>
<li><a href="delegation-mixbag.html">Delegation Mixbag</a></li>
</ul>
</div>

</body>
</html>

0 comments on commit 0479ab6

Please sign in to comment.
You can’t perform that action at this time.