2010-03-12 03:18:34 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2010-01-14 17:23:11 +00:00
|
|
|
<head>
|
2010-03-12 03:18:34 +00:00
|
|
|
<meta charset="UTF-8" />
|
2010-01-14 17:23:11 +00:00
|
|
|
<title>Autocomplete Visual Test: Default</title>
|
|
|
|
<link rel="stylesheet" href="../visual.css" type="text/css" />
|
2010-02-16 01:38:23 +00:00
|
|
|
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
|
2011-03-03 02:00:50 +00:00
|
|
|
<script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
|
2010-01-14 17:23:11 +00:00
|
|
|
<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.autocomplete.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();
|
|
|
|
|
|
|
|
function log(message) {
|
|
|
|
$("<div/>").text(message).prependTo("#log");
|
2011-07-29 18:57:06 +00:00
|
|
|
$("#log").scrollTop(0);
|
2010-01-14 17:23:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function enable() {
|
|
|
|
$("#tags").autocomplete({
|
2010-03-20 14:37:18 +00:00
|
|
|
source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"],
|
2010-01-14 17:23:11 +00:00
|
|
|
delay: 0,
|
|
|
|
search: function() {
|
|
|
|
log("Searching for: " + this.value);
|
|
|
|
},
|
|
|
|
open: function() {
|
|
|
|
log("Found something");
|
|
|
|
},
|
|
|
|
focus: function(event, ui) {
|
|
|
|
log("Moving focus to " + ui.item.label);
|
|
|
|
},
|
|
|
|
close: function() {
|
|
|
|
log("Hiding suggestions");
|
|
|
|
},
|
2010-05-15 14:09:12 +00:00
|
|
|
select: function(event, ui) {
|
|
|
|
log("Selected: " + ui.item.value);
|
|
|
|
},
|
2010-01-14 17:23:11 +00:00
|
|
|
change: function(event, ui) {
|
2010-05-15 14:09:12 +00:00
|
|
|
log(ui.item ? ("Changed to: " + ui.item.value) : "Nothing selected, input was " + this.value);
|
2010-01-14 17:23:11 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
enable();
|
|
|
|
$("#toggle").toggle(function() {
|
|
|
|
$("#tags").autocomplete("destroy");
|
|
|
|
}, enable);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div class="ui-widget">
|
|
|
|
<label for="tags">Tags: </label>
|
|
|
|
<input class="ui-widget ui-widget-content ui-corner-all" id="tags" />
|
|
|
|
</div>
|
2010-01-27 17:56:22 +00:00
|
|
|
<div>
|
|
|
|
<label for="tags">Select: </label>
|
|
|
|
<select>
|
|
|
|
<option>label</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2010-01-14 17:23:11 +00:00
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<button id="toggle">Toggle widget</button>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|