Skip to content

Commit

Permalink
Merge commit '1.8.1' into panel
Browse files Browse the repository at this point in the history
  • Loading branch information
rdworth committed Apr 21, 2010
2 parents 76b22c0 + 469d0c5 commit 66f480d
Show file tree
Hide file tree
Showing 54 changed files with 2,207 additions and 782 deletions.
112 changes: 86 additions & 26 deletions build/build.xml
Expand Up @@ -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"/>
Expand All @@ -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">
Expand All @@ -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>
Expand Down Expand Up @@ -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>

Expand Down Expand Up @@ -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>
19 changes: 12 additions & 7 deletions demos/autocomplete/combobox.html
Expand Up @@ -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 + "']")
});

Expand All @@ -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({
Expand All @@ -81,7 +81,10 @@
})(jQuery);

$(function() {
$("select").combobox();
$("#combobox").combobox();
$("#toggle").click(function() {
$("#combobox").toggle();
});
});
</script>
</head>
Expand All @@ -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>
Expand All @@ -107,6 +111,7 @@
<option value="s">scala</option>
</select>
</div>
<button id="toggle">Show underlying select</button>

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

Expand Down
8 changes: 7 additions & 1 deletion demos/autocomplete/custom-data.html
Expand Up @@ -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>
Expand Down
64 changes: 64 additions & 0 deletions 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>
3 changes: 3 additions & 0 deletions demos/autocomplete/index.html
Expand Up @@ -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>
Expand Down

0 comments on commit 66f480d

Please sign in to comment.