Permalink
Browse files

Merge https://github.com/jquery/jquery-ui

  • Loading branch information...
2 parents 50ed8ea + baf28d2 commit bc84cbc948ad70c39f78bf06b5f4fe32d5adc54a Jay Merrifield committed Feb 25, 2011
Showing with 1,137 additions and 798 deletions.
  1. +2 −0 demos/datepicker/localization.html
  2. +1 −0 demos/index.html
  3. +2 −3 demos/menu/contextmenu.html
  4. +3 −2 tests/unit/accordion/accordio.html
  5. +3 −2 tests/unit/accordion/accordion.html
  6. +3 −14 tests/unit/accordion/accordion_methods.js
  7. +46 −1 tests/unit/accordion/accordion_options.js
  8. +3 −1 tests/unit/autocomplete/autocomplete.html
  9. +1 −1 tests/unit/autocomplete/autocomplete_core.js
  10. +45 −1 tests/unit/autocomplete/autocomplete_events.js
  11. +3 −7 tests/unit/autocomplete/autocomplete_methods.js
  12. +2 −1 tests/unit/button/button.html
  13. +2 −1 tests/unit/core/core.html
  14. +2 −1 tests/unit/datepicker/datepicker.html
  15. +5 −5 tests/unit/datepicker/datepicker_core.js
  16. +1 −6 tests/unit/datepicker/datepicker_events.js
  17. +1 −6 tests/unit/datepicker/datepicker_methods.js
  18. +16 −16 tests/unit/datepicker/datepicker_options.js
  19. +1 −6 tests/unit/datepicker/datepicker_tickets.js
  20. +0 −56 tests/unit/defaults.html
  21. +13 −1 tests/unit/dialog/dialog.html
  22. +2 −1 tests/unit/draggable/draggable.html
  23. +2 −1 tests/unit/droppable/droppable.html
  24. +2 −0 tests/unit/index.html
  25. +4 −3 tests/unit/menu/menu.html
  26. +8 −2 tests/unit/menu/menu_core.js
  27. +4 −2 tests/unit/menu/menu_defaults.js
  28. +3 −7 tests/unit/menu/menu_methods.js
  29. +2 −1 tests/unit/position/position.html
  30. +2 −1 tests/unit/progressbar/progressbar.html
  31. +2 −1 tests/unit/resizable/resizable.html
  32. +2 −1 tests/unit/selectable/selectable.html
  33. +2 −1 tests/unit/slider/slider.html
  34. +2 −1 tests/unit/sortable/sortable.html
  35. +4 −0 tests/unit/spinner/spinner.html
  36. +2 −1 tests/unit/tabs/tabs.html
  37. +13 −3 tests/unit/tabs/tabs_events.js
  38. +33 −3 tests/unit/testsuite.js
  39. +5 −1 tests/unit/tooltip/tooltip.html
  40. +9 −1 tests/unit/tooltip/tooltip_options.js
  41. +2 −1 tests/unit/widget/widget.html
  42. +51 −24 tests/unit/widget/widget_core.js
  43. +2 −1 tests/visual/index.html
  44. +78 −45 tests/visual/menu/contextmenu.html
  45. +2 −4 tests/visual/menu/drilldown.html
  46. +31 −4 tests/visual/menu/menu.html
  47. +95 −39 tests/visual/menu/menubar.html
  48. +113 −0 tests/visual/menu/menubar.js
  49. +0 −238 tests/visual/menu/nested.html
  50. +67 −0 tests/visual/menu/tablemenu.html
  51. +6 −1 themes/base/jquery.ui.menu.css
  52. +2 −2 ui/i18n/jquery.ui.datepicker-ar-DZ.js
  53. +2 −2 ui/i18n/jquery.ui.datepicker-ar.js
  54. +2 −2 ui/i18n/jquery.ui.datepicker-az.js
  55. +3 −3 ui/i18n/jquery.ui.datepicker-bg.js
  56. +2 −2 ui/i18n/jquery.ui.datepicker-bs.js
  57. +3 −3 ui/i18n/jquery.ui.datepicker-ca.js
  58. +2 −2 ui/i18n/jquery.ui.datepicker-cs.js
  59. +2 −2 ui/i18n/jquery.ui.datepicker-da.js
  60. +2 −2 ui/i18n/jquery.ui.datepicker-de.js
  61. +2 −2 ui/i18n/jquery.ui.datepicker-eo.js
  62. +5 −5 ui/i18n/jquery.ui.datepicker-es.js
  63. +2 −2 ui/i18n/jquery.ui.datepicker-eu.js
  64. +2 −2 ui/i18n/jquery.ui.datepicker-fa.js
  65. +7 −7 ui/i18n/jquery.ui.datepicker-fi.js
  66. +2 −2 ui/i18n/jquery.ui.datepicker-fo.js
  67. +2 −2 ui/i18n/jquery.ui.datepicker-fr-CH.js
  68. +5 −5 ui/i18n/jquery.ui.datepicker-gl.js
  69. +2 −2 ui/i18n/jquery.ui.datepicker-he.js
  70. +2 −2 ui/i18n/jquery.ui.datepicker-hr.js
  71. +3 −3 ui/i18n/jquery.ui.datepicker-hu.js
  72. +2 −2 ui/i18n/jquery.ui.datepicker-hy.js
  73. +2 −2 ui/i18n/jquery.ui.datepicker-id.js
  74. +10 −10 ui/i18n/jquery.ui.datepicker-is.js
  75. +3 −3 ui/i18n/jquery.ui.datepicker-it.js
  76. +2 −2 ui/i18n/jquery.ui.datepicker-ja.js
  77. +2 −2 ui/i18n/jquery.ui.datepicker-kz.js
  78. +2 −2 ui/i18n/jquery.ui.datepicker-lt.js
  79. +2 −2 ui/i18n/jquery.ui.datepicker-ms.js
  80. +19 −19 ui/i18n/jquery.ui.datepicker-no.js
  81. +2 −2 ui/i18n/jquery.ui.datepicker-pl.js
  82. +6 −6 ui/i18n/jquery.ui.datepicker-pt-BR.js
  83. +5 −5 ui/i18n/jquery.ui.datepicker-pt.js
  84. +2 −2 ui/i18n/jquery.ui.datepicker-rm.js
  85. +2 −2 ui/i18n/jquery.ui.datepicker-ro.js
  86. +2 −2 ui/i18n/jquery.ui.datepicker-ru.js
  87. +2 −2 ui/i18n/jquery.ui.datepicker-sk.js
  88. +2 −2 ui/i18n/jquery.ui.datepicker-sl.js
  89. +2 −2 ui/i18n/jquery.ui.datepicker-sq.js
  90. +2 −2 ui/i18n/jquery.ui.datepicker-sr-SR.js
  91. +2 −2 ui/i18n/jquery.ui.datepicker-sr.js
  92. +2 −2 ui/i18n/jquery.ui.datepicker-sv.js
  93. +2 −2 ui/i18n/jquery.ui.datepicker-th.js
  94. +23 −0 ui/i18n/jquery.ui.datepicker-tj.js
  95. +1 −1 ui/i18n/jquery.ui.datepicker-tr.js
  96. +2 −2 ui/i18n/jquery.ui.datepicker-uk.js
  97. +2 −2 ui/i18n/jquery.ui.datepicker-vi.js
  98. +2 −2 ui/i18n/jquery.ui.datepicker-zh-CN.js
  99. +2 −2 ui/i18n/jquery.ui.datepicker-zh-HK.js
  100. +2 −2 ui/i18n/jquery.ui.datepicker-zh-TW.js
  101. +2 −2 ui/jquery.effects.pulsate.js
  102. +1 −1 ui/jquery.effects.scale.js
  103. +14 −5 ui/jquery.ui.accordion.js
  104. +22 −16 ui/jquery.ui.autocomplete.js
  105. +12 −7 ui/jquery.ui.button.js
  106. +8 −3 ui/jquery.ui.datepicker.js
  107. +162 −33 ui/jquery.ui.menu.js
  108. +0 −35 ui/jquery.ui.position.js
  109. +1 −1 ui/jquery.ui.slider.js
  110. +3 −8 ui/jquery.ui.spinner.js
  111. +9 −9 ui/jquery.ui.tabs.js
  112. +33 −17 ui/jquery.ui.widget.js
@@ -62,6 +62,7 @@
<script src="../../ui/i18n/jquery.ui.datepicker-sv.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-ta.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-th.js"></script>
+ <script src="../../ui/i18n/jquery.ui.datepicker-tj.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-tr.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-uk.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-vi.js"></script>
@@ -143,6 +144,7 @@
<option value="sv">Swedish (Svenska)</option>
<option value="ta">Tamil (&#2980;&#2990;&#3007;&#2996;&#3021;)</option>
<option value="th">Thai (&#3616;&#3634;&#3625;&#3634;&#3652;&#3607;&#3618;)</option>
+ <option value="tj">Tajikistan</option>
<option value="tr">Turkish (T&uuml;rk&ccedil;e)</option>
<option value="uk">Ukranian (&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;)</option>
<option value="vi">Vietnamese (Ti&#7871;ng Vi&#7879;t)</option>
View
@@ -96,6 +96,7 @@
<script src="../ui/i18n/jquery.ui.datepicker-sv.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ta.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-th.js"></script>
+ <script src="../ui/i18n/jquery.ui.datepicker-tj.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-tr.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-uk.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-vi.js"></script>
@@ -23,16 +23,15 @@
select: function(event, ui) {
$(this).hide();
$("#log").append("<div>Selected " + ui.item.text() + "</div>");
- },
- input: $(this)
+ }
}).hide();
}).click(function(event) {
var menu = $(this).next();
if (menu.is(":visible")) {
menu.hide();
return false;
}
- menu.menu("deactivate").show().css({top:0, left:0}).position({
+ menu.menu("blur").show().position({
my: "left top",
at: "right top",
of: this
@@ -56,19 +56,20 @@
<script src="../swarminject.js"></script>
<style>
- #main { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
+ #qunit-fixture { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
#list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; }
</style>
</head>
<body>
<h1 id="qunit-header">jQuery UI Accordion Test Suite</h1>
<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>
-<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
+<div id="qunit-fixture">
<div>
<div id="list1" class="foo">
@@ -58,19 +58,20 @@
<script src="../swarminject.js"></script>
<style>
- #main { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
+ #qunit-fixture { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
#list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; }
</style>
</head>
<body>
<h1 id="qunit-header">jQuery UI Accordion Test Suite</h1>
<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>
-<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
+<div id="qunit-fixture">
<div>
<div id="list1" class="foo">
@@ -3,20 +3,9 @@
module( "accordion: methods", accordionSetupTeardown() );
test( "destroy", function() {
- 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
- .replace( / role=""/g, "" );
- equal( afterHtml, beforeHtml );
+ domEqual("#list1", function() {
+ $("#list1").accordion().accordion("destroy");
+ });
});
test( "enable/disable", function() {
@@ -105,7 +105,52 @@ test( "{ collapsible: true }", function() {
state( ac, 0, 0, 0 );
});
-// TODO: add event tests
+test( "{ event: null }", function() {
+ var ac = $( "#list1" ).accordion({
+ event: null
+ });
+ state( ac, 1, 0, 0 );
+
+ ac.accordion( "option", "active", 1 );
+ equal( ac.accordion( "option", "active" ), 1 );
+ state( ac, 0, 1, 0 );
+
+ // ensure default click handler isn't bound
+ ac.find( ".ui-accordion-header" ).eq( 2 ).click();
+ equal( ac.accordion( "option", "active" ), 1 );
+ state( ac, 0, 1, 0 );
+});
+
+test( "{ event: custom }", function() {
+ var ac = $( "#list1" ).accordion({
+ event: "custom1 custom2"
+ });
+ state( ac, 1, 0, 0 );
+
+ ac.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
+ equal( ac.accordion( "option", "active" ), 1 );
+ state( ac, 0, 1, 0 );
+
+ // ensure default click handler isn't bound
+ ac.find( ".ui-accordion-header" ).eq( 2 ).trigger( "click" );
+ equal( ac.accordion( "option", "active" ), 1 );
+ state( ac, 0, 1, 0 );
+
+ ac.find( ".ui-accordion-header" ).eq( 2 ).trigger( "custom2" );
+ equal( ac.accordion( "option", "active" ), 2 );
+ state( ac, 0, 0, 1 );
+
+ ac.accordion( "option", "event", "custom3" );
+
+ // ensure old event handlers are unbound
+ ac.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
+ equal( ac.accordion( "option", "active" ), 2 );
+ state( ac, 0, 0, 1 );
+
+ ac.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom3" );
+ equal( ac.accordion( "option", "active" ), 1 );
+ state( ac, 0, 1, 0 );
+});
test( "{ header: default }", function() {
// default: > li > :first-child,> :not(li):even
@@ -31,14 +31,16 @@
<h1 id="qunit-header">jQuery UI Autocomplete Test Suite</h1>
<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>
-<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
+<div id="qunit-fixture">
<div id="ac-wrap1" class="ac-wrap"></div>
<div id="ac-wrap2" class="ac-wrap"><input id="autocomplete" class="foo" /></div>
+ <div id="autocomplete-contenteditable" contenteditable="" tabindex=0></div>
</div>
</body>
@@ -49,7 +49,7 @@ test( "prevent form submit on enter when menu is active", function() {
event = $.Event( "keydown" );
event.keyCode = $.ui.keyCode.DOWN;
ac.trigger( event );
- same( $( ".ui-menu-item:has(.ui-state-hover)" ).length, 1, "menu item is active" );
+ same( $( ".ui-menu-item:has(.ui-state-focus)" ).length, 1, "menu item is active" );
event = $.Event( "keydown" );
event.keyCode = $.ui.keyCode.ENTER;
@@ -47,7 +47,51 @@ test("all events", function() {
same( $(".ui-menu:visible").length, 1 );
ac.simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
ac.simulate("keydown", { keyCode: $.ui.keyCode.ENTER });
- $.browser.msie ? ac.simulate("blur") : ac.blur();
+ // blurring through jQuery causes a bug in IE 6 which causes the
+ // autocompletechange event to occur twice
+ ac[0].blur();
+ }, 50);
+});
+
+test("all events - contenteditable", function() {
+ expect(12);
+ var ac = $("#autocomplete-contenteditable").autocomplete({
+ delay: 0,
+ source: data,
+ search: function(event) {
+ same(event.type, "autocompletesearch");
+ },
+ open: function(event) {
+ same(event.type, "autocompleteopen");
+ },
+ focus: function(event, ui) {
+ same(event.type, "autocompletefocus");
+ same(ui.item, {label:"java", value:"java"});
+ },
+ close: function(event) {
+ same(event.type, "autocompleteclose");
+ same( $(".ui-menu:visible").length, 0 );
+ },
+ select: function(event, ui) {
+ same(event.type, "autocompleteselect");
+ same(ui.item, {label:"java", value:"java"});
+ },
+ change: function(event, ui) {
+ same(event.type, "autocompletechange");
+ same(ui.item, {label:"java", value:"java"});
+ same( $(".ui-menu:visible").length, 0 );
+ start();
+ }
+ });
+ stop();
+ ac.focus().text("ja").keydown();
+ setTimeout(function() {
+ same( $(".ui-menu:visible").length, 1 );
+ ac.simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
+ ac.simulate("keydown", { keyCode: $.ui.keyCode.ENTER });
+ // blurring through jQuery causes a bug in IE 6 which causes the
+ // autocompletechange event to occur twice
+ ac[0].blur();
}, 50);
});
@@ -11,13 +11,9 @@ module("autocomplete: methods", {
});
test("destroy", function() {
- var beforeHtml = $("#autocomplete").parent().html();
- var afterHtml = $("#autocomplete").autocomplete().autocomplete("destroy").parent().html();
- // Opera 9 outputs role="" instead of removing the attribute like everyone else
- if ($.browser.opera) {
- afterHtml = afterHtml.replace(/ role=""/g, "");
- }
- equal( afterHtml, beforeHtml, "before/after html should be the same" );
+ domEqual("#autocomplete", function() {
+ $("#autocomplete").autocomplete().autocomplete("destroy");
+ });
})
var data = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];
@@ -29,11 +29,12 @@
<h1 id="qunit-header">jQuery UI Button Test Suite</h1>
<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>
-<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
+<div id="qunit-fixture">
<div><button id="button" class="foo">Label</button></div>
@@ -27,11 +27,12 @@
<h1 id="qunit-header">jQuery UI Core Test Suite</h1>
<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>
-<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
+<div id="qunit-fixture">
<img src="../images/jqueryui_32x32.png" usemap="#mymap" width="10", height="10">
<map name="mymap">
@@ -41,11 +41,12 @@
<h1 id="qunit-header">jQuery UI Datepicker Test Suite</h1>
<h2 id="qunit-banner"></h2>
+<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>
-<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
+<div id="qunit-fixture">
<p><input type="text" id="inp"/><input type="text" id="alt"/><div id="inl"></div></p>
</div>
@@ -40,11 +40,11 @@ var PROP_NAME = 'datepicker';
(function($) {
-module("datepicker: core", {
- teardown: function() {
- stop();
- setTimeout(start, 13);
- }
+module("datepicker: core");
+
+test( "widget method - empty collection", function() {
+ $( "#nonExist" ).datepicker(); // should create nothing
+ ok( !$( "#ui-datepicker-div" ).length, "Non init on empty collection" );
});
test("widget method", function() {
@@ -3,12 +3,7 @@
*/
(function($) {
-module("datepicker: events", {
- teardown: function() {
- stop();
- setTimeout(start, 13);
- }
-});
+module("datepicker: events");
var selectedThis = null;
var selectedDate = null;
@@ -3,12 +3,7 @@
*/
(function($) {
-module("datepicker: methods", {
- teardown: function() {
- stop();
- setTimeout(start, 13);
- }
-});
+module("datepicker: methods");
test('destroy', function() {
var inp = init('#inp');
Oops, something went wrong. Retry.

0 comments on commit bc84cbc

Please sign in to comment.