Skip to content
Permalink
Browse files

Merge remote branch 'origin/master'

  • Loading branch information...
jzaefferer committed Jul 20, 2010
2 parents 4be0942 + 5debdb0 commit 88ec776178b62d21ac6e218946800b2d0c2b0b78
Showing with 273 additions and 113 deletions.
  1. +1 −1 demos/addClass/default.html
  2. +28 −13 demos/autocomplete/combobox.html
  3. +2 −2 demos/autocomplete/custom-data.html
  4. +1 −1 demos/autocomplete/default.html
  5. BIN demos/{ → autocomplete}/images/jquery_32x32.png
  6. BIN demos/{ → autocomplete}/images/jqueryui_32x32.png
  7. BIN demos/{ → autocomplete}/images/sizzlejs_32x32.png
  8. BIN demos/{ → autocomplete}/images/transparent_1x1.png
  9. BIN {themes/base → demos/autocomplete}/images/ui-anim_basic_16x16.gif
  10. +2 −0 demos/autocomplete/index.html
  11. +52 −0 demos/autocomplete/maxheight.html
  12. +3 −0 demos/autocomplete/multiple-remote.html
  13. +1 −1 demos/autocomplete/multiple.html
  14. +3 −0 demos/autocomplete/remote-jsonp.html
  15. +3 −0 demos/autocomplete/remote-with-cache.html
  16. +3 −0 demos/autocomplete/remote.html
  17. +2 −2 demos/autocomplete/search.php
  18. +3 −0 demos/autocomplete/xml.html
  19. +1 −1 demos/removeClass/default.html
  20. +2 −2 demos/switchClass/default.html
  21. +1 −1 demos/toggleClass/default.html
  22. +6 −1 tests/unit/autocomplete/autocomplete_defaults.js
  23. +22 −26 tests/unit/dialog/dialog_options.js
  24. +4 −0 tests/unit/draggable/draggable_options.js
  25. +2 −1 tests/unit/tabs/tabs.html
  26. +1 −10 tests/unit/tabs/tabs_methods.js
  27. +2 −1 tests/unit/widget/widget.html
  28. 0 tests/unit/widget/{widget.js → widget_core.js}
  29. +46 −0 tests/unit/widget/widget_tickets.js
  30. +3 −0 tests/visual/button/button_performance.html
  31. +1 −1 tests/visual/menu/drilldown.html
  32. +1 −1 tests/visual/menu/menu.html
  33. +1 −1 themes/base/jquery.ui.autocomplete.css
  34. +1 −1 themes/base/jquery.ui.dialog.css
  35. +3 −3 ui/i18n/jquery.ui.datepicker-pt-BR.js
  36. +3 −1 ui/jquery.ui.accordion.js
  37. +29 −16 ui/jquery.ui.autocomplete.js
  38. +1 −1 ui/jquery.ui.button.js
  39. +13 −15 ui/jquery.ui.dialog.js
  40. +4 −0 ui/jquery.ui.sortable.js
  41. +21 −9 ui/jquery.ui.tabs.js
  42. +1 −1 ui/jquery.ui.widget.js
@@ -11,7 +11,7 @@
.toggler { width: 500px; height: 200px; position: relative;}
#button { padding: .5em 1em; text-decoration: none; }
#effect { width: 240px; padding: 1em; font-size: 1.2em; border: 1px solid #000; background: #eee; color: #333; }
#effect.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
</style>
<script type="text/javascript">
$(function() {
@@ -54,6 +54,12 @@
minLength: 0
})
.addClass("ui-widget ui-widget-content ui-corner-left");
input.data("autocomplete")._renderItem = function( ul, item) {
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.label + "</a>" )
.appendTo( ul );
};
$("<button>&nbsp;</button>")
.attr("tabIndex", -1)
.attr("title", "Show All Items")
@@ -96,19 +102,28 @@
<label>Your preferred programming language: </label>
<select id="combobox">
<option value="">Select one...</option>
<option value="a">asp</option>
<option value="c">c</option>
<option value="cpp">c++</option>
<option value="cf">coldfusion</option>
<option value="g">groovy</option>
<option value="h">haskell</option>
<option value="j">java</option>
<option value="js">javascript</option>
<option value="p1">perl</option>
<option value="p2">php</option>
<option value="p3">python</option>
<option value="r">ruby</option>
<option value="s">scala</option>
<option value="ActionScript">ActionScript</option>
<option value="AppleScript">AppleScript</option>
<option value="Asp">Asp</option>
<option value="BASIC">BASIC</option>
<option value="C">C</option>
<option value="C++">C++</option>
<option value="Clojure">Clojure</option>
<option value="COBOL">COBOL</option>
<option value="ColdFusion">ColdFusion</option>
<option value="Erlang">Erlang</option>
<option value="Fortran">Fortran</option>
<option value="Groovy">Groovy</option>
<option value="Haskell">Haskell</option>
<option value="Java">Java</option>
<option value="JavaScript">JavaScript</option>
<option value="Lisp">Lisp</option>
<option value="Perl">Perl</option>
<option value="PHP">PHP</option>
<option value="Python">Python</option>
<option value="Ruby">Ruby</option>
<option value="Scala">Scala</option>
<option value="Scheme">Scheme</option>
</select>
</div>
<button id="toggle">Show underlying select</button>
@@ -60,7 +60,7 @@
$('#project').val(ui.item.label);
$('#project-id').val(ui.item.value);
$('#project-description').html(ui.item.desc);
$('#project-icon').attr('src', '../images/' + ui.item.icon);
$('#project-icon').attr('src', 'images/' + ui.item.icon);
return false;
}
@@ -78,7 +78,7 @@

<div class="demo">
<div id="project-label">Select a project (type "j" for a start):</div>
<img id="project-icon" src="../images/transparent_1x1.png" class="ui-state-default"/>
<img id="project-icon" src="images/transparent_1x1.png" class="ui-state-default"/>
<input id="project"/>
<input type="hidden" id="project-id"/>
<p id="project-description"></p>
@@ -12,7 +12,7 @@
<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"];
var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
$("#tags").autocomplete({
source: availableTags
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -13,10 +13,12 @@ <h4>Examples</h4>
<li><a href="remote.html">Remote datasource</a></li>
<li><a href="remote-with-cache.html">Remote with caching</a></li>
<li><a href="remote-jsonp.html">Remote JSONP datasource</a></li>
<li><a href="maxheight.html">Scrollable results</a></li>
<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="folding.html">Accent folding</a></li>
<li><a href="multiple.html">Multiple values</a></li>
<li><a href="multiple-remote.html">Multiple, remote</a></li>
</ul>
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>jQuery UI Autocomplete Scrollable Results 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" />
<style type="text/css">
.ui-autocomplete {
max-height: 100px;
overflow-y: auto;
}
/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete {
height: 100px;
}
</style>
<script type="text/javascript">
$(function() {
var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
$("#tags").autocomplete({
source: availableTags
});
});
</script>
</head>
<body>

<div class="demo">

<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags" />
</div>

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

<div class="demo-description">
<p>
When displaying a long list of options, you can simply set the max-height for the autocomplete menu to prevent the menu from growing too large. Try typing "a" or "s" above to get a long list of results that you can scroll through.
</p>
</div><!-- End demo-description -->

</body>
</html>
@@ -10,6 +10,9 @@
<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" />
<style type="text/css">
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script type="text/javascript">
$(function() {
function split(val) {
@@ -12,7 +12,7 @@
<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"];
var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
function split(val) {
return val.split(/,\s*/);
}
@@ -10,6 +10,9 @@
<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" />
<style type="text/css">
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script type="text/javascript">
$(function() {
function log(message) {
@@ -10,6 +10,9 @@
<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" />
<style type="text/css">
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script type="text/javascript">
$(function() {
var cache = {};
@@ -10,6 +10,9 @@
<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" />
<style type="text/css">
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script type="text/javascript">
$(function() {
function log(message) {
@@ -3,8 +3,8 @@
$q = strtolower($_GET["term"]);
if (!$q) return;
$items = array(
"Great <em>Bittern</em>"=>"Botaurus stellaris",
"Little <em>Grebe</em>"=>"Tachybaptus ruficollis",
"Great Bittern"=>"Botaurus stellaris",
"Little Grebe"=>"Tachybaptus ruficollis",
"Black-necked Grebe"=>"Podiceps nigricollis",
"Little Bittern"=>"Ixobrychus minutus",
"Black-crowned Night Heron"=>"Nycticorax nycticorax",
@@ -10,6 +10,9 @@
<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" />
<style type="text/css">
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script type="text/javascript">
$(function() {
function log(message) {
@@ -11,7 +11,7 @@
.toggler { width: 500px; height: 200px; position: relative;}
#button { padding: .5em 1em; text-decoration: none; }
#effect {position: relative; width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; border: 1px solid #000; background: #eee; color: #333; }
#effect.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
</style>
<script type="text/javascript">
$(function() {
@@ -11,8 +11,8 @@
.toggler { width: 500px; height: 200px; position: relative;}
#button { padding: .5em 1em; text-decoration: none; }
#effect {position: relative; }
#effect.newClass { width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; }
#effect.anotherNewClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
.newClass { width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; margin: 0; }
.anotherNewClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
</style>
<script type="text/javascript">
$(function() {
@@ -11,7 +11,7 @@
.toggler { width: 500px; height: 200px; position: relative;}
#button { padding: .5em 1em; text-decoration: none; }
#effect {position: relative; width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; border: 1px solid #000; background: #eee; color: #333; }
#effect.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
</style>
<script type="text/javascript">
$(function() {
@@ -6,7 +6,12 @@ var autocomplete_defaults = {
delay: 300,
disabled: false,
minLength: 1,
source: undefined
position: {
my: "left top",
at: "left bottom",
collision: "none"
},
source: null
};

commonWidgetTests('autocomplete', { defaults: autocomplete_defaults });
@@ -242,25 +242,25 @@ test("modal", function() {

test("position, default center on window", function() {
var el = $('<div></div>').dialog();
var offset = el.parent().offset();
// use .position() instead to avoid replicating center-logic?
var dialog = el.dialog('widget');
var offset = dialog.offset();
same(offset.left, Math.floor($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
same(offset.top, Math.floor($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
el.remove();
});

test("position, top on window", function() {
var el = $('<div></div>').dialog({ position: "top" });
var dialog = el.closest('.ui-dialog');
var dialog = el.dialog('widget');
var offset = dialog.offset();
same(offset.left, Math.floor($(window).width() / 2 - dialog.outerWidth() / 2));
same(offset.left, Math.floor($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
same(offset.top, $(window).scrollTop());
el.remove();
});

test("position, left on window", function() {
var el = $('<div></div>').dialog({ position: "left" });
var dialog = el.closest('.ui-dialog');
var dialog = el.dialog('widget');
var offset = dialog.offset();
same(offset.left, 0);
same(offset.top, Math.floor($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
@@ -269,27 +269,27 @@ test("position, left on window", function() {

test("position, right bottom on window", function() {
var el = $('<div></div>').dialog({ position: "right bottom" });
var dialog = el.closest('.ui-dialog');
var dialog = el.dialog('widget');
var offset = dialog.offset();
same(offset.left, $(window).width() - dialog.outerWidth());
same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft());
same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
el.remove();
});

test("position, right bottom on window w/array", function() {
var el = $('<div></div>').dialog({ position: ["right", "bottom"] });
var dialog = el.closest('.ui-dialog');
var dialog = el.dialog('widget');
var offset = dialog.offset();
same(offset.left, $(window).width() - dialog.outerWidth());
same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft());
same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
el.remove();
});

test("position, offset from top left w/array", function() {
var el = $('<div></div>').dialog({ position: [10, 10] });
var dialog = el.closest('.ui-dialog');
var dialog = el.dialog('widget');
var offset = dialog.offset();
same(offset.left, 10);
same(offset.left, 10 + $(window).scrollLeft());
same(offset.top, 10 + $(window).scrollTop());
el.remove();
});
@@ -302,10 +302,10 @@ test("position, right bottom at right bottom via ui.position args", function() {
}
});

var dialog = el.closest('.ui-dialog');
var dialog = el.dialog('widget');
var offset = dialog.offset();

same(offset.left, $(window).width() - dialog.outerWidth());
same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft());
same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
el.remove();
});
@@ -317,41 +317,37 @@ test("position, at another element", function() {
left: 600,
height: 10,
width: 10
});
}).appendTo('body');

var el = $('<div></div>').dialog({
position: {
my: "left top",
at: "top left",
at: "left top",
of: parent
}
});

var dialog = el.closest('.ui-dialog');
var dialog = el.dialog('widget');
var offset = dialog.offset();
var parentOffset = parent.offset();

same(offset.left, parentOffset.left);
same(offset.top, parentOffset.top);
same(offset.left, 600);
same(offset.top, 400);

el.dialog('option', 'position', {
my: "left top",
at: "right bottom",
of: parent
});

same(offset.left, parentOffset.left + parent.outerWidth());
same(offset.top, parentOffset.top + parent.outerHeight());
var offset = dialog.offset();

same(offset.left, 610);
same(offset.top, 410);

el.remove();
parent.remove();
});


test("position, others", function() {
ok(false, 'missing test - untested code is broken code');
});

test("resizable", function() {
expect(4);

1 comment on commit 88ec776

@jzaefferer

This comment has been minimized.

Copy link
Member Author

commented on 88ec776 Jul 20, 2010

Damnit, I should stop using "git push"...

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