Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge commit '1.8.1' into panel

  • Loading branch information...
commit 66f480d9ade5ea3a8c611a0bae86762528a6d15b 2 parents 76b22c0 + 469d0c5
@rdworth rdworth authored
Showing with 2,207 additions and 782 deletions.
  1. +86 −26 build/build.xml
  2. +12 −7 demos/autocomplete/combobox.html
  3. +7 −1 demos/autocomplete/custom-data.html
  4. +64 −0 demos/autocomplete/folding.html
  5. +3 −0  demos/autocomplete/index.html
  6. +75 −0 demos/autocomplete/multiple-remote.html
  7. +69 −0 demos/autocomplete/multiple.html
  8. +3 −4 demos/autocomplete/remote-with-cache.html
  9. +15 −13 demos/button/splitbutton.html
  10. +1 −1  demos/draggable/visual-feedback.html
  11. +1 −0  demos/droppable/index.html
  12. +101 −0 demos/droppable/shopping-cart.html
  13. +1 −1  demos/effect/index.html
  14. +57 −0 demos/tabs/cookie.html
  15. +1 −0  demos/tabs/index.html
  16. +5 −7 external/qunit.js
  17. +172 −0 tests/static/menu/all-menus-icons.html
  18. +27 −4 tests/unit/accordion/accordion.html
  19. +0 −11 tests/unit/accordion/accordion_core.js
  20. +12 −28 tests/unit/accordion/accordion_methods.js
  21. +11 −30 tests/unit/accordion/accordion_options.js
  22. +22 −4 tests/unit/autocomplete/autocomplete_events.js
  23. +4 −0 tests/unit/autocomplete/autocomplete_methods.js
  24. +1 −1  tests/unit/autocomplete/autocomplete_options.js
  25. +4 −0 tests/unit/button/button_methods.js
  26. +12 −1 tests/unit/core/core.html
  27. +12 −1 tests/unit/datepicker/datepicker.html
  28. +12 −1 tests/unit/dialog/dialog.html
  29. +12 −1 tests/unit/draggable/draggable.html
  30. +12 −1 tests/unit/droppable/droppable.html
  31. +2 −0  tests/unit/position/position_core.js
  32. +2 −2 tests/unit/progressbar/progressbar_core.js
  33. +12 −1 tests/unit/resizable/resizable.html
  34. +12 −1 tests/unit/selectable/selectable.html
  35. +37 −4 tests/unit/slider/slider_options.js
  36. +12 −1 tests/unit/sortable/sortable.html
  37. +2 −1  tests/unit/sortable/sortable_methods.js
  38. +12 −1 tests/unit/tabs/tabs.html
  39. +15 −13 tests/unit/tabs/tabs_core.js
  40. +34 −7 tests/unit/tabs/tabs_events.js
  41. +36 −20 tests/unit/tabs/tabs_methods.js
  42. +552 −0 tests/visual/button/button_performance.html
  43. +225 −225 tests/visual/compound/widgets_in_dialog.html
  44. +1 −0  themes/base/jquery.ui.autocomplete.css
  45. +1 −1  themes/base/jquery.ui.tabs.css
  46. +6 −6 ui/i18n/jquery.ui.datepicker-fr-CH.js
  47. +1 −1  ui/i18n/jquery.ui.datepicker-pl.js
  48. +2 −2 ui/jquery.ui.accordion.js
  49. +16 −7 ui/jquery.ui.autocomplete.js
  50. +2 −4 ui/jquery.ui.core.js
  51. +396 −339 ui/jquery.ui.slider.js
  52. +12 −0 ui/jquery.ui.sortable.js
  53. +2 −2 ui/jquery.ui.widget.js
  54. +1 −1  version.txt
View
112 build/build.xml
@@ -22,24 +22,26 @@
<property name="release.filename" value="jquery-ui-${release.version}" />
<property name="dist.dir" value="dist/${release.filename}/" />
+ <property name="cdndist.dir" value="dist/${release.filename}-googlecdn" />
<property name="build.dir" value="build" />
<property name="ui.dir" value="../" />
<property name="src.dir" value="${ui.dir}/ui/" />
<property name="theme.dir" value="${ui.dir}/themes/base/" />
<property name="docs.dir" value="${ui.dir}/docs/" />
- <property name="min.folder" value="${dist.dir}/ui/minified" />
+ <property name="min.dir" value="${dist.dir}/ui/minified" />
<property name="concatenated" value="jquery-ui" />
<property name="concatenated.i18n" value="jquery-ui-i18n" />
<property name="core.files" value="jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.effects.core.js" />
+ <property name="core.files.min" value="jquery.ui.core.min.js, jquery.ui.widget.min.js, jquery.ui.mouse.min.js, jquery.ui.draggable.min.js, jquery.ui.droppable.min.js, jquery.ui.resizable.min.js, jquery.ui.selectable.min.js, jquery.ui.sortable.min.js, jquery.effects.core.min.js" />
<property description="Google Closure" name="closure-jar" value="${build.dir}/google-compiler-20091218.jar" />
- <target name="deploy-release" depends="docs-download, concatenate, minify, copy, replace-version, prepend-header, zip" description="Release builder">
+ <target name="deploy-release" depends="clean, docs-download, concatenate, minify, copy, replace-version, prepend-header, zip, googlecdn" description="Release builder">
</target>
-
+
<target name="replace-version">
<replaceregexp match="@VERSION" replace="${release.version}" flags="g" byline="true">
<fileset dir="${dist.dir}/ui/" includes="*.js"/>
@@ -49,7 +51,6 @@
</target>
<target name="prepend-header">
- <!-- TODO: refactor this ugly mess -->
<copy todir="${dist.dir}/headers/">
<fileset dir="${dist.dir}/ui/" includes="*.js" />
</copy>
@@ -57,7 +58,7 @@
<fileset dir="${dist.dir}/headers/" includes="*.js"/>
</replaceregexp>
<for param="file">
- <path><fileset dir="${dist.dir}/ui/minified/" includes="*.js" /></path>
+ <path><fileset dir="${min.dir}/" includes="*.js" /></path>
<sequential>
<propertyregex override="yes" property="target" input="@{file}" regexp=".*[\\/](.+)\.min\.js$" replace="\1"/>
<concat destfile="${dist.dir}/ui-headered/${target}.min.js">
@@ -66,9 +67,33 @@
</concat>
</sequential>
</for>
- <copy todir="${dist.dir}/ui/minified">
+ <copy todir="${min.dir}">
<fileset dir="${dist.dir}/ui-headered/" includes="*.js" />
</copy>
+
+ <!-- once more for the i18n files -->
+ <!-- need to clean up headers in those files first
+ <copy todir="${dist.dir}/headers/i18n/">
+ <fileset dir="${dist.dir}/ui/i18n/" includes="*.js" />
+ </copy>
+ <replaceregexp match="^(\/\*.*?\*\/\s).+" replace="\1" flags="s">
+ <fileset dir="${dist.dir}/headers/i18n/" includes="*.js"/>
+ </replaceregexp>
+ <for param="file">
+ <path><fileset dir="${min.dir}/i18n/" includes="*.js" /></path>
+ <sequential>
+ <propertyregex override="yes" property="target" input="@{file}" regexp=".*[\\/](.+)\.min\.js$" replace="\1"/>
+ <concat destfile="${dist.dir}/ui-headered/i18n/${target}.min.js">
+ <header file="${dist.dir}/headers/i18n/${target}.js" />
+ <fileset file="@{file}" />
+ </concat>
+ </sequential>
+ </for>
+ <copy todir="${min.dir}/i18n/">
+ <fileset dir="${dist.dir}/ui-headered/i18n/" includes="*.js" />
+ </copy>
+ -->
+
<delete dir="${dist.dir}/headers/" />
<delete dir="${dist.dir}/ui-headered/" />
</target>
@@ -108,45 +133,44 @@
<target name="minify" depends="concatenate" description="Remove all comments and whitespace, no compression, great in combination with GZip">
<echo message="Building minified" />
- <delete dir="${min.folder}/" />
- <mkdir dir="${min.folder}" />
- <delete dir="${min.folder}/i18n/" />
- <mkdir dir="${min.folder}/i18n/" />
+ <delete dir="${min.dir}/" />
+ <mkdir dir="${min.dir}" />
+ <delete dir="${min.dir}/i18n/" />
+ <mkdir dir="${min.dir}/i18n/" />
<apply executable="java" parallel="false">
<fileset dir="${src.dir}/" includes="jquery.ui.*.js, jquery.effects.*.js" />
<arg line="-jar" />
- <arg path="build/google-compiler-20091218.jar" />
+ <arg path="${closure-jar}" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<arg value="--js" />
- <mapper type="glob" from="*.js" to="${min.folder}/*.min.js" />
+ <mapper type="glob" from="*.js" to="${min.dir}/*.min.js" />
</apply>
+
+ <concat destfile="${min.dir}/${concatenated}.min.js">
+ <filelist dir="${min.dir}" files="${core.files.min}" />
+ <fileset dir="${min.dir}" includes="jquery.ui.*.js, jquery.effects.*.js" excludes="${core.files.min}" />
+ </concat>
- <apply executable="java" parallel="false" verbose="true" dest="${dist.dir}">
- <filelist dir="${dist.dir}/ui/" files="${concatenated}.js" />
+ <apply executable="java" parallel="false">
+ <fileset dir="${src.dir}/i18n/" includes="jquery.ui.*.js" />
<arg line="-jar" />
- <arg path="build/google-compiler-20091218.jar" />
+ <arg path="${closure-jar}" />
<arg value="--warning_level" />
<arg value="QUIET" />
<arg value="--js_output_file" />
<targetfile />
<arg value="--js" />
- <mapper type="glob" from="${concatenated}.js" to="tmpmin" />
+ <mapper type="glob" from="*.js" to="${min.dir}/i18n/*.min.js" />
</apply>
- <concat destfile="${min.folder}/jquery-ui.min.js">
- <filelist files="${src.dir}/jquery.ui.core.js, ${dist.dir}/tmpmin"/>
- <filterchain>
- <headfilter lines="9"/>
- </filterchain>
- </concat>
- <concat destfile="${min.folder}/jquery-ui.min.js" append="yes">
- <filelist files="${dist.dir}/tmpmin"/>
+
+ <concat destfile="${min.dir}/i18n/${concatenated.i18n}.min.js">
+ <fileset dir="${min.dir}/i18n" includes="jquery.ui.*.js" />
</concat>
- <delete file="${dist.dir}/tmpmin"/>
-
+
<echo message="Minified ui/ built." />
</target>
@@ -257,5 +281,41 @@
</replaceregexp>
<echo message="All trailing spaces removed." />
</target>
+
+ <target name="googlecdn">
+ <delete dir="${cdndist.dir}" />
+ <mkdir dir="${cdndist.dir}" />
+ <copy todir="${cdndist.dir}">
+ <fileset dir=".." includes="AUTHORS.txt, GPL-LICENSE.txt, MIT-LICENSE.txt, version.txt" />
+ </copy>
+ <copy todir="${cdndist.dir}">
+ <fileset dir="${dist.dir}ui" includes="jquery-ui.js" />
+ <fileset dir="${dist.dir}ui/minified" includes="jquery-ui.min.js" />
+ </copy>
+ <copy todir="${cdndist.dir}/i18n">
+ <fileset dir="${dist.dir}ui/i18n" />
+ <fileset dir="${dist.dir}ui/minified/i18n" />
+ </copy>
+ <copy todir="${cdndist.dir}/themes">
+ <fileset dir="${dist.dir}themes" />
+ </copy>
+ <checksum>
+ <fileset dir="${cdndist.dir}" />
+ </checksum>
+ <for param="file">
+ <path><fileset dir="${cdndist.dir}" includes="**/" excludes="**/*.MD5" /></path>
+ <sequential>
+ <!-- @{file} is an absolute path, use that ugly regexes to make it relative -->
+ <propertyregex override="yes" property="relativepath" input="@{file}" regexp=".+?googlecdn[\\/](.+)$" replace="\1"/>
+ <propertyregex override="yes" property="relativepath" input="${relativepath}" regexp="\\" replace="/" global="true" />
+ <concat destfile="${cdndist.dir}/MANIFEST" append="yes">${relativepath} </concat>
+ <concat destfile="${cdndist.dir}/MANIFEST" append="yes"><file file="@{file}.MD5" /></concat>
+ </sequential>
+ </for>
+ <delete dir="${cdndist.dir}" includes="**/*.MD5" />
+ <zip destfile="${dist.dir}/../${release.filename}-googlecdn.zip">
+ <zipfileset dir="${cdndist.dir}/" />
+ </zip>
+ </target>
</project>
View
19 demos/autocomplete/combobox.html
@@ -30,24 +30,23 @@
var matcher = new RegExp(request.term, "i");
response(select.children("option").map(function() {
var text = $(this).text();
- if (!request.term || matcher.test(text))
+ if (this.value && (!request.term || matcher.test(text)))
return {
- id: $(this).val(),
+ id: this.value,
label: text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
value: text
};
}));
},
delay: 0,
- select: function(e, ui) {
+ change: function(event, ui) {
if (!ui.item) {
// remove invalid value, as it didn't match anything
$(this).val("");
return false;
}
- $(this).focus();
select.val(ui.item.id);
- self._trigger("selected", null, {
+ self._trigger("selected", event, {
item: select.find("[value='" + ui.item.id + "']")
});
@@ -56,6 +55,7 @@
})
.addClass("ui-widget ui-widget-content ui-corner-left");
$("<button>&nbsp;</button>")
+ .attr("tabIndex", -1)
.attr("title", "Show All Items")
.insertAfter(input)
.button({
@@ -81,7 +81,10 @@
})(jQuery);
$(function() {
- $("select").combobox();
+ $("#combobox").combobox();
+ $("#toggle").click(function() {
+ $("#combobox").toggle();
+ });
});
</script>
</head>
@@ -91,7 +94,8 @@
<div class="ui-widget">
<label>Your preferred programming language: </label>
- <select>
+ <select id="combobox">
+ <option value="">Select one...</option>
<option value="a">asp</option>
<option value="c">c</option>
<option value="cpp">c++</option>
@@ -107,6 +111,7 @@
<option value="s">scala</option>
</select>
</div>
+<button id="toggle">Show underlying select</button>
</div><!-- End demo -->
View
8 demos/autocomplete/custom-data.html
@@ -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>
View
64 demos/autocomplete/folding.html
@@ -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>
View
3  demos/autocomplete/index.html
@@ -16,6 +16,9 @@
<li><a href="combobox.html">Combobox</a></li>
<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>
View
75 demos/autocomplete/multiple-remote.html
@@ -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>
View
69 demos/autocomplete/multiple.html
@@ -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>
View
7 demos/autocomplete/remote-with-cache.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",
View
28 demos/button/splitbutton.html
@@ -11,21 +11,23 @@
<link type="text/css" href="../demos.css" rel="stylesheet" />
<script type="text/javascript">
$(function() {
- $("#rerun").button().click(function() {
- alert("Running the last action");
- })
+ $("#rerun")
+ .button()
+ .click( function() {
+ alert( "Running the last action" );
+ })
.next()
- .button({
- text: false,
- icons: {
- primary: "ui-icon-triangle-1-s"
- }
- })
- .click(function() {
- alert("Could display a menu to select an action");
- })
+ .button( {
+ text: false,
+ icons: {
+ primary: "ui-icon-triangle-1-s"
+ }
+ })
+ .click( function() {
+ alert( "Could display a menu to select an action" );
+ })
.parent()
- .buttonset();
+ .buttonset();
});
</script>
<style>
View
2  demos/draggable/visual-feedback.html
@@ -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>
View
1  demos/droppable/index.html
@@ -15,6 +15,7 @@
<li><a href="propagation.html">Prevent propagation</a></li>
<li><a href="visual-feedback.html">Visual feedback</a></li>
<li><a href="revert.html">Revert draggable position</a></li>
+ <li><a href="shopping-cart.html">Shopping Cart</a></li>
<li><a href="photo-manager.html">Simple photo manager</a></li>
</ul>
</div>
View
101 demos/droppable/shopping-cart.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>jQuery UI Droppable - Shopping Cart 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.mouse.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.draggable.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.droppable.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.sortable.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.accordion.js"></script>
+ <link type="text/css" href="../demos.css" rel="stylesheet" />
+ <style type="text/css">
+ h1 { padding: .2em; margin: 0; }
+ #products { float:left; width: 500px; margin-right: 2em; }
+ #cart { width: 200px; float: left; }
+ /* style the list to maximize the droppable hitarea */
+ #cart ol { margin: 0; padding: 1em 0 1em 3em; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $("#catalog").accordion();
+ $("#catalog li").draggable({
+ appendTo: "body",
+ helper: "clone"
+ });
+ $("#cart ol").droppable({
+ activeClass: "ui-state-default",
+ hoverClass: "ui-state-hover",
+ accept: ":not(.ui-sortable-helper)",
+ drop: function(event, ui) {
+ $(this).find(".placeholder").remove();
+ $("<li></li>").text(ui.draggable.text()).appendTo(this);
+ }
+ }).sortable({
+ items: "li:not(.placeholder)",
+ sort: function() {
+ // gets added unintentionally by droppable interacting with sortable
+ // using connectWithSortable fixes this, but doesn't allow you to customize active/hoverClass options
+ $(this).removeClass("ui-state-default");
+ }
+ });
+
+ });
+ </script>
+</head>
+<body>
+<div class="demo">
+
+<div id="products">
+ <h1 class="ui-widget-header">Products</h1>
+ <div id="catalog">
+ <h3><a href="#">T-Shirts</a></h3>
+ <div>
+ <ul>
+ <li>Lolcat Shirt</li>
+ <li>Cheezeburger Shirt</li>
+ <li>Buckit Shirt</li>
+ </ul>
+ </div>
+ <h3><a href="#">Bags</a></h3>
+ <div>
+ <ul>
+ <li>Zebra Striped</li>
+ <li>Black Leather</li>
+ <li>Alligator Leather</li>
+ </ul>
+ </div>
+ <h3><a href="#">Gadgets</a></h3>
+ <div>
+ <ul>
+ <li>iPhone</li>
+ <li>iPod</li>
+ <li>iPad</li>
+ </ul>
+ </div>
+ </div>
+</div>
+
+<div id="cart">
+ <h1 class="ui-widget-header">Shopping Cart</h1>
+ <div class="ui-widget-content">
+ <ol>
+ <li class="placeholder">Add your items here</li>
+ </ol>
+ </div>
+</div>
+
+</div><!-- End demo -->
+
+<div class="demo-description">
+
+<p>Demonstrate how to use an accordion to structure products into a catalog and make use drag and drop for adding
+them to a shopping cart, where they are sortable.</p>
+
+</div><!-- End demo-description -->
+</body>
+</html>
View
2  demos/effect/index.html
@@ -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>
View
57 demos/tabs/cookie.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>jQuery UI Tabs - Default functionality</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="../../external/jquery.cookie.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.tabs.js"></script>
+ <link type="text/css" href="../demos.css" rel="stylesheet" />
+ <script type="text/javascript">
+ $(function() {
+ $("#tabs").tabs({
+ cookie: {
+ // store cookie for a day, without, it would be a session cookie
+ expires: 1
+ }
+ });
+ });
+ </script>
+</head>
+<body>
+
+<div class="demo">
+
+<div id="tabs">
+ <ul>
+ <li><a href="#tabs-1">Nunc tincidunt</a></li>
+ <li><a href="#tabs-2">Proin dolor</a></li>
+ <li><a href="#tabs-3">Aenean lacinia</a></li>
+ </ul>
+ <div id="tabs-1">
+ <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
+ </div>
+ <div id="tabs-2">
+ <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
+ </div>
+ <div id="tabs-3">
+ <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p>
+ <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
+ </div>
+</div>
+
+</div><!-- End demo -->
+
+<div class="demo-description">
+
+<p>Looks the same as the default demo, but uses cookie to store the selected tab, and restore it when the page (re)loads.
+
+The cookie is stored for a day, so tabs will be restored even after closing the browser. Use cookie: {} for using cookies with default options.</p>
+
+</div><!-- End demo-description -->
+
+</body>
+</html>
View
1  demos/tabs/index.html
@@ -17,6 +17,7 @@
<li><a href="sortable.html">Sortable</a></li>
<li><a href="manipulation.html">Simple manipulation</a></li>
<li><a href="bottom.html">Tabs below content</a></li>
+ <li><a href="cookie.html">Cookie persistence</a></li>
</ul>
</div>
View
12 external/qunit.js
@@ -953,16 +953,14 @@ QUnit.jsDump = (function() {
type = "date";
} else if (QUnit.is("Function", obj)) {
type = "function";
- } else if (QUnit.is("Array", obj)) {
- type = "array";
- } else if (QUnit.is("Window", obj) || QUnit.is("global", obj)) {
+ } else if (obj.setInterval && obj.document && !obj.nodeType) {
type = "window";
- } else if (QUnit.is("HTMLDocument", obj)) {
+ } else if (obj.nodeType === 9) {
type = "document";
- } else if (QUnit.is("HTMLCollection", obj) || QUnit.is("NodeList", obj)) {
- type = "nodelist";
- } else if (/^\[object HTML/.test(Object.prototype.toString.call( obj ))) {
+ } else if (obj.nodeType) {
type = "node";
+ } else if (typeof obj === "object" && typeof obj.length === "number" && obj.length >= 0) {
+ type = "array";
} else {
type = typeof obj;
}
View
172 tests/static/menu/all-menus-icons.html
@@ -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>
View
31 tests/unit/accordion/accordion.html
@@ -16,6 +16,29 @@
<script type="text/javascript" src="../../jquery.simulate.js"></script>
<script type="text/javascript" src="../testsuite.js"></script>
+ <script type="text/javascript">
+ $.ui.accordion.prototype.options.animated = false;
+
+ function state(accordion) {
+ var args = $.makeArray(arguments).slice(1);
+ var result = [];
+ $.each(args, function(i, n) {
+ result.push( accordion.find(".ui-accordion-content").eq(i).filter(function() {
+ return $(this).css("display") != "none"
+ }).length ? 1 : 0 );
+ });
+ 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>
<script type="text/javascript" src="accordion_events.js"></script>
@@ -25,7 +48,7 @@
<style>
#main { font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; }
- #navigation * { margin: 0; padding: 0; font-size: 12px; }
+ #list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; }
</style>
</head>
<body>
@@ -41,7 +64,7 @@ <h2 id="qunit-userAgent"></h2>
<div>
<div id="list1" class="foo">
<a class="bar">There is one obvious advantage:</a>
- <div style="" class="foo">
+ <div class="foo">
<p>
You've seen it coming!
<br/>
@@ -51,7 +74,7 @@ <h2 id="qunit-userAgent"></h2>
</p>
</div>
<a class="bar">Now that you've got...</a>
- <div style="" class="foo">
+ <div class="foo">
<p>
your bear, you have to admit it!
<br/>
@@ -62,7 +85,7 @@ <h2 id="qunit-userAgent"></h2>
</p>
</div>
<a class="bar">Rent one bear, ...</a>
- <div style="" class="foo">
+ <div class="foo">
<p>
get two for three beer.
</p>
View
11 tests/unit/accordion/accordion_core.js
@@ -5,17 +5,6 @@
(function($) {
-$.ui.accordion.prototype.options.animated = false;
-
-function state(accordion) {
- var args = $.makeArray(arguments).slice(1);
- var result = [];
- $.each(args, function(i, n) {
- result.push( accordion.find(".ui-accordion-content").eq(i).is(":visible") ? 1 : 0 );
- });
- same(args, result)
-}
-
module("accordion: core");
test("handle click on header-descendant", function() {
View
40 tests/unit/accordion/accordion_methods.js
@@ -3,15 +3,6 @@
*/
(function($) {
-function state(accordion) {
- var expected = $.makeArray(arguments).slice(1);
- var actual = [];
- $.each(expected, function(i, n) {
- actual.push( accordion.find(".ui-accordion-content").eq(i).is(":visible") ? 1 : 0 );
- });
- same(actual, expected)
-}
-
module("accordion: methods");
test("init", function() {
@@ -40,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 );
});
@@ -112,8 +107,7 @@ test("activate, string expression", function() {
ac.accordion("activate", ":last");
state(ac, 0, 0, 1);
});
-//[ 0, 1, 1 ] result: [ 0, 0, 1 ]
-//[ 0, 1, 1] result: [ 0, 0, 1]
+
test("activate, jQuery or DOM element", function() {
var ac = $('#list1').accordion({ active: $("#list1 a:last") });
state(ac, 0, 0, 1);
@@ -124,24 +118,14 @@ test("activate, jQuery or DOM element", function() {
});
test("resize", function() {
- var expected = $('#list1').accordion();
-
- 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());
+ var expected = $('#navigation').parent().height(300).end().accordion({
+ fillSpace: true
});
- same(sizes, sizes2);
+ equalHeights(expected, 246, 258);
- expected.find(".ui-accordion-content:first").height(500)
- var sizes3 = [];
+ expected.parent().height(500);
+ expected.accordion("resize");
+ equalHeights(expected, 446, 458);
});
})(jQuery);
View
41 tests/unit/accordion/accordion_options.js
@@ -3,16 +3,6 @@
*/
(function($) {
-function state(accordion) {
- var expected = $.makeArray(arguments).slice(1);
- var actual = [];
- $.each(expected, function(i, n) {
- actual.push( accordion.find(".ui-accordion-content").eq(i).is(":visible") ? 1 : 0 );
- });
- same(actual, expected)
-}
-
-
module("accordion: options");
test("{ active: first child }, default", function() {
@@ -76,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() {
@@ -105,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() {
View
26 tests/unit/autocomplete/autocomplete_events.js
@@ -12,7 +12,7 @@ module("autocomplete: events", {
var data = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];
test("all events", function() {
- expect(11);
+ expect(12);
var ac = $("#autocomplete").autocomplete({
delay: 0,
source: data,
@@ -34,21 +34,39 @@ test("all events", function() {
same(event.type, "autocompleteselect");
same(ui.item, {label:"java", value:"java"});
},
- change: function(event) {
+ change: function(event, ui) {
same(event.type, "autocompletechange");
+ same(ui.item, {label:"java", value:"java"});
same( $(".ui-menu:visible").length, 0 );
+ start();
}
});
stop();
- ac.val("ja").keydown();
+ ac.focus().val("ja").keydown();
setTimeout(function() {
same( $(".ui-menu:visible").length, 1 );
ac.simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
ac.simulate("keydown", { keyCode: $.ui.keyCode.ENTER });
- start();
+ $.browser.msie ? ac.simulate("blur") : ac.blur();
}, 50);
});
+test("change without selection", function() {
+ expect(2);
+ stop();
+ var ac = $("#autocomplete").autocomplete({
+ delay: 0,
+ source: data,
+ change: function(event, ui) {
+ same(event.type, "autocompletechange");
+ same(ui.item, null);
+ start();
+ }
+ });
+ ac.triggerHandler("focus");
+ ac.val("ja").triggerHandler("blur");
+});
+
test("cancel search", function() {
expect(6);
var first = true;
View
4 tests/unit/autocomplete/autocomplete_methods.js
@@ -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" );
})
View
2  tests/unit/autocomplete/autocomplete_options.js
@@ -120,7 +120,7 @@ function source_test(source, async) {
}
if (async) {
stop();
- setTimeout(result, 100);
+ $(document).one("ajaxStop", result);
} else {
result();
}
View
4 tests/unit/button/button_methods.js
@@ -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 );
});
View
13 tests/unit/core/core.html
@@ -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}
View
13 tests/unit/datepicker/datepicker.html
@@ -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>
View
13 tests/unit/dialog/dialog.html
@@ -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>
View
13 tests/unit/draggable/draggable.html
@@ -13,7 +13,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="draggable_core.js"></script>
<script type="text/javascript" src="draggable_defaults.js"></script>
@@ -21,6 +20,18 @@
<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">
+ // 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>
View
13 tests/unit/droppable/droppable.html
@@ -14,7 +14,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="droppable_core.js"></script>
<script type="text/javascript" src="droppable_defaults.js"></script>
@@ -22,6 +21,18 @@
<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">
+ // 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>
View
2  tests/unit/position/position_core.js
@@ -2,6 +2,8 @@
* position_core.js
*/
(function($) {
+
+module("position");
test('my, at, of', function() {
$('#elx').position({
View
4 tests/unit/progressbar/progressbar_core.js
@@ -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);
View
13 tests/unit/resizable/resizable.html
@@ -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="resizable_core.js"></script>
<script type="text/javascript" src="resizable_defaults.js"></script>
@@ -23,6 +22,18 @@
<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">
+ // 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>
View
13 tests/unit/selectable/selectable.html
@@ -13,7 +13,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="selectable_core.js"></script>
<script type="text/javascript" src="selectable_defaults.js"></script>
@@ -21,6 +20,18 @@
<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">
+ // 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>
View
41 tests/unit/slider/slider_options.js
@@ -88,17 +88,50 @@ test("range", function() {
ok(false, "missing test - untested code is broken code.");
});
+//spec: http://wiki.jqueryui.com/Slider#specs
+// value option/method: the value option is not restricted by min/max/step.
+// What is returned by the value method is restricted by min (>=), max (<=), and step (even multiple)
test("step", function() {
var el = $('<div></div>').slider({
- step: 10
+ min: 0,
+ value: 0,
+ step: 10,
+ max: 100,
});
- equals( el.slider("value"), 0 )
+ equals( el.slider("value"), 0 );
+
el.slider("value", 1);
+ equals( el.slider("value"), 0 );
+
+ el.slider("value", 9);
equals( el.slider("value"), 10 );
- el.slider("value", 10);
- equals( el.slider("value"), 10 );
+
el.slider("value", 11);
+ equals( el.slider("value"), 10 );
+
+ el.slider("value", 19);
equals( el.slider("value"), 20 );
+
+el = $('<div></div>').slider({
+ min: 0,
+ value: 0,
+ step: 20,
+ max: 100,
+ });
+ el.slider("value", 0);
+
+ el.slider("option", "value", 1);
+ equals( el.slider("value"), 0 );
+
+ el.slider("option", "value", 9);
+ equals( el.slider("value"), 0 );
+
+ el.slider("option", "value", 11);
+ equals( el.slider("value"), 20 );
+
+ el.slider("option", "value", 19);
+ equals( el.slider("value"), 20 );
+
el.slider('destroy');
});
View
13 tests/unit/sortable/sortable.html
@@ -13,7 +13,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="sortable_core.js"></script>
<script type="text/javascript" src="sortable_defaults.js"></script>
@@ -21,6 +20,18 @@
<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">
+ // 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>
View
3  tests/unit/sortable/sortable_methods.js
@@ -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(),
View
13 tests/unit/tabs/tabs.html
@@ -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>
View
28 tests/unit/tabs/tabs_core.js
@@ -35,19 +35,21 @@ test('ajax', function() {
selected: 2,
load: function() {
// spinner: default spinner
- equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed");
- equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed");
- el.tabs('destroy');
- el.tabs({
- selected: 2,
- spinner: '<img src="spinner.gif" alt="">',
- load: function() {
- // spinner: image
- equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed");
- equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed");
- start();
- }
- });
+ setTimeout(function() {
+ equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed");
+ equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed");
+ el.tabs('destroy');
+ el.tabs({
+ selected: 2,
+ spinner: '<img src="spinner.gif" alt="">',
+ load: function() {
+ // spinner: image
+ equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed");
+ equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed");
+ start();
+ }
+ });
+ }, 1);
}
});
View
41 tests/unit/tabs/tabs_events.js
@@ -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');