From 54092e4f63fefb37f7aade2fab42dcf2b288ae9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Thu, 21 Mar 2013 17:09:21 +0100 Subject: [PATCH 01/25] Autocomplete: Menu's input option is long gone, remove leftovers --- ui/jquery.ui.autocomplete.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 92ddc3a12..3d0343379 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -195,8 +195,6 @@ $.widget( "ui.autocomplete", { .addClass( "ui-autocomplete ui-front" ) .appendTo( this._appendTo() ) .menu({ - // custom key handling for now - input: $(), // disable ARIA support, the live region takes care of that role: null }) From f281ce9e6c99cc28dbbcf38b7d32bccd14b91b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 21 Mar 2013 12:34:28 -0400 Subject: [PATCH 02/25] Upgrade to grunt 0.4.1. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 93c45a9fc..f348f88cd 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ ], "dependencies": {}, "devDependencies": { - "grunt": "0.4.0", + "grunt": "0.4.1", "grunt-contrib-jshint": "0.1.1", "grunt-contrib-uglify": "0.1.1", "grunt-contrib-concat": "0.1.3", From ff11b69a67e0176c851ff3bdec997c7a75d47a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 21 Mar 2013 15:54:50 -0400 Subject: [PATCH 03/25] Autocomplete: Insert the live region before the input. Fixes #9172 - Autocomplete: .replaceWith() fails to replace. --- tests/unit/autocomplete/autocomplete_core.js | 10 ++++++++++ ui/jquery.ui.autocomplete.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js index a9fc1143c..6f1195910 100644 --- a/tests/unit/autocomplete/autocomplete_core.js +++ b/tests/unit/autocomplete/autocomplete_core.js @@ -188,4 +188,14 @@ test( "ARIA", function() { "Live region for multiple values" ); }); +test( ".replaceWith() (#9172)", function() { + expect( 1 ); + + var element = $( "#autocomplete" ).autocomplete(), + replacement = "
test
", + parent = element.parent(); + element.replaceWith( replacement ); + equal( parent.html(), replacement ); +}); + }( jQuery ) ); diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 3d0343379..28cfdf2fb 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -296,7 +296,7 @@ $.widget( "ui.autocomplete", { "aria-live": "polite" }) .addClass( "ui-helper-hidden-accessible" ) - .insertAfter( this.element ); + .insertBefore( this.element ); // turning off autocomplete prevents the browser from remembering the // value when navigating through history, so we re-enable autocomplete From ae4753b3f1c8d320e11a63f028ec02dc621d24e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 21 Mar 2013 17:11:59 -0400 Subject: [PATCH 04/25] Datepicker Added it-CH locale. Fixes #9175 - Datepicker: Add Italian in Switzerland locale. --- ui/i18n/jquery.ui.datepicker-it-CH.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ui/i18n/jquery.ui.datepicker-it-CH.js diff --git a/ui/i18n/jquery.ui.datepicker-it-CH.js b/ui/i18n/jquery.ui.datepicker-it-CH.js new file mode 100644 index 000000000..f19a56d34 --- /dev/null +++ b/ui/i18n/jquery.ui.datepicker-it-CH.js @@ -0,0 +1,23 @@ +/* Italian initialisation for the jQuery UI date picker plugin. */ +/* Written by Antonello Pasella (antonello.pasella@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['it-CH'] = { + closeText: 'Chiudi', + prevText: '<Prec', + nextText: 'Succ>', + currentText: 'Oggi', + monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', + 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], + monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', + 'Lug','Ago','Set','Ott','Nov','Dic'], + dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'], + dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], + dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'], + weekHeader: 'Sm', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['it-CH']); +}); From f306a826a4d3b4c36c3f86cb5feeee23bb0db4c3 Mon Sep 17 00:00:00 2001 From: Jason Moon Date: Thu, 21 Mar 2013 09:56:39 -0500 Subject: [PATCH 05/25] Sortable: update placeholder when axis is x or y for connected lists. Fixed #8301 - Placeholder doesn't move when using connectWith option --- tests/unit/sortable/sortable_options.js | 28 +++++++++++++++++++++++++ ui/jquery.ui.sortable.js | 4 +++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/unit/sortable/sortable_options.js b/tests/unit/sortable/sortable_options.js index 8dcf0e82f..a499c01c1 100644 --- a/tests/unit/sortable/sortable_options.js +++ b/tests/unit/sortable/sortable_options.js @@ -151,6 +151,34 @@ test( "#8792: issues with floated items in connected lists", function() { equal( changeCount, 3, "change fired once for each expected change when dragging a floated sortable to a connected container" ); }); +test( "#8301: single axis with connected list", function() { + expect( 1 ); + + var element = $( "#sortable" ).sortable({ + axis: "y", + tolerance: "pointer", + connectWith: ".connected" + }); + + $( "
  • Item 7
  • Item 8
" ) + .sortable({ + axis: "y", + tolerance: "pointer", + connectWith: "#sortable", + receive: function() { + ok( true, "connected list received item" ); + } + }) + .insertAfter( element ); + + element.find( "li" ).eq( 0 ).simulate( "drag", { + handle: "corner", + dx: -1, + dy: 114, + moves: 1 + }); +}); + /* test("{ connectWith: false }, default", function() { ok(false, "missing test - untested code is broken code."); diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 642d5d947..d16407216 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -535,7 +535,9 @@ $.widget("ui.sortable", $.ui.mouse, { b = t + item.height, dyClick = this.offset.click.top, dxClick = this.offset.click.left, - isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ), + isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ), + isOverElement = isOverElementHeight && isOverElementWidth; if ( this.options.tolerance === "pointer" || this.options.forcePointerForContainers || From dc5254aa0703f9f7fd9d290c3078a5e9267160d9 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Sat, 23 Mar 2013 04:12:52 +0200 Subject: [PATCH 06/25] Draggable: Handle containment set to false after init, and style improvements. Fixes #8962 - Containment doesn't properly update --- tests/unit/draggable/draggable_options.js | 7 +- ui/jquery.ui.draggable.js | 99 +++++++++++++---------- 2 files changed, 61 insertions(+), 45 deletions(-) diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index f4fca0b2e..bf47b4354 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -378,7 +378,7 @@ test( "containment, account for border", function() { }); test( "containment, default, switching after initialization", function() { - expect( 2 ); + expect( 3 ); var element = $( "#draggable1" ).draggable({ containment: false }); @@ -393,9 +393,8 @@ test( "containment, default, switching after initialization", function() { TestHelpers.draggable.testDrag( element, element, -100, -100, 0, 0 ); - // TODO: Switching back to false does not update to false - // element.draggable( "option", "containment", false ); - // TestHelpers.draggable.testDrag( element, element, -100, -100, -100, -100 ); + element.draggable( "option", "containment", false ); + TestHelpers.draggable.testDrag( element, element, -100, -100, -100, -100 ); }); test( "{ cursor: 'auto' }, default", function() { diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index e5fc069b9..0c58aa4b8 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -156,9 +156,7 @@ $.widget("ui.draggable", $.ui.mouse, { (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); //Set a containment if given in the options - if(o.containment) { - this._setContainment(); - } + this._setContainment(); //Trigger event + callbacks if(this._trigger("start", event) === false) { @@ -383,40 +381,56 @@ $.widget("ui.draggable", $.ui.mouse, { var over, c, ce, o = this.options; - if(o.containment === "parent") { - o.containment = this.helper[0].parentNode; - } - if(o.containment === "document" || o.containment === "window") { - this.containment = [ - o.containment === "document" ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, - o.containment === "document" ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, - (o.containment === "document" ? 0 : $(window).scrollLeft()) + $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left, - (o.containment === "document" ? 0 : $(window).scrollTop()) + ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top - ]; + if ( !o.containment ) { + this.containment = null; + return; } - if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor !== Array) { - c = $(o.containment); - ce = c[0]; - - if(!ce) { - return; - } - - over = ($(ce).css("overflow") !== "hidden"); - + if ( o.containment === "window" ) { this.containment = [ - (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), - (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), - (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderRightWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, - (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderBottomWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom + $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left, + $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top, + $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left, + $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top ]; - this.relative_container = c; + return; + } - } else if(o.containment.constructor === Array) { + if ( o.containment === "document") { + this.containment = [ + 0, + 0, + $( document ).width() - this.helperProportions.width - this.margins.left, + ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top + ]; + return; + } + + if ( o.containment.constructor === Array ) { this.containment = o.containment; + return; } + if ( o.containment === "parent" ) { + o.containment = this.helper[ 0 ].parentNode; + } + + c = $( o.containment ); + ce = c[ 0 ]; + + if( !ce ) { + return; + } + + over = c.css( "overflow" ) !== "hidden"; + + this.containment = [ + ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ), + ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ) , + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left - this.margins.right, + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top - this.margins.bottom + ]; + this.relative_container = c; }, _convertPositionTo: function(d, pos) { @@ -469,18 +483,21 @@ $.widget("ui.draggable", $.ui.mouse, { * Constrain the position to a mix of grid, containment. */ - if(this.originalPosition) { //If we are not dragging yet, we won't check for options - if(this.containment) { - if (this.relative_container){ - co = this.relative_container.offset(); - containment = [ this.containment[0] + co.left, - this.containment[1] + co.top, - this.containment[2] + co.left, - this.containment[3] + co.top ]; - } - else { - containment = this.containment; - } + // If we are not dragging yet, we won't check for options + if ( this.originalPosition ) { + if ( this.containment ) { + if ( this.relative_container ){ + co = this.relative_container.offset(); + containment = [ + this.containment[ 0 ] + co.left, + this.containment[ 1 ] + co.top, + this.containment[ 2 ] + co.left, + this.containment[ 3 ] + co.top + ]; + } + else { + containment = this.containment; + } if(event.pageX - this.offset.click.left < containment[0]) { pageX = containment[0] + this.offset.click.left; From 53c88a76ab965fed2ace8df42b3890549d2817d6 Mon Sep 17 00:00:00 2001 From: Suhail Alkowaileet Date: Sat, 23 Mar 2013 13:11:14 +0300 Subject: [PATCH 07/25] Datepicker demo: Corrected the Arabic word for Arabic. --- demos/datepicker/localization.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/datepicker/localization.html b/demos/datepicker/localization.html index c5e6dd0fd..d788108d1 100644 --- a/demos/datepicker/localization.html +++ b/demos/datepicker/localization.html @@ -28,7 +28,7 @@

Date: