Skip to content
Permalink
Browse files

Merge branch 'master' into selectmenu

  • Loading branch information...
fnagel committed May 31, 2012
2 parents 8abe1d0 + e0fe788 commit 749c8fbb6673a15c6477b43d6a6a4f7101f85a5b
Showing with 590 additions and 331 deletions.
  1. +0 −7 demos/autocomplete/categories.html
  2. +1 −1 demos/datepicker/localization.html
  3. +1 −1 demos/index.html
  4. +7 −7 tests/unit/accordion/accordion_deprecated.js
  5. +23 −23 tests/unit/accordion/accordion_events.js
  6. +3 −3 tests/unit/accordion/accordion_methods.js
  7. +8 −8 tests/unit/accordion/accordion_options.js
  8. +2 −7 tests/unit/accordion/accordion_test_helpers.js
  9. +10 −0 tests/unit/core/core.js
  10. +3 −18 tests/unit/dialog/dialog_core.js
  11. +6 −3 tests/unit/menu/menu.html
  12. +1 −1 tests/unit/menu/menu_core.js
  13. +19 −8 tests/unit/menu/menu_events.js
  14. +5 −1 tests/unit/menu/menu_methods.js
  15. +14 −22 tests/unit/progressbar/progressbar_core.js
  16. +24 −32 tests/unit/progressbar/progressbar_events.js
  17. +12 −31 tests/unit/progressbar/progressbar_methods.js
  18. +25 −27 tests/unit/progressbar/progressbar_options.js
  19. +25 −0 tests/unit/tabs/tabs.html
  20. +1 −0 tests/unit/tabs/tabs_common.js
  21. +1 −0 tests/unit/tabs/tabs_common_deprecated.js
  22. +25 −0 tests/unit/tabs/tabs_deprecated.html
  23. +67 −0 tests/unit/tabs/tabs_options.js
  24. +6 −0 tests/unit/tabs/tabs_test_helpers.js
  25. +47 −16 tests/unit/testsuite.js
  26. +49 −2 tests/visual/menu/menu.html
  27. +2 −2 ui/i18n/{jquery.ui.datepicker-ge.js → jquery.ui.datepicker-ka.js}
  28. +33 −16 ui/jquery.ui.accordion.js
  29. +0 −1 ui/jquery.ui.autocomplete.js
  30. +19 −0 ui/jquery.ui.core.js
  31. +6 −6 ui/jquery.ui.dialog.js
  32. +5 −11 ui/jquery.ui.draggable.js
  33. +2 −7 ui/jquery.ui.droppable.js
  34. +64 −51 ui/jquery.ui.menu.js
  35. +2 −2 ui/jquery.ui.resizable.js
  36. +2 −6 ui/jquery.ui.selectable.js
  37. +1 −2 ui/jquery.ui.spinner.js
  38. +69 −9 ui/jquery.ui.tabs.js
@@ -18,13 +18,6 @@
margin: .8em 0 .2em;
line-height: 1.5;
}
.ui-autocomplete li.ui-autocomplete-category {
font-size: 1em;
line-height: 1.5;
margin: 0.5em 0 0 0;
height: auto;
border: 0;
}
</style>
<script>
$.widget( "custom.catcomplete", $.ui.autocomplete, {
@@ -32,7 +32,6 @@
<script src="../../ui/i18n/jquery.ui.datepicker-fo.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-fr.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-fr-CH.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-ge.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-gl.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-he.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-hi.js"></script>
@@ -43,6 +42,7 @@
<script src="../../ui/i18n/jquery.ui.datepicker-is.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-it.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-ja.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-ka.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-kk.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-km.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-ko.js"></script>
@@ -66,7 +66,6 @@
<script src="../ui/i18n/jquery.ui.datepicker-fo.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-fr.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-fr-CH.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ge.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-gl.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-he.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-hi.js"></script>
@@ -77,6 +76,7 @@
<script src="../ui/i18n/jquery.ui.datepicker-is.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-it.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ja.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ka.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-kk.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-km.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ko.js"></script>
@@ -1,6 +1,6 @@
(function( $ ) {

var equalHeights = TestHelpers.accordion.equalHeights,
var equalHeight = TestHelpers.accordion.equalHeight,
setupTeardown = TestHelpers.accordion.setupTeardown,
state = TestHelpers.accordion.state;

@@ -109,7 +109,7 @@ module( "accordion (deprecated) - height options", setupTeardown() );

test( "{ autoHeight: true }, default", function() {
expect( 3 );
equalHeights( $( "#navigation" ).accordion({ autoHeight: true }), 95, 130 );
equalHeight( $( "#navigation" ).accordion({ autoHeight: true }), 105 );
});

test( "{ autoHeight: false }", function() {
@@ -128,7 +128,7 @@ test( "{ fillSpace: true }", function() {
expect( 3 );
$( "#navigationWrapper" ).height( 500 );
var element = $( "#navigation" ).accordion({ fillSpace: true });
equalHeights( element, 446, 458 );
equalHeight( element, 455 );
});

test( "{ fillSapce: true } with sibling", function() {
@@ -142,7 +142,7 @@ test( "{ fillSapce: true } with sibling", function() {
})
.prependTo( "#navigationWrapper" );
var element = $( "#navigation" ).accordion({ fillSpace: true });
equalHeights( element , 346, 358);
equalHeight( element , 355 );
});

test( "{ fillSpace: true } with multiple siblings", function() {
@@ -171,7 +171,7 @@ test( "{ fillSpace: true } with multiple siblings", function() {
})
.prependTo( "#navigationWrapper" );
var element = $( "#navigation" ).accordion({ fillSpace: true });
equalHeights( element, 296, 308 );
equalHeight( element, 305 );
});


@@ -206,11 +206,11 @@ test( "resize", function() {
.accordion({
heightStyle: "fill"
});
equalHeights( element, 246, 258 );
equalHeight( element, 255 );

element.parent().height( 500 );
element.accordion( "resize" );
equalHeights( element, 446, 458 );
equalHeight( element, 455 );
});


@@ -56,11 +56,11 @@ test( "beforeActivate", function() {
element.one( "accordionbeforeactivate", function( event, ui ) {
ok( !( "originalEvent" in event ) );
equal( ui.oldHeader.length, 0 );
equal( ui.oldContent.length, 0 );
equal( ui.oldPanel.length, 0 );
equal( ui.newHeader.length, 1 );
strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
equal( ui.newContent.length, 1 );
strictEqual( ui.newContent[ 0 ], content[ 0 ] );
equal( ui.newPanel.length, 1 );
strictEqual( ui.newPanel[ 0 ], content[ 0 ] );
state( element, 0, 0, 0 );
});
element.accordion( "option", "active", 0 );
@@ -70,12 +70,12 @@ test( "beforeActivate", function() {
equal( event.originalEvent.type, "click" );
equal( ui.oldHeader.length, 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
equal( ui.oldContent.length, 1 );
strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
equal( ui.oldPanel.length, 1 );
strictEqual( ui.oldPanel[ 0 ], content[ 0 ] );
equal( ui.newHeader.length, 1 );
strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
equal( ui.newContent.length, 1 );
strictEqual( ui.newContent[ 0 ], content[ 1 ] );
equal( ui.newPanel.length, 1 );
strictEqual( ui.newPanel[ 0 ], content[ 1 ] );
state( element, 1, 0, 0 );
});
headers.eq( 1 ).click();
@@ -85,10 +85,10 @@ test( "beforeActivate", function() {
ok( !( "originalEvent" in event ) );
equal( ui.oldHeader.length, 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
equal( ui.oldContent.length, 1 );
strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
equal( ui.oldPanel.length, 1 );
strictEqual( ui.oldPanel[ 0 ], content[ 1 ] );
equal( ui.newHeader.length, 0 );
equal( ui.newContent.length, 0 );
equal( ui.newPanel.length, 0 );
state( element, 0, 1, 0 );
});
element.accordion( "option", "active", false );
@@ -97,11 +97,11 @@ test( "beforeActivate", function() {
element.one( "accordionbeforeactivate", function( event, ui ) {
ok( !( "originalEvent" in event ) );
equal( ui.oldHeader.length, 0 );
equal( ui.oldContent.length, 0 );
equal( ui.oldPanel.length, 0 );
equal( ui.newHeader.length, 1 );
strictEqual( ui.newHeader[ 0 ], headers[ 2 ] );
equal( ui.newContent.length, 1 );
strictEqual( ui.newContent[ 0 ], content[ 2 ] );
equal( ui.newPanel.length, 1 );
strictEqual( ui.newPanel[ 0 ], content[ 2 ] );
event.preventDefault();
state( element, 0, 0, 0 );
});
@@ -120,33 +120,33 @@ test( "activate", function() {

element.one( "accordionactivate", function( event, ui ) {
equal( ui.oldHeader.length, 0 );
equal( ui.oldContent.length, 0 );
equal( ui.oldPanel.length, 0 );
equal( ui.newHeader.length, 1 );
strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
equal( ui.newContent.length, 1 );
strictEqual( ui.newContent[ 0 ], content[ 0 ] );
equal( ui.newPanel.length, 1 );
strictEqual( ui.newPanel[ 0 ], content[ 0 ] );
});
element.accordion( "option", "active", 0 );

element.one( "accordionactivate", function( event, ui ) {
equal( ui.oldHeader.length, 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
equal( ui.oldContent.length, 1 );
strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
equal( ui.oldPanel.length, 1 );
strictEqual( ui.oldPanel[ 0 ], content[ 0 ] );
equal( ui.newHeader.length, 1 );
strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
equal( ui.newContent.length, 1 );
strictEqual( ui.newContent[ 0 ], content[ 1 ] );
equal( ui.newPanel.length, 1 );
strictEqual( ui.newPanel[ 0 ], content[ 1 ] );
});
headers.eq( 1 ).click();

element.one( "accordionactivate", function( event, ui ) {
equal( ui.oldHeader.length, 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
equal( ui.oldContent.length, 1 );
strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
equal( ui.oldPanel.length, 1 );
strictEqual( ui.oldPanel[ 0 ], content[ 1 ] );
equal( ui.newHeader.length, 0 );
equal( ui.newContent.length, 0 );
equal( ui.newPanel.length, 0 );
});
element.accordion( "option", "active", false );

@@ -1,6 +1,6 @@
(function( $ ) {

var equalHeights = TestHelpers.accordion.equalHeights,
var equalHeight = TestHelpers.accordion.equalHeight,
setupTeardown = TestHelpers.accordion.setupTeardown,
state = TestHelpers.accordion.state;

@@ -38,11 +38,11 @@ test( "refresh", function() {
.accordion({
heightStyle: "fill"
});
equalHeights( element, 246, 258 );
equalHeight( element, 255 );

element.parent().height( 500 );
element.accordion( "refresh" );
equalHeights( element, 446, 458 );
equalHeight( element, 455 );
});

}( jQuery ) );
@@ -1,6 +1,6 @@
(function( $ ) {

var equalHeights = TestHelpers.accordion.equalHeights,
var equalHeight = TestHelpers.accordion.equalHeight,
setupTeardown = TestHelpers.accordion.setupTeardown,
state = TestHelpers.accordion.state;

@@ -359,7 +359,7 @@ test( "{ header: custom }", function() {
test( "{ heightStyle: 'auto' }", function() {
expect( 3 );
var element = $( "#navigation" ).accordion({ heightStyle: "auto" });
equalHeights( element, 95, 130 );
equalHeight( element, 105 );
});

test( "{ heightStyle: 'content' }", function() {
@@ -368,16 +368,16 @@ test( "{ heightStyle: 'content' }", function() {
sizes = element.find( ".ui-accordion-content" ).map(function() {
return $( this ).height();
}).get();
ok( sizes[ 0 ] >= 70 && sizes[ 0 ] <= 105, "was " + sizes[ 0 ] );
ok( sizes[ 1 ] >= 98 && sizes[ 1 ] <= 126, "was " + sizes[ 1 ] );
ok( sizes[ 2 ] >= 42 && sizes[ 2 ] <= 54, "was " + sizes[ 2 ] );
equal( sizes[ 0 ], 75 );
equal( sizes[ 1 ], 105 );
equal( sizes[ 2 ], 45 );
});

test( "{ heightStyle: 'fill' }", function() {
expect( 3 );
$( "#navigationWrapper" ).height( 500 );
var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
equalHeights( element, 446, 458 );
equalHeight( element, 455 );
});

test( "{ heightStyle: 'fill' } with sibling", function() {
@@ -391,7 +391,7 @@ test( "{ heightStyle: 'fill' } with sibling", function() {
})
.prependTo( "#navigationWrapper" );
var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
equalHeights( element , 346, 358);
equalHeight( element , 355 );
});

test( "{ heightStyle: 'fill' } with multiple siblings", function() {
@@ -420,7 +420,7 @@ test( "{ heightStyle: 'fill' } with multiple siblings", function() {
})
.prependTo( "#navigationWrapper" );
var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
equalHeights( element, 296, 308 );
equalHeight( element, 305 );
});

test( "{ icons: false }", function() {
@@ -1,13 +1,8 @@
TestHelpers.accordion = {
equalHeights: function( accordion, min, max ) {
var sizes = [];
equalHeight: function( accordion, height ) {
accordion.find( ".ui-accordion-content" ).each(function() {
sizes.push( $( this ).outerHeight() );
equal( $( this ).outerHeight(), height );
});
ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
"must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
deepEqual( sizes[ 0 ], sizes[ 1 ] );
deepEqual( sizes[ 0 ], sizes[ 2 ] );
},

setupTeardown: function() {
@@ -153,4 +153,14 @@ test( "outerHeight(true) - setter", function() {
equal( el.height(), 32, "height set properly when hidden" );
});

test( "uniqueId / removeUniqueId", function() {
var el = $( "img" ).eq( 0 );

equal( el.attr( "id" ), undefined, "element has no initial id" );
el.uniqueId();
ok( /ui-id-\d+$/.test( el.attr( "id" ) ), "element has generated id" );
el.removeUniqueId();
equal( el.attr( "id" ), undefined, "unique id has been removed from element" );
});

})( jQuery );
@@ -89,26 +89,11 @@ function margin(el, side) {
module("dialog: core");

test("title id", function() {
expect(3);

var titleId;

// reset the uuid so we know what values to expect
$.ui.dialog.uuid = 0;
expect(1);

el = $('<div></div>').dialog();
titleId = dlg().find('.ui-dialog-title').attr('id');
equal(titleId, 'ui-dialog-title-1', 'auto-numbered title id');
el.remove();

el = $('<div></div>').dialog();
titleId = dlg().find('.ui-dialog-title').attr('id');
equal(titleId, 'ui-dialog-title-2', 'auto-numbered title id');
el.remove();

el = $('<div id="foo">').dialog();
titleId = dlg().find('.ui-dialog-title').attr('id');
equal(titleId, 'ui-dialog-title-foo', 'carried over title id');
var titleId = dlg().find('.ui-dialog-title').attr('id');
ok( /ui-id-\d+$/.test( titleId ), 'auto-numbered title id');
el.remove();
});

@@ -55,7 +55,7 @@ <h2 id="qunit-userAgent"></h2>
<li class="foo"><a class="foo" href="#">Aberdeen</a></li>
<li class="foo"><a class="foo" href="#">Ada</a></li>
<li class="foo"><a class="foo" href="#">Adamsville</a></li>
<li class="foo"><a class="foo" href="#">Addyston</a></li>
<li class="foo"><a id="testID1" class="foo" href="#">Addyston</a></li>
<li class="foo"><a class="foo" href="#">Adelphi</a></li>
</ul>

@@ -88,8 +88,11 @@ <h2 id="qunit-userAgent"></h2>
<a href="#">Delphi</a>
<ul>
<li class="foo"><a class="foo" href="#">Ada</a></li>
<li> - </li>
<li class="foo"><a class="foo" href="#">Saarland</a></li>
<li></li>
<li class="foo"><a class="foo" href="#">Salzburg</a></li>
<li>&ndash;</li>
</ul>
</li>
<li class="foo"><a class="foo" href="#">Perch</a></li>
@@ -232,7 +235,7 @@ <h2 id="qunit-userAgent"></h2>
<a href="#">Delphi</a>
<div>
<blockquote><a href="#">Ada</a></blockquote>
<blockquote><a href="#">Saarland</a></blockquote>
<blockquote><a id="testID2" href="#">Saarland</a></blockquote>
<blockquote><a href="#">Salzburg</a></blockquote>
</div>
</blockquote>
@@ -255,7 +258,7 @@ <h2 id="qunit-userAgent"></h2>
<li class="foo"><a class="foo" href="#">Adamsville</a></li>
<li class="foo"><a class="foo" href="#">Addyston</a></li>
<li class="ui-state-disabled">
<a href="#">Delphi</a>
<a id="testID3" href="#">Delphi</a>
<ul>
<li class="foo"><a class="foo" href="#">Ada</a></li>
<li class="foo"><a class="foo" href="#">Saarland</a></li>
@@ -23,7 +23,7 @@ test("accessibility", function () {

item = menu.find( "li:last" );
menu.menu( "focus", $.Event(), item );
equal( menu.attr("aria-activedescendant"), "menu1-4", "aria attribute, generated id");
ok( /^ui-id-\d+$/.test( menu.attr( "aria-activedescendant" ) ), "aria attribute, generated id");
});

})(jQuery);

0 comments on commit 749c8fb

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