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

This commit is contained in:
maggiewachs 2010-04-16 14:24:49 -04:00
commit 970ed9a67a
56 changed files with 2162 additions and 1058 deletions

View File

@ -22,22 +22,24 @@
<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">
@ -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,44 +133,43 @@
<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>
<apply executable="java" parallel="false" verbose="true" dest="${dist.dir}">
<filelist dir="${dist.dir}/ui/" files="${concatenated}.js" />
<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">
<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 destfile="${min.dir}/i18n/${concatenated.i18n}.min.js">
<fileset dir="${min.dir}/i18n" includes="jquery.ui.*.js" />
</concat>
<concat destfile="${min.folder}/jquery-ui.min.js" append="yes">
<filelist files="${dist.dir}/tmpmin"/>
</concat>
<delete file="${dist.dir}/tmpmin"/>
<echo message="Minified ui/ built." />
</target>
@ -258,4 +282,40 @@
<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 File

@ -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 -->

View File

@ -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 File

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>jQuery UI Autocomplete multiple demo</title>
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery-1.4.2.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
<link type="text/css" href="../demos.css" rel="stylesheet" />
<script type="text/javascript">
$(function() {
function split(val) {
return val.split(/,\s*/);
}
function extractLast(term) {
return split(term).pop();
}
$("#birds").autocomplete({
source: function(request, response) {
$.getJSON("search.php", {
term: extractLast(request.term)
}, response);
},
search: function() {
// custom minLength
var term = extractLast(this.value);
if (term.length < 2) {
return false;
}
},
focus: function() {
// prevent value inserted on focus
return false;
},
select: function(event, ui) {
var terms = split( this.value );
// remove the current input
terms.pop();
// add the selected item
terms.push( ui.item.value );
// add placeholder to get the comma-and-space at the end
terms.push("");
this.value = terms.join(", ");
return false;
}
});
});
</script>
</head>
<body>
<div class="demo">
<div class="ui-widget">
<label for="birds">Birds: </label>
<input id="birds" size="50" />
</div>
</div><!-- End demo -->
<div class="demo-description">
<p>
Usage: Enter at least two characters to get bird name suggestions. Select a value to continue adding more names.
</p>
<p>
This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.
</p>
</div><!-- End demo-description -->
</body>
</html>

View File

@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>jQuery UI Autocomplete multiple demo</title>
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="../../jquery-1.4.2.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
<link type="text/css" href="../demos.css" rel="stylesheet" />
<script type="text/javascript">
$(function() {
var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];
function split(val) {
return val.split(/,\s*/);
}
function extractLast(term) {
return split(term).pop();
}
$("#tags").autocomplete({
minLength: 0,
source: function(request, response) {
// delegate back to autocomplete, but extract the last term
response($.ui.autocomplete.filter(availableTags, extractLast(request.term)));
},
focus: function() {
// prevent value inserted on focus
return false;
},
select: function(event, ui) {
var terms = split( this.value );
// remove the current input
terms.pop();
// add the selected item
terms.push( ui.item.value );
// add placeholder to get the comma-and-space at the end
terms.push("");
this.value = terms.join(", ");
return false;
}
});
});
</script>
</head>
<body>
<div class="demo">
<div class="ui-widget">
<label for="tags">Tag programming languages: </label>
<input id="tags" size="50" />
</div>
</div><!-- End demo -->
<div class="demo-description">
<p>
Usage: Type something, eg. "j" to see suggestions for tagging with programming languages. Select a value, then continue typing to add more.
</p>
<p>
This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.
</p>
</div><!-- End demo-description -->
</body>
</html>

View File

@ -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 File

@ -18,7 +18,6 @@
}
$("#birds").autocomplete({
// TODO doesn't work when loaded from /demos/#autocomplete|remote
source: "search.php",
minLength: 2,
select: function(event, ui) {

View File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -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>

57
demos/tabs/cookie.html Normal file
View File

@ -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 File

@ -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>

58
external/qunit.js vendored
View File

@ -18,6 +18,7 @@ var QUnit = {
stats: { all: 0, bad: 0 },
moduleStats: { all: 0, bad: 0 },
started: +new Date,
updateRate: 1000,
blocking: false,
autorun: false,
assertions: [],
@ -578,7 +579,7 @@ function validTest( name ) {
function push(result, actual, expected, message) {
message = message || (result ? "okay" : "failed");
QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) );
QUnit.ok( result, result ? message + ": " + QUnit.jsDump.parse(expected) : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) );
}
function synchronize( callback ) {
@ -590,8 +591,16 @@ function synchronize( callback ) {
}
function process() {
var start = (new Date()).getTime();
while ( config.queue.length && !config.blocking ) {
config.queue.shift()();
if ( config.updateRate <= 0 || (((new Date()).getTime() - start) < config.updateRate) ) {
config.queue.shift()();
} else {
setTimeout( process, 13 );
break;
}
}
}
@ -679,6 +688,7 @@ QUnit.equiv = function () {
var innerEquiv; // the real equiv function
var callers = []; // stack to decide between skip/abort functions
var parents = []; // stack to avoiding loops from circular referencing
// Determine what is o.
@ -788,7 +798,7 @@ QUnit.equiv = function () {
},
"array": function (b, a) {
var i;
var i, j, loop;
var len;
// b could be an object literal here
@ -800,16 +810,27 @@ QUnit.equiv = function () {
if (len !== b.length) { // safe and faster
return false;
}
//track reference to avoid circular references
parents.push(a);
for (i = 0; i < len; i++) {
if ( ! innerEquiv(a[i], b[i])) {
loop = false;
for(j=0;j<parents.length;j++){
if(parents[j] === a[i]){
loop = true;//dont rewalk array
}
}
if (!loop && ! innerEquiv(a[i], b[i])) {
parents.pop();
return false;
}
}
parents.pop();
return true;
},
"object": function (b, a) {
var i;
var i, j, loop;
var eq = true; // unless we can proove it
var aProperties = [], bProperties = []; // collection of strings
@ -820,18 +841,25 @@ QUnit.equiv = function () {
// stack constructor before traversing properties
callers.push(a.constructor);
//track reference to avoid circular references
parents.push(a);
for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
loop = false;
for(j=0;j<parents.length;j++){
if(parents[j] === a[i])
loop = true; //don't go down the same path twice
}
aProperties.push(i); // collect a's properties
if ( ! innerEquiv(a[i], b[i])) {
if (!loop && ! innerEquiv(a[i], b[i])) {
eq = false;
break;
}
}
callers.pop(); // unstack, we are done
parents.pop();
for (i in b) {
bProperties.push(i); // collect b's properties
@ -925,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;
}
@ -1032,9 +1058,9 @@ QUnit.jsDump = (function() {
name:'name',
'class':'className'
},
HTML:true,//if true, entities are escaped ( <, >, \t, space and \n )
HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
indentChar:' ',//indentation unit
multiline:true //if true, items in a collection, are separated by a \n, else just a space.
multiline:false //if true, items in a collection, are separated by a \n, else just a space.
};
return jsDump;

View File

@ -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,8 +48,7 @@
<style>
#main { font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; }
#main h2 { margin: 0; }
#main ul, #main li { padding: 0; }
#list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; }
</style>
</head>
<body>
@ -39,37 +61,39 @@
<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
<div id="list1">
<a>There is one obvious advantage:</a>
<div>
<p>
You've seen it coming!
<br/>
Buy now and get nothing for free!
<br/>
Well, at least no free beer. Perhaps a bear, if you can afford it.
</p>
</div>
<a>Now that you've got...</a>
<div>
<p>
your bear, you have to admit it!
<br/>
No, we aren't selling bears.
</p>
<p>
We could talk about renting one.
</p>
</div>
<a>Rent one bear, ...</a>
<div>
<p>
get two for three beer.
</p>
<p>
And now, for something completely different.
</p>
</div>
<div>
<div id="list1" class="foo">
<a class="bar">There is one obvious advantage:</a>
<div class="foo">
<p>
You've seen it coming!
<br/>
Buy now and get nothing for free!
<br/>
Well, at least no free beer. Perhaps a bear, if you can afford it.
</p>
</div>
<a class="bar">Now that you've got...</a>
<div class="foo">
<p>
your bear, you have to admit it!
<br/>
No, we aren't selling bears.
</p>
<p>
We could talk about renting one.
</p>
</div>
<a class="bar">Rent one bear, ...</a>
<div class="foo">
<p>
get two for three beer.
</p>
<p>
And now, for something completely different.
</p>
</div>
</div>
</div>
<div id="navigationWrapper">

View File

@ -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 File

@ -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,21 +31,13 @@ test("init", function() {
});
test("destroy", function() {
$("<div></div>").appendTo('body').accordion().accordion("destroy").remove();
ok(true, '.accordion("destroy") called on element');
$([]).accordion().accordion("destroy").remove();
ok(true, '.accordion("destroy") called on empty collection');
$('<div></div>').accordion().accordion("destroy").remove();
ok(true, '.accordion("destroy") called on disconnected DOMElement');
$('<div></div>').accordion().accordion("destroy").accordion("foo").remove();
ok(true, 'arbitrary method called after destroy');
var expected = $('<div></div>').accordion(),
actual = expected.accordion('destroy');
equals(actual, expected, 'destroy is chainable');
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 );
});
test("enable", function() {
@ -124,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);
@ -136,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 expected = $('#navigation').parent().height(300).end().accordion({
fillSpace: true
});
equalHeights(expected, 246, 258);
var actual = expected.accordion('resize');
equals(actual, expected, 'resize is chainable');
var sizes2 = [];
expected.find(".ui-accordion-content").each(function() {
sizes2.push($(this).outerHeight());
});
same(sizes, sizes2);
expected.find(".ui-accordion-content:first").height(500)
var sizes3 = [];
expected.parent().height(500);
expected.accordion("resize");
equalHeights(expected, 446, 458);
});
})(jQuery);

View File

@ -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(), 362 );
equals( $('#navigation > li:eq(1) > ul').height(), 362 );
equals( $('#navigation > li:eq(2) > ul').height(), 362 );
equalHeights($('#navigation').accordion({ fillSpace: true }), 446, 458);
});
test("{ header: '> li > :first-child,> :not(li):even' }, default", function() {

View File

@ -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 File

@ -13,8 +13,11 @@ module("autocomplete: methods", {
test("destroy", function() {
var beforeHtml = $("#autocomplete").parent().html();
var afterHtml = $("#autocomplete").autocomplete().autocomplete("destroy").parent().html();
// TODO can't use same, as that would insert the markup unescaped into the test results, screwing up other tests
ok( beforeHtml == afterHtml );
// 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" );
})
var data = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];

View File

@ -120,7 +120,7 @@ function source_test(source, async) {
}
if (async) {
stop();
setTimeout(result, 100);
$(document).one("ajaxStop", result);
} else {
result();
}

View File

@ -9,7 +9,11 @@ module("button: methods");
test("destroy", function() {
var beforeHtml = $("#button").parent().html();
var afterHtml = $("#button").button().button("destroy").parent().html();
same( beforeHtml, afterHtml );
// Opera 9 outputs role="" instead of removing the attribute like everyone else
if ($.browser.opera) {
afterHtml = afterHtml.replace(/ role=""/g, "");
}
equal( afterHtml, beforeHtml );
});
})(jQuery);

View File

@ -15,6 +15,18 @@
<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 File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -43,5 +43,9 @@
<div style="position: absolute; height: 5000px; width: 5000px;"></div>
<div id="bug-5280" style="height: 30px; width: 201px;">
<div style="width: 50px; height: 10px;"></div>
</div>
</body>
</html>

View File

@ -3,6 +3,8 @@
*/
(function($) {
module("position");
test('my, at, of', function() {
$('#elx').position({
my: 'left top',
@ -330,4 +332,22 @@ test("collision: none, with offset", function() {
}, { top: -13, left: -12 }, "left top, negative offset");
});
//test('bug #5280: consistent results (avoid fractional values)', function() {
// var wrapper = $('#bug-5280'),
// elem = wrapper.children(),
// offset1 = elem.position({
// my: 'center',
// at: 'center',
// of: wrapper,
// collision: 'none'
// }).offset(),
// offset2 = elem.position({
// my: 'center',
// at: 'center',
// of: wrapper,
// collision: 'none'
// }).offset();
// same(offset1, offset2);
//});
})(jQuery);

View File

@ -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 File

@ -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 File

@ -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 File

@ -3,45 +3,54 @@
*/
(function($) {
var el;
module( "slider: events" );
test( "start", function() {
ok( false, "missing test - untested code is broken code." );
});
test( "slide", function() {
ok( false, "missing test - untested code is broken code." );
});
//Specs from http://wiki.jqueryui.com/Slider#specs
//"change callback: triggers when the slider has stopped moving and has a new
// value (even if same as previous value), via mouse(mouseup) or keyboard(keyup)
// or value method/option"
test( "change", function() {
expect(8);
test( "mouse based interaction", function() {
expect(4);
var handle;
// Test mouseup at end of handle slide (mouse)
el = $( "<div></div>" )
var el = $( "<div></div>" )
.appendTo( "body" )
.slider({
start: function(event, ui) {
equals( event.originalEvent.type, "mousedown", "start triggered by mousedown" );
},
slide: function(event, ui) {
equals( event.originalEvent.type, "mousemove", "slider triggered by mousemove" );
},
stop: function(event, ui) {
equals( event.originalEvent.type, "mouseup", "stop triggered by mouseup" );
},
change: function(event, ui) {
ok( true, "change triggered by mouseup at end of handle slide (mouse)" );
equals( event.originalEvent.type, "mouseup", "change triggered by mouseup" );
}
});
el.find( ".ui-slider-handle" ).eq( 0 )
.simulate( "drag", { dx: 10, dy: 10 } );
reset();
});
test( "keyboard based interaction", function() {
expect(3);
// Test keyup at end of handle slide (keyboard)
el = $( "<div></div>" )
var el = $( "<div></div>" )
.appendTo( "body" )
.slider({
start: function(event, ui) {
equals( event.originalEvent.type, "keydown", "start triggered by keydown" );
},
slide: function(event, ui) {
ok( false, "Slider never triggered by keys" );
},
stop: function(event, ui) {
equals( event.originalEvent.type, "keyup", "stop triggered by keyup" );
},
change: function(event, ui) {
ok( true, "change triggered by keyup at end of handle slide (keyboard)" );
equals( event.originalEvent.type, "keyup", "change triggered by keyup" );
}
});
@ -50,9 +59,12 @@ test( "change", function() {
.simulate( "keypress", { keyCode: $.ui.keyCode.LEFT } )
.simulate( "keyup", { keyCode: $.ui.keyCode.LEFT } );
reset();
});
test( "programmatic event triggers", function() {
expect(6);
// Test value method
el = $( "<div></div>" )
var el = $( "<div></div>" )
.slider({
change: function(event, ui) {
ok( true, "change triggered by value method" );
@ -94,8 +106,4 @@ test( "change", function() {
});
test( "stop", function() {
ok( false, "missing test - untested code is broken code." );
});
}( jQuery ) );

View File

@ -11,10 +11,6 @@ function handle() {
module("slider: options");
test("animate", function() {
ok(false, "missing test - untested code is broken code.");
});
test("max", function() {
el = $('<div></div>');
@ -92,8 +88,51 @@ 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() {
ok(false, "missing test - untested code is broken code.");
var el = $('<div></div>').slider({
min: 0,
value: 0,
step: 10,
max: 100,
});
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", 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');
});
test("value", function() {

View File

@ -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 File

@ -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 File

@ -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 File

@ -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 File

@ -0,0 +1,552 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Button Visual push: Default</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
<style type="text/css">
#toolbar { margin-top: 2em; padding:0.2em; }
#ops1, #ops2, #format, #mode { margin-right: 1em }
</style>
<script type="text/javascript" src="../../../jquery-1.4.2.js"></script>
<script type="text/javascript" src="../../../external/jquery.metadata.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.button.js"></script>
<script type="text/javascript">
$(function() {
$("button").button();
});
</script>
</head>
<body>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
<button>Simple button, only text</button>
<button class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with icon only</button>
<button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with icon on the left</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}}}">Button with two icons</button>
<button class="{button:{icons:{primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'},text:false}}">Button with two icons</button>
</body>
</html>

View File

@ -8,93 +8,120 @@
<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.button.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.autocomplete.js"></script>
<script type="text/javascript">
$(function() {
$.widget("ui.drilldown", {
_init: function() {
var self = this;
this.active = this.element;
this.active = this.element.find(">ul").attr("tabindex", 0);
// hide submenus and create indicator icons
this.element.find("ul").hide().prev("a").prepend('<span class="ui-icon ui-icon-carat-1-e"></span>').end().filter(":first").show();
this.element.find("ul").menu({
focus: function(event, ui) {
self.activeItem = ui.item;
},
selected: function(event, ui) {
var nested = $(">ul", ui.item);
if (!nested.length) {
self.element.find("h3").text(ui.item.text());
self.options.selected.apply(this, arguments);
if (this != self.active[0]) {
return;
}
self.active = ui.item.parent();
// put a previous submenu back into its place and hide it
self.hideDown();
var nested = $(">ul", ui.item);
if (nested.length) {
// append to body in order to display the submenu above the parent menu, instead of inside of it
nested.appendTo(document.body).menu("deactivate").show().position({
my: "left top",
at: "left top",
of: self.element.children("ul:first")
// store the current submenu
}).data("menuparent", ui.item);
self.active.data("submenu", nested);
self._open(nested);
} else {
self.element.find("h3").text(ui.item.text());
self.options.selected.apply(this, arguments);
}
}
});
this.back = this.element.children(":last").button({
icons: {
primary: "ui-icon-carat-1-w"
}
}).click(function() {
self.up();
return false;
}).hide();
},
_open: function(submenu) {
this.active = submenu.show().css({
top: 0,
left: 0,
opacity: 0
}).position({
my: "left top",
at: "right top",
of: this.widget()
}).position({
my: "left top",
at: "left top",
of: this.widget(),
using: function(to) {
$(this).animate({
left: to.left,
top: to.top,
opacity: 1
});
}
});
this.back.show();
},
up: function() {
if (!this.active.data("menuparent"))
if (this.active.parent()[0] == this.element[0]) {
return;
this.hideDown();
this.active.menu("deactivate");
this.active = this.active.data("menuparent").parent();
},
down: function() {
var submenu = this.active.data("submenu");
if (!submenu)
return;
submenu.data("menu").activate(submenu.children(":first"))
this.active = submenu;
},
show: function() {
this.element.menu("deactivate").show();
this.active = this.element;
},
hide: function() {
this.hideDown();
var child = this.active.hide(), parent;
while(child.data("menuparent")) {
parent = child.data("menuparent");
child.appendTo(parent).removeData("menuparent");
child = parent.parent().removeData("submenu").hide();
}
this.active.position({
my: "left top",
at: "right top",
of: this.widget(),
using: function(to) {
$(this).animate({
left: to.left,
top: to.top,
opacity: 0
});
}
});
this.active = this.active.parent().parent().show();
this.activeItem = this.active.data("menu").active;
if (!this.active.parent().parent().is(":ui-menu")) {
this.back.hide();
}
},
hideDown: function() {
var submenu = this.active.data("submenu");
while(submenu) {
var parent = submenu.data("menuparent");
submenu.appendTo(parent).hide().removeData("menuparent");
parent.parent().removeData("submenu");
submenu = submenu.data("submenu");
};
down: function(event) {
var nested = this.activeItem.find(">ul");
if (nested.length) {
this._open(nested);
nested.menu("activate", event, nested.children(":first"))
}
},
show: function() {
},
hide: function() {
},
widget: function() {
return this.element.find(">ul");
}
});
var nestedmenu = $("#drilldown").drilldown({
var drilldown = $("#drilldown").drilldown({
selected: function(event, ui) {
$("#log").append("<div>Selected " + ui.item.text() + "</div>");
}
});
$().keydown(function(event) {
var menu = nestedmenu.data("drilldown").active.data("menu");
drilldown.drilldown("widget").keydown(function(event) {
var menu = drilldown.data("drilldown").active.data("menu");
if (menu.widget().is(":hidden"))
return;
event.stopPropagation();
@ -109,10 +136,10 @@
menu.previous();
break;
case $.ui.keyCode.LEFT:
nestedmenu.nestedmenu("up");
drilldown.drilldown("up");
break;
case $.ui.keyCode.RIGHT:
nestedmenu.nestedmenu("down");
drilldown.drilldown("down");
break;
case $.ui.keyCode.DOWN:
menu.next();
@ -121,11 +148,11 @@
case $.ui.keyCode.ENTER:
case $.ui.keyCode.TAB:
menu.select();
nestedmenu.nestedmenu("hide");
drilldown.drilldown("hide");
event.preventDefault();
break;
case $.ui.keyCode.ESCAPE:
nestedmenu.nestedmenu("hide");
drilldown.drilldown("hide", event);
break;
default:
clearTimeout(menu.filterTimer);
@ -149,7 +176,7 @@
});
}
if (match.length) {
menu.activate(match);
menu.activate(event, match);
if (match.length > 1) {
menu.previousFilter = character;
menu.filterTimer = setTimeout(function() {
@ -168,6 +195,7 @@
<style>
body { font-size:62.5%; }
.ui-menu { width: 200px; height: 170px; }
.ui-menu .ui-menu { position: absolute; }
.ui-menu .ui-icon { float: right; }
</style>
</head>
@ -219,6 +247,7 @@
<li><a href="#">Utrecht</a></li>
<li><a href="#">Zurich</a></li>
</ul>
<a href="#">Go back</a>
</div>
<div class="ui-widget" style="margin-top:2em; font-family:Arial">

View File

@ -9,8 +9,16 @@
<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.autocomplete.js"></script>
<script type="text/javascript" src="../../../external/jquery.bgiframe-2.1.1.js"></script>
<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
<script type="text/javascript">
$(function() {
$.fn.themeswitcher && $('<div/>').css({
position: "absolute",
right: 10,
top: 10
}).appendTo(document.body).themeswitcher();
$.widget("ui.nestedmenu", {
_init: function() {
var self = this;
@ -24,77 +32,46 @@
focus: function(event, ui) {
self.active = ui.item.parent();
self.activeItem = ui.item;
// put a previous submenu back into its place and hide it
self.hideDown();
ui.item.parent().find("ul").hide();
var nested = $(">ul", ui.item);
// only for mouse-events (should actually check event.originalEvent.type, but for keys, originalEvent is undefined...)
if (nested.length && /^mouse/.test(event.originalEvent.type)) {
self._openSubmenu(nested, ui.item);
self._open(nested);
}
}
})
},
_openSubmenu: function(nested, item) {
// append to body in order to display the submenu above the parent menu, instead of inside of it
nested.appendTo(document.body).menu("deactivate").show().position({
_open: function(submenu) {
submenu.show().css({
top: 0,
left: 0
}).position({
my: "left top",
at: "right top",
of: item
// store the current submenu
}).data("menuparent", item);
this.active.data("submenu", nested);
of: this.activeItem
});
},
up: function(event) {
if (!this.active.data("menuparent"))
return;
this.active.menu("deactivate");
this.active = this.active.data("menuparent").parent();
this.active = this.active.menu("deactivate").hide().parent().parent();
this.activeItem = this.active.data("menu").active;
this.hideDown();
},
down: function(event) {
var submenu = this.active.data("submenu");
if (!submenu && this.activeItem) {
// try to open submenu or return(?); only mouseover opens submenu directly, key doesn't
var item = this.activeItem,
nested = item.children("ul");
if (!nested.length)
return;
this._openSubmenu(nested, item);
submenu = this.active.data("submenu");
}
submenu.data("menu").activate(event, submenu.children(":first"))
this.active = submenu;
var submenu = $(">ul", this.activeItem);
this._open(submenu, this.activeItem);
submenu.menu("activate", event, submenu.children(":first"));
},
show: function() {
this.element.menu("deactivate").show();
this.active = this.element;
this.element.show();
},
hide: function() {
this.hideDown();
var child = this.active.hide(), parent;
while(child.data("menuparent")) {
parent = child.data("menuparent");
child.appendTo(parent).removeData("menuparent");
child = parent.parent().removeData("submenu").hide();
}
},
hideDown: function() {
var submenu = this.active.data("submenu");
while(submenu) {
var parent = submenu.data("menuparent");
submenu.appendTo(parent).hide().removeData("menuparent");
parent.parent().removeData("submenu");
submenu = submenu.data("submenu");
};
this.element.find("ul").andSelf().menu("deactivate").hide();
}
});
var nestedmenu = $("#menu").nestedmenu({
@ -200,6 +177,10 @@
<body>
<button>Show context menu</button>
<br/>
<select>
<option>some option with some text</option>
</select>
<ul id="menu">
<li>

View File

@ -1,103 +0,0 @@
<!doctype html>
<html>
<head>
<title>Menu Visual Test: Default</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
<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>
<script type="text/javascript" src="../../../external/jquery.bgiframe-2.1.1.js"></script>
<script type="text/javascript">
$(function() {
$.fn.position2 = function(options) {
return this.css({
top: 0,
left: 0
}).position(options);
}
var menus = $("#menu").menu().position2({
my: "left top",
at: "center bottom",
of: "button"
}).find("ul").menu().hide();
var sub1 = menus.filter(":first").show().position2({
my: "left top",
at: "right center",
of: "#menu"
});
sub1.find("ul:first").show().position2({
of: sub1,
offset: "-10 50"
});
});
</script>
<style>
body { font-size:62.5%; }
.ui-menu { width: 200px; position: absolute; }
.ui-menu .ui-icon { float: right; }
ul, li {margin: 0; padding: 0}
</style>
</head>
<body>
<button>Show context menu</button>
<br/>
<select>
<option>some option with some text</option>
</select>
<ul id="menu">
<li>
<a href="#">Amsterdam</a>
<ul>
<li><a href="#">Aberdeen</a></li>
<li><a href="#">Ada</a></li>
<li>
<a href="#">Adamsville</a>
<ul>
<li><a href="#">Anaheim</a></li>
<li>
<a href="#">Cologne</a>
<ul>
<li><a href="#">Mberdeen</a></li>
<li><a href="#">Mda</a></li>
<li><a href="#">Mdamsville</a></li>
<li><a href="#">Mddyston</a></li>
<li><a href="#">Mmesville</a></li>
</ul>
</li>
<li><a href="#">Frankfurt</a></li>
</ul>
</li>
<li><a href="#">Addyston</a></li>
<li><a href="#">Amesville</a></li>
</ul>
</li>
<li><a href="#">Anaheim</a></li>
<li><a href="#">Cologne</a></li>
<li><a href="#">Frankfurt</a></li>
<li>
<a href="#">Magdeburg</a>
<ul>
<li><a href="#">Mberdeen</a></li>
<li><a href="#">Mda</a></li>
<li><a href="#">Mdamsville</a></li>
<li><a href="#">Mddyston</a></li>
<li><a href="#">Mmesville</a></li>
</ul>
</li>
<li><a href="#">Munich</a></li>
<li><a href="#">Utrecht</a></li>
<li><a href="#">Zurich</a></li>
</ul>
<div class="ui-widget" style="margin-top:2em; font-family:Arial">
Log:
<div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
</div>
</body>
</html>

View File

@ -4,6 +4,8 @@
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
/* IE7-/Win - Fix extra vertical space in lists */
.ui-accordion a { zoom: 1; }
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }

View File

@ -20,6 +20,10 @@
.ui-menu .ui-menu-item {
margin:0;
padding: 0;
zoom: 1;
float: left;
clear: left;
width: 100%;
}
.ui-menu .ui-menu-item a {
text-decoration:none;
@ -30,5 +34,6 @@
}
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
}

View File

@ -7,5 +7,5 @@
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }

View File

@ -10,7 +10,7 @@ jQuery(function($){
'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
'Lip','Sie','Wrz','Pa','Lis','Gru'],
dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
weekHeader: 'Tydz',

View File

@ -74,11 +74,6 @@ $.widget("ui.accordion", {
//Append icon elements
this._createIcons();
// IE7-/Win - Extra vertical space in lists fixed
if ($.browser.msie) {
this.element.find('a').css('zoom', '1');
}
this.resize();
//ARIA
@ -145,9 +140,9 @@ $.widget("ui.accordion", {
this.headers
.unbind(".accordion")
.removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top")
.removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");
.removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");
this.headers.find("a").removeAttr("tabindex");
this.headers.find("a").removeAttr("tabIndex");
this._destroyIcons();
var contents = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");
if (o.autoHeight || o.fillHeight) {

View File

@ -70,7 +70,7 @@ $.widget( "ui.autocomplete", {
case keyCode.RIGHT:
case keyCode.SHIFT:
case keyCode.CONTROL:
case 18:
case keyCode.ALT:
// ignore metakeys (shift, ctrl, alt)
break;
default:
@ -83,6 +83,7 @@ $.widget( "ui.autocomplete", {
}
})
.bind( "focus.autocomplete", function() {
self.selectedItem = null;
self.previous = self.element.val();
})
.bind( "blur.autocomplete", function( event ) {
@ -91,6 +92,7 @@ $.widget( "ui.autocomplete", {
// TODO try to implement this without a timeout, see clearTimeout in search()
self.closing = setTimeout(function() {
self.close( event );
self._change( event );
}, 150 );
});
this._initSource();
@ -116,11 +118,13 @@ $.widget( "ui.autocomplete", {
self.element.val( item.value );
}
self.close( event );
self.previous = self.element.val();
// only trigger when focus was lost (click on menu)
var previous = self.previous;
if ( self.element[0] !== doc.activeElement ) {
self.element.focus();
self.previous = previous;
}
self.selectedItem = item;
},
blur: function( event, ui ) {
if ( self.menu.element.is(":visible") ) {
@ -140,7 +144,7 @@ $.widget( "ui.autocomplete", {
destroy: function() {
this.element
.removeClass( "ui-autocomplete-input ui-widget ui-widget-content" )
.removeClass( "ui-autocomplete-input" )
.removeAttr( "autocomplete" )
.removeAttr( "role" )
.removeAttr( "aria-autocomplete" )
@ -162,11 +166,7 @@ $.widget( "ui.autocomplete", {
if ( $.isArray(this.options.source) ) {
array = this.options.source;
this.source = function( request, response ) {
// escape regex characters
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( $.grep( array, function(value) {
return matcher.test( value.label || value.value || value );
}) );
response( $.ui.autocomplete.filter(array, request.term) );
};
} else if ( typeof this.options.source === "string" ) {
url = this.options.source;
@ -219,8 +219,11 @@ $.widget( "ui.autocomplete", {
this.menu.element.hide();
this.menu.deactivate();
}
},
_change: function( event ) {
if ( this.previous !== this.element.val() ) {
this._trigger( "change", event );
this._trigger( "change", event, { item: this.selectedItem } );
}
},
@ -301,6 +304,12 @@ $.widget( "ui.autocomplete", {
$.extend( $.ui.autocomplete, {
escapeRegex: function( value ) {
return value.replace( /([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1" );
},
filter: function(array, term) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
return $.grep( array, function(value) {
return matcher.test( value.label || value.value || value );
});
}
});

View File

@ -70,6 +70,7 @@ $.ui = {
},
keyCode: {
ALT: 18,
BACKSPACE: 8,
CAPS_LOCK: 20,
COMMA: 188,
@ -117,15 +118,13 @@ $.fn.extend({
enableSelection: function() {
return this
.attr('unselectable', 'off')
.css('MozUserSelect', '')
.unbind('selectstart.ui');
.css('MozUserSelect', '');
},
disableSelection: function() {
return this
.attr('unselectable', 'on')
.css('MozUserSelect', 'none')
.bind('selectstart.ui', function() { return false; });
.css('MozUserSelect', 'none');
},
scrollParent: function() {

View File

@ -622,8 +622,11 @@ $.widget("ui.dialog", {
// reset content sizing
// hide for non content measurement because height: 0 doesn't work in IE quirks mode (see #4350)
this.element.css('width', 'auto')
.height(0);
this.element.css({
width: 'auto',
minHeight: 0,
height: 0
});
// reset wrapper sizing
// determine the height of all the non-content elements

View File

@ -113,6 +113,10 @@ $.fn.position = function( options ) {
position.top -= elemHeight / 2;
}
// prevent fractions (see #5280)
position.left = parseInt( position.left );
position.top = parseInt( position.top );
$.each( [ "left", "top" ], function( i, dir ) {
if ( $.ui.position[ collision[i] ] ) {
$.ui.position[ collision[i] ][ dir ]( position, {

727
ui/jquery.ui.slider.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -73,6 +73,18 @@ $.widget("ui.sortable", $.ui.mouse, {
return this;
},
_setOption: function(key, value){
if ( key === "disabled" ) {
this.options[ key ] = value;
this.widget()
[ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" );
} else {
// Don't call widget base _setOption for disable as it adds ui-state-disabled class
$.Widget.prototype._setOption.apply(self, arguments);
}
},
_mouseCapture: function(event, overrideHandle) {
if (this.reverting) {

View File

@ -155,7 +155,7 @@ $.Widget.prototype = {
.removeAttr( "aria-disabled" )
.removeClass(
this.widgetBaseClass + "-disabled " +
this.namespace + "-state-disabled" );
"ui-state-disabled" );
},
widget: function() {
@ -192,7 +192,7 @@ $.Widget.prototype = {
this.widget()
[ value ? "addClass" : "removeClass"](
this.widgetBaseClass + "-disabled" + " " +
this.namespace + "-state-disabled" )
"ui-state-disabled" )
.attr( "aria-disabled", value );
}