mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Merge commit '1.8.1' into tooltip
This commit is contained in:
commit
cfa185d962
@ -64,7 +64,13 @@
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
})
|
||||
.data( "autocomplete" )._renderItem = function( ul, item ) {
|
||||
return $( "<li></li>" )
|
||||
.data( "item.autocomplete", item )
|
||||
.append( "<a>" + item.label + "<br>" + item.desc + "</a>" )
|
||||
.appendTo( ul );
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
64
demos/autocomplete/folding.html
Normal file
64
demos/autocomplete/folding.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>jQuery UI Autocomplete Accent Folding Demo</title>
|
||||
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
|
||||
<script type="text/javascript" src="../../jquery-1.4.2.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.autocomplete.js"></script>
|
||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var names = [ "Jörn Zaefferer", "Scott González", "John Resig" ];
|
||||
|
||||
var accentMap = {
|
||||
'á':'a',
|
||||
'ö':'o'
|
||||
};
|
||||
var normalize = function( term ) {
|
||||
var ret = '';
|
||||
for ( var i = 0; i < term.length; i++ ) {
|
||||
ret += accentMap[ term.charAt(i) ] || term.charAt(i);
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
$( "#developer" ).autocomplete({
|
||||
source: function( request, response ) {
|
||||
var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
|
||||
response( $.grep( names, function( value ) {
|
||||
value = value.label || value.value || value;
|
||||
return matcher.test( value ) || matcher.test( normalize( value ) );
|
||||
}) );
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="demo">
|
||||
|
||||
<div class="ui-widget">
|
||||
<form>
|
||||
<label for="developer">Developer: </label>
|
||||
<input id="developer" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div><!-- End demo -->
|
||||
|
||||
<div class="demo-description">
|
||||
<p>
|
||||
The autocomplete field uses a custom source option which will match results that have accented characters even when the text field doesn't contain accented characters. However if the you type in accented characters in the text field it is smart enough not to show results that aren't accented.
|
||||
</p>
|
||||
<p>
|
||||
Try typing "Jo" to see "John" and "Jörn", then type "Jö" to see only "Jörn".
|
||||
</p>
|
||||
</div><!-- End demo-description -->
|
||||
|
||||
</body>
|
||||
</html>
|
@ -17,6 +17,8 @@
|
||||
<li><a href="custom-data.html">Custom data and display</a></li>
|
||||
<li><a href="xml.html">XML data parsed once</a></li>
|
||||
<li><a href="categories.html">Categories</a></li>
|
||||
<li><a href="multiple.html">Multiple values</a></li>
|
||||
<li><a href="multiple-remote.html">Multiple, remote</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
75
demos/autocomplete/multiple-remote.html
Normal file
75
demos/autocomplete/multiple-remote.html
Normal file
@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>jQuery UI Autocomplete multiple demo</title>
|
||||
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
|
||||
<script type="text/javascript" src="../../jquery-1.4.2.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.autocomplete.js"></script>
|
||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
function split(val) {
|
||||
return val.split(/,\s*/);
|
||||
}
|
||||
function extractLast(term) {
|
||||
return split(term).pop();
|
||||
}
|
||||
|
||||
$("#birds").autocomplete({
|
||||
source: function(request, response) {
|
||||
$.getJSON("search.php", {
|
||||
term: extractLast(request.term)
|
||||
}, response);
|
||||
},
|
||||
search: function() {
|
||||
// custom minLength
|
||||
var term = extractLast(this.value);
|
||||
if (term.length < 2) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
focus: function() {
|
||||
// prevent value inserted on focus
|
||||
return false;
|
||||
},
|
||||
select: function(event, ui) {
|
||||
var terms = split( this.value );
|
||||
// remove the current input
|
||||
terms.pop();
|
||||
// add the selected item
|
||||
terms.push( ui.item.value );
|
||||
// add placeholder to get the comma-and-space at the end
|
||||
terms.push("");
|
||||
this.value = terms.join(", ");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="demo">
|
||||
|
||||
<div class="ui-widget">
|
||||
<label for="birds">Birds: </label>
|
||||
<input id="birds" size="50" />
|
||||
</div>
|
||||
|
||||
</div><!-- End demo -->
|
||||
|
||||
<div class="demo-description">
|
||||
<p>
|
||||
Usage: Enter at least two characters to get bird name suggestions. Select a value to continue adding more names.
|
||||
</p>
|
||||
<p>
|
||||
This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.
|
||||
</p>
|
||||
</div><!-- End demo-description -->
|
||||
|
||||
</body>
|
||||
</html>
|
69
demos/autocomplete/multiple.html
Normal file
69
demos/autocomplete/multiple.html
Normal file
@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>jQuery UI Autocomplete multiple demo</title>
|
||||
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
|
||||
<script type="text/javascript" src="../../jquery-1.4.2.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.autocomplete.js"></script>
|
||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];
|
||||
function split(val) {
|
||||
return val.split(/,\s*/);
|
||||
}
|
||||
function extractLast(term) {
|
||||
return split(term).pop();
|
||||
}
|
||||
|
||||
$("#tags").autocomplete({
|
||||
minLength: 0,
|
||||
source: function(request, response) {
|
||||
// delegate back to autocomplete, but extract the last term
|
||||
response($.ui.autocomplete.filter(availableTags, extractLast(request.term)));
|
||||
},
|
||||
focus: function() {
|
||||
// prevent value inserted on focus
|
||||
return false;
|
||||
},
|
||||
select: function(event, ui) {
|
||||
var terms = split( this.value );
|
||||
// remove the current input
|
||||
terms.pop();
|
||||
// add the selected item
|
||||
terms.push( ui.item.value );
|
||||
// add placeholder to get the comma-and-space at the end
|
||||
terms.push("");
|
||||
this.value = terms.join(", ");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="demo">
|
||||
|
||||
<div class="ui-widget">
|
||||
<label for="tags">Tag programming languages: </label>
|
||||
<input id="tags" size="50" />
|
||||
</div>
|
||||
|
||||
</div><!-- End demo -->
|
||||
|
||||
<div class="demo-description">
|
||||
<p>
|
||||
Usage: Type something, eg. "j" to see suggestions for tagging with programming languages. Select a value, then continue typing to add more.
|
||||
</p>
|
||||
<p>
|
||||
This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.
|
||||
</p>
|
||||
</div><!-- End demo-description -->
|
||||
|
||||
</body>
|
||||
</html>
|
@ -22,12 +22,11 @@
|
||||
source: function(request, response) {
|
||||
if (cache.term == request.term && cache.content) {
|
||||
response(cache.content);
|
||||
return;
|
||||
}
|
||||
if (new RegExp(cache.term).test(request.term) && cache.content && cache.content.length < 13) {
|
||||
var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
|
||||
response($.grep(cache.content, function(value) {
|
||||
return matcher.test(value.value)
|
||||
}));
|
||||
response($.ui.autocomplete.filter(cache.content, request.term));
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: "search.php",
|
||||
|
@ -27,7 +27,7 @@
|
||||
return $('<div class="ui-widget-header">I\'m a custom helper</div>');
|
||||
}
|
||||
});
|
||||
$("#set div").draggable({ stack: { group: '#set div', min: 1 } });
|
||||
$("#set div").draggable({ stack: '#set div' });
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<h4>Examples</h4>
|
||||
<ul>
|
||||
<li class="demo-config-on"><a href="default.html">Effect showcase</a></li>
|
||||
<li class="demo-config-on"><a href="easing.html">Easing showcase</a></li>
|
||||
<li><a href="easing.html">Easing showcase</a></li>
|
||||
<!-- WIP
|
||||
<li class="demo-config-on"><a href="scale.html">Scale effect</a></li>
|
||||
<li class="demo-config-on"><a href="size.html">Size effect</a></li>
|
||||
|
172
tests/static/menu/all-menus-icons.html
Normal file
172
tests/static/menu/all-menus-icons.html
Normal file
@ -0,0 +1,172 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Menu Static Test : Default</title>
|
||||
<link rel="stylesheet" href="../static.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
|
||||
<script type="text/javascript" src="../../../jquery-1.4.2.js"></script>
|
||||
<script type="text/javascript" src="../static.js"></script>
|
||||
|
||||
<script src="http://jqueryui.com/themeroller/themeswitchertool/" type="text/javascript"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#switcher').themeswitcher();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
/* styles for this page only */
|
||||
.ui-menu { width: 200px; }
|
||||
#flyout .ui-menu { position: relative; }
|
||||
#flyout .ui-menu.ui-menu-icons { position: absolute; }
|
||||
|
||||
.ui-menu.ui-menu-icons { position: relative; }
|
||||
.ui-menu.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
|
||||
|
||||
/* left-aligned icon */
|
||||
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
|
||||
|
||||
/* right-aligned icon */
|
||||
.ui-menu .ui-icon.ui-menu-icon { position: static; float: right; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="switcher" style="position: absolute; top: 20px; right: 20px;"></div>
|
||||
|
||||
|
||||
<!-- NOTES:
|
||||
|
||||
* Added "ui-menu-icons" class to set a left indent value for all menu items in a single menu
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<h2>Default</h2>
|
||||
|
||||
<ul role="menu" aria-activedescendant="ui-active-menuitem" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-bottom">
|
||||
<li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all"><span class="ui-icon ui-icon-print"></span>Aberdeen</a></li>
|
||||
<li class="ui-menu-item" role="menuitem" id="ui-active-menuitem"><a href="#" tabindex="-1" class="ui-state-hover ui-corner-all">Ada</a></li>
|
||||
<li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Adamsville</a></li>
|
||||
<li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all"><span class="ui-icon ui-icon-scissors"></span>Addyston really long menu option to show wrap</a></li>
|
||||
<li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all"><span class="ui-icon ui-icon-wrench"></span>Adelphi</a></li>
|
||||
<li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all"><span class="ui-icon ui-icon-star"></span>Adena</a></li>
|
||||
<li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Adrian</a></li>
|
||||
<li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Akron</a></li>
|
||||
<li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Albany</a></li>
|
||||
</ul>
|
||||
|
||||
<br /><br />
|
||||
|
||||
<div id="drilldown">
|
||||
|
||||
<h2>Drilldown</h2>
|
||||
|
||||
<ul role="listbox" aria-activedescendant="ui-active-menuitem" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
|
||||
<li role="menuitem" class="ui-menu-item">
|
||||
<a href="#" tabindex="-1" class="ui-state-hover ui-corner-all"><span class="ui-icon ui-icon-print"></span><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Amsterdam</a>
|
||||
<ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-widget ui-widget-content ui-corner-all" style="display: none;">
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Aberdeen</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Ada</a></li>
|
||||
<li role="menuitem" class="ui-menu-item">
|
||||
<a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Adamsville</a>
|
||||
<ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-widget ui-widget-content ui-corner-all" style="display: none;">
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Anaheim</a></li>
|
||||
<li role="menuitem" class="ui-menu-item">
|
||||
<a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Cologne</a>
|
||||
<ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-widget ui-widget-content ui-corner-all" style="display: none;">
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mberdeen</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mda</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mdamsville</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mddyston</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mmesville</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Frankfurt</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Addyston</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Amesville</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-star"></span>Anaheim</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-heart"></span>Cologne</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-key"></span>Frankfurt</a></li>
|
||||
<li role="menuitem" class="ui-menu-item">
|
||||
<a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Magdeburg</a>
|
||||
<ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-widget ui-widget-content ui-corner-all" style="display: none;">
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mberdeen</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mda</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mdamsville</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mddyston</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mmesville</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Munich</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Utrecht</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Zurich</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<br /><br />
|
||||
|
||||
<div id="flyout">
|
||||
|
||||
<h2>Flyout / nested</h2>
|
||||
|
||||
<ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all" id="menu">
|
||||
<li role="menuitem" class="ui-menu-item">
|
||||
<a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-scissors"></span>Amsterdam</a>
|
||||
<ul style="display: block; top: 88.5px; left: 205px;" aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Aberdeen</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Ada</a></li>
|
||||
<li role="menuitem" class="ui-menu-item">
|
||||
<a tabindex="-1" class="ui-state-active ui-corner-all" href="#"><span class="ui-icon ui-icon-print"></span><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Adamsville</a>
|
||||
<ul style="display: block; top: 73px; left: -11px; z-index: 9999;" aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Anaheim</a></li>
|
||||
<li role="menuitem" class="ui-menu-item">
|
||||
<a tabindex="-1" class="ui-corner-all" href="#">Cologne</a>
|
||||
<ul style="display: none;" aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mberdeen</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mda</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mdamsville</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mddyston</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mmesville</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-state-hover ui-corner-all" href="#">Frankfurt</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Addyston</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Amesville</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Anaheim</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-pencil"></span>Cologne</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-clock"></span>Frankfurt</a></li>
|
||||
<li role="menuitem" class="ui-menu-item">
|
||||
<a tabindex="-1" class="ui-state-active ui-corner-all" href="#"><span class="ui-icon ui-icon-print"></span><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Magdeburg</a>
|
||||
<ul style="display: none;" aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mberdeen</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mda</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mdamsville</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mddyston</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mmesville</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-lightbulb"></span>Munich</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-clipboard"></span>Utrecht</a></li>
|
||||
<li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Zurich</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -29,6 +29,15 @@
|
||||
});
|
||||
same(args, result)
|
||||
}
|
||||
function equalHeights(accordion, min, max) {
|
||||
var sizes = [];
|
||||
accordion.find(".ui-accordion-content").each(function() {
|
||||
sizes.push($(this).outerHeight());
|
||||
});
|
||||
ok( sizes[0] >= min && sizes[0] <= max, "must be within " + min + " and " + max + ", was " + sizes[0] );
|
||||
same(sizes[0], sizes[1]);
|
||||
same(sizes[0], sizes[2]);
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="accordion_core.js"></script>
|
||||
<script type="text/javascript" src="accordion_defaults.js"></script>
|
||||
@ -55,7 +64,7 @@
|
||||
<div>
|
||||
<div id="list1" class="foo">
|
||||
<a class="bar">There is one obvious advantage:</a>
|
||||
<div style="font-style: normal; " class="foo">
|
||||
<div class="foo">
|
||||
<p>
|
||||
You've seen it coming!
|
||||
<br/>
|
||||
@ -65,7 +74,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<a class="bar">Now that you've got...</a>
|
||||
<div style="font-style: normal; " class="foo">
|
||||
<div class="foo">
|
||||
<p>
|
||||
your bear, you have to admit it!
|
||||
<br/>
|
||||
@ -76,7 +85,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<a class="bar">Rent one bear, ...</a>
|
||||
<div style="font-style: normal; " class="foo">
|
||||
<div class="foo">
|
||||
<p>
|
||||
get two for three beer.
|
||||
</p>
|
||||
|
@ -31,8 +31,12 @@ test("init", function() {
|
||||
});
|
||||
|
||||
test("destroy", function() {
|
||||
var beforeHtml = $("#list1").parent().html();
|
||||
var beforeHtml = $("#list1").find("div").css("font-style", "normal").end().parent().html();
|
||||
var afterHtml = $("#list1").accordion().accordion("destroy").parent().html();
|
||||
// Opera 9 outputs role="" instead of removing the attribute like everyone else
|
||||
if ($.browser.opera) {
|
||||
afterHtml = afterHtml.replace(/ role=""/g, "");
|
||||
}
|
||||
equal( afterHtml, beforeHtml );
|
||||
});
|
||||
|
||||
@ -114,31 +118,14 @@ test("activate, jQuery or DOM element", function() {
|
||||
});
|
||||
|
||||
test("resize", function() {
|
||||
var expected = $('#list1').parent().height(300).end().accordion({
|
||||
var expected = $('#navigation').parent().height(300).end().accordion({
|
||||
fillSpace: true
|
||||
});
|
||||
|
||||
var sizes = [];
|
||||
expected.find(".ui-accordion-content").each(function() {
|
||||
sizes.push($(this).outerHeight());
|
||||
});
|
||||
|
||||
var actual = expected.accordion('resize');
|
||||
equals(actual, expected, 'resize is chainable');
|
||||
|
||||
var sizes2 = [];
|
||||
expected.find(".ui-accordion-content").each(function() {
|
||||
sizes2.push($(this).outerHeight());
|
||||
});
|
||||
same(sizes, [246, 246, 246]);
|
||||
equalHeights(expected, 246, 258);
|
||||
|
||||
expected.parent().height(500);
|
||||
expected.accordion("resize");
|
||||
var sizes2 = [];
|
||||
expected.find(".ui-accordion-content").each(function() {
|
||||
sizes2.push($(this).outerHeight());
|
||||
});
|
||||
same(sizes2, [446, 446, 446]);
|
||||
equalHeights(expected, 446, 458);
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -66,17 +66,18 @@ test("{ active: Number }", function() {
|
||||
});
|
||||
|
||||
test("{ autoHeight: true }, default", function() {
|
||||
$('#navigation').accordion({ autoHeight: true });
|
||||
equals( $('#navigation > li:eq(0) > ul').height(), 126 );
|
||||
equals( $('#navigation > li:eq(1) > ul').height(), 126 );
|
||||
equals( $('#navigation > li:eq(2) > ul').height(), 126 );
|
||||
equalHeights($('#navigation').accordion({ autoHeight: true }), 95, 130);
|
||||
});
|
||||
|
||||
test("{ autoHeight: false }", function() {
|
||||
$('#navigation').accordion({ autoHeight: false });
|
||||
equals( $('#navigation > li:eq(0) > ul').height(), 90 );
|
||||
equals( $('#navigation > li:eq(1) > ul').height(), 126 );
|
||||
equals( $('#navigation > li:eq(2) > ul').height(), 54 );
|
||||
var accordion = $('#navigation').accordion({ autoHeight: false });
|
||||
var sizes = [];
|
||||
accordion.find(".ui-accordion-content").each(function() {
|
||||
sizes.push($(this).height());
|
||||
});
|
||||
ok( sizes[0] >= 70 && sizes[0] <= 90, "was " + sizes[0] );
|
||||
ok( sizes[1] >= 98 && sizes[1] <= 126, "was " + sizes[1] );
|
||||
ok( sizes[2] >= 42 && sizes[2] <= 54, "was " + sizes[2] );
|
||||
});
|
||||
|
||||
test("{ collapsible: false }, default", function() {
|
||||
@ -95,20 +96,10 @@ test("{ collapsible: true }", function() {
|
||||
state(ac, 0, 0, 0);
|
||||
});
|
||||
|
||||
test("{ fillSpace: false }, default", function() {
|
||||
$("#navigationWrapper").height(500);
|
||||
$('#navigation').accordion({ fillSpace: false });
|
||||
equals( $('#navigation > li:eq(0) > ul').height(), 126 );
|
||||
equals( $('#navigation > li:eq(1) > ul').height(), 126 );
|
||||
equals( $('#navigation > li:eq(2) > ul').height(), 126 );
|
||||
});
|
||||
|
||||
// fillSpace: false == autoHeight: true, covered above
|
||||
test("{ fillSpace: true }", function() {
|
||||
$("#navigationWrapper").height(500);
|
||||
$('#navigation').accordion({ fillSpace: true });
|
||||
equals( $('#navigation > li:eq(0) > ul').height(), 446 );
|
||||
equals( $('#navigation > li:eq(1) > ul').height(), 446 );
|
||||
equals( $('#navigation > li:eq(2) > ul').height(), 446 );
|
||||
equalHeights($('#navigation').accordion({ fillSpace: true }), 446, 458);
|
||||
});
|
||||
|
||||
test("{ header: '> li > :first-child,> :not(li):even' }, default", function() {
|
||||
|
@ -47,7 +47,7 @@ test("all events", function() {
|
||||
same( $(".ui-menu:visible").length, 1 );
|
||||
ac.simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
|
||||
ac.simulate("keydown", { keyCode: $.ui.keyCode.ENTER });
|
||||
ac.blur();
|
||||
$.browser.msie ? ac.simulate("blur") : ac.blur();
|
||||
}, 50);
|
||||
});
|
||||
|
||||
@ -63,7 +63,8 @@ test("change without selection", function() {
|
||||
start();
|
||||
}
|
||||
});
|
||||
ac.focus().val("ja").blur();
|
||||
ac.triggerHandler("focus");
|
||||
ac.val("ja").triggerHandler("blur");
|
||||
});
|
||||
|
||||
test("cancel search", function() {
|
||||
|
@ -13,6 +13,10 @@ module("autocomplete: methods", {
|
||||
test("destroy", function() {
|
||||
var beforeHtml = $("#autocomplete").parent().html();
|
||||
var afterHtml = $("#autocomplete").autocomplete().autocomplete("destroy").parent().html();
|
||||
// Opera 9 outputs role="" instead of removing the attribute like everyone else
|
||||
if ($.browser.opera) {
|
||||
afterHtml = afterHtml.replace(/ role=""/g, "");
|
||||
}
|
||||
equal( afterHtml, beforeHtml, "before/after html should be the same" );
|
||||
})
|
||||
|
||||
|
@ -9,6 +9,10 @@ module("button: methods");
|
||||
test("destroy", function() {
|
||||
var beforeHtml = $("#button").parent().html();
|
||||
var afterHtml = $("#button").button().button("destroy").parent().html();
|
||||
// Opera 9 outputs role="" instead of removing the attribute like everyone else
|
||||
if ($.browser.opera) {
|
||||
afterHtml = afterHtml.replace(/ role=""/g, "");
|
||||
}
|
||||
equal( afterHtml, beforeHtml );
|
||||
});
|
||||
|
||||
|
@ -11,11 +11,22 @@
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<script type="text/javascript" src="core.js"></script>
|
||||
<script type="text/javascript" src="selector.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// disable this stale testsuite for testswarm only
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
|
||||
if ( url && url.indexOf("http") == 0 ) {
|
||||
// reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
|
||||
QUnit.init();
|
||||
test("core", function() { ok(true, "disabled core testsuite"); });
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.zindex {z-index: 100}
|
||||
.absolute {position: absolute}
|
||||
|
@ -16,7 +16,6 @@
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<script type="text/javascript" src="datepicker_core.js"></script>
|
||||
<script type="text/javascript" src="datepicker_defaults.js"></script>
|
||||
@ -24,6 +23,18 @@
|
||||
<script type="text/javascript" src="datepicker_methods.js"></script>
|
||||
<script type="text/javascript" src="datepicker_options.js"></script>
|
||||
<script type="text/javascript" src="datepicker_tickets.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// disable this stale testsuite for testswarm only
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
|
||||
if ( url && url.indexOf("http") == 0 ) {
|
||||
// reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
|
||||
QUnit.init();
|
||||
test("datepicker", function() { ok(true, "disabled datepicker testsuite"); });
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<script type="text/javascript" src="dialog_core.js"></script>
|
||||
<script type="text/javascript" src="dialog_defaults.js"></script>
|
||||
@ -27,6 +26,18 @@
|
||||
<script type="text/javascript" src="dialog_methods.js"></script>
|
||||
<script type="text/javascript" src="dialog_options.js"></script>
|
||||
<script type="text/javascript" src="dialog_tickets.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// disable this stale testsuite for testswarm only
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
|
||||
if ( url && url.indexOf("http") == 0 ) {
|
||||
// reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
|
||||
QUnit.init();
|
||||
test("dialog", function() { ok(true, "disabled dialog testsuite"); });
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -13,17 +13,25 @@
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript" src="draggable_core.js"></script>
|
||||
<script type="text/javascript" src="draggable_defaults.js"></script>
|
||||
<script type="text/javascript" src="draggable_events.js"></script>
|
||||
<script type="text/javascript" src="draggable_methods.js"></script>
|
||||
<script type="text/javascript" src="draggable_options.js"></script>
|
||||
<script type="text/javascript" src="draggable_tickets.js"></script>
|
||||
-->
|
||||
<script type="text/javascript">test("draggable", function() { ok(true, "disabled draggable testsuite"); });</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// disable this stale testsuite for testswarm only
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
|
||||
if ( url && url.indexOf("http") == 0 ) {
|
||||
// reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
|
||||
QUnit.init();
|
||||
test("draggable", function() { ok(true, "disabled draggable testsuite"); });
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -14,17 +14,25 @@
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript" src="droppable_core.js"></script>
|
||||
<script type="text/javascript" src="droppable_defaults.js"></script>
|
||||
<script type="text/javascript" src="droppable_events.js"></script>
|
||||
<script type="text/javascript" src="droppable_methods.js"></script>
|
||||
<script type="text/javascript" src="droppable_options.js"></script>
|
||||
<script type="text/javascript" src="droppable_tickets.js"></script>
|
||||
-->
|
||||
<script type="text/javascript">test("droppable", function() { ok(true, "disabled droppable testsuite"); });</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// disable this stale testsuite for testswarm only
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
|
||||
if ( url && url.indexOf("http") == 0 ) {
|
||||
// reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
|
||||
QUnit.init();
|
||||
test("droppable", function() { ok(true, "disabled droppable testsuite"); });
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
* position_core.js
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
module("position");
|
||||
|
||||
test('my, at, of', function() {
|
||||
$('#elx').position({
|
||||
|
@ -21,8 +21,8 @@ test("accessibility", function() {
|
||||
el.progressbar("disable");
|
||||
equals(el.attr("aria-disabled"), "true", "aria-disabled on");
|
||||
el.progressbar("enable");
|
||||
// FAIL: for some reason IE6 returns a boolean false instead of the string
|
||||
equals(el.attr("aria-disabled"), "false", "aria-disabled off");
|
||||
// FAIL: for some reason IE6 and 7 return a boolean false instead of the string
|
||||
equals(el.attr("aria-disabled"), $.browser.msie && $.browser.version == 6 || $.browser.version == 7 ? false : "false", "aria-disabled off");
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -15,17 +15,25 @@
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript" src="resizable_core.js"></script>
|
||||
<script type="text/javascript" src="resizable_defaults.js"></script>
|
||||
<script type="text/javascript" src="resizable_events.js"></script>
|
||||
<script type="text/javascript" src="resizable_methods.js"></script>
|
||||
<script type="text/javascript" src="resizable_options.js"></script>
|
||||
<script type="text/javascript" src="resizable_tickets.js"></script>
|
||||
-->
|
||||
<script type="text/javascript">test("resizable", function() { ok(true, "disabled resizable testsuite"); });</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// disable this stale testsuite for testswarm only
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
|
||||
if ( url && url.indexOf("http") == 0 ) {
|
||||
// reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
|
||||
QUnit.init();
|
||||
test("resizable", function() { ok(true, "disabled resizable testsuite"); });
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -13,17 +13,25 @@
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript" src="selectable_core.js"></script>
|
||||
<script type="text/javascript" src="selectable_defaults.js"></script>
|
||||
<script type="text/javascript" src="selectable_events.js"></script>
|
||||
<script type="text/javascript" src="selectable_methods.js"></script>
|
||||
<script type="text/javascript" src="selectable_options.js"></script>
|
||||
<script type="text/javascript" src="selectable_tickets.js"></script>
|
||||
-->
|
||||
<script type="text/javascript">test("selectable", function() { ok(true, "disabled selectable testsuite"); });</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// disable this stale testsuite for testswarm only
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
|
||||
if ( url && url.indexOf("http") == 0 ) {
|
||||
// reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
|
||||
QUnit.init();
|
||||
test("selectable", function() { ok(true, "disabled selectable testsuite"); });
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -13,17 +13,25 @@
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript" src="sortable_core.js"></script>
|
||||
<script type="text/javascript" src="sortable_defaults.js"></script>
|
||||
<script type="text/javascript" src="sortable_events.js"></script>
|
||||
<script type="text/javascript" src="sortable_methods.js"></script>
|
||||
<script type="text/javascript" src="sortable_options.js"></script>
|
||||
<script type="text/javascript" src="sortable_tickets.js"></script>
|
||||
-->
|
||||
<script type="text/javascript">test("sortable", function() { ok(true, "disabled sortable testsuite"); });</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// disable this stale testsuite for testswarm only
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
|
||||
if ( url && url.indexOf("http") == 0 ) {
|
||||
// reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
|
||||
QUnit.init();
|
||||
test("sortable", function() { ok(true, "disabled sortable testsuite"); });
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -84,7 +84,7 @@ test("enable", function() {
|
||||
});
|
||||
|
||||
test("disable", function() {
|
||||
expect(6);
|
||||
expect(7);
|
||||
el = $("#sortable").sortable({ disabled: false });
|
||||
sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })');
|
||||
|
||||
@ -97,6 +97,7 @@ test("disable", function() {
|
||||
sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })');
|
||||
el.sortable("option", "disabled", true);
|
||||
equals(el.sortable("option", "disabled"), true, "disabled option setter");
|
||||
ok(el.sortable("widget").is(":not(.ui-state-disabled)"), "sortable element does not get ui-state-disabled since it's an interaction");
|
||||
sort($("li", el)[0], 0, 40, 0, '.sortable("option", "disabled", true)');
|
||||
|
||||
var expected = $('<div></div>').sortable(),
|
||||
|
@ -15,7 +15,6 @@
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
|
||||
<script type="text/javascript" src="tabs_core.js"></script>
|
||||
<script type="text/javascript" src="tabs_defaults.js"></script>
|
||||
@ -23,6 +22,18 @@
|
||||
<script type="text/javascript" src="tabs_methods.js"></script>
|
||||
<script type="text/javascript" src="tabs_options.js"></script>
|
||||
<script type="text/javascript" src="tabs_tickets.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// disable this stale testsuite for testswarm only
|
||||
var url = window.location.search;
|
||||
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
|
||||
if ( url && url.indexOf("http") == 0 ) {
|
||||
// reset config to kill previous tests; make sure testsuite.js is loaded afterwards to init the testswarm script
|
||||
QUnit.init();
|
||||
test("tabs", function() { ok(true, "disabled tabs testsuite"); });
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="../testsuite.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -22,15 +22,17 @@ test('show', function() {
|
||||
uiObj = ui;
|
||||
}
|
||||
});
|
||||
ok(uiObj !== undefined, 'should fire show after init');
|
||||
equals(uiObj.tab, $('#tabs1 a')[0], 'should have tab as DOM anchor element');
|
||||
equals(uiObj.panel, $('#tabs1 div')[0], 'should have panel as DOM div element');
|
||||
equals(uiObj.index, 0, 'should have index');
|
||||
|
||||
ok(uiObj !== undefined, 'trigger callback after initialization');
|
||||
equals(uiObj.tab, $('a', el)[0], 'contain tab as DOM anchor element');
|
||||
equals(uiObj.panel, $('div', el)[0], 'contain panel as DOM div element');
|
||||
equals(uiObj.index, 0, 'contain index');
|
||||
|
||||
});
|
||||
|
||||
test('add', function() {
|
||||
|
||||
// TODO move to methods, not at all event related...
|
||||
|
||||
var el = $('<div id="tabs"><ul></ul></div>').tabs();
|
||||
equals(el.tabs('option', 'selected'), -1, 'Initially empty, no selected tab');
|
||||
|
||||
@ -47,11 +49,36 @@ test('remove', function() {
|
||||
});
|
||||
|
||||
test('enable', function() {
|
||||
ok(false, "missing test - untested code is broken code.");
|
||||
expect(4);
|
||||
|
||||
var uiObj;
|
||||
el = $('#tabs1').tabs({
|
||||
disabled: [ 0, 1 ],
|
||||
enable: function (event, ui) {
|
||||
uiObj = ui;
|
||||
}
|
||||
});
|
||||
el.tabs('enable', 1);
|
||||
ok(uiObj !== undefined, 'trigger callback');
|
||||
equals(uiObj.tab, $('a', el)[1], 'contain tab as DOM anchor element');
|
||||
equals(uiObj.panel, $('div', el)[1], 'contain panel as DOM div element');
|
||||
equals(uiObj.index, 1, 'contain index');
|
||||
});
|
||||
|
||||
test('disable', function() {
|
||||
ok(false, "missing test - untested code is broken code.");
|
||||
expect(4);
|
||||
|
||||
var uiObj;
|
||||
el = $('#tabs1').tabs({
|
||||
disable: function (event, ui) {
|
||||
uiObj = ui;
|
||||
}
|
||||
});
|
||||
el.tabs('disable', 1);
|
||||
ok(uiObj !== undefined, 'trigger callback');
|
||||
equals(uiObj.tab, $('a', el)[1], 'contain tab as DOM anchor element');
|
||||
equals(uiObj.panel, $('div', el)[1], 'contain panel as DOM div element');
|
||||
equals(uiObj.index, 1, 'contain index');
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
@ -9,7 +9,7 @@ test('init', function() {
|
||||
expect(9);
|
||||
|
||||
el = $('#tabs1').tabs();
|
||||
|
||||
|
||||
ok(true, '.tabs() called on element');
|
||||
ok( el.is('.ui-tabs.ui-widget.ui-widget-content.ui-corner-all'), 'attach classes to container');
|
||||
ok( $('ul', el).is('.ui-tabs-nav.ui-helper-reset.ui-helper-clearfix.ui-widget-header.ui-corner-all'), 'attach classes to list' );
|
||||
@ -23,32 +23,48 @@ test('init', function() {
|
||||
|
||||
test('destroy', function() {
|
||||
expect(6);
|
||||
|
||||
|
||||
el = $('#tabs1').tabs({ collapsible: true });
|
||||
$('li:eq(2)', el).simulate('mouseover').find('a').focus();
|
||||
el.tabs('destroy');
|
||||
|
||||
|
||||
ok( el.is(':not(.ui-tabs, .ui-widget, .ui-widget-content, .ui-corner-all, .ui-tabs-collapsible)'), 'remove classes from container');
|
||||
ok( $('ul', el).is(':not(.ui-tabs-nav, .ui-helper-reset, .ui-helper-clearfix, .ui-widget-header, .ui-corner-all)'), 'remove classes from list' );
|
||||
ok( $('div:eq(1)', el).is(':not(.ui-tabs-panel, .ui-widget-content, .ui-corner-bottom, .ui-tabs-hide)'), 'remove classes to panel' );
|
||||
ok( $('li:eq(0)', el).is(':not(.ui-tabs-selected, .ui-state-active, .ui-corner-top)'), 'remove classes from active li');
|
||||
ok( $('li:eq(0)', el).is(':not(.ui-tabs-selected, .ui-state-active, .ui-corner-top)'), 'remove classes from active li');
|
||||
ok( $('li:eq(1)', el).is(':not(.ui-state-default, .ui-corner-top)'), 'remove classes from inactive li');
|
||||
ok( $('li:eq(2)', el).is(':not(.ui-state-hover, .ui-state-focus)'), 'remove classes from mouseovered or focused li');
|
||||
});
|
||||
|
||||
test('enable', function() {
|
||||
ok(false, "missing test - untested code is broken code.");
|
||||
expect(2);
|
||||
|
||||
el = $('#tabs1').tabs({ disabled: [ 0, 1 ] });
|
||||
el.tabs("enable", 1);
|
||||
ok( $('li:eq(1)', el).is(':not(.ui-state-disabled)'), 'remove class from li');
|
||||
same(el.tabs('option', 'disabled'), [ ], 'update property');
|
||||
});
|
||||
|
||||
test('disable', function() {
|
||||
ok(false, "missing test - untested code is broken code.");
|
||||
expect(4);
|
||||
|
||||
// normal
|
||||
el = $('#tabs1').tabs();
|
||||
el.tabs('disable', 1);
|
||||
ok( $('li:eq(1)', el).is('.ui-state-disabled'), 'add class to li');
|
||||
same(el.tabs('option', 'disabled'), [ 1 ], 'update disabled property');
|
||||
|
||||
// attempt to disable selected has no effect
|
||||
el.tabs('disable', 0);
|
||||
ok( $('li:eq(0)', el).is(':not(.ui-state-disabled)'), 'not add class to li');
|
||||
same(el.tabs('option', 'disabled'), [ 1 ], 'not update property');
|
||||
});
|
||||
|
||||
test('add', function() {
|
||||
expect(4);
|
||||
|
||||
|
||||
el = $('#tabs1').tabs();
|
||||
el.tabs('add', "#new", 'New');
|
||||
el.tabs('add', '#new', 'New');
|
||||
|
||||
var added = $('li:last', el).simulate('mouseover');
|
||||
ok(added.is('.ui-state-hover'), 'should add mouseover handler to added tab');
|
||||
@ -56,9 +72,9 @@ test('add', function() {
|
||||
var other = $('li:first', el).simulate('mouseover');
|
||||
ok(other.is('.ui-state-hover'), 'should not remove mouseover handler from existing tab');
|
||||
other.simulate('mouseout');
|
||||
|
||||
|
||||
equals($('a', added).attr('href'), '#new', 'should not expand href to full url of current page');
|
||||
|
||||
|
||||
ok(false, "missing test - untested code is broken code.");
|
||||
});
|
||||
|
||||
@ -66,25 +82,25 @@ test('remove', function() {
|
||||
expect(4);
|
||||
|
||||
el = $('#tabs1').tabs();
|
||||
|
||||
|
||||
el.tabs('remove', 0);
|
||||
equals(el.tabs('length'), 2, 'remove tab');
|
||||
equals($('li a[href$="fragment-1"]', el).length, 0, 'remove associated list item');
|
||||
equals($('#fragment-1').length, 0, 'remove associated panel');
|
||||
|
||||
|
||||
// TODO delete tab -> focus tab to right
|
||||
// TODO delete last tab -> focus tab to left
|
||||
|
||||
|
||||
el.tabs('select', 1);
|
||||
el.tabs('remove', 1);
|
||||
equals(el.tabs('option', 'selected'), 0, 'update selected property');
|
||||
equals(el.tabs('option', 'selected'), 0, 'update selected property');
|
||||
});
|
||||
|
||||
test('select', function() {
|
||||
expect(9);
|
||||
|
||||
|
||||
el = $('#tabs1').tabs();
|
||||
|
||||
|
||||
el.tabs('select', 1);
|
||||
equals(el.tabs('option', 'selected'), 1, 'should select tab');
|
||||
|
||||
@ -97,11 +113,11 @@ test('select', function() {
|
||||
el.tabs({ collapsible: true });
|
||||
el.tabs('select', -1);
|
||||
equals(el.tabs('option', 'selected'), -1, 'should collapse tab passing in -1');
|
||||
|
||||
|
||||
el.tabs('destroy');
|
||||
el.tabs({ collapsible: true });
|
||||
el.tabs('select', null);
|
||||
equals(el.tabs('option', 'selected'), -1, 'should collapse tab passing in null (deprecated)');
|
||||
equals(el.tabs('option', 'selected'), -1, 'should collapse tab passing in null (deprecated)');
|
||||
el.tabs('select', null);
|
||||
equals(el.tabs('option', 'selected'), -1, 'should not select tab passing in null a second time (deprecated)');
|
||||
|
||||
@ -113,7 +129,7 @@ test('select', function() {
|
||||
equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true');
|
||||
el.tabs('select', null);
|
||||
equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true');
|
||||
|
||||
|
||||
el.tabs('select', '#fragment-2');
|
||||
equals(el.tabs('option', 'selected'), 1, 'should select tab by id');
|
||||
});
|
||||
@ -128,7 +144,7 @@ test('url', function() {
|
||||
|
||||
test('length', function() {
|
||||
expect(1);
|
||||
|
||||
|
||||
el = $('#tabs1').tabs();
|
||||
equals(el.tabs('length'), $('ul a', el).length, ' should return length');
|
||||
});
|
||||
|
12
ui/i18n/jquery.ui.datepicker-fr-CH.js
vendored
12
ui/i18n/jquery.ui.datepicker-fr-CH.js
vendored
@ -1,15 +1,15 @@
|
||||
/* Swiss-French initialisation for the jQuery UI date picker plugin. */
|
||||
/* Swiss-French initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written Martin Voelkle (martin.voelkle@e-tc.ch). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['fr-CH'] = {
|
||||
closeText: 'Fermer',
|
||||
prevText: '<Préc',
|
||||
prevText: '<Préc',
|
||||
nextText: 'Suiv>',
|
||||
currentText: 'Courant',
|
||||
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
|
||||
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
|
||||
monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
|
||||
'Jul','Aoû','Sep','Oct','Nov','Déc'],
|
||||
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
|
||||
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
|
||||
monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
|
||||
'Jul','Aoû','Sep','Oct','Nov','Déc'],
|
||||
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
|
||||
dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
|
||||
dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
|
||||
|
12
ui/jquery.ui.autocomplete.js
vendored
12
ui/jquery.ui.autocomplete.js
vendored
@ -166,11 +166,7 @@ $.widget( "ui.autocomplete", {
|
||||
if ( $.isArray(this.options.source) ) {
|
||||
array = this.options.source;
|
||||
this.source = function( request, response ) {
|
||||
// escape regex characters
|
||||
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
|
||||
response( $.grep( array, function(value) {
|
||||
return matcher.test( value.label || value.value || value );
|
||||
}) );
|
||||
response( $.ui.autocomplete.filter(array, request.term) );
|
||||
};
|
||||
} else if ( typeof this.options.source === "string" ) {
|
||||
url = this.options.source;
|
||||
@ -308,6 +304,12 @@ $.widget( "ui.autocomplete", {
|
||||
$.extend( $.ui.autocomplete, {
|
||||
escapeRegex: function( value ) {
|
||||
return value.replace( /([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1" );
|
||||
},
|
||||
filter: function(array, term) {
|
||||
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
|
||||
return $.grep( array, function(value) {
|
||||
return matcher.test( value.label || value.value || value );
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
12
ui/jquery.ui.sortable.js
vendored
12
ui/jquery.ui.sortable.js
vendored
@ -73,6 +73,18 @@ $.widget("ui.sortable", $.ui.mouse, {
|
||||
return this;
|
||||
},
|
||||
|
||||
_setOption: function(key, value){
|
||||
if ( key === "disabled" ) {
|
||||
this.options[ key ] = value;
|
||||
|
||||
this.widget()
|
||||
[ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" );
|
||||
} else {
|
||||
// Don't call widget base _setOption for disable as it adds ui-state-disabled class
|
||||
$.Widget.prototype._setOption.apply(self, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
_mouseCapture: function(event, overrideHandle) {
|
||||
|
||||
if (this.reverting) {
|
||||
|
@ -1 +1 @@
|
||||
1.9pre
|
||||
1.8.1
|
Loading…
Reference in New Issue
Block a user