Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:jquery/jquery-ui

  • Loading branch information
maggiewachs committed Apr 16, 2010
2 parents 4ffe074 + d1033cc commit 970ed9a67a533ab44b184babf52100dfbcfa7c96
Showing with 2,156 additions and 1,052 deletions.
  1. +86 −26 build/build.xml
  2. +13 −8 demos/autocomplete/combobox.html
  3. +3 −0 demos/autocomplete/index.html
  4. +75 −0 demos/autocomplete/multiple-remote.html
  5. +69 −0 demos/autocomplete/multiple.html
  6. +3 −4 demos/autocomplete/remote-with-cache.html
  7. +0 −1 demos/autocomplete/remote.html
  8. +15 −13 demos/button/splitbutton.html
  9. +1 −1 demos/draggable/visual-feedback.html
  10. +1 −0 demos/droppable/index.html
  11. +101 −0 demos/droppable/shopping-cart.html
  12. +1 −1 demos/effect/index.html
  13. +57 −0 demos/tabs/cookie.html
  14. +1 −0 demos/tabs/index.html
  15. +45 −19 external/qunit.js
  16. +57 −33 tests/unit/accordion/accordion.html
  17. +0 −11 tests/unit/accordion/accordion_core.js
  18. +14 −42 tests/unit/accordion/accordion_methods.js
  19. +11 −30 tests/unit/accordion/accordion_options.js
  20. +22 −4 tests/unit/autocomplete/autocomplete_events.js
  21. +5 −2 tests/unit/autocomplete/autocomplete_methods.js
  22. +1 −1 tests/unit/autocomplete/autocomplete_options.js
  23. +5 −1 tests/unit/button/button_methods.js
  24. +12 −0 tests/unit/core/core.html
  25. +12 −1 tests/unit/datepicker/datepicker.html
  26. +12 −1 tests/unit/dialog/dialog.html
  27. +12 −1 tests/unit/draggable/draggable.html
  28. +12 −1 tests/unit/droppable/droppable.html
  29. +4 −0 tests/unit/position/position.html
  30. +20 −0 tests/unit/position/position_core.js
  31. +2 −2 tests/unit/progressbar/progressbar_core.js
  32. +12 −1 tests/unit/resizable/resizable.html
  33. +12 −1 tests/unit/selectable/selectable.html
  34. +33 −25 tests/unit/slider/slider_events.js
  35. +44 −5 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. +552 −0 tests/visual/button/button_performance.html
  41. +225 −225 tests/visual/compound/widgets_in_dialog.html
  42. +81 −52 tests/visual/menu/drilldown.html
  43. +28 −47 tests/visual/menu/nested.html
  44. +0 −103 tests/visual/menu/nested2.html
  45. +2 −0 themes/base/jquery.ui.accordion.css
  46. +5 −0 themes/base/jquery.ui.autocomplete.css
  47. +1 −1 themes/base/jquery.ui.tabs.css
  48. +1 −1 ui/i18n/jquery.ui.datepicker-pl.js
  49. +2 −7 ui/jquery.ui.accordion.js
  50. +18 −9 ui/jquery.ui.autocomplete.js
  51. +3 −4 ui/jquery.ui.core.js
  52. +5 −2 ui/jquery.ui.dialog.js
  53. +4 −0 ui/jquery.ui.position.js
  54. +401 −348 ui/jquery.ui.slider.js
  55. +12 −0 ui/jquery.ui.sortable.js
  56. +2 −2 ui/jquery.ui.widget.js
@@ -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,15 +51,14 @@
</target>

<target name="prepend-header">
<!-- TODO: refactor this ugly mess -->
<copy todir="${dist.dir}/headers/">
<fileset dir="${dist.dir}/ui/" includes="*.js" />
</copy>
<replaceregexp match="^(\/\*.*?\*\/\s).+" replace="\1" flags="s">
<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>
@@ -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(),
label: text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + request.term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
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 -->

@@ -16,6 +16,9 @@ <h4>Examples</h4>
<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>
@@ -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>

0 comments on commit 970ed9a

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