From 9f841dffcc83105cc2517c7e31640848fbfff0af Mon Sep 17 00:00:00 2001 From: Matthieu Penant Date: Mon, 17 Dec 2012 08:29:17 -0500 Subject: [PATCH 1/3] Datepicker: Added Candian French locale. Fixes #8917 - Datepicker: Add Canadian French locale. --- demos/datepicker/localization.html | 2 ++ ui/i18n/jquery.ui.datepicker-fr-CA.js | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 ui/i18n/jquery.ui.datepicker-fr-CA.js diff --git a/demos/datepicker/localization.html b/demos/datepicker/localization.html index 968196295..49e8475b4 100644 --- a/demos/datepicker/localization.html +++ b/demos/datepicker/localization.html @@ -32,6 +32,7 @@ + @@ -106,6 +107,7 @@ + diff --git a/ui/i18n/jquery.ui.datepicker-fr-CA.js b/ui/i18n/jquery.ui.datepicker-fr-CA.js new file mode 100644 index 000000000..184b88fd3 --- /dev/null +++ b/ui/i18n/jquery.ui.datepicker-fr-CA.js @@ -0,0 +1,23 @@ +/* Canadian-French initialisation for the jQuery UI date picker plugin. */ +jQuery(function ($) { + $.datepicker.regional['fr-CA'] = { + closeText: 'Fermer', + prevText: 'Précédent', + nextText: 'Suivant', + currentText: 'Aujourd\'hui', + monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', + 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], + monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin', + 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], + dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], + dayNamesShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], + dayNamesMin: ['D', 'L', 'M', 'M', 'J', 'V', 'S'], + weekHeader: 'Sem.', + dateFormat: 'yy-mm-dd', + firstDay: 0, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: '' + }; + $.datepicker.setDefaults($.datepicker.regional['fr-CA']); +}); From 9cbd4b42221389277cf90a6662f17c500d1a77df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 18 Dec 2012 08:38:36 -0500 Subject: [PATCH 2/3] Tooltip: Clear the tracking interval on close. Fixes #8920 -Tooltip potential setinterval endless loop. --- ui/jquery.ui.tooltip.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index 3984826ce..d44ff8d06 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -270,7 +270,7 @@ $.widget( "ui.tooltip", { // as the tooltip is visible, position the tooltip using the most recent // event. if ( this.options.show && this.options.show.delay ) { - delayedShow = setInterval(function() { + delayedShow = this.delayedShow = setInterval(function() { if ( tooltip.is( ":visible" ) ) { position( positionOption.of ); clearInterval( delayedShow ); @@ -312,6 +312,9 @@ $.widget( "ui.tooltip", { return; } + // Clear the interval for delayed tracking tooltips + clearInterval( this.delayedShow ); + // only set title if we had one before (see comment in _open()) if ( target.data( "ui-tooltip-title" ) ) { target.attr( "title", target.data( "ui-tooltip-title" ) ); From 209443d716587d896ffcdf26c0fd8c8a23437b3c Mon Sep 17 00:00:00 2001 From: Dominic Barnes Date: Thu, 6 Dec 2012 16:11:23 -0600 Subject: [PATCH 3/3] Slider: Create clone of options.values during _create(). Fixed #8892 - Multiple Sliders have Conflict with options.values. --- tests/unit/slider/slider_options.js | 31 ++++++++++++++++++++++++++--- ui/jquery.ui.slider.js | 5 +++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/tests/unit/slider/slider_options.js b/tests/unit/slider/slider_options.js index 96d0d45d0..e34352eb0 100644 --- a/tests/unit/slider/slider_options.js +++ b/tests/unit/slider/slider_options.js @@ -143,8 +143,33 @@ test("step", function() { // ok(false, "missing test - untested code is broken code."); //}); -//test("values", function() { -// ok(false, "missing test - untested code is broken code."); -//}); +test("values", function() { + expect( 2 ); + + // testing multiple ranges on the same page, the object reference to the values + // property is preserved via multiple range elements, so updating options.values + // of 1 slider updates options.values of all the others + var ranges = $([ + document.createElement("div"), + document.createElement("div") + ]).slider({ + range: true, + values: [ 25, 75 ] + }); + + notStrictEqual( + ranges.eq(0).data("uiSlider").options.values, + ranges.eq(1).data("uiSlider").options.values, + "multiple range sliders should not have a reference to the same options.values array" + ); + + ranges.eq(0).slider("values", 0, 10); + + notEqual( + ranges.eq(0).slider("values", 0), + ranges.eq(1).slider("values", 0), + "the values for multiple sliders should be different" + ); +}); })(jQuery); diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index 4054f1848..712c6853d 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -62,9 +62,10 @@ $.widget( "ui.slider", $.ui.mouse, { if ( o.range === true ) { if ( !o.values ) { o.values = [ this._valueMin(), this._valueMin() ]; - } - if ( o.values.length && o.values.length !== 2 ) { + } else if ( o.values.length && o.values.length !== 2 ) { o.values = [ o.values[0], o.values[0] ]; + } else if ( $.isArray( o.values ) ) { + o.values = o.values.slice(0); } }