From 29bea45e0ca8a53928b491ede773d010d9a5abbf Mon Sep 17 00:00:00 2001
From: tomykaira
Date: Mon, 16 May 2011 12:29:23 +0900
Subject: [PATCH 01/38] effects.scale:fix the position after resizing with
saving the result value. #4316 - Element jumps to wrong position after scale
effect with origin: ['middle','center'] parameter
---
ui/jquery.effects.scale.js | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/ui/jquery.effects.scale.js b/ui/jquery.effects.scale.js
index 843aa2241df..71f608998b1 100644
--- a/ui/jquery.effects.scale.js
+++ b/ui/jquery.effects.scale.js
@@ -174,6 +174,13 @@ $.effects.effect.size = function( o ) {
};
};
+ if (restore) {
+ $.effects.save( el, props );
+ } else {
+ el.to.topAbs = parseInt( el.css( "top" ) , 10 ) + el.to.top;
+ el.to.leftAbs = parseInt( el.css( "left" ) , 10 ) + el.to.left;
+ $.effects.save( el, props1 );
+ }
$.effects.save( el, restore ? props : props1 );
el.show();
$.effects.createWrapper( el );
@@ -238,7 +245,13 @@ $.effects.effect.size = function( o ) {
if( mode == 'hide' ) {
el.hide();
}
- $.effects.restore( el, restore ? props : props1 );
+ if ( restore ) {
+ $.effects.restore( el, props );
+ } else {
+ $.effects.restore( el, props1 );
+ el.css( "top", el.to.topAbs );
+ el.css( "left", el.to.leftAbs );
+ }
$.effects.removeWrapper( el );
$.isFunction( o.complete ) && o.complete.apply( this, arguments ); // Callback
el.dequeue();
From 9b3fc64aba031ebeac20d19e0375c92a1bdcb815 Mon Sep 17 00:00:00 2001
From: tomykaira
Date: Mon, 16 May 2011 12:29:23 +0900
Subject: [PATCH 02/38] effects.scale:fix the position after resizing with
saving the result value. #4316 - Element jumps to wrong position after scale
effect with origin: ['middle','center'] parameter
---
ui/jquery.effects.scale.js | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/ui/jquery.effects.scale.js b/ui/jquery.effects.scale.js
index 843aa2241df..71f608998b1 100644
--- a/ui/jquery.effects.scale.js
+++ b/ui/jquery.effects.scale.js
@@ -174,6 +174,13 @@ $.effects.effect.size = function( o ) {
};
};
+ if (restore) {
+ $.effects.save( el, props );
+ } else {
+ el.to.topAbs = parseInt( el.css( "top" ) , 10 ) + el.to.top;
+ el.to.leftAbs = parseInt( el.css( "left" ) , 10 ) + el.to.left;
+ $.effects.save( el, props1 );
+ }
$.effects.save( el, restore ? props : props1 );
el.show();
$.effects.createWrapper( el );
@@ -238,7 +245,13 @@ $.effects.effect.size = function( o ) {
if( mode == 'hide' ) {
el.hide();
}
- $.effects.restore( el, restore ? props : props1 );
+ if ( restore ) {
+ $.effects.restore( el, props );
+ } else {
+ $.effects.restore( el, props1 );
+ el.css( "top", el.to.topAbs );
+ el.css( "left", el.to.leftAbs );
+ }
$.effects.removeWrapper( el );
$.isFunction( o.complete ) && o.complete.apply( this, arguments ); // Callback
el.dequeue();
From ca8d70dbbf9eff0057cf67f695e66b8c40cec09b Mon Sep 17 00:00:00 2001
From: tomykaira
Date: Mon, 16 May 2011 12:35:23 +0900
Subject: [PATCH 03/38] effects.scale:[amend] fix the position after resizing
with saving the result value. #4316 - Element jumps to wrong position after
scale effect with origin: ['middle','center'] parameter
---
ui/jquery.effects.scale.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/ui/jquery.effects.scale.js b/ui/jquery.effects.scale.js
index 71f608998b1..e79ec82e1ed 100644
--- a/ui/jquery.effects.scale.js
+++ b/ui/jquery.effects.scale.js
@@ -181,7 +181,6 @@ $.effects.effect.size = function( o ) {
el.to.leftAbs = parseInt( el.css( "left" ) , 10 ) + el.to.left;
$.effects.save( el, props1 );
}
- $.effects.save( el, restore ? props : props1 );
el.show();
$.effects.createWrapper( el );
el.css( 'overflow', 'hidden' ).css( el.from );
From cfc833a223658bcbbac89f5b6cb09f12062d218f Mon Sep 17 00:00:00 2001
From: tomykaira
Date: Thu, 19 May 2011 01:49:18 +0900
Subject: [PATCH 04/38] effects.scale: fix the position when top or left is
auto. #4316 - Element jumps to wrong position after "scale" effect with
origin: ['middle','center'] parameter
---
ui/jquery.effects.scale.js | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/ui/jquery.effects.scale.js b/ui/jquery.effects.scale.js
index e79ec82e1ed..64dbd69cea0 100644
--- a/ui/jquery.effects.scale.js
+++ b/ui/jquery.effects.scale.js
@@ -117,7 +117,9 @@ $.effects.effect.size = function( o ) {
origin = o.origin,
original = {
height: el.height(),
- width: el.width()
+ width: el.width(),
+ top: el.offset().top,
+ left: el.offset().left
},
baseline, factor;
@@ -177,8 +179,8 @@ $.effects.effect.size = function( o ) {
if (restore) {
$.effects.save( el, props );
} else {
- el.to.topAbs = parseInt( el.css( "top" ) , 10 ) + el.to.top;
- el.to.leftAbs = parseInt( el.css( "left" ) , 10 ) + el.to.left;
+ el.to.topAbs = original.top + el.to.top;
+ el.to.leftAbs = original.left + el.to.left;
$.effects.save( el, props1 );
}
el.show();
@@ -248,6 +250,7 @@ $.effects.effect.size = function( o ) {
$.effects.restore( el, props );
} else {
$.effects.restore( el, props1 );
+ el.css( "position", "absolute" );
el.css( "top", el.to.topAbs );
el.css( "left", el.to.leftAbs );
}
From 4de3f0f1f27ebff5a87b64ddae2adae65b685234 Mon Sep 17 00:00:00 2001
From: Kato Kazuyoshi
Date: Sat, 7 May 2011 05:58:06 +0900
Subject: [PATCH 05/38] Datepicker: onClose callback should be triggered by
show. Fixed #6656 - onClose event not triggered.
---
tests/unit/datepicker/datepicker.html | 1 +
tests/unit/datepicker/datepicker_events.js | 5 +++++
ui/jquery.ui.datepicker.js | 16 ++++++++++++----
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/tests/unit/datepicker/datepicker.html b/tests/unit/datepicker/datepicker.html
index fa346c6c910..d0c2c8c8cee 100644
--- a/tests/unit/datepicker/datepicker.html
+++ b/tests/unit/datepicker/datepicker.html
@@ -49,6 +49,7 @@
diff --git a/tests/unit/datepicker/datepicker_events.js b/tests/unit/datepicker/datepicker_events.js
index 84ca2f98ed3..bf48c9c8a58 100644
--- a/tests/unit/datepicker/datepicker_events.js
+++ b/tests/unit/datepicker/datepicker_events.js
@@ -112,6 +112,11 @@ test('events', function() {
inp.val('02/04/2008').datepicker('show').
simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END});
equals(selectedDate, '', 'Callback close date - ctrl+end');
+
+ var inp2 = init('#inp2');
+ inp2.datepicker().datepicker('option', {onClose: callback}).datepicker('show');
+ inp.datepicker('show');
+ equals(selectedThis, inp2[0], 'Callback close this');
});
})(jQuery);
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 5b1dad68472..79232c62dff 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -614,6 +614,9 @@ $.extend(Datepicker.prototype, {
return;
var inst = $.datepicker._getInst(input);
if ($.datepicker._curInst && $.datepicker._curInst != inst) {
+ if ( $.datepicker._datepickerShowing ) {
+ $.datepicker._triggerOnClose($.datepicker._curInst);
+ }
$.datepicker._curInst.dpDiv.stop(true, true);
}
var beforeShow = $.datepicker._get(inst, 'beforeShow');
@@ -759,6 +762,14 @@ $.extend(Datepicker.prototype, {
return [position.left, position.top];
},
+ /* Trigger custom callback of onClose. */
+ _triggerOnClose: function(inst) {
+ var onClose = this._get(inst, 'onClose');
+ if (onClose)
+ onClose.apply((inst.input ? inst.input[0] : null),
+ [(inst.input ? inst.input.val() : ''), inst]);
+ },
+
/* Hide the date picker from view.
@param input element - the input field attached to the date picker */
_hideDatepicker: function(input) {
@@ -781,10 +792,7 @@ $.extend(Datepicker.prototype, {
(showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);
if (!showAnim)
postProcess();
- var onClose = this._get(inst, 'onClose');
- if (onClose)
- onClose.apply((inst.input ? inst.input[0] : null),
- [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback
+ $.datepicker._triggerOnClose(inst);
this._datepickerShowing = false;
this._lastInput = null;
if (this._inDialog) {
From ba2d7f4959a4db364c60e8b21285faf97ed3a436 Mon Sep 17 00:00:00 2001
From: kborchers
Date: Thu, 12 May 2011 13:31:15 -0500
Subject: [PATCH 06/38] Dialog: Changed IE6 overlay width adjustment to apply
to all IE versions. Fixed #3623 - Opening a Modal Dialog shows a horizontal
scroll bar
---
ui/jquery.ui.dialog.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 496118761d0..64b1de92d70 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -780,8 +780,8 @@ $.extend( $.ui.dialog.overlay, {
width: function() {
var scrollWidth,
offsetWidth;
- // handle IE 6
- if ( $.browser.msie && $.browser.version < 7 ) {
+ // handle IE
+ if ( $.browser.msie ) {
scrollWidth = Math.max(
document.documentElement.scrollWidth,
document.body.scrollWidth
From f0400e62093dcec82381bc2ec4cd1996d28d02df Mon Sep 17 00:00:00 2001
From: gnarf
Date: Sat, 14 May 2011 06:26:46 -0500
Subject: [PATCH 07/38] Tabs: Removing queue logic, _hideTab, and _showTab -
Replaced with _toggle - Fixes #7357 Tabs: Remove queueing logic
---
ui/jquery.ui.tabs.js | 118 ++++++++++++++++++-------------------------
1 file changed, 50 insertions(+), 68 deletions(-)
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 76f4fb27449..3ea6017d796 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -13,7 +13,7 @@
*/
(function( $, undefined ) {
-var tabId = 0
+var tabId = 0;
function getNextTabId() {
return ++tabId;
}
@@ -289,58 +289,14 @@ $.widget( "ui.tabs", {
// Reset certain styles left over from animation
// and prevent IE's ClearType bug...
_resetStyle: function ( $el, fx ) {
- $el.css( "display", "" );
+ $el.css( "display", function( oldValue ) {
+ return oldValue === "none" ? oldValue : "";
+ });
if ( !$.support.opacity && fx.opacity ) {
$el[ 0 ].style.removeAttribute( "filter" );
}
},
- _showTab: function( event, eventData ) {
- var that = this;
-
- $( eventData.newTab ).closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
-
- if ( that.showFx ) {
- that.running = true;
- eventData.newPanel
- // TODO: why are we hiding? old code?
- .hide()
- .animate( that.showFx, that.showFx.duration || "normal", function() {
- that._resetStyle( $( this ), that.showFx );
- that.running = false;
- that._trigger( "activate", event, eventData );
- });
- } else {
- eventData.newPanel.show();
- that._trigger( "activate", event, eventData );
- }
- },
-
- // TODO: combine with _showTab()
- _hideTab: function( event, eventData ) {
- var that = this;
-
- if ( that.hideFx ) {
- that.running = true;
- eventData.oldPanel.animate( that.hideFx, that.hideFx.duration || "normal", function() {
- that.running = false;
- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
- that._resetStyle( $( this ), that.hideFx );
- that.element.dequeue( "tabs" );
- if ( !eventData.newPanel.length ) {
- that._trigger( "activate", event, eventData );
- }
- });
- } else {
- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
- eventData.oldPanel.hide();
- that.element.dequeue( "tabs" );
- if ( !eventData.newPanel.length ) {
- that._trigger( "activate", event, eventData );
- }
- }
- },
-
_setupEvents: function( event ) {
// attach tab event handler, unbind to avoid duplicates from former tabifying...
this.anchors.unbind( ".tabs" );
@@ -399,22 +355,58 @@ $.widget( "ui.tabs", {
throw "jQuery UI Tabs: Mismatching fragment identifier.";
}
- if ( toHide.length ) {
- that.element.queue( "tabs", function() {
- that._hideTab( event, eventData );
- });
- }
if ( toShow.length ) {
- that.element.queue( "tabs", function() {
- that._showTab( event, eventData );
- });
// TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
that.load( that.anchors.index( clicked ), event );
clicked[ 0 ].blur();
+ }
+ that._toggle( event, eventData );
+ },
+
+ // handles show/hide for selecting tabs
+ _toggle: function( event, eventData ) {
+ var that = this,
+ options = that.options,
+ toShow = eventData.newPanel,
+ toHide = eventData.oldPanel;
+
+ that.running = true;
+
+ function complete() {
+ that.running = false;
+ that._trigger( "activate", event, eventData );
+ }
+
+ function show() {
+ eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
+
+ if ( toShow.length && that.showFx ) {
+ toShow
+ // TODO: why are we hiding? old code?
+ .hide()
+ .animate( that.showFx, that.showFx.duration || "normal", function() {
+ that._resetStyle( $( this ), that.showFx );
+ complete();
+ });
+ } else {
+ toShow.show();
+ complete();
+ }
+ }
+
+ // start out by hiding, then showing, then completing
+ if ( toHide.length && that.hideFx ) {
+ toHide.animate( that.hideFx, that.hideFx.duration || "normal", function() {
+ eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
+ that._resetStyle( $( this ), that.hideFx );
+ show();
+ });
} else {
- that.element.dequeue( "tabs" );
+ eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
+ toHide.hide();
+ show();
}
},
@@ -554,7 +546,6 @@ $.widget( "ui.tabs", {
// not remote
if ( !url ) {
- this.element.dequeue( "tabs" );
return;
}
@@ -577,13 +568,7 @@ $.widget( "ui.tabs", {
})
.complete(function( jqXHR, status ) {
if ( status === "abort" ) {
- // stop possibly running animations
- self.element.queue( [] );
self.panels.stop( false, true );
-
- // "tabs" queue must not contain more than two elements,
- // which are the callbacks for the latest clicked tab...
- self.element.queue( "tabs", self.element.queue( "tabs" ).splice( -2, 2 ) );
}
self.lis.eq( index ).removeClass( "ui-tabs-loading" );
@@ -592,9 +577,6 @@ $.widget( "ui.tabs", {
});
}
- // last, so that load event is fired before show...
- self.element.dequeue( "tabs" );
-
return this;
},
@@ -938,7 +920,7 @@ if ( $.uiBackCompat !== false ) {
this._trigger( "show", null, this._ui(
this.active[ 0 ], this._getPanelForTab( this.active )[ 0 ] ) );
}
- }
+ };
prototype._trigger = function( type, event, data ) {
var ret = _trigger.apply( this, arguments );
if ( !ret ) {
From 45ad61388e914fac60309a371c24514b4b158365 Mon Sep 17 00:00:00 2001
From: Trey Hunner
Date: Tue, 10 May 2011 20:24:21 -0700
Subject: [PATCH 08/38] Autocomplete: Trigger search timeout on all input
events. Fixes #6666 - keyboard-autorepeat on Firefox and paste event
The input event triggers after all changes to an input field including
paste/cut events.
---
ui/jquery.ui.autocomplete.js | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 0e62ccfdb62..f6573174ad4 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -47,7 +47,8 @@ $.widget( "ui.autocomplete", {
_create: function() {
var self = this,
doc = this.element[ 0 ].ownerDocument,
- suppressKeyPress;
+ suppressKeyPress,
+ suppressInput;
this.valueMethod = this.element[ this.element.is( "input" ) ? "val" : "text" ];
@@ -63,10 +64,12 @@ $.widget( "ui.autocomplete", {
.bind( "keydown.autocomplete", function( event ) {
if ( self.options.disabled || self.element.attr( "readonly" ) ) {
suppressKeyPress = true;
+ suppressInput = true;
return;
}
suppressKeyPress = false;
+ suppressInput = false;
var keyCode = $.ui.keyCode;
switch( event.keyCode ) {
case keyCode.PAGE_UP:
@@ -110,15 +113,8 @@ $.widget( "ui.autocomplete", {
self.close( event );
break;
default:
- // keypress is triggered before the input value is changed
- clearTimeout( self.searching );
- self.searching = setTimeout(function() {
- // only search if the value has changed
- if ( self.term != self._value() ) {
- self.selectedItem = null;
- self.search( null, event );
- }
- }, self.options.delay );
+ // search timeout should be triggered before the input value is changed
+ self._searchTimeout( event );
break;
}
})
@@ -150,6 +146,14 @@ $.widget( "ui.autocomplete", {
break;
}
})
+ .bind( "input.autocomplete", function(event) {
+ if ( suppressInput ) {
+ suppressInput = false;
+ event.preventDefault();
+ return;
+ }
+ self._searchTimeout( event );
+ })
.bind( "focus.autocomplete", function() {
if ( self.options.disabled ) {
return;
@@ -317,6 +321,17 @@ $.widget( "ui.autocomplete", {
}
},
+ _searchTimeout: function( event ) {
+ var self = this;
+ self.searching = setTimeout(function() {
+ // only search if the value has changed
+ if ( self.term != self.element.val() ) {
+ self.selectedItem = null;
+ self.search( null, event );
+ }
+ }, self.options.delay );
+ },
+
search: function( value, event ) {
value = value != null ? value : this._value();
From 02201ae0124f79692c0605b50d9a191d85150bdb Mon Sep 17 00:00:00 2001
From: Ben Boyle
Date: Mon, 16 May 2011 21:08:13 +1000
Subject: [PATCH 09/38] Button demo: modified order of selectors. Fixed #7094 -
Buttons problem in Opera
---
demos/button/default.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/demos/button/default.html b/demos/button/default.html
index 1ea3fa79652..969ec68380c 100644
--- a/demos/button/default.html
+++ b/demos/button/default.html
@@ -11,7 +11,7 @@
From 8bfbdb17ae02e499ea94e152241532c0cbaf789d Mon Sep 17 00:00:00 2001
From: Jay Merrifield
Date: Sat, 14 May 2011 18:20:06 -0400
Subject: [PATCH 10/38] Datepicker: Made the day of year calculator be more
accurate. Fixes #6827 - Datepicker: Incorrect value for "oo" during Daylight
Saving Time.
---
tests/unit/datepicker/datepicker_tickets.js | 5 +++++
ui/jquery.ui.datepicker.js | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/unit/datepicker/datepicker_tickets.js b/tests/unit/datepicker/datepicker_tickets.js
index 7e6dc5f0009..2b9ce05de68 100644
--- a/tests/unit/datepicker/datepicker_tickets.js
+++ b/tests/unit/datepicker/datepicker_tickets.js
@@ -24,4 +24,9 @@ test('beforeShowDay-getDate', function() {
inp.datepicker('hide');
});
+test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){
+ var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
+ equals(time, "089");
+});
+
})(jQuery);
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 79232c62dff..021041202ed 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -1193,7 +1193,7 @@ $.extend(Datepicker.prototype, {
break;
case 'o':
output += formatNumber('o',
- (date.getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000, 3);
+ Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
break;
case 'm':
output += formatNumber('m', date.getMonth() + 1, 2);
From 1da890e8bf6cd9dfee97bc78fe1305250078587c Mon Sep 17 00:00:00 2001
From: David Murdoch
Date: Mon, 16 May 2011 12:30:23 -0400
Subject: [PATCH 11/38] Tabs: When adding a new tab with an existing panel,
don't move it. Fixes #4578 - adding tab moves targeted panel.
---
ui/jquery.ui.tabs.js | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 3ea6017d796..0df35be339c 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -775,20 +775,30 @@ if ( $.uiBackCompat !== false ) {
li.addClass( "ui-state-default ui-corner-top" ).data( "destroy.tabs", true );
li.find( "a" ).attr( "aria-controls", id );
+ var doInsertAfter = index >= this.lis.length;
+
// try to find an existing element before creating a new one
var panel = this.element.find( "#" + id );
if ( !panel.length ) {
panel = this._createPanel( id );
+ if ( doInsertAfter ) {
+ if ( index > 0 ) {
+ panel.insertAfter( this.panels.eq( -1 ) );
+ } else {
+ panel.appendTo( this.element );
+ }
+ } else {
+ panel.insertBefore( this.panels[ index ] );
+ }
}
panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ).hide();
- if ( index >= this.lis.length ) {
+ if ( doInsertAfter ) {
li.appendTo( this.list );
- panel.appendTo( this.list[ 0 ].parentNode );
} else {
li.insertBefore( this.lis[ index ] );
- panel.insertBefore( this.panels[ index ] );
}
+
options.disabled = $.map( options.disabled, function( n ) {
return n >= index ? ++n : n;
});
From 41443f9d8fb475c956b61ef440887849053b75d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Mon, 16 May 2011 14:41:27 -0400
Subject: [PATCH 12/38] Tabs: Added tests for load method.
---
tests/unit/tabs/tabs_methods.js | 81 ++++++++++++++++++++++++++++++++-
ui/jquery.ui.tabs.js | 11 ++---
2 files changed, 84 insertions(+), 8 deletions(-)
diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js
index 221b0d39de8..5cf917550e5 100644
--- a/tests/unit/tabs/tabs_methods.js
+++ b/tests/unit/tabs/tabs_methods.js
@@ -145,8 +145,85 @@ test( "refresh", function() {
tabs_disabled( element, false );
});
-test('load', function() {
- ok(false, "missing test - untested code is broken code.");
+asyncTest( "load", function() {
+ expect( 30 );
+
+ var element = $( "#tabs2" ).tabs();
+
+ // load content of inactive tab
+ // useful for preloading content with custom caching
+ element.one( "tabsbeforeload", function( event, ui ) {
+ var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
+ panelId = tab.attr( "aria-controls" ),
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ tabs_state( element, 1, 0, 0, 0, 0 );
+ });
+ element.one( "tabsload", function( event, ui ) {
+ var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
+ panelId = tab.attr( "aria-controls" ),
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equals( ui.panel.find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 1, 0, 0, 0, 0 );
+ setTimeout( tabsload1, 1 );
+ });
+ element.tabs( "load", 3 );
+ tabs_state( element, 1, 0, 0, 0, 0 );
+
+ function tabsload1() {
+ // no need to test details of event (tested in events tests)
+ element.one( "tabsbeforeload", function() {
+ ok( true, "tabsbeforeload invoked" );
+ });
+ element.one( "tabsload", function() {
+ ok( true, "tabsload invoked" );
+ setTimeout( tabsload2, 1 );
+ });
+ element.tabs( "option", "active", 3 );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ }
+
+ function tabsload2() {
+ // reload content of active tab
+ element.one( "tabsbeforeload", function( event, ui ) {
+ var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
+ panelId = tab.attr( "aria-controls" ),
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ });
+ element.one( "tabsload", function( event, ui ) {
+ var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
+ panelId = tab.attr( "aria-controls" ),
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ start();
+ });
+ element.tabs( "load", 3 );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ }
});
}( jQuery ) );
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 0df35be339c..36c9000efaf 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -529,14 +529,14 @@ $.widget( "ui.tabs", {
load: function( index, event ) {
index = this._getIndex( index );
var self = this,
- o = this.options,
- a = this.anchors.eq( index )[ 0 ],
- panel = self._getPanelForTab( a ),
+ options = this.options,
+ anchor = this.anchors.eq( index ),
+ panel = self._getPanelForTab( anchor ),
// TODO until #3808 is fixed strip fragment identifier from url
// (IE fails to load from such url)
- url = $( a ).attr( "href" ).replace( /#.*$/, "" ),
+ url = anchor.attr( "href" ).replace( /#.*$/, "" ),
eventData = {
- tab: $( a ),
+ tab: anchor,
panel: panel
};
@@ -558,7 +558,6 @@ $.widget( "ui.tabs", {
});
if ( this.xhr ) {
- // load remote from here on
this.lis.eq( index ).addClass( "ui-tabs-loading" );
this.xhr
From 6317615c0a8a567a2c84948c9739949abd9151cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Mon, 16 May 2011 14:42:31 -0400
Subject: [PATCH 13/38] Tabs: Enable test suites for TestSwarm.
---
tests/unit/tabs/tabs.html | 10 ----------
tests/unit/tabs/tabs_deprecated.html | 10 ----------
2 files changed, 20 deletions(-)
diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html
index 34ec28bc4b1..60f5e972ef5 100644
--- a/tests/unit/tabs/tabs.html
+++ b/tests/unit/tabs/tabs.html
@@ -81,16 +81,6 @@
same( actual, expected );
}
-
diff --git a/tests/unit/tabs/tabs_deprecated.html b/tests/unit/tabs/tabs_deprecated.html
index 89d08f4d005..ed6518be333 100644
--- a/tests/unit/tabs/tabs_deprecated.html
+++ b/tests/unit/tabs/tabs_deprecated.html
@@ -80,16 +80,6 @@
same( actual, expected );
}
-
From 4311cff1d7c7ae399d3df99ea140f3f084f557a1 Mon Sep 17 00:00:00 2001
From: kborchers
Date: Mon, 16 May 2011 16:25:03 -0500
Subject: [PATCH 14/38] Sortable: Changed to check the parent's length so that
the dom position of the removed element is not updated. Fixed #4088 - Unable
to remove() ui.draggable (sortable item) immediately after the drop callback.
---
ui/jquery.ui.sortable.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index 78349669a2e..a8084412f80 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -983,7 +983,7 @@ $.widget("ui.sortable", $.ui.mouse, {
// We first have to update the dom position of the actual currentItem
// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
- if(!this._noFinalSort && this.currentItem[0].parentNode) this.placeholder.before(this.currentItem);
+ if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
this._noFinalSort = null;
if(this.helper[0] == this.currentItem[0]) {
From db009215002e5bac9235c7bcca117e079a97154e Mon Sep 17 00:00:00 2001
From: gnarf
Date: Mon, 16 May 2011 17:19:57 -0500
Subject: [PATCH 15/38] Unit Tests: Cleaning up some code in effects unit
tests, removing magic numbers used for animation durations
---
tests/unit/effects/effects_core.js | 37 ++++++++++++++++++------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js
index 044cc16953c..8d2e8f8df9a 100644
--- a/tests/unit/effects/effects_core.js
+++ b/tests/unit/effects/effects_core.js
@@ -8,7 +8,14 @@ function notPresent( value, array, message ) {
QUnit.push( jQuery.inArray( value, array ) === -1 , value, array, message );
}
-var animateTime = 15;
+// minDuration is used for "short" animate tests where we are only concerned about the final
+var minDuration = 15,
+
+ // duration is used for "long" animates where we plan on testing properties during animation
+ duration = 200,
+
+ // mid is used for testing in the "middle" of the "duration" animations
+ mid = duration / 2;
module( "effects.core" );
@@ -31,16 +38,16 @@ $.each( $.effects.effect, function( effect ) {
test++;
equal( point, test, "Queue function fired in order" );
if ( fn ) {
- fn ();
+ fn();
} else {
- setTimeout( next, animateTime );
+ setTimeout( next, minDuration );
}
};
}
-
- hidden.queue( queueTest() ).show( effect, animateTime, queueTest(function() {
+
+ hidden.queue( queueTest() ).show( effect, minDuration, queueTest(function() {
equal( hidden.css("display"), "block", "Hidden is shown after .show(\"" +effect+ "\", time)" );
- })).queue( queueTest() ).hide( effect, animateTime, queueTest(function() {
+ })).queue( queueTest() ).hide( effect, minDuration, queueTest(function() {
equal( hidden.css("display"), "none", "Back to hidden after .hide(\"" +effect+ "\", time)" );
})).queue( queueTest(function(next) {
deepEqual( hidden.queue(), ["inprogress"], "Only the inprogress sentinel remains");
@@ -55,8 +62,8 @@ asyncTest( "animateClass works with borderStyle", function() {
var test = $("div.animateClass"),
count = 0;
expect(3);
- test.toggleClass("testAddBorder", 20, function() {
- test.toggleClass("testAddBorder", 20, function() {
+ test.toggleClass("testAddBorder", minDuration, function() {
+ test.toggleClass("testAddBorder", minDuration, function() {
equal( test.css("borderLeftStyle"), "none", "None border set" );
start();
});
@@ -69,7 +76,7 @@ asyncTest( "animateClass works with colors", function() {
var test = $("div.animateClass"),
count = 0;
expect(2);
- test.toggleClass("testChangeBackground", 100, function() {
+ test.toggleClass("testChangeBackground", duration, function() {
present( test.css("backgroundColor"), [ "#ffffff", "rgb(255, 255, 255)" ], "Color is final" );
start();
});
@@ -77,27 +84,27 @@ asyncTest( "animateClass works with colors", function() {
var color = test.css("backgroundColor");
notPresent( color, [ "#000000", "#ffffff", "rgb(0, 0, 0)", "rgb(255,255,255)" ],
"Color is not endpoints in middle." );
- }, 50);
+ }, mid);
});
asyncTest( "animateClass works with children", function() {
var test = $("div.animateClass"),
h2 = test.find("h2");
-
+
expect(4);
- test.toggleClass("testChildren", { children: true, duration: 100, complete: function() {
+ test.toggleClass("testChildren", { children: true, duration: duration, complete: function() {
equal( h2.css("fontSize"), "20px", "Text size is final during complete");
- test.toggleClass("testChildren", 100, function() {
+ test.toggleClass("testChildren", duration, function() {
equal( h2.css("fontSize"), "10px", "Text size revertted after class removed");
start();
});
setTimeout(function() {
equal( h2.css("fontSize"), "20px", "Text size unchanged with children: undefined" );
- }, 50);
+ }, mid);
}});
setTimeout(function() {
notPresent( h2.css("fontSize"), ["10px","20px"], "Font size is neither endpoint when in middle.");
- }, 50);
+ }, mid);
});
})(jQuery);
From 0cdc74b0b0a64b610e0d423934b8a5c53474b5ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Tue, 17 May 2011 10:02:22 -0400
Subject: [PATCH 16/38] Tabs: Escape all special characters when sanitizing
hash selectors. Fixes #4681 - Tabs: _sanitizeSelector needs to escape '.'.
---
ui/jquery.ui.tabs.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 36c9000efaf..7702c1e4b75 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -144,7 +144,7 @@ $.widget( "ui.tabs", {
_sanitizeSelector: function( hash ) {
// we need this because an id may contain a ":"
- return hash ? hash.replace( /:/g, "\\:" ) : "";
+ return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@[\]^`{|}~]/g, "\\$&" ) : "";
},
refresh: function() {
From b5633d9d767eadeb618fdd691a3422c35ca37a9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Tue, 17 May 2011 11:13:03 -0400
Subject: [PATCH 17/38] Tabs: Adjust CSS to fix a display issue in IE. Fixes
#5520 - Tabs: Bottom border disappears in IE.
Thanks pmawhinney
---
themes/base/jquery.ui.tabs.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/themes/base/jquery.ui.tabs.css b/themes/base/jquery.ui.tabs.css
index d4c039f3055..9986ab114b6 100644
--- a/themes/base/jquery.ui.tabs.css
+++ b/themes/base/jquery.ui.tabs.css
@@ -9,7 +9,7 @@
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em -1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
From a7189aea3ba696e950ef7ca356d5dcb4ea3fd68a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Tue, 17 May 2011 13:15:44 -0400
Subject: [PATCH 18/38] Tabs: Removed some animation cleanup code that doesn't
appear to be necessary.
---
ui/jquery.ui.tabs.js | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 7702c1e4b75..84d623f62b0 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -286,12 +286,8 @@ $.widget( "ui.tabs", {
}
},
- // Reset certain styles left over from animation
- // and prevent IE's ClearType bug...
+ // TODO: remove once jQuery core properly removes filters - see #4621
_resetStyle: function ( $el, fx ) {
- $el.css( "display", function( oldValue ) {
- return oldValue === "none" ? oldValue : "";
- });
if ( !$.support.opacity && fx.opacity ) {
$el[ 0 ].style.removeAttribute( "filter" );
}
@@ -384,8 +380,6 @@ $.widget( "ui.tabs", {
if ( toShow.length && that.showFx ) {
toShow
- // TODO: why are we hiding? old code?
- .hide()
.animate( that.showFx, that.showFx.duration || "normal", function() {
that._resetStyle( $( this ), that.showFx );
complete();
From 91ff8d49e6cd52e33a3bdb413efcdc7f5216e180 Mon Sep 17 00:00:00 2001
From: David Murdoch
Date: Tue, 17 May 2011 14:12:16 -0400
Subject: [PATCH 19/38] Tabs: Fixed CSS when tabs wrap onto multiple lines.
Fixes #4882 - Selected Tab CSS causes problem when tabs are wrapped onto more
than one line.
---
themes/base/jquery.ui.tabs.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/themes/base/jquery.ui.tabs.css b/themes/base/jquery.ui.tabs.css
index 9986ab114b6..b6429cf721d 100644
--- a/themes/base/jquery.ui.tabs.css
+++ b/themes/base/jquery.ui.tabs.css
@@ -9,9 +9,9 @@
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em -1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: 0; padding-bottom: 1px; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
From bd0bb45bd70e28710b852934ddddbc481c87ea72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Tue, 17 May 2011 15:46:41 -0400
Subject: [PATCH 20/38] Tabs: Fixed load event with back compat enabled.
---
tests/unit/tabs/tabs_deprecated.js | 58 +++++++++++++++++-
tests/unit/tabs/tabs_events.js | 96 +++++++++++++++---------------
tests/unit/tabs/tabs_methods.js | 26 +++++---
ui/jquery.ui.tabs.js | 12 ++++
4 files changed, 135 insertions(+), 57 deletions(-)
diff --git a/tests/unit/tabs/tabs_deprecated.js b/tests/unit/tabs/tabs_deprecated.js
index 4b50df405e7..1323c774a0c 100644
--- a/tests/unit/tabs/tabs_deprecated.js
+++ b/tests/unit/tabs/tabs_deprecated.js
@@ -35,7 +35,7 @@ asyncTest( "ajaxOptions", function() {
}
});
element.one( "tabsload", function( event, ui ) {
- equals( ui.panel.html(), "test" );
+ equals( $( ui.panel ).html(), "test" );
start();
});
element.tabs( "option", "active", 2 );
@@ -220,6 +220,62 @@ test( "selected", function() {
module( "tabs (deprecated): events" );
+asyncTest( "load", function() {
+ expect( 15 );
+
+ var tab, panelId, panel,
+ element = $( "#tabs2" );
+
+ // init
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 2 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ strictEqual( ui.tab, tab[ 0 ], "tab" );
+ strictEqual( ui.panel, panel[ 0 ], "panel" );
+ equals( $( ui.panel ).find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ tabsload1();
+ });
+ element.tabs({ active: 2 });
+
+ function tabsload1() {
+ // .option()
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 3 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ strictEqual( ui.tab, tab[ 0 ], "tab" );
+ strictEqual( ui.panel, panel[ 0 ], "panel" );
+ equals( $( ui.panel ).find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ tabsload2();
+ });
+ element.tabs( "option", "active", 3 );
+ }
+
+ function tabsload2() {
+ // click, change panel content
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 4 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ equals( event.originalEvent.type, "click", "originalEvent" );
+ strictEqual( ui.tab, tab[ 0 ], "tab" );
+ strictEqual( ui.panel, panel[ 0 ], "panel" );
+ equals( $( ui.panel ).find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 0, 0, 1 );
+ start();
+ });
+ element.find( ".ui-tabs-nav a" ).eq( 4 ).click();
+ }
+});
+
test( "enable", function() {
expect( 3 );
diff --git a/tests/unit/tabs/tabs_events.js b/tests/unit/tabs/tabs_events.js
index 2fabaafca49..12c9bb87b3e 100644
--- a/tests/unit/tabs/tabs_events.js
+++ b/tests/unit/tabs/tabs_events.js
@@ -209,66 +209,68 @@ test( "beforeLoad", function() {
equals( panel.html(), "testing
", "panel html after" );
});
-asyncTest( "load", function() {
- expect( 21 );
+if ( $.uiBackCompat === false ) {
+ asyncTest( "load", function() {
+ expect( 21 );
- var tab, panelId, panel,
- element = $( "#tabs2" );
-
- // init
- element.one( "tabsload", function( event, ui ) {
- tab = element.find( ".ui-tabs-nav a" ).eq( 2 );
- panelId = tab.attr( "aria-controls" );
- panel = $( "#" + panelId );
-
- ok( !( "originalEvent" in event ), "originalEvent" );
- equals( ui.tab.size(), 1, "tab size" );
- strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
- equals( ui.panel.size(), 1, "panel size" );
- strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
- equals( ui.panel.find( "p" ).length, 1, "panel html" );
- tabs_state( element, 0, 0, 1, 0, 0 );
- tabsload1();
- });
- element.tabs({ active: 2 });
+ var tab, panelId, panel,
+ element = $( "#tabs2" );
- function tabsload1() {
- // .option()
+ // init
element.one( "tabsload", function( event, ui ) {
- tab = element.find( ".ui-tabs-nav a" ).eq( 3 );
+ tab = element.find( ".ui-tabs-nav a" ).eq( 2 );
panelId = tab.attr( "aria-controls" );
panel = $( "#" + panelId );
-
+
ok( !( "originalEvent" in event ), "originalEvent" );
equals( ui.tab.size(), 1, "tab size" );
strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
equals( ui.panel.size(), 1, "panel size" );
strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
equals( ui.panel.find( "p" ).length, 1, "panel html" );
- tabs_state( element, 0, 0, 0, 1, 0 );
- tabsload2();
+ tabs_state( element, 0, 0, 1, 0, 0 );
+ tabsload1();
});
- element.tabs( "option", "active", 3 );
- }
+ element.tabs({ active: 2 });
- function tabsload2() {
- // click, change panel content
- element.one( "tabsload", function( event, ui ) {
- tab = element.find( ".ui-tabs-nav a" ).eq( 4 );
- panelId = tab.attr( "aria-controls" );
- panel = $( "#" + panelId );
+ function tabsload1() {
+ // .option()
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 3 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
- equals( event.originalEvent.type, "click", "originalEvent" );
- equals( ui.tab.size(), 1, "tab size" );
- strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
- equals( ui.panel.size(), 1, "panel size" );
- strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
- equals( ui.panel.find( "p" ).length, 1, "panel html" );
- tabs_state( element, 0, 0, 0, 0, 1 );
- start();
- });
- element.find( ".ui-tabs-nav a" ).eq( 4 ).click();
- }
-});
+ ok( !( "originalEvent" in event ), "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equals( ui.panel.find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 0, 1, 0 );
+ tabsload2();
+ });
+ element.tabs( "option", "active", 3 );
+ }
+
+ function tabsload2() {
+ // click, change panel content
+ element.one( "tabsload", function( event, ui ) {
+ tab = element.find( ".ui-tabs-nav a" ).eq( 4 );
+ panelId = tab.attr( "aria-controls" );
+ panel = $( "#" + panelId );
+
+ equals( event.originalEvent.type, "click", "originalEvent" );
+ equals( ui.tab.size(), 1, "tab size" );
+ strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
+ equals( ui.panel.size(), 1, "panel size" );
+ strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equals( ui.panel.find( "p" ).length, 1, "panel html" );
+ tabs_state( element, 0, 0, 0, 0, 1 );
+ start();
+ });
+ element.find( ".ui-tabs-nav a" ).eq( 4 ).click();
+ }
+ });
+}
}( jQuery ) );
diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js
index 5cf917550e5..ec21e2de790 100644
--- a/tests/unit/tabs/tabs_methods.js
+++ b/tests/unit/tabs/tabs_methods.js
@@ -165,16 +165,20 @@ asyncTest( "load", function() {
tabs_state( element, 1, 0, 0, 0, 0 );
});
element.one( "tabsload", function( event, ui ) {
+ // TODO: remove wrapping in 2.0
+ var uiTab = $( ui.tab ),
+ uiPanel = $( ui.panel );
+
var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
panelId = tab.attr( "aria-controls" ),
panel = $( "#" + panelId );
ok( !( "originalEvent" in event ), "originalEvent" );
- equals( ui.tab.size(), 1, "tab size" );
- strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
- equals( ui.panel.size(), 1, "panel size" );
- strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
- equals( ui.panel.find( "p" ).length, 1, "panel html" );
+ equals( uiTab.size(), 1, "tab size" );
+ strictEqual( uiTab[ 0 ], tab[ 0 ], "tab" );
+ equals( uiPanel.size(), 1, "panel size" );
+ strictEqual( uiPanel[ 0 ], panel[ 0 ], "panel" );
+ equals( uiPanel.find( "p" ).length, 1, "panel html" );
tabs_state( element, 1, 0, 0, 0, 0 );
setTimeout( tabsload1, 1 );
});
@@ -209,15 +213,19 @@ asyncTest( "load", function() {
tabs_state( element, 0, 0, 0, 1, 0 );
});
element.one( "tabsload", function( event, ui ) {
+ // TODO: remove wrapping in 2.0
+ var uiTab = $( ui.tab ),
+ uiPanel = $( ui.panel );
+
var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ),
panelId = tab.attr( "aria-controls" ),
panel = $( "#" + panelId );
ok( !( "originalEvent" in event ), "originalEvent" );
- equals( ui.tab.size(), 1, "tab size" );
- strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" );
- equals( ui.panel.size(), 1, "panel size" );
- strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" );
+ equals( uiTab.size(), 1, "tab size" );
+ strictEqual( uiTab[ 0 ], tab[ 0 ], "tab" );
+ equals( uiPanel.size(), 1, "panel size" );
+ strictEqual( uiPanel[ 0 ], panel[ 0 ], "panel" );
tabs_state( element, 0, 0, 0, 1, 0 );
start();
});
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 84d623f62b0..b20cd9a2617 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -1009,6 +1009,18 @@ if ( $.uiBackCompat !== false ) {
}
}
});
+
+ // load event
+ $.widget( "ui.tabs", $.ui.tabs, {
+ _trigger: function( type, event, data ) {
+ var _data = $.extend( {}, data );
+ if ( type === "load" ) {
+ _data.panel = _data.panel[ 0 ];
+ _data.tab = _data.tab[ 0 ];
+ }
+ return this._super( "_trigger", type, event, _data );
+ }
+ });
}
})( jQuery );
From 86fb3aff6fbdbdc9c3ebc7e4224498142d812548 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Tue, 17 May 2011 16:23:10 -0400
Subject: [PATCH 21/38] Tabs: Don't cancel existing ajax requests when
programmatically loading a tab. Fixes #7204 - Tabs: Programmatically loading
a tab shouldn't cancel active ajax requests.
---
ui/jquery.ui.tabs.js | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index b20cd9a2617..239805b146d 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -534,10 +534,6 @@ $.widget( "ui.tabs", {
panel: panel
};
- if ( this.xhr ) {
- this.xhr.abort();
- }
-
// not remote
if ( !url ) {
return;
@@ -566,7 +562,9 @@ $.widget( "ui.tabs", {
self.lis.eq( index ).removeClass( "ui-tabs-loading" );
- delete self.xhr;
+ if ( jqXHR === self.xhr ) {
+ delete self.xhr;
+ }
});
}
From 88cbc69c8cbb5abd303bbcb7467a8978477a380c Mon Sep 17 00:00:00 2001
From: Jesse Baird
Date: Tue, 17 May 2011 14:10:30 -0700
Subject: [PATCH 22/38] missing comma
---
themes/base/jquery.ui.theme.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/themes/base/jquery.ui.theme.css b/themes/base/jquery.ui.theme.css
index de15086f922..81f6051f2a5 100644
--- a/themes/base/jquery.ui.theme.css
+++ b/themes/base/jquery.ui.theme.css
@@ -238,7 +238,7 @@
/* Corner radius */
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-all, .ui-corner-top, .ui-corner-right .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
From 480624b2769f564b34962fa0ac2375f54ea8a8d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Tue, 17 May 2011 21:07:44 -0400
Subject: [PATCH 23/38] Spinner: Coding standards.
---
ui/jquery.ui.spinner.js | 367 +++++++++++++++++++++-------------------
1 file changed, 189 insertions(+), 178 deletions(-)
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index b8cca7dcd4a..2709175b50f 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -11,11 +11,11 @@
* jquery.ui.core.js
* jquery.ui.widget.js
*/
-(function($) {
+(function( $ ) {
-$.widget('ui.spinner', {
+$.widget( "ui.spinner", {
defaultElement: "",
- widgetEventPrefix: "spin",
+ widgetEventPrefix: "spin",
options: {
incremental: true,
max: null,
@@ -25,218 +25,227 @@ $.widget('ui.spinner', {
step: null,
value: null
},
-
+
_create: function() {
this._draw();
this._markupOptions();
this._mousewheel();
this._aria();
},
-
+
_markupOptions: function() {
- var _this = this;
+ var that = this;
$.each({
min: -Number.MAX_VALUE,
max: Number.MAX_VALUE,
step: 1
- }, function(attr, defaultValue) {
- if (_this.options[attr] === null) {
- var value = _this.element.attr(attr);
- _this.options[attr] = typeof value == "string" && value.length > 0 ? _this._parse(value) : defaultValue;
+ }, function( attr, defaultValue ) {
+ if ( that.options[ attr ] === null ) {
+ var value = that.element.attr( attr );
+ that.options[ attr ] = typeof value === "string" && value.length > 0 ?
+ that._parse( value ) :
+ defaultValue;
}
});
- this.value(this.options.value !== null ? this.options.value : this.element.val() || 0);
+ this.value( this.options.value !== null ? this.options.value : this.element.val() || 0 );
},
-
+
_draw: function() {
var self = this,
options = self.options;
var uiSpinner = this.uiSpinner = self.element
- .addClass('ui-spinner-input')
- .attr('autocomplete', 'off')
- .wrap(self._uiSpinnerHtml())
+ .addClass( "ui-spinner-input" )
+ .attr( "autocomplete", "off" )
+ .wrap( self._uiSpinnerHtml() )
.parent()
// add buttons
- .append(self._buttonHtml())
+ .append( self._buttonHtml() )
// add behaviours
+ // TODO: user ._hoverable
.hover(function() {
- if (!options.disabled) {
- $(this).addClass('ui-state-hover');
+ if ( !options.disabled ) {
+ $( this ).addClass( "ui-state-hover" );
}
self.hovered = true;
}, function() {
- $(this).removeClass('ui-state-hover');
+ $( this ).removeClass( "ui-state-hover" );
self.hovered = false;
});
+ // TODO: use ._bind()
this.element
.attr( "role", "spinbutton" )
- .bind('keydown.spinner', function(event) {
- if (self.options.disabled) {
+ .bind( "keydown.spinner", function( event ) {
+ if ( options.disabled ) {
return;
}
- if (self._start(event)) {
- return self._keydown(event);
+ if ( self._start( event ) ) {
+ return self._keydown( event );
}
return true;
})
- .bind('keyup.spinner', function(event) {
- if (self.options.disabled) {
+ .bind( "keyup.spinner", function( event ) {
+ if ( options.disabled ) {
return;
}
- if (self.spinning) {
- self._stop(event);
- self._change(event);
+ if ( self.spinning ) {
+ self._stop( event );
+ self._change( event );
}
})
- .bind('focus.spinner', function() {
- uiSpinner.addClass('ui-state-active');
+ .bind( "focus.spinner", function() {
+ uiSpinner.addClass( "ui-state-active" );
self.focused = true;
})
- .bind('blur.spinner', function(event) {
- self.value(self.element.val());
- if (!self.hovered) {
- uiSpinner.removeClass('ui-state-active');
- }
+ .bind( "blur.spinner", function( event ) {
+ self.value( self.element.val() );
+ if ( !self.hovered ) {
+ uiSpinner.removeClass( "ui-state-active" );
+ }
self.focused = false;
});
// button bindings
- this.buttons = uiSpinner.find('.ui-spinner-button')
- .attr("tabIndex", -1)
+ this.buttons = uiSpinner.find( ".ui-spinner-button" )
+ .attr( "tabIndex", -1 )
.button()
- .removeClass("ui-corner-all")
- .bind('mousedown', function(event) {
- if (self.options.disabled) {
+ .removeClass( "ui-corner-all" )
+ .bind( "mousedown", function( event ) {
+ if ( options.disabled ) {
return;
}
- if (self._start(event) === false) {
+ if ( self._start( event ) === false ) {
return false;
}
- self._repeat(null, $(this).hasClass('ui-spinner-up') ? 1 : -1, event);
+ self._repeat( null, $( this ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
})
- .bind('mouseup', function(event) {
- if (self.options.disabled) {
+ .bind( "mouseup", function( event ) {
+ if ( options.disabled ) {
return;
}
- if (self.spinning) {
- self._stop(event);
- self._change(event);
+ if ( self.spinning ) {
+ self._stop( event );
+ self._change( event );
}
})
- .bind("mouseenter", function() {
- if (self.options.disabled) {
+ .bind( "mouseenter", function() {
+ if ( self.options.disabled ) {
return;
}
// button will add ui-state-active if mouse was down while mouseleave and kept down
- if ($(this).hasClass("ui-state-active")) {
- if (self._start(event) === false) {
+ if ( $( this ).hasClass( "ui-state-active" ) ) {
+ if ( self._start( event ) === false ) {
return false;
}
- self._repeat(null, $(this).hasClass('ui-spinner-up') ? 1 : -1, event);
+ self._repeat( null, $( this ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
}
})
- .bind("mouseleave", function() {
- if (self.spinning) {
- self._stop(event);
- self._change(event);
+ .bind( "mouseleave", function() {
+ if ( self.spinning ) {
+ self._stop( event );
+ self._change( event );
}
});
-
+
// disable spinner if element was already disabled
- if (options.disabled) {
+ if ( options.disabled ) {
this.disable();
}
},
-
- _keydown: function(event) {
- var o = this.options,
- KEYS = $.ui.keyCode;
-
- switch (event.keyCode) {
- case KEYS.UP:
- this._repeat(null, 1, event);
+
+ _keydown: function( event ) {
+ var options = this.options,
+ keyCode = $.ui.keyCode;
+
+ switch ( event.keyCode ) {
+ case keyCode.UP:
+ this._repeat( null, 1, event );
return false;
- case KEYS.DOWN:
- this._repeat(null, -1, event);
+ case keyCode.DOWN:
+ this._repeat( null, -1, event );
return false;
- case KEYS.PAGE_UP:
- this._repeat(null, this.options.page, event);
+ case keyCode.PAGE_UP:
+ this._repeat( null, options.page, event );
return false;
- case KEYS.PAGE_DOWN:
- this._repeat(null, -this.options.page, event);
+ case keyCode.PAGE_DOWN:
+ this._repeat( null, -options.page, event );
return false;
-
- case KEYS.ENTER:
- this.value(this.element.val());
+ case keyCode.ENTER:
+ this.value( this.element.val() );
}
-
+
return true;
},
-
+
_mousewheel: function() {
// need the delta normalization that mousewheel plugin provides
- if (!$.fn.mousewheel) {
+ if ( !$.fn.mousewheel ) {
return;
}
var self = this;
- this.element.bind("mousewheel.spinner", function(event, delta) {
- if (self.options.disabled || !delta) {
+ this.element.bind( "mousewheel.spinner", function( event, delta ) {
+ if ( self.options.disabled || !delta ) {
return;
}
- if (!self.spinning && !self._start(event)) {
+ if ( !self.spinning && !self._start( event ) ) {
return false;
}
- self._spin((delta > 0 ? 1 : -1) * self.options.step, event);
- clearTimeout(self.timeout);
+ self._spin( (delta > 0 ? 1 : -1) * self.options.step, event );
+ clearTimeout( self.timeout );
self.timeout = setTimeout(function() {
- if (self.spinning) {
- self._stop(event);
- self._change(event);
+ if ( self.spinning ) {
+ self._stop( event );
+ self._change( event );
}
}, 100);
event.preventDefault();
});
},
-
+
_uiSpinnerHtml: function() {
- return '';
+ return "";
},
-
+
_buttonHtml: function() {
- return '▲' +
- '▼';
+ return "" +
+ "" +
+ "▲" +
+ "" +
+ "" +
+ "▼" +
+ "";
},
-
- _start: function(event) {
- if (!this.spinning && this._trigger('start', event) !== false) {
- if (!this.counter) {
- this.counter = 1;
- }
- this.spinning = true;
- return true;
+
+ _start: function( event ) {
+ if ( !this.spinning && this._trigger( "start", event ) === false ) {
+ return false;
+ }
+
+ if ( !this.counter ) {
+ this.counter = 1;
}
- return false;
+ this.spinning = true;
+ return true;
},
-
- _repeat: function(i, steps, event) {
+
+ _repeat: function( i, steps, event ) {
var self = this;
i = i || 500;
- clearTimeout(this.timer);
+ clearTimeout( this.timer );
this.timer = setTimeout(function() {
- self._repeat(40, steps, event);
- }, i);
-
- self._spin(steps * self.options.step, event);
+ self._repeat( 40, steps, event );
+ }, i );
+
+ self._spin( steps * self.options.step, event );
},
-
- _spin: function(step, event) {
- if (!this.counter) {
+
+ _spin: function( step, event ) {
+ if ( !this.counter ) {
this.counter = 1;
}
-
+
// TODO refactor, maybe figure out some non-linear math
var newVal = this.value() + step * (this.options.incremental &&
this.counter > 20
@@ -246,49 +255,51 @@ $.widget('ui.spinner', {
: 10
: 2
: 1);
-
- if (this._trigger('spin', event, { value: newVal }) !== false) {
- this.value(newVal);
- this.counter++;
+
+ if ( this._trigger( "spin", event, { value: newVal } ) !== false) {
+ this.value( newVal );
+ this.counter++;
}
},
-
- _stop: function(event) {
+
+ _stop: function( event ) {
this.counter = 0;
- if (this.timer) {
- window.clearTimeout(this.timer);
+ if ( this.timer ) {
+ clearTimeout( this.timer );
}
this.element.focus();
this.spinning = false;
- this._trigger('stop', event);
+ this._trigger( "stop", event );
},
-
- _change: function(event) {
- this._trigger('change', event);
+
+ _change: function( event ) {
+ this._trigger( "change", event );
},
-
- _setOption: function(key, value) {
- if (key == 'value') {
- value = this._parse(value);
- if (value < this.options.min) {
+
+ _setOption: function( key, value ) {
+ if ( key === "value") {
+ value = this._parse( value );
+ if ( value < this.options.min ) {
value = this.options.min;
}
- if (value > this.options.max) {
+ if ( value > this.options.max ) {
value = this.options.max;
}
}
- if (key == 'disabled') {
- if (value) {
- this.element.attr("disabled", true);
- this.buttons.button("disable");
+
+ if ( key === "disabled" ) {
+ if ( value ) {
+ this.element.attr( "disabled", true );
+ this.buttons.button( "disable" );
} else {
- this.element.removeAttr("disabled");
- this.buttons.button("enable");
+ this.element.removeAttr( "disabled" );
+ this.buttons.button( "enable" );
}
}
+
this._super( "_setOption", key, value );
},
-
+
_setOptions: function( options ) {
this._super( "_setOptions", options );
if ( "value" in options ) {
@@ -296,62 +307,62 @@ $.widget('ui.spinner', {
}
this._aria();
},
-
+
_aria: function() {
- this.element
- .attr('aria-valuemin', this.options.min)
- .attr('aria-valuemax', this.options.max)
- .attr('aria-valuenow', this.options.value);
+ this.element.attr({
+ "aria-valuemin": this.options.min,
+ "aria-valuemax": this.options.max,
+ "aria-valuenow": this.options.value
+ });
},
-
- _parse: function(val) {
- var input = val;
- if (typeof val == 'string') {
- val = $.global && this.options.numberformat ? $.global.parseFloat(val) : +val;
+
+ _parse: function( val ) {
+ if ( typeof val === "string" ) {
+ val = $.global && this.options.numberformat ? $.global.parseFloat( val ) : +val;
}
- return isNaN(val) ? null : val;
+ return isNaN( val ) ? null : val;
},
-
- _format: function(num) {
- this.element.val( $.global && this.options.numberformat ? $.global.format(num, this.options.numberformat) : num );
+
+ _format: function( num ) {
+ this.element.val( $.global && this.options.numberformat ? $.global.format( num, this.options.numberformat ) : num );
},
-
+
destroy: function() {
this.element
- .removeClass('ui-spinner-input')
- .removeAttr('disabled')
- .removeAttr('autocomplete')
- .removeAttr('role')
- .removeAttr('aria-valuemin')
- .removeAttr('aria-valuemax')
- .removeAttr('aria-valuenow');
+ .removeClass( "ui-spinner-input" )
+ .removeAttr( "disabled" )
+ .removeAttr( "autocomplete" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-valuemin" )
+ .removeAttr( "aria-valuemax" )
+ .removeAttr( "aria-valuenow" );
this._super( "destroy" );
- this.uiSpinner.replaceWith(this.element);
+ this.uiSpinner.replaceWith( this.element );
},
-
- stepUp: function(steps) {
- this._spin((steps || 1) * this.options.step);
+
+ stepUp: function( steps ) {
+ this._spin( (steps || 1) * this.options.step );
},
-
- stepDown: function(steps) {
- this._spin((steps || 1) * -this.options.step);
+
+ stepDown: function( steps ) {
+ this._spin( (steps || 1) * -this.options.step );
},
-
- pageUp: function(pages) {
- this.stepUp((pages || 1) * this.options.page);
+
+ pageUp: function( pages ) {
+ this.stepUp( (pages || 1) * this.options.page );
},
-
- pageDown: function(pages) {
- this.stepDown((pages || 1) * this.options.page);
+
+ pageDown: function( pages ) {
+ this.stepDown( (pages || 1) * this.options.page );
},
-
- value: function(newVal) {
- if (!arguments.length) {
- return this._parse(this.element.val());
+
+ value: function( newVal ) {
+ if ( !arguments.length ) {
+ return this._parse( this.element.val() );
}
- this.option('value', newVal);
+ this.option( "value", newVal );
},
-
+
widget: function() {
return this.uiSpinner;
}
@@ -359,4 +370,4 @@ $.widget('ui.spinner', {
$.ui.spinner.version = "@VERSION";
-})(jQuery);
+}( jQuery ) );
From d652a3636e5077118c5b7b9144e38905ec2d6d2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?=
Date: Wed, 18 May 2011 15:14:08 +0200
Subject: [PATCH 24/38] QUnit update
---
external/qunit.css | 12 ++--
external/qunit.js | 155 +++++++++++++++++++++++----------------------
2 files changed, 84 insertions(+), 83 deletions(-)
diff --git a/external/qunit.css b/external/qunit.css
index be37520aee4..b3c6db5237a 100644
--- a/external/qunit.css
+++ b/external/qunit.css
@@ -1,6 +1,6 @@
/**
* QUnit - A JavaScript Unit Testing Framework
- *
+ *
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2011 John Resig, Jörn Zaefferer
@@ -37,7 +37,7 @@
font-size: 1.5em;
line-height: 1em;
font-weight: normal;
-
+
border-radius: 15px 15px 0 0;
-moz-border-radius: 15px 15px 0 0;
-webkit-border-top-right-radius: 15px;
@@ -105,13 +105,13 @@
#qunit-tests ol {
margin-top: 0.5em;
padding: 0.5em;
-
+
background-color: #fff;
-
+
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
-
+
box-shadow: inset 0px 2px 13px #999;
-moz-box-shadow: inset 0px 2px 13px #999;
-webkit-box-shadow: inset 0px 2px 13px #999;
@@ -174,7 +174,7 @@
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
-
+
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999999; }
diff --git a/external/qunit.js b/external/qunit.js
index 135e80978cd..d56936ee253 100644
--- a/external/qunit.js
+++ b/external/qunit.js
@@ -1,6 +1,6 @@
/**
* QUnit - A JavaScript Unit Testing Framework
- *
+ *
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2011 John Resig, Jörn Zaefferer
@@ -78,7 +78,7 @@ Test.prototype = {
// allow utility functions to access the current test environment
// TODO why??
QUnit.current_testEnvironment = this.testEnvironment;
-
+
try {
if ( !config.pollution ) {
saveGlobal();
@@ -114,8 +114,8 @@ Test.prototype = {
},
teardown: function() {
try {
- checkPollution();
this.testEnvironment.teardown.call(this.testEnvironment);
+ checkPollution();
} catch(e) {
QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message );
}
@@ -124,7 +124,7 @@ Test.prototype = {
if ( this.expected && this.expected != this.assertions.length ) {
QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
}
-
+
var good = 0, bad = 0,
tests = id("qunit-tests");
@@ -166,17 +166,17 @@ Test.prototype = {
var b = document.createElement("strong");
b.innerHTML = this.name + " (" + bad + ", " + good + ", " + this.assertions.length + ")";
-
+
var a = document.createElement("a");
a.innerHTML = "Rerun";
a.href = QUnit.url({ filter: getText([b]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") });
-
+
addEvent(b, "click", function() {
var next = b.nextSibling.nextSibling,
display = next.style.display;
next.style.display = display === "none" ? "block" : "none";
});
-
+
addEvent(b, "dblclick", function(e) {
var target = e && e.target ? e.target : window.event.srcElement;
if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
@@ -217,7 +217,7 @@ Test.prototype = {
total: this.assertions.length
} );
},
-
+
queue: function() {
var test = this;
synchronize(function() {
@@ -246,7 +246,7 @@ Test.prototype = {
synchronize(run);
};
}
-
+
};
var QUnit = {
@@ -265,7 +265,7 @@ var QUnit = {
QUnit.test(testName, expected, callback, true);
},
-
+
test: function(testName, expected, callback, async) {
var name = '' + testName + '', testEnvironmentArg;
@@ -286,13 +286,13 @@ var QUnit = {
if ( !validTest(config.currentModule + ": " + testName) ) {
return;
}
-
+
var test = new Test(name, testName, expected, testEnvironmentArg, async, callback);
test.module = config.currentModule;
test.moduleTestEnvironment = config.currentModuleTestEnviroment;
test.queue();
},
-
+
/**
* Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
*/
@@ -337,7 +337,7 @@ var QUnit = {
notEqual: function(actual, expected, message) {
QUnit.push(expected != actual, actual, expected, message);
},
-
+
deepEqual: function(actual, expected, message) {
QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
},
@@ -356,34 +356,34 @@ var QUnit = {
raises: function(block, expected, message) {
var actual, ok = false;
-
+
if (typeof expected === 'string') {
message = expected;
expected = null;
}
-
+
try {
block();
} catch (e) {
actual = e;
}
-
+
if (actual) {
// we don't want to validate thrown error
if (!expected) {
ok = true;
- // expected is a regexp
+ // expected is a regexp
} else if (QUnit.objectType(expected) === "regexp") {
ok = expected.test(actual);
- // expected is a constructor
+ // expected is a constructor
} else if (actual instanceof expected) {
ok = true;
- // expected is a validation function which returns true is validation passed
+ // expected is a validation function which returns true is validation passed
} else if (expected.call({}, actual) === true) {
ok = true;
}
}
-
+
QUnit.ok(ok, message);
},
@@ -412,7 +412,7 @@ var QUnit = {
process();
}
},
-
+
stop: function(timeout) {
config.semaphore++;
config.blocking = true;
@@ -438,7 +438,7 @@ var config = {
// block until document ready
blocking: true,
-
+
// by default, run previously failed tests first
// very useful in combination with "Hide passed tests" checked
reorder: true,
@@ -519,7 +519,7 @@ extend(QUnit, {
if ( result ) {
result.parentNode.removeChild( result );
}
-
+
if ( tests ) {
result = document.createElement( "p" );
result.id = "qunit-testresult";
@@ -528,10 +528,10 @@ extend(QUnit, {
result.innerHTML = 'Running...
';
}
},
-
+
/**
* Resets the test setup. Useful for tests that modify the DOM.
- *
+ *
* If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
*/
reset: function() {
@@ -544,7 +544,7 @@ extend(QUnit, {
}
}
},
-
+
/**
* Trigger an event on an element.
*
@@ -564,12 +564,12 @@ extend(QUnit, {
elem.fireEvent("on"+type);
}
},
-
+
// Safe object type checking
is: function( type, obj ) {
return QUnit.objectType( obj ) == type;
},
-
+
objectType: function( obj ) {
if (typeof obj === "undefined") {
return "undefined";
@@ -603,7 +603,7 @@ extend(QUnit, {
}
return undefined;
},
-
+
push: function(result, actual, expected, message) {
var details = {
result: result,
@@ -611,7 +611,7 @@ extend(QUnit, {
actual: actual,
expected: expected
};
-
+
message = escapeHtml(message) || (result ? "okay" : "failed");
message = '' + message + "";
expected = escapeHtml(QUnit.jsDump.parse(expected));
@@ -629,15 +629,15 @@ extend(QUnit, {
}
}
output += "";
-
+
QUnit.log(details);
-
+
config.current.assertions.push({
result: !!result,
message: output
});
},
-
+
url: function( params ) {
params = extend( extend( {}, QUnit.urlParams ), params );
var querystring = "?",
@@ -648,7 +648,7 @@ extend(QUnit, {
}
return window.location.pathname + querystring.slice( 0, -1 );
},
-
+
// Logging callbacks; all receive a single argument with the listed properties
// run test/logs.html for any related changes
begin: function() {},
@@ -672,7 +672,7 @@ if ( typeof document === "undefined" || document.readyState === "complete" ) {
addEvent(window, "load", function() {
QUnit.begin({});
-
+
// Initialize the config, saving the execution queue
var oldconfig = extend({}, config);
QUnit.init();
@@ -695,7 +695,7 @@ addEvent(window, "load", function() {
window.location = QUnit.url( params );
});
}
-
+
var toolbar = id("qunit-testrunner-toolbar");
if ( toolbar ) {
var filter = document.createElement("input");
@@ -774,18 +774,19 @@ function done() {
banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
}
- if ( tests ) {
+ if ( tests ) {
id( "qunit-testresult" ).innerHTML = html;
}
if ( typeof document !== "undefined" && document.title ) {
- // TODO what are the unicode codes for these? as-is fails if qunit.js isn't served with the right mimetype/charset
- document.title = (config.stats.bad ? "✖" : "✔") + " " + document.title;
+ // show ✖ for good, ✔ for bad suite result in title
+ // use escape sequences in case file gets loaded with non-utf-8-charset
+ document.title = (config.stats.bad ? "\u2716" : "\u2714") + " " + document.title;
}
QUnit.done( {
failed: config.stats.bad,
- passed: passed,
+ passed: passed,
total: config.stats.all,
runtime: runtime
} );
@@ -799,7 +800,7 @@ function validTest( name ) {
return true;
}
- not = filter.charAt( 0 ) === "!";
+ var not = filter.charAt( 0 ) === "!";
if ( not ) {
filter = filter.slice( 1 );
}
@@ -874,7 +875,7 @@ function process() {
function saveGlobal() {
config.pollution = [];
-
+
if ( config.noglobals ) {
for ( var key in window ) {
config.pollution.push( key );
@@ -885,7 +886,7 @@ function saveGlobal() {
function checkPollution( name ) {
var old = config.pollution;
saveGlobal();
-
+
var newGlobals = diff( config.pollution, old );
if ( newGlobals.length > 0 ) {
ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
@@ -971,7 +972,7 @@ QUnit.equiv = function () {
}
}
}
-
+
var callbacks = function () {
// for string, boolean, number and null
@@ -1025,13 +1026,13 @@ QUnit.equiv = function () {
// b could be an object literal here
if ( ! (QUnit.objectType(b) === "array")) {
return false;
- }
-
+ }
+
len = a.length;
if (len !== b.length) { // safe and faster
return false;
}
-
+
//track reference to avoid circular references
parents.push(a);
for (i = 0; i < len; i++) {
@@ -1064,7 +1065,7 @@ QUnit.equiv = function () {
callers.push(a.constructor);
//track reference to avoid circular references
parents.push(a);
-
+
for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
loop = false;
for(j=0;j<',
close = QUnit.jsDump.HTML ? '>' : '>';
-
+
var tag = node.nodeName.toLowerCase(),
ret = open + tag;
-
+
for ( var a in QUnit.jsDump.DOMAttrs ) {
var val = node[QUnit.jsDump.DOMAttrs[a]];
if ( val )
@@ -1258,8 +1259,8 @@ QUnit.jsDump = (function() {
},
functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
var l = fn.length;
- if ( !l ) return '';
-
+ if ( !l ) return '';
+
var args = Array(l);
while ( l-- )
args[l] = String.fromCharCode(97+l);//97 is 'a'
@@ -1316,34 +1317,34 @@ function getText( elems ) {
*
* More Info:
* http://ejohn.org/projects/javascript-diff-algorithm/
- *
+ *
* Usage: QUnit.diff(expected, actual)
- *
+ *
* QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick brown fox jumped jumps over"
*/
QUnit.diff = (function() {
function diff(o, n){
var ns = new Object();
var os = new Object();
-
+
for (var i = 0; i < n.length; i++) {
- if (ns[n[i]] == null)
+ if (ns[n[i]] == null)
ns[n[i]] = {
rows: new Array(),
o: null
};
ns[n[i]].rows.push(i);
}
-
+
for (var i = 0; i < o.length; i++) {
- if (os[o[i]] == null)
+ if (os[o[i]] == null)
os[o[i]] = {
rows: new Array(),
n: null
};
os[o[i]].rows.push(i);
}
-
+
for (var i in ns) {
if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
n[ns[i].rows[0]] = {
@@ -1356,7 +1357,7 @@ QUnit.diff = (function() {
};
}
}
-
+
for (var i = 0; i < n.length - 1; i++) {
if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null &&
n[i + 1] == o[n[i].row + 1]) {
@@ -1370,7 +1371,7 @@ QUnit.diff = (function() {
};
}
}
-
+
for (var i = n.length - 1; i > 0; i--) {
if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null &&
n[i - 1] == o[n[i].row - 1]) {
@@ -1384,20 +1385,20 @@ QUnit.diff = (function() {
};
}
}
-
+
return {
o: o,
n: n
};
}
-
+
return function(o, n){
o = o.replace(/\s+$/, '');
n = n.replace(/\s+$/, '');
var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/));
var str = "";
-
+
var oSpace = o.match(/\s+/g);
if (oSpace == null) {
oSpace = [" "];
@@ -1412,7 +1413,7 @@ QUnit.diff = (function() {
else {
nSpace.push(" ");
}
-
+
if (out.n.length == 0) {
for (var i = 0; i < out.o.length; i++) {
str += '' + out.o[i] + oSpace[i] + "";
@@ -1424,14 +1425,14 @@ QUnit.diff = (function() {
str += '' + out.o[n] + oSpace[n] + "";
}
}
-
+
for (var i = 0; i < out.n.length; i++) {
if (out.n[i].text == null) {
str += '' + out.n[i] + nSpace[i] + "";
}
else {
var pre = "";
-
+
for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) {
pre += '' + out.o[n] + oSpace[n] + "";
}
@@ -1439,7 +1440,7 @@ QUnit.diff = (function() {
}
}
}
-
+
return str;
};
})();
From 4e29ea37b45fd0b81adf9b6ee00e7276360bd760 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Wed, 18 May 2011 09:34:20 -0400
Subject: [PATCH 25/38] Dialog: Reduce old overlay dimensions to 0x0 to avoid
sizing issues. Fixes #5637 - Dialog: Dimensions of reused overlay may cause
scrollbars.
---
ui/jquery.ui.dialog.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 64b1de92d70..dc2849155e0 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -742,7 +742,7 @@ $.extend( $.ui.dialog.overlay, {
$( [ document, window ] ).unbind( ".dialog-overlay" );
}
- $el.remove();
+ $el.height( 0 ).width( 0 ).remove();
// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
var maxZ = 0;
From a90c92c7045080f5c02d3e7c1dec7905ae158fd2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Wed, 18 May 2011 10:32:59 -0400
Subject: [PATCH 26/38] Button: Refactored formResetHandler and fixed scope.
Foxes #7261 - Refresh scope in formResetHandler unintentionally wide.
---
ui/jquery.ui.button.js | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index e5eedc3e576..a95dddc6c01 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -17,13 +17,11 @@ var lastActive, startXPos, startYPos, clickDragged,
baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
stateClasses = "ui-state-hover ui-state-active ",
typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
- formResetHandler = function( event ) {
- $( ":ui-button", event.target.form ).each(function() {
- var inst = $( this ).data( "button" );
- setTimeout(function() {
- inst.refresh();
- }, 1 );
- });
+ formResetHandler = function() {
+ var buttons = $( this ).find( ":ui-button" );
+ setTimeout(function() {
+ buttons.button( "refresh" );
+ }, 1 );
},
radioGroup = function( radio ) {
var name = radio.name,
From f837e0b0ccee2d42acdccd22fad699d19e68f6b3 Mon Sep 17 00:00:00 2001
From: kborchers
Date: Wed, 18 May 2011 10:54:36 -0400
Subject: [PATCH 27/38] Accordion: Added check to not allow 0 height on empty
panels causing height issues on non-empty panels. Fixed #7335 - Accordion:
Incorrect size when a panel is empty
---
ui/jquery.ui.accordion.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index 0cc1f9e2aba..c6b33befb8c 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -486,9 +486,11 @@ $.extend( $.ui.accordion, {
$.each( fxAttrs, function( i, prop ) {
hideProps[ prop ] = "hide";
- var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ );
+ var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ ),
+ // work around bug when a panel has no height - #7335
+ propVal = prop === "height" && parts[ 1 ] === "0" ? 1 : parts[ 1 ];
showProps[ prop ] = {
- value: parts[ 1 ],
+ value: propVal,
unit: parts[ 2 ] || "px"
};
});
From dcaa280496149c77fb525539b05046623a7ef962 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?=
Date: Wed, 18 May 2011 17:30:26 +0200
Subject: [PATCH 28/38] There's no guard against unparsed characters at the end
of the date string, any extra characters are just ignored
Fixes #7244 - Datepicker: parseDate() does not throw an exception for long years
---
tests/unit/datepicker/datepicker_tickets.js | 9 +++++++++
ui/jquery.ui.datepicker.js | 3 +++
2 files changed, 12 insertions(+)
diff --git a/tests/unit/datepicker/datepicker_tickets.js b/tests/unit/datepicker/datepicker_tickets.js
index 2b9ce05de68..d5249f9051d 100644
--- a/tests/unit/datepicker/datepicker_tickets.js
+++ b/tests/unit/datepicker/datepicker_tickets.js
@@ -29,4 +29,13 @@ test('Ticket 6827: formatDate day of year calculation is wrong during day lights
equals(time, "089");
});
+test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() {
+ expect(1);
+ try{
+ var date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881');
+ }catch(e){
+ ok("invalid date detected");
+ }
+});
+
})(jQuery);
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 021041202ed..4c73bdfd8e3 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -1082,6 +1082,9 @@ $.extend(Datepicker.prototype, {
checkLiteral();
}
}
+ if (iValue < value.length){
+ throw "Extra/unparsed characters found in date: " + value.substring(iValue);
+ }
if (year == -1)
year = new Date().getFullYear();
else if (year < 100)
From 6a023aa1a3663cf79b809097001bf53906627d98 Mon Sep 17 00:00:00 2001
From: jgv
Date: Wed, 18 May 2011 11:54:48 -0400
Subject: [PATCH 29/38] CSS: added support for konqueror border-radius. Fixed
#6097.
---
themes/base/jquery.ui.theme.css | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/themes/base/jquery.ui.theme.css b/themes/base/jquery.ui.theme.css
index 81f6051f2a5..be2676909b5 100644
--- a/themes/base/jquery.ui.theme.css
+++ b/themes/base/jquery.ui.theme.css
@@ -237,11 +237,11 @@
----------------------------------*/
/* Corner radius */
-.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
-.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
-.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
\ No newline at end of file
+.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
\ No newline at end of file
From e076ad0187621bc86fa7b70d3cb00da52039c113 Mon Sep 17 00:00:00 2001
From: gnarf
Date: Wed, 18 May 2011 18:13:37 -0500
Subject: [PATCH 30/38] Unit Tests & effects.scale: Fixing bugs in effects unit
tests - Particularly IE, found a bug in scale.js in the meantime. Fixes #7395
- Size based effects are breaking unit tests in IE - also leaking a global
var
---
tests/unit/effects/effects.html | 3 +++
tests/unit/effects/effects_core.js | 13 +++++++------
ui/jquery.effects.core.js | 2 +-
ui/jquery.effects.scale.js | 22 ++++++++++++----------
4 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/tests/unit/effects/effects.html b/tests/unit/effects/effects.html
index 0879a98b235..84fecd9ccc0 100644
--- a/tests/unit/effects/effects.html
+++ b/tests/unit/effects/effects.html
@@ -38,10 +38,13 @@
.test {
background: #000;
border: 0;
+ width: 100px;
+ height: 100px;
}
.testAddBorder {
border: 10px solid #000;
}
+ .testChildren,
.testChangeBackground {
background: #fff;
}
diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js
index 8d2e8f8df9a..ed9fbf9ba0e 100644
--- a/tests/unit/effects/effects_core.js
+++ b/tests/unit/effects/effects_core.js
@@ -77,12 +77,12 @@ asyncTest( "animateClass works with colors", function() {
count = 0;
expect(2);
test.toggleClass("testChangeBackground", duration, function() {
- present( test.css("backgroundColor"), [ "#ffffff", "rgb(255, 255, 255)" ], "Color is final" );
+ present( test.css("backgroundColor"), [ "#ffffff", "#fff", "rgb(255, 255, 255)" ], "Color is final" );
start();
});
setTimeout(function() {
var color = test.css("backgroundColor");
- notPresent( color, [ "#000000", "#ffffff", "rgb(0, 0, 0)", "rgb(255,255,255)" ],
+ notPresent( color, [ "#000000", "#ffffff", "#000", "#fff", "rgb(0, 0, 0)", "rgb(255,255,255)" ],
"Color is not endpoints in middle." );
}, mid);
});
@@ -92,19 +92,20 @@ asyncTest( "animateClass works with children", function() {
h2 = test.find("h2");
expect(4);
+ setTimeout(function() {
+ notPresent( h2.css("fontSize"), ["10px","20px"], "Font size is neither endpoint when in middle.");
+ }, mid);
test.toggleClass("testChildren", { children: true, duration: duration, complete: function() {
equal( h2.css("fontSize"), "20px", "Text size is final during complete");
test.toggleClass("testChildren", duration, function() {
equal( h2.css("fontSize"), "10px", "Text size revertted after class removed");
+
start();
});
setTimeout(function() {
- equal( h2.css("fontSize"), "20px", "Text size unchanged with children: undefined" );
+ equal( h2.css("fontSize"), "20px", "Text size unchanged during animate with children: undefined" );
}, mid);
}});
- setTimeout(function() {
- notPresent( h2.css("fontSize"), ["10px","20px"], "Font size is neither endpoint when in middle.");
- }, mid);
});
})(jQuery);
diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js
index 63811957975..7650aa8f4e6 100644
--- a/ui/jquery.effects.core.js
+++ b/ui/jquery.effects.core.js
@@ -451,7 +451,7 @@ $.extend( $.effects, {
setTransition: function( element, list, factor, value ) {
value = value || {};
$.each( list, function(i, x){
- unit = element.cssUnit( x );
+ var unit = element.cssUnit( x );
if ( unit[ 0 ] > 0 ) value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
});
return value;
diff --git a/ui/jquery.effects.scale.js b/ui/jquery.effects.scale.js
index 64dbd69cea0..64c192f690b 100644
--- a/ui/jquery.effects.scale.js
+++ b/ui/jquery.effects.scale.js
@@ -115,13 +115,15 @@ $.effects.effect.size = function( o ) {
restore = o.restore || false,
scale = o.scale || 'both',
origin = o.origin,
- original = {
- height: el.height(),
- width: el.width(),
- top: el.offset().top,
- left: el.offset().left
- },
- baseline, factor;
+ original, baseline, factor;
+
+ if ( mode === "show" ) {
+ el.show();
+ }
+ original = {
+ height: el.height(),
+ width: el.width()
+ };
el.from = o.from || original;
el.to = o.to || original;
@@ -151,14 +153,14 @@ $.effects.effect.size = function( o ) {
if ( scale == 'box' || scale == 'both' ) {
// Vertical props scaling
- if ( factor.from.y != factor.to.y ) {
+ if ( factor.from.y !== factor.to.y ) {
props = props.concat( vProps );
el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
};
// Horizontal props scaling
- if ( factor.from.x != factor.to.x ) {
+ if ( factor.from.x !== factor.to.x ) {
props = props.concat( hProps );
el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
@@ -169,7 +171,7 @@ $.effects.effect.size = function( o ) {
if ( scale == 'content' || scale == 'both' ) {
// Vertical props scaling
- if ( factor.from.y != factor.to.y ) {
+ if ( factor.from.y !== factor.to.y ) {
props = props.concat( cProps );
el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
From a7640cade13dc33f9238da532139e8607917f925 Mon Sep 17 00:00:00 2001
From: techtangents
Date: Fri, 20 May 2011 21:17:30 +1000
Subject: [PATCH 31/38] Builds: used ant parallel task to run the two closure
compiler steps and the yui css compressor step in parallel. The http get
requests for documentation are also run in parallel. Reduced build time by
about 40%. Fixed #7404 - build.xml can run quicker.
---
build/build.xml | 173 +++++++++++++++++++++++++-----------------------
1 file changed, 90 insertions(+), 83 deletions(-)
diff --git a/build/build.xml b/build/build.xml
index bd6144f292b..154e7f60ce3 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -160,42 +160,46 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -258,53 +262,56 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From c02495dedc30a1e06358ea5fe0fa8a457bd2d239 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Fri, 20 May 2011 09:53:50 -0400
Subject: [PATCH 32/38] Resizable: Remove workaround for handles not working in
IE when transparent with overlapping content. Fixes #7397 - Resizable: icon
not showing. Fixes #7390 - Resizable: https domain reports 'unsecured items'
in IE7. Reopens #7233 - Resizable: resizable handles fail to work in IE if
transparent and content overlaps.
---
themes/base/jquery.ui.resizable.css | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/themes/base/jquery.ui.resizable.css b/themes/base/jquery.ui.resizable.css
index 2c1de870eb6..ed639523080 100644
--- a/themes/base/jquery.ui.resizable.css
+++ b/themes/base/jquery.ui.resizable.css
@@ -8,12 +8,7 @@
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;
- /* http://bugs.jqueryui.com/ticket/7233
- - Resizable: resizable handles fail to work in IE if transparent and content overlaps
- */
- background-image:url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=);
-}
+.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
From eacddcca4ffca8efff4acb6134e9cb0c18c38fe8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Fri, 20 May 2011 10:11:16 -0400
Subject: [PATCH 33/38] Tagging the 1.9m5 release.
---
version.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version.txt b/version.txt
index 13c1a737145..6f1e9cad1ac 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-1.9pre
+1.9m5
From 5884aa27f0d686538b211b3f3eb48e1b06e51ad8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Fri, 20 May 2011 10:12:12 -0400
Subject: [PATCH 34/38] Updating the master version to 1.9pre
---
version.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version.txt b/version.txt
index 6f1e9cad1ac..13c1a737145 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-1.9m5
+1.9pre
From 280da6e9abf60e0e37aafeff9b1b96079d33ec04 Mon Sep 17 00:00:00 2001
From: "Richard D. Worth"
Date: Tue, 24 May 2011 07:43:44 -0700
Subject: [PATCH 35/38] README: Fixed code samples to be (markdown) indented
properly with 4 spaces instead of 2.
---
README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index ace5fe2deff..547f2886b52 100644
--- a/README.md
+++ b/README.md
@@ -14,13 +14,13 @@ When looking at pull requests, first check for [proper commit messages](http://w
Unless everything is fine and you can merge directly via GitHub's interface, fetch the remote first:
- git remote add [username] [his-fork.git] -f
+ git remote add [username] [his-fork.git] -f
If you want just one commit and edit the commit message:
- git cherry-pick -e [sha-of-commit]
+ git cherry-pick -e [sha-of-commit]
If it should go to the stable brach, cherry-pick it to stable:
- git checkout 1-8-stable
- git cherry-pick -x [sha-of-commit]
+ git checkout 1-8-stable
+ git cherry-pick -x [sha-of-commit]
From 34a8aab425b1886366fd63e3ddd381db6af529e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?=
Date: Fri, 20 May 2011 16:25:04 -0400
Subject: [PATCH 36/38] Spinner: Changed casing of option numberformat ->
numberFormat.
---
demos/spinner/currency.html | 2 +-
demos/spinner/decimal.html | 2 +-
tests/unit/spinner/spinner_defaults.js | 2 +-
tests/unit/spinner/spinner_options.js | 14 +++++++-------
ui/jquery.ui.spinner.js | 6 +++---
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/demos/spinner/currency.html b/demos/spinner/currency.html
index 8288e4c3de5..1e9b37d08e3 100644
--- a/demos/spinner/currency.html
+++ b/demos/spinner/currency.html
@@ -27,7 +27,7 @@
max: 2500,
step: 25,
start: 1000,
- numberformat: "C"
+ numberFormat: "C"
});
});
diff --git a/demos/spinner/decimal.html b/demos/spinner/decimal.html
index 0a38fc51f8f..cdc65929873 100644
--- a/demos/spinner/decimal.html
+++ b/demos/spinner/decimal.html
@@ -18,7 +18,7 @@
$(function() {
$("#spinner").spinner({
step: 0.01,
- numberformat: "n"
+ numberFormat: "n"
});
$("#culture").change(function() {
diff --git a/tests/unit/spinner/spinner_defaults.js b/tests/unit/spinner/spinner_defaults.js
index f6081b1f3fb..c9a7d5f626a 100644
--- a/tests/unit/spinner/spinner_defaults.js
+++ b/tests/unit/spinner/spinner_defaults.js
@@ -4,7 +4,7 @@ commonWidgetTests( "spinner", {
incremental: true,
max: null,
min: null,
- numberformat: null,
+ numberFormat: null,
page: 10,
step: null,
value: null,
diff --git a/tests/unit/spinner/spinner_options.js b/tests/unit/spinner/spinner_options.js
index 3db7e5c5541..398780ad208 100644
--- a/tests/unit/spinner/spinner_options.js
+++ b/tests/unit/spinner/spinner_options.js
@@ -5,26 +5,26 @@
module("spinner: options");
-test("numberformat, number", function() {
+test("numberFormat, number", function() {
var el = $("#spin").spinner({
value: "1",
- numberformat: "n"
+ numberFormat: "n"
});
equal(el.val(), "1.00");
});
-test("numberformat, number, simple", function() {
+test("numberFormat, number, simple", function() {
var el = $("#spin").spinner({
value: "1",
- numberformat: "n0"
+ numberFormat: "n0"
});
equal(el.val(), "1");
});
-test("numberformat, currency", function() {
+test("numberFormat, currency", function() {
var el = $("#spin").spinner({
value: "1",
- numberformat: "C"
+ numberFormat: "C"
});
equal(el.val(), "$1.00");
});
@@ -111,7 +111,7 @@ test("step, 2", function() {
test("step, 0.7", function() {
var el = $("#spin").spinner({
step: 0.7,
- numberformat: "n1"
+ numberFormat: "n1"
});
equals(el.val(), "0.0", "value initialized to");
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index 2709175b50f..0a0ebb37e82 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -20,7 +20,7 @@ $.widget( "ui.spinner", {
incremental: true,
max: null,
min: null,
- numberformat: null,
+ numberFormat: null,
page: 10,
step: null,
value: null
@@ -318,13 +318,13 @@ $.widget( "ui.spinner", {
_parse: function( val ) {
if ( typeof val === "string" ) {
- val = $.global && this.options.numberformat ? $.global.parseFloat( val ) : +val;
+ val = $.global && this.options.numberFormat ? $.global.parseFloat( val ) : +val;
}
return isNaN( val ) ? null : val;
},
_format: function( num ) {
- this.element.val( $.global && this.options.numberformat ? $.global.format( num, this.options.numberformat ) : num );
+ this.element.val( $.global && this.options.numberFormat ? $.global.format( num, this.options.numberFormat ) : num );
},
destroy: function() {
From 902c685c4d54b8848edfefe4365767a1bfd1e424 Mon Sep 17 00:00:00 2001
From: tomykaira
Date: Wed, 25 May 2011 15:52:53 -0400
Subject: [PATCH 37/38] effects.blind: Save the wrapper status if already
wrapped. Fixes #6245 - position: absolute is lost when .stop() is used with
.show('blind').
---
ui/jquery.effects.blind.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/ui/jquery.effects.blind.js b/ui/jquery.effects.blind.js
index 7a59d8a75f5..8ef544faa6d 100644
--- a/ui/jquery.effects.blind.js
+++ b/ui/jquery.effects.blind.js
@@ -31,7 +31,12 @@ $.effects.effect.blind = function( o ) {
animation = {},
wrapper, distance;
- $.effects.save( el, props );
+ // if already wrapped, the wrapper's properties are my property. #6245
+ if ( el.parent().is( ".ui-effects-wrapper" ) ) {
+ $.effects.save( el.parent(), props );
+ } else {
+ $.effects.save( el, props );
+ }
el.show();
wrapper = $.effects.createWrapper( el ).css({
overflow: "hidden"
From 7fc07d52e18013f4aefd58f057953c6e3fa44f1a Mon Sep 17 00:00:00 2001
From: tomykaira
Date: Thu, 26 May 2011 11:34:03 +0900
Subject: [PATCH 38/38] effects.transfer: check the target is fixed or not, and
consider scrolling. Fixed #5547 - Transfer effect to fixed positioned
element.
---
ui/jquery.effects.transfer.js | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/ui/jquery.effects.transfer.js b/ui/jquery.effects.transfer.js
index 17d23c5fab2..8a66c534c53 100644
--- a/ui/jquery.effects.transfer.js
+++ b/ui/jquery.effects.transfer.js
@@ -17,10 +17,11 @@ $.effects.effect.transfer = function( o ) {
return this.queue( function() {
var elem = $( this ),
target = $( o.to ),
+ isFixed = target.css( "position" ) === "fixed",
endPosition = target.offset(),
animation = {
- top: endPosition.top,
- left: endPosition.left,
+ top: isFixed ? endPosition.top - $("body").scrollTop() : endPosition.top,
+ left: isFixed ? endPosition.left - $("body").scrollLeft() : endPosition.left,
height: target.innerHeight(),
width: target.innerWidth()
},
@@ -29,11 +30,11 @@ $.effects.effect.transfer = function( o ) {
.appendTo( document.body )
.addClass( o.className )
.css({
- top: startPosition.top,
- left: startPosition.left,
+ top: isFixed ? startPosition.top - $("body").scrollTop() : startPosition.top,
+ left: isFixed ? startPosition.left - $("body").scrollLeft() : startPosition.left,
height: elem.innerHeight(),
width: elem.innerWidth(),
- position: 'absolute'
+ position: isFixed ? 'fixed' : 'absolute'
})
.animate( animation, o.duration, o.easing, function() {
transfer.remove();