From 025266e00270d155f45550b6838ddd6f4a44470b Mon Sep 17 00:00:00 2001 From: Scott González Date: Sat, 13 Oct 2012 14:50:51 -0400 Subject: Resizable: Use .insertAfter() instead of .after() to avoid recursively destroying. Fixes #8662 - Infinite loop - new to jQuery UI 1.9.0. --- ui/jquery.ui.resizable.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ui/jquery.ui.resizable.js') diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index cc82b8b92..c1fd676d9 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -204,15 +204,14 @@ $.widget("ui.resizable", $.ui.mouse, { if (this.elementIsWrapper) { _destroy(this.element); var wrapper = this.element; - wrapper.after( - this.originalElement.css({ - position: wrapper.css('position'), - width: wrapper.outerWidth(), - height: wrapper.outerHeight(), - top: wrapper.css('top'), - left: wrapper.css('left') - }) - ).remove(); + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }).insertAfter( wrapper ); + wrapper.remove(); } this.originalElement.css('resize', this.originalResizeStyle); -- cgit v1.2.3 From 49f9b849b9c5023f138e8932510b11bfc9765814 Mon Sep 17 00:00:00 2001 From: Trey Hunner Date: Sun, 21 Oct 2012 18:50:03 -0700 Subject: Remove trailing whitespace and add final newlines --- tests/jquery-1.6.1.js | 106 +++++++++++++-------------- tests/jquery-1.6.2.js | 110 ++++++++++++++-------------- tests/jquery-1.6.3.js | 108 ++++++++++++++-------------- tests/jquery-1.6.4.js | 108 ++++++++++++++-------------- tests/jquery-1.6.js | 130 +++++++++++++++++----------------- tests/jquery-1.7.1.js | 82 ++++++++++----------- tests/jquery-1.7.2.js | 2 +- tests/jquery-1.7.js | 82 ++++++++++----------- tests/jquery-1.8.0.js | 2 +- tests/jquery.simulate.js | 4 +- tests/unit/dialog/dialog_tickets.js | 6 +- ui/i18n/jquery.ui.datepicker-ar.js | 2 +- ui/i18n/jquery.ui.datepicker-az.js | 2 +- ui/i18n/jquery.ui.datepicker-bs.js | 10 +-- ui/i18n/jquery.ui.datepicker-cy-GB.js | 2 +- ui/i18n/jquery.ui.datepicker-el.js | 2 +- ui/i18n/jquery.ui.datepicker-es.js | 2 +- ui/i18n/jquery.ui.datepicker-et.js | 2 +- ui/i18n/jquery.ui.datepicker-eu.js | 2 +- ui/i18n/jquery.ui.datepicker-fa.js | 6 +- ui/i18n/jquery.ui.datepicker-fr-CH.js | 2 +- ui/i18n/jquery.ui.datepicker-gl.js | 2 +- ui/i18n/jquery.ui.datepicker-hr.js | 2 +- ui/i18n/jquery.ui.datepicker-hy.js | 2 +- ui/i18n/jquery.ui.datepicker-id.js | 2 +- ui/i18n/jquery.ui.datepicker-is.js | 2 +- ui/i18n/jquery.ui.datepicker-ja.js | 2 +- ui/i18n/jquery.ui.datepicker-ko.js | 2 +- ui/i18n/jquery.ui.datepicker-lt.js | 2 +- ui/i18n/jquery.ui.datepicker-lv.js | 2 +- ui/i18n/jquery.ui.datepicker-ml.js | 2 +- ui/i18n/jquery.ui.datepicker-ms.js | 2 +- ui/i18n/jquery.ui.datepicker-nl.js | 2 +- ui/i18n/jquery.ui.datepicker-pt-BR.js | 2 +- ui/i18n/jquery.ui.datepicker-pt.js | 2 +- ui/i18n/jquery.ui.datepicker-ru.js | 2 +- ui/i18n/jquery.ui.datepicker-th.js | 2 +- ui/i18n/jquery.ui.datepicker-tj.js | 2 +- ui/i18n/jquery.ui.datepicker-tr.js | 2 +- ui/i18n/jquery.ui.datepicker-uk.js | 2 +- ui/jquery.ui.datepicker.js | 24 +++---- ui/jquery.ui.draggable.js | 40 +++++------ ui/jquery.ui.effect-highlight.js | 2 +- ui/jquery.ui.mouse.js | 2 +- ui/jquery.ui.resizable.js | 2 +- 45 files changed, 440 insertions(+), 440 deletions(-) (limited to 'ui/jquery.ui.resizable.js') diff --git a/tests/jquery-1.6.1.js b/tests/jquery-1.6.1.js index 5d5a1d58e..33e87732d 100644 --- a/tests/jquery-1.6.1.js +++ b/tests/jquery-1.6.1.js @@ -1895,11 +1895,11 @@ jQuery.fn.extend({ jQuery.removeAttr( this, name ); }); }, - + prop: function( name, value ) { return jQuery.access( this, name, value, true, jQuery.prop ); }, - + removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { @@ -2031,7 +2031,7 @@ jQuery.fn.extend({ val: function( value ) { var hooks, ret, elem = this[0]; - + if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; @@ -2159,15 +2159,15 @@ jQuery.extend({ height: true, offset: true }, - + attrFix: { // Always normalize to ensure hook usage tabindex: "tabIndex" }, - + attr: function( elem, name, value, pass ) { var nType = elem.nodeType; - + // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return undefined; @@ -2235,7 +2235,7 @@ jQuery.extend({ var propName; if ( elem.nodeType === 1 ) { name = jQuery.attrFix[ name ] || name; - + if ( jQuery.support.getSetAttribute ) { // Use removeAttribute in browsers that support it elem.removeAttribute( name ); @@ -2299,7 +2299,7 @@ jQuery.extend({ frameborder: "frameBorder", contenteditable: "contentEditable" }, - + prop: function( elem, name, value ) { var nType = elem.nodeType; @@ -2313,7 +2313,7 @@ jQuery.extend({ // Try to normalize/fix the name name = notxml && jQuery.propFix[ name ] || name; - + hooks = jQuery.propHooks[ name ]; if ( value !== undefined ) { @@ -2333,7 +2333,7 @@ jQuery.extend({ } } }, - + propHooks: {} }); @@ -2388,7 +2388,7 @@ if ( !jQuery.support.getSetAttribute ) { // propFix is more comprehensive and contains all fixes jQuery.attrFix = jQuery.propFix; - + // Use this for any attribute on a form in IE6/7 formHook = jQuery.attrHooks.name = jQuery.valHooks.button = { get: function( elem, name ) { @@ -2759,7 +2759,7 @@ jQuery.event = { } } }, - + // Events that are safe to short-circuit if no handlers are attached. // Native DOM events should not be added, they may have inline handlers. customEvent: { @@ -2805,7 +2805,7 @@ jQuery.event = { event.exclusive = exclusive; event.namespace = namespaces.join("."); event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); - + // triggerHandler() and global events don't bubble or run the default action if ( onlyHandlers || !elem ) { event.preventDefault(); @@ -2896,7 +2896,7 @@ jQuery.event = { jQuery.event.triggered = undefined; } } - + return event.result; }, @@ -3731,7 +3731,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } @@ -3741,7 +3741,7 @@ var Sizzle = function( selector, context, results, seed ) { contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); @@ -3749,9 +3749,9 @@ var Sizzle = function( selector, context, results, seed ) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3775,7 +3775,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set ); } } @@ -3904,7 +3904,7 @@ Sizzle.find = function( expr, context, isXML ) { for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); @@ -4236,7 +4236,7 @@ var Expr = Sizzle.selectors = { ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -4270,7 +4270,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, @@ -4280,7 +4280,7 @@ var Expr = Sizzle.selectors = { return match; } }, - + filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; @@ -4293,14 +4293,14 @@ var Expr = Sizzle.selectors = { checked: function( elem ) { return elem.checked === true; }, - + selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } - + return elem.selected === true; }, @@ -4322,7 +4322,7 @@ var Expr = Sizzle.selectors = { text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, @@ -4438,21 +4438,21 @@ var Expr = Sizzle.selectors = { case "only": case "first": while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } @@ -4465,22 +4465,22 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + var doneName = match[0], parent = elem.parentNode; - + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; - + for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent.sizcache = doneName; } - + var diff = elem.nodeIndex - last; if ( first === 0 ) { @@ -4499,7 +4499,7 @@ var Expr = Sizzle.selectors = { TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, - + CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; @@ -4565,7 +4565,7 @@ var makeArray = function( array, results ) { results.push.apply( results, array ); return results; } - + return array; }; @@ -4817,7 +4817,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function( query, context, extra, seed ) { context = context || document; @@ -4826,24 +4826,24 @@ if ( document.querySelectorAll ) { if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); - + // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } - + if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); - + // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); @@ -4856,12 +4856,12 @@ if ( document.querySelectorAll ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } - + } else { return makeArray( [], extra ); } } - + try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} @@ -4899,7 +4899,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -4926,7 +4926,7 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } @@ -4936,7 +4936,7 @@ if ( document.querySelectorAll ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); @@ -4973,7 +4973,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -5024,7 +5024,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { if ( elem ) { var match = false; - + elem = elem[dir]; while ( elem ) { @@ -5077,7 +5077,7 @@ if ( document.documentElement.contains ) { Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; @@ -5198,7 +5198,7 @@ jQuery.fn.extend({ closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; - + // Array if ( jQuery.isArray( selectors ) ) { var match, selector, diff --git a/tests/jquery-1.6.2.js b/tests/jquery-1.6.2.js index f3201aacb..fc5a1d74d 100644 --- a/tests/jquery-1.6.2.js +++ b/tests/jquery-1.6.2.js @@ -1511,7 +1511,7 @@ jQuery.extend({ return thisCache[ internalKey ] && thisCache[ internalKey ].events; } - return getByName ? + return getByName ? // Check for both converted-to-camel and non-converted data property names thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] : thisCache; @@ -1923,11 +1923,11 @@ jQuery.fn.extend({ jQuery.removeAttr( this, name ); }); }, - + prop: function( name, value ) { return jQuery.access( this, name, value, true, jQuery.prop ); }, - + removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { @@ -2060,7 +2060,7 @@ jQuery.fn.extend({ val: function( value ) { var hooks, ret, elem = this[0]; - + if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; @@ -2071,9 +2071,9 @@ jQuery.fn.extend({ ret = elem.value; - return typeof ret === "string" ? + return typeof ret === "string" ? // handle most common string cases - ret.replace(rreturn, "") : + ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } @@ -2194,15 +2194,15 @@ jQuery.extend({ height: true, offset: true }, - + attrFix: { // Always normalize to ensure hook usage tabindex: "tabIndex" }, - + attr: function( elem, name, value, pass ) { var nType = elem.nodeType; - + // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return undefined; @@ -2273,7 +2273,7 @@ jQuery.extend({ var propName; if ( elem.nodeType === 1 ) { name = jQuery.attrFix[ name ] || name; - + if ( jQuery.support.getSetAttribute ) { // Use removeAttribute in browsers that support it elem.removeAttribute( name ); @@ -2356,7 +2356,7 @@ jQuery.extend({ frameborder: "frameBorder", contenteditable: "contentEditable" }, - + prop: function( elem, name, value ) { var nType = elem.nodeType; @@ -2391,7 +2391,7 @@ jQuery.extend({ } } }, - + propHooks: {} }); @@ -2428,7 +2428,7 @@ if ( !jQuery.support.getSetAttribute ) { // propFix is more comprehensive and contains all fixes jQuery.attrFix = jQuery.propFix; - + // Use this for any attribute on a form in IE6/7 formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = { get: function( elem, name ) { @@ -2798,7 +2798,7 @@ jQuery.event = { } } }, - + // Events that are safe to short-circuit if no handlers are attached. // Native DOM events should not be added, they may have inline handlers. customEvent: { @@ -2844,7 +2844,7 @@ jQuery.event = { event.exclusive = exclusive; event.namespace = namespaces.join("."); event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); - + // triggerHandler() and global events don't bubble or run the default action if ( onlyHandlers || !elem ) { event.preventDefault(); @@ -2935,7 +2935,7 @@ jQuery.event = { jQuery.event.triggered = undefined; } } - + return event.result; }, @@ -3763,7 +3763,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } @@ -3773,7 +3773,7 @@ var Sizzle = function( selector, context, results, seed ) { contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); @@ -3781,9 +3781,9 @@ var Sizzle = function( selector, context, results, seed ) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3807,7 +3807,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set ); } } @@ -3936,7 +3936,7 @@ Sizzle.find = function( expr, context, isXML ) { for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); @@ -4268,7 +4268,7 @@ var Expr = Sizzle.selectors = { ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -4302,7 +4302,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, @@ -4312,7 +4312,7 @@ var Expr = Sizzle.selectors = { return match; } }, - + filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; @@ -4325,14 +4325,14 @@ var Expr = Sizzle.selectors = { checked: function( elem ) { return elem.checked === true; }, - + selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } - + return elem.selected === true; }, @@ -4354,7 +4354,7 @@ var Expr = Sizzle.selectors = { text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, @@ -4470,21 +4470,21 @@ var Expr = Sizzle.selectors = { case "only": case "first": while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } @@ -4497,22 +4497,22 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + var doneName = match[0], parent = elem.parentNode; - + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; - + for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent.sizcache = doneName; } - + var diff = elem.nodeIndex - last; if ( first === 0 ) { @@ -4531,7 +4531,7 @@ var Expr = Sizzle.selectors = { TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, - + CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; @@ -4597,7 +4597,7 @@ var makeArray = function( array, results ) { results.push.apply( results, array ); return results; } - + return array; }; @@ -4849,7 +4849,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function( query, context, extra, seed ) { context = context || document; @@ -4858,24 +4858,24 @@ if ( document.querySelectorAll ) { if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); - + // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } - + if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); - + // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); @@ -4888,12 +4888,12 @@ if ( document.querySelectorAll ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } - + } else { return makeArray( [], extra ); } } - + try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} @@ -4931,7 +4931,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -4958,7 +4958,7 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } @@ -4968,7 +4968,7 @@ if ( document.querySelectorAll ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); @@ -5005,7 +5005,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -5056,7 +5056,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { if ( elem ) { var match = false; - + elem = elem[dir]; while ( elem ) { @@ -5109,7 +5109,7 @@ if ( document.documentElement.contains ) { Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; @@ -5230,7 +5230,7 @@ jQuery.fn.extend({ closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; - + // Array if ( jQuery.isArray( selectors ) ) { var match, selector, diff --git a/tests/jquery-1.6.3.js b/tests/jquery-1.6.3.js index 792e62f49..f69fd06b0 100644 --- a/tests/jquery-1.6.3.js +++ b/tests/jquery-1.6.3.js @@ -1961,11 +1961,11 @@ jQuery.fn.extend({ jQuery.removeAttr( this, name ); }); }, - + prop: function( name, value ) { return jQuery.access( this, name, value, true, jQuery.prop ); }, - + removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { @@ -2098,7 +2098,7 @@ jQuery.fn.extend({ val: function( value ) { var hooks, ret, elem = this[0]; - + if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; @@ -2109,9 +2109,9 @@ jQuery.fn.extend({ ret = elem.value; - return typeof ret === "string" ? + return typeof ret === "string" ? // handle most common string cases - ret.replace(rreturn, "") : + ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } @@ -2232,15 +2232,15 @@ jQuery.extend({ height: true, offset: true }, - + attrFix: { // Always normalize to ensure hook usage tabindex: "tabIndex" }, - + attr: function( elem, name, value, pass ) { var nType = elem.nodeType; - + // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return undefined; @@ -2373,7 +2373,7 @@ jQuery.extend({ frameborder: "frameBorder", contenteditable: "contentEditable" }, - + prop: function( elem, name, value ) { var nType = elem.nodeType; @@ -2408,7 +2408,7 @@ jQuery.extend({ } } }, - + propHooks: { tabIndex: { get: function( elem ) { @@ -2461,7 +2461,7 @@ boolHook = { // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !jQuery.support.getSetAttribute ) { - + // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = jQuery.valHooks.button = { @@ -2833,7 +2833,7 @@ jQuery.event = { } } }, - + // Events that are safe to short-circuit if no handlers are attached. // Native DOM events should not be added, they may have inline handlers. customEvent: { @@ -2879,7 +2879,7 @@ jQuery.event = { event.exclusive = exclusive; event.namespace = namespaces.join("."); event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); - + // triggerHandler() and global events don't bubble or run the default action if ( onlyHandlers || !elem ) { event.preventDefault(); @@ -2970,7 +2970,7 @@ jQuery.event = { jQuery.event.triggered = undefined; } } - + return event.result; }, @@ -3799,7 +3799,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } @@ -3809,7 +3809,7 @@ var Sizzle = function( selector, context, results, seed ) { contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); @@ -3817,9 +3817,9 @@ var Sizzle = function( selector, context, results, seed ) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3843,7 +3843,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set ); } } @@ -3972,7 +3972,7 @@ Sizzle.find = function( expr, context, isXML ) { for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); @@ -4304,7 +4304,7 @@ var Expr = Sizzle.selectors = { ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -4338,7 +4338,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, @@ -4348,7 +4348,7 @@ var Expr = Sizzle.selectors = { return match; } }, - + filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; @@ -4361,14 +4361,14 @@ var Expr = Sizzle.selectors = { checked: function( elem ) { return elem.checked === true; }, - + selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } - + return elem.selected === true; }, @@ -4390,7 +4390,7 @@ var Expr = Sizzle.selectors = { text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, @@ -4506,21 +4506,21 @@ var Expr = Sizzle.selectors = { case "only": case "first": while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } @@ -4533,22 +4533,22 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + var doneName = match[0], parent = elem.parentNode; - + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; - + for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent.sizcache = doneName; } - + var diff = elem.nodeIndex - last; if ( first === 0 ) { @@ -4567,7 +4567,7 @@ var Expr = Sizzle.selectors = { TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, - + CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; @@ -4633,7 +4633,7 @@ var makeArray = function( array, results ) { results.push.apply( results, array ); return results; } - + return array; }; @@ -4885,7 +4885,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function( query, context, extra, seed ) { context = context || document; @@ -4894,24 +4894,24 @@ if ( document.querySelectorAll ) { if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); - + // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } - + if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); - + // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); @@ -4924,12 +4924,12 @@ if ( document.querySelectorAll ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } - + } else { return makeArray( [], extra ); } } - + try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} @@ -4967,7 +4967,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -4994,7 +4994,7 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } @@ -5004,7 +5004,7 @@ if ( document.querySelectorAll ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); @@ -5041,7 +5041,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -5092,7 +5092,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { if ( elem ) { var match = false; - + elem = elem[dir]; while ( elem ) { @@ -5145,7 +5145,7 @@ if ( document.documentElement.contains ) { Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; @@ -5266,7 +5266,7 @@ jQuery.fn.extend({ closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; - + // Array if ( jQuery.isArray( selectors ) ) { var match, selector, @@ -6718,7 +6718,7 @@ var r20 = /%20/g, // Document location segments ajaxLocParts, - + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = ["*/"] + ["*"]; diff --git a/tests/jquery-1.6.4.js b/tests/jquery-1.6.4.js index 11e6d0679..5ccaf5b8e 100644 --- a/tests/jquery-1.6.4.js +++ b/tests/jquery-1.6.4.js @@ -1962,11 +1962,11 @@ jQuery.fn.extend({ jQuery.removeAttr( this, name ); }); }, - + prop: function( name, value ) { return jQuery.access( this, name, value, true, jQuery.prop ); }, - + removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { @@ -2099,7 +2099,7 @@ jQuery.fn.extend({ val: function( value ) { var hooks, ret, elem = this[0]; - + if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; @@ -2110,9 +2110,9 @@ jQuery.fn.extend({ ret = elem.value; - return typeof ret === "string" ? + return typeof ret === "string" ? // handle most common string cases - ret.replace(rreturn, "") : + ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } @@ -2233,15 +2233,15 @@ jQuery.extend({ height: true, offset: true }, - + attrFix: { // Always normalize to ensure hook usage tabindex: "tabIndex" }, - + attr: function( elem, name, value, pass ) { var nType = elem.nodeType; - + // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return undefined; @@ -2374,7 +2374,7 @@ jQuery.extend({ frameborder: "frameBorder", contenteditable: "contentEditable" }, - + prop: function( elem, name, value ) { var nType = elem.nodeType; @@ -2409,7 +2409,7 @@ jQuery.extend({ } } }, - + propHooks: { tabIndex: { get: function( elem ) { @@ -2462,7 +2462,7 @@ boolHook = { // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !jQuery.support.getSetAttribute ) { - + // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = jQuery.valHooks.button = { @@ -2834,7 +2834,7 @@ jQuery.event = { } } }, - + // Events that are safe to short-circuit if no handlers are attached. // Native DOM events should not be added, they may have inline handlers. customEvent: { @@ -2880,7 +2880,7 @@ jQuery.event = { event.exclusive = exclusive; event.namespace = namespaces.join("."); event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); - + // triggerHandler() and global events don't bubble or run the default action if ( onlyHandlers || !elem ) { event.preventDefault(); @@ -2971,7 +2971,7 @@ jQuery.event = { jQuery.event.triggered = undefined; } } - + return event.result; }, @@ -3801,7 +3801,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } @@ -3811,7 +3811,7 @@ var Sizzle = function( selector, context, results, seed ) { contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); @@ -3819,9 +3819,9 @@ var Sizzle = function( selector, context, results, seed ) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3845,7 +3845,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set ); } } @@ -3974,7 +3974,7 @@ Sizzle.find = function( expr, context, isXML ) { for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); @@ -4306,7 +4306,7 @@ var Expr = Sizzle.selectors = { ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -4340,7 +4340,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, @@ -4350,7 +4350,7 @@ var Expr = Sizzle.selectors = { return match; } }, - + filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; @@ -4363,14 +4363,14 @@ var Expr = Sizzle.selectors = { checked: function( elem ) { return elem.checked === true; }, - + selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } - + return elem.selected === true; }, @@ -4392,7 +4392,7 @@ var Expr = Sizzle.selectors = { text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, @@ -4508,21 +4508,21 @@ var Expr = Sizzle.selectors = { case "only": case "first": while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } @@ -4535,22 +4535,22 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + var doneName = match[0], parent = elem.parentNode; - + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; - + for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent.sizcache = doneName; } - + var diff = elem.nodeIndex - last; if ( first === 0 ) { @@ -4569,7 +4569,7 @@ var Expr = Sizzle.selectors = { TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, - + CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; @@ -4635,7 +4635,7 @@ var makeArray = function( array, results ) { results.push.apply( results, array ); return results; } - + return array; }; @@ -4887,7 +4887,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function( query, context, extra, seed ) { context = context || document; @@ -4896,24 +4896,24 @@ if ( document.querySelectorAll ) { if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); - + // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } - + if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); - + // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); @@ -4926,12 +4926,12 @@ if ( document.querySelectorAll ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } - + } else { return makeArray( [], extra ); } } - + try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} @@ -4969,7 +4969,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -4996,7 +4996,7 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } @@ -5006,7 +5006,7 @@ if ( document.querySelectorAll ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); @@ -5043,7 +5043,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -5094,7 +5094,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { if ( elem ) { var match = false; - + elem = elem[dir]; while ( elem ) { @@ -5147,7 +5147,7 @@ if ( document.documentElement.contains ) { Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; @@ -5268,7 +5268,7 @@ jQuery.fn.extend({ closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; - + // Array if ( jQuery.isArray( selectors ) ) { var match, selector, @@ -6720,7 +6720,7 @@ var r20 = /%20/g, // Document location segments ajaxLocParts, - + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = ["*/"] + ["*"]; diff --git a/tests/jquery-1.6.js b/tests/jquery-1.6.js index 9a13ab960..61091a7e7 100644 --- a/tests/jquery-1.6.js +++ b/tests/jquery-1.6.js @@ -1893,11 +1893,11 @@ jQuery.fn.extend({ jQuery.removeAttr( this, name ); }); }, - + prop: function( name, value ) { return jQuery.access( this, name, value, true, jQuery.prop ); }, - + removeProp: function( name ) { return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) @@ -2028,7 +2028,7 @@ jQuery.fn.extend({ val: function( value ) { var hooks, ret, elem = this[0]; - + if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; @@ -2155,16 +2155,16 @@ jQuery.extend({ height: true, offset: true }, - + attrFix: { // Always normalize to ensure hook usage tabindex: "tabIndex", readonly: "readOnly" }, - + attr: function( elem, name, value, pass ) { var nType = elem.nodeType; - + // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return undefined; @@ -2173,10 +2173,10 @@ jQuery.extend({ if ( pass && name in jQuery.attrFn ) { return jQuery( elem )[ name ]( value ); } - + var ret, hooks, notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - + // Normalize the name if needed name = notxml && jQuery.attrFix[ name ] || name; @@ -2223,11 +2223,11 @@ jQuery.extend({ } } }, - + removeAttr: function( elem, name ) { if ( elem.nodeType === 1 ) { name = jQuery.attrFix[ name ] || name; - + if ( jQuery.support.getSetAttribute ) { // Use removeAttribute in browsers that support it elem.removeAttribute( name ); @@ -2271,43 +2271,43 @@ jQuery.extend({ } } }, - + propFix: {}, - + prop: function( elem, name, value ) { var nType = elem.nodeType; - + // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return undefined; } - + var ret, hooks, notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - + // Try to normalize/fix the name name = notxml && jQuery.propFix[ name ] || name; - + hooks = jQuery.propHooks[ name ]; - + if ( value !== undefined ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; - + } else { return (elem[ name ] = value); } - + } else { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) { return ret; - + } else { return elem[ name ]; } } }, - + propHooks: {} }); @@ -2324,7 +2324,7 @@ if ( !jQuery.support.getSetAttribute ) { usemap: "useMap", frameborder: "frameBorder" }); - + // Use this for any attribute on a form in IE6/7 formHook = jQuery.attrHooks.name = jQuery.attrHooks.value = jQuery.valHooks.button = { get: function( elem, name ) { @@ -2698,7 +2698,7 @@ jQuery.event = { } } }, - + // Events that are safe to short-circuit if no handlers are attached. // Native DOM events should not be added, they may have inline handlers. customEvent: { @@ -2744,7 +2744,7 @@ jQuery.event = { event.exclusive = exclusive; event.namespace = namespaces.join("."); event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); - + // triggerHandler() and global events don't bubble or run the default action if ( onlyHandlers || !elem ) { event.preventDefault(); @@ -2835,7 +2835,7 @@ jQuery.event = { jQuery.event.triggered = undefined; } } - + return event.result; }, @@ -3669,7 +3669,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } @@ -3679,7 +3679,7 @@ var Sizzle = function( selector, context, results, seed ) { contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); @@ -3687,9 +3687,9 @@ var Sizzle = function( selector, context, results, seed ) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3713,7 +3713,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set ); } } @@ -3842,7 +3842,7 @@ Sizzle.find = function( expr, context, isXML ) { for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); @@ -4174,7 +4174,7 @@ var Expr = Sizzle.selectors = { ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -4208,7 +4208,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, @@ -4218,7 +4218,7 @@ var Expr = Sizzle.selectors = { return match; } }, - + filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; @@ -4231,14 +4231,14 @@ var Expr = Sizzle.selectors = { checked: function( elem ) { return elem.checked === true; }, - + selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } - + return elem.selected === true; }, @@ -4260,7 +4260,7 @@ var Expr = Sizzle.selectors = { text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, @@ -4375,21 +4375,21 @@ var Expr = Sizzle.selectors = { case "only": case "first": while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } @@ -4402,22 +4402,22 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + var doneName = match[0], parent = elem.parentNode; - + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; - + for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent.sizcache = doneName; } - + var diff = elem.nodeIndex - last; if ( first === 0 ) { @@ -4436,7 +4436,7 @@ var Expr = Sizzle.selectors = { TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, - + CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; @@ -4502,7 +4502,7 @@ var makeArray = function( array, results ) { results.push.apply( results, array ); return results; } - + return array; }; @@ -4749,7 +4749,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function( query, context, extra, seed ) { context = context || document; @@ -4758,24 +4758,24 @@ if ( document.querySelectorAll ) { if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); - + // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } - + if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); - + // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); @@ -4788,12 +4788,12 @@ if ( document.querySelectorAll ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } - + } else { return makeArray( [], extra ); } } - + try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} @@ -4831,7 +4831,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -4858,7 +4858,7 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } @@ -4868,7 +4868,7 @@ if ( document.querySelectorAll ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); @@ -4905,7 +4905,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -4956,7 +4956,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { if ( elem ) { var match = false; - + elem = elem[dir]; while ( elem ) { @@ -5009,7 +5009,7 @@ if ( document.documentElement.contains ) { Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; @@ -5130,7 +5130,7 @@ jQuery.fn.extend({ closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; - + // Array if ( jQuery.isArray( selectors ) ) { var match, selector, @@ -5884,7 +5884,7 @@ jQuery.each({ function getAll( elem ) { if ( "getElementsByTagName" in elem ) { return elem.getElementsByTagName( "*" ); - + } else if ( "querySelectorAll" in elem ) { return elem.querySelectorAll( "*" ); diff --git a/tests/jquery-1.7.1.js b/tests/jquery-1.7.1.js index 8ccd0ea78..c8e7d7a01 100644 --- a/tests/jquery-1.7.1.js +++ b/tests/jquery-1.7.1.js @@ -3885,7 +3885,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } @@ -3895,7 +3895,7 @@ var Sizzle = function( selector, context, results, seed ) { contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); @@ -3903,9 +3903,9 @@ var Sizzle = function( selector, context, results, seed ) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3929,7 +3929,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set, seed ); } } @@ -4057,7 +4057,7 @@ Sizzle.find = function( expr, context, isXML ) { for ( i = 0, len = Expr.order.length; i < len; i++ ) { type = Expr.order[i]; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { left = match[1]; match.splice( 1, 1 ); @@ -4429,7 +4429,7 @@ var Expr = Sizzle.selectors = { ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -4463,7 +4463,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, @@ -4473,7 +4473,7 @@ var Expr = Sizzle.selectors = { return match; } }, - + filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; @@ -4486,14 +4486,14 @@ var Expr = Sizzle.selectors = { checked: function( elem ) { return elem.checked === true; }, - + selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } - + return elem.selected === true; }, @@ -4515,7 +4515,7 @@ var Expr = Sizzle.selectors = { text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, @@ -4634,21 +4634,21 @@ var Expr = Sizzle.selectors = { case "only": case "first": while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } @@ -4661,22 +4661,22 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + doneName = match[0]; parent = elem.parentNode; - + if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { count = 0; - + for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent[ expando ] = doneName; } - + diff = elem.nodeIndex - last; if ( first === 0 ) { @@ -4695,7 +4695,7 @@ var Expr = Sizzle.selectors = { TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; }, - + CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; @@ -4765,7 +4765,7 @@ var makeArray = function( array, results ) { results.push.apply( results, array ); return results; } - + return array; }; @@ -4997,7 +4997,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function( query, context, extra, seed ) { context = context || document; @@ -5006,24 +5006,24 @@ if ( document.querySelectorAll ) { if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); - + // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } - + if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); - + // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); @@ -5036,12 +5036,12 @@ if ( document.querySelectorAll ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } - + } else { return makeArray( [], extra ); } } - + try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} @@ -5079,7 +5079,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -5106,7 +5106,7 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } @@ -5116,7 +5116,7 @@ if ( document.querySelectorAll ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); @@ -5153,7 +5153,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -5204,7 +5204,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { if ( elem ) { var match = false; - + elem = elem[dir]; while ( elem ) { @@ -5257,7 +5257,7 @@ if ( document.documentElement.contains ) { Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; @@ -5374,11 +5374,11 @@ jQuery.fn.extend({ }, is: function( selector ) { - return !!selector && ( + return !!selector && ( typeof selector === "string" ? // If this is a positional selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? + POS.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); @@ -5386,7 +5386,7 @@ jQuery.fn.extend({ closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; - + // Array (deprecated as of jQuery 1.7) if ( jQuery.isArray( selectors ) ) { var level = 1; diff --git a/tests/jquery-1.7.2.js b/tests/jquery-1.7.2.js index 3774ff986..ceb681ff9 100644 --- a/tests/jquery-1.7.2.js +++ b/tests/jquery-1.7.2.js @@ -3645,7 +3645,7 @@ if ( !jQuery.support.submitBubbles ) { }); // return undefined since we don't need an event listener }, - + postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { diff --git a/tests/jquery-1.7.js b/tests/jquery-1.7.js index eda55db35..3c9ea9e56 100644 --- a/tests/jquery-1.7.js +++ b/tests/jquery-1.7.js @@ -3947,7 +3947,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } @@ -3957,7 +3957,7 @@ var Sizzle = function( selector, context, results, seed ) { contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); @@ -3965,9 +3965,9 @@ var Sizzle = function( selector, context, results, seed ) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3991,7 +3991,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set, seed ); } } @@ -4119,7 +4119,7 @@ Sizzle.find = function( expr, context, isXML ) { for ( i = 0, len = Expr.order.length; i < len; i++ ) { type = Expr.order[i]; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { left = match[1]; match.splice( 1, 1 ); @@ -4491,7 +4491,7 @@ var Expr = Sizzle.selectors = { ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -4525,7 +4525,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, @@ -4535,7 +4535,7 @@ var Expr = Sizzle.selectors = { return match; } }, - + filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; @@ -4548,14 +4548,14 @@ var Expr = Sizzle.selectors = { checked: function( elem ) { return elem.checked === true; }, - + selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } - + return elem.selected === true; }, @@ -4577,7 +4577,7 @@ var Expr = Sizzle.selectors = { text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, @@ -4696,21 +4696,21 @@ var Expr = Sizzle.selectors = { case "only": case "first": while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } @@ -4723,22 +4723,22 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + doneName = match[0]; parent = elem.parentNode; - + if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { count = 0; - + for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent[ expando ] = doneName; } - + diff = elem.nodeIndex - last; if ( first === 0 ) { @@ -4757,7 +4757,7 @@ var Expr = Sizzle.selectors = { TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; }, - + CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; @@ -4827,7 +4827,7 @@ var makeArray = function( array, results ) { results.push.apply( results, array ); return results; } - + return array; }; @@ -5059,7 +5059,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function( query, context, extra, seed ) { context = context || document; @@ -5068,24 +5068,24 @@ if ( document.querySelectorAll ) { if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); - + // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } - + if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); - + // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); @@ -5098,12 +5098,12 @@ if ( document.querySelectorAll ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } - + } else { return makeArray( [], extra ); } } - + try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} @@ -5141,7 +5141,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -5168,7 +5168,7 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } @@ -5178,7 +5178,7 @@ if ( document.querySelectorAll ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); @@ -5215,7 +5215,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -5266,7 +5266,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { if ( elem ) { var match = false; - + elem = elem[dir]; while ( elem ) { @@ -5319,7 +5319,7 @@ if ( document.documentElement.contains ) { Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; @@ -5436,11 +5436,11 @@ jQuery.fn.extend({ }, is: function( selector ) { - return !!selector && ( + return !!selector && ( typeof selector === "string" ? // If this is a positional selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? + POS.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); @@ -5448,7 +5448,7 @@ jQuery.fn.extend({ closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; - + // Array (deprecated as of jQuery 1.7) if ( jQuery.isArray( selectors ) ) { var level = 1; diff --git a/tests/jquery-1.8.0.js b/tests/jquery-1.8.0.js index dfe5eb00a..f81bd3d46 100644 --- a/tests/jquery-1.8.0.js +++ b/tests/jquery-1.8.0.js @@ -6322,7 +6322,7 @@ jQuery.sub = function() { var rootjQuerySub = jQuerySub(document); return jQuerySub; }; - + })(); var curCSS, iframe, iframeDoc, ralpha = /alpha\([^)]*\)/i, diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js index 790c88c27..08cbaafda 100644 --- a/tests/jquery.simulate.js +++ b/tests/jquery.simulate.js @@ -228,7 +228,7 @@ function findCenter( elem ) { document = $( elem.ownerDocument ); elem = $( elem ); offset = elem.offset(); - + return { x: offset.left + elem.outerWidth() / 2 - document.scrollLeft(), y: offset.top + elem.outerHeight() / 2 - document.scrollTop() @@ -241,7 +241,7 @@ $.extend( $.simulate.prototype, { options = this.options, center = findCenter( target ), x = Math.floor( center.x ), - y = Math.floor( center.y ), + y = Math.floor( center.y ), dx = options.dx || 0, dy = options.dy || 0, coord = { clientX: x, clientY: y }; diff --git a/tests/unit/dialog/dialog_tickets.js b/tests/unit/dialog/dialog_tickets.js index 5c3277c2f..e17d55a15 100644 --- a/tests/unit/dialog/dialog_tickets.js +++ b/tests/unit/dialog/dialog_tickets.js @@ -125,7 +125,7 @@ test("#6966: Escape key closes all dialogs, not the top one", function(){ ok(d1.data('dialog') && d1.dialog('isOpen'), 'first dialog is open'); ok(d2.data('dialog') && d2.dialog('isOpen'), 'second dialog is open'); - + $( document ).simulate('keydown', {keyCode: $.ui.keyCode.ESCAPE}); ok(d1.data('dialog') && d1.dialog('isOpen'), 'first dialog still open'); ok(!d2.data('dialog'), 'second dialog is closed'); @@ -136,14 +136,14 @@ test("#6966: Escape key closes all dialogs, not the top one", function(){ d2.remove(); d1.remove(); - + // test with close function removing dialog triggered through the dialog d1 = $('
Dialog 1
').dialog({modal: true, close: function(){ d1.remove(); }}); d2 = $('
Dialog 2
').dialog({modal: true, close: function(){ d2.remove(); }}); ok(d1.data('dialog') && d1.dialog('isOpen'), 'first dialog is open'); ok(d2.data('dialog') && d2.dialog('isOpen'), 'second dialog is open'); - + d2.simulate('keydown', {keyCode: $.ui.keyCode.ESCAPE}); ok(d1.data('dialog') && d1.dialog('isOpen'), 'first dialog still open'); ok(!d2.data('dialog'), 'second dialog is closed'); diff --git a/ui/i18n/jquery.ui.datepicker-ar.js b/ui/i18n/jquery.ui.datepicker-ar.js index f0d009667..cef0f08fd 100644 --- a/ui/i18n/jquery.ui.datepicker-ar.js +++ b/ui/i18n/jquery.ui.datepicker-ar.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['ar']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-az.js b/ui/i18n/jquery.ui.datepicker-az.js index 1101c8b91..a133a9eb2 100644 --- a/ui/i18n/jquery.ui.datepicker-az.js +++ b/ui/i18n/jquery.ui.datepicker-az.js @@ -20,4 +20,4 @@ jQuery(function($) { showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['az']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-bs.js b/ui/i18n/jquery.ui.datepicker-bs.js index d64573755..f08870ffe 100644 --- a/ui/i18n/jquery.ui.datepicker-bs.js +++ b/ui/i18n/jquery.ui.datepicker-bs.js @@ -2,10 +2,10 @@ /* Written by Kenan Konjo. */ jQuery(function($){ $.datepicker.regional['bs'] = { - closeText: 'Zatvori', - prevText: '<', - nextText: '>', - currentText: 'Danas', + closeText: 'Zatvori', + prevText: '<', + nextText: '>', + currentText: 'Danas', monthNames: ['Januar','Februar','Mart','April','Maj','Juni', 'Juli','August','Septembar','Oktobar','Novembar','Decembar'], monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['bs']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-cy-GB.js b/ui/i18n/jquery.ui.datepicker-cy-GB.js index dfee2f9d4..cf3a38e6c 100644 --- a/ui/i18n/jquery.ui.datepicker-cy-GB.js +++ b/ui/i18n/jquery.ui.datepicker-cy-GB.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['cy-GB']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-el.js b/ui/i18n/jquery.ui.datepicker-el.js index 6d775f995..1ac47561a 100644 --- a/ui/i18n/jquery.ui.datepicker-el.js +++ b/ui/i18n/jquery.ui.datepicker-el.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['el']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-es.js b/ui/i18n/jquery.ui.datepicker-es.js index 63368aecc..97a2d6ead 100644 --- a/ui/i18n/jquery.ui.datepicker-es.js +++ b/ui/i18n/jquery.ui.datepicker-es.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['es']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-et.js b/ui/i18n/jquery.ui.datepicker-et.js index 32702b243..62cbea8fa 100644 --- a/ui/i18n/jquery.ui.datepicker-et.js +++ b/ui/i18n/jquery.ui.datepicker-et.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['et']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-eu.js b/ui/i18n/jquery.ui.datepicker-eu.js index 846ce3abc..a71db2c72 100644 --- a/ui/i18n/jquery.ui.datepicker-eu.js +++ b/ui/i18n/jquery.ui.datepicker-eu.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['eu']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-fa.js b/ui/i18n/jquery.ui.datepicker-fa.js index be8acd2a5..bb957f6d8 100644 --- a/ui/i18n/jquery.ui.datepicker-fa.js +++ b/ui/i18n/jquery.ui.datepicker-fa.js @@ -37,7 +37,7 @@ jQuery(function($) { 'س', 'چ', 'پ', - 'ج', + 'ج', 'ش' ], dayNamesMin: [ @@ -46,7 +46,7 @@ jQuery(function($) { 'س', 'چ', 'پ', - 'ج', + 'ج', 'ش' ], weekHeader: 'هف', @@ -56,4 +56,4 @@ jQuery(function($) { showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['fa']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-fr-CH.js b/ui/i18n/jquery.ui.datepicker-fr-CH.js index fec03a042..e574537b0 100644 --- a/ui/i18n/jquery.ui.datepicker-fr-CH.js +++ b/ui/i18n/jquery.ui.datepicker-fr-CH.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['fr-CH']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-gl.js b/ui/i18n/jquery.ui.datepicker-gl.js index 0de64968f..59b989a6d 100644 --- a/ui/i18n/jquery.ui.datepicker-gl.js +++ b/ui/i18n/jquery.ui.datepicker-gl.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['gl']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-hr.js b/ui/i18n/jquery.ui.datepicker-hr.js index 6bc5aade1..2fe37b64b 100644 --- a/ui/i18n/jquery.ui.datepicker-hr.js +++ b/ui/i18n/jquery.ui.datepicker-hr.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['hr']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-hy.js b/ui/i18n/jquery.ui.datepicker-hy.js index b42851596..6d4eca555 100644 --- a/ui/i18n/jquery.ui.datepicker-hy.js +++ b/ui/i18n/jquery.ui.datepicker-hy.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['hy']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-id.js b/ui/i18n/jquery.ui.datepicker-id.js index 4ad46f640..6327fa60c 100644 --- a/ui/i18n/jquery.ui.datepicker-id.js +++ b/ui/i18n/jquery.ui.datepicker-id.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['id']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-is.js b/ui/i18n/jquery.ui.datepicker-is.js index f1b067ebf..925341a7a 100644 --- a/ui/i18n/jquery.ui.datepicker-is.js +++ b/ui/i18n/jquery.ui.datepicker-is.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['is']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-ja.js b/ui/i18n/jquery.ui.datepicker-ja.js index afd298315..4d0b63c77 100644 --- a/ui/i18n/jquery.ui.datepicker-ja.js +++ b/ui/i18n/jquery.ui.datepicker-ja.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: true, yearSuffix: '年'}; $.datepicker.setDefaults($.datepicker.regional['ja']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-ko.js b/ui/i18n/jquery.ui.datepicker-ko.js index 04112424d..af36f3d6b 100644 --- a/ui/i18n/jquery.ui.datepicker-ko.js +++ b/ui/i18n/jquery.ui.datepicker-ko.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: true, yearSuffix: '년'}; $.datepicker.setDefaults($.datepicker.regional['ko']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-lt.js b/ui/i18n/jquery.ui.datepicker-lt.js index 2970f8f37..1afaaac5d 100644 --- a/ui/i18n/jquery.ui.datepicker-lt.js +++ b/ui/i18n/jquery.ui.datepicker-lt.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['lt']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-lv.js b/ui/i18n/jquery.ui.datepicker-lv.js index 003934e72..28cc102fc 100644 --- a/ui/i18n/jquery.ui.datepicker-lv.js +++ b/ui/i18n/jquery.ui.datepicker-lv.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['lv']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-ml.js b/ui/i18n/jquery.ui.datepicker-ml.js index 1e3432c0a..9b8f460db 100644 --- a/ui/i18n/jquery.ui.datepicker-ml.js +++ b/ui/i18n/jquery.ui.datepicker-ml.js @@ -3,7 +3,7 @@ jQuery(function($){ $.datepicker.regional['ml'] = { closeText: 'ശരി', - prevText: 'മുന്നത്തെ', + prevText: 'മുന്നത്തെ', nextText: 'അടുത്തത് ', currentText: 'ഇന്ന്', monthNames: ['ജനുവരി','ഫെബ്രുവരി','മാര്‍ച്ച്','ഏപ്രില്‍','മേയ്','ജൂണ്‍', diff --git a/ui/i18n/jquery.ui.datepicker-ms.js b/ui/i18n/jquery.ui.datepicker-ms.js index c290af10a..e70de7299 100644 --- a/ui/i18n/jquery.ui.datepicker-ms.js +++ b/ui/i18n/jquery.ui.datepicker-ms.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['ms']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-nl.js b/ui/i18n/jquery.ui.datepicker-nl.js index 781fe6191..203f16069 100644 --- a/ui/i18n/jquery.ui.datepicker-nl.js +++ b/ui/i18n/jquery.ui.datepicker-nl.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional.nl); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-pt-BR.js b/ui/i18n/jquery.ui.datepicker-pt-BR.js index 0741892ab..521967ec3 100644 --- a/ui/i18n/jquery.ui.datepicker-pt-BR.js +++ b/ui/i18n/jquery.ui.datepicker-pt-BR.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['pt-BR']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-pt.js b/ui/i18n/jquery.ui.datepicker-pt.js index 98925b455..999f20e3e 100644 --- a/ui/i18n/jquery.ui.datepicker-pt.js +++ b/ui/i18n/jquery.ui.datepicker-pt.js @@ -19,4 +19,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['pt']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-ru.js b/ui/i18n/jquery.ui.datepicker-ru.js index 2017e0537..a51971405 100644 --- a/ui/i18n/jquery.ui.datepicker-ru.js +++ b/ui/i18n/jquery.ui.datepicker-ru.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['ru']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-th.js b/ui/i18n/jquery.ui.datepicker-th.js index d57541f64..aecfd27cc 100644 --- a/ui/i18n/jquery.ui.datepicker-th.js +++ b/ui/i18n/jquery.ui.datepicker-th.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['th']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-tj.js b/ui/i18n/jquery.ui.datepicker-tj.js index ed662392c..9a20e4d37 100644 --- a/ui/i18n/jquery.ui.datepicker-tj.js +++ b/ui/i18n/jquery.ui.datepicker-tj.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['tj']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-tr.js b/ui/i18n/jquery.ui.datepicker-tr.js index 1b5cafc39..75b583a77 100644 --- a/ui/i18n/jquery.ui.datepicker-tr.js +++ b/ui/i18n/jquery.ui.datepicker-tr.js @@ -20,4 +20,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['tr']); -}); \ No newline at end of file +}); diff --git a/ui/i18n/jquery.ui.datepicker-uk.js b/ui/i18n/jquery.ui.datepicker-uk.js index 31964af44..2bdc82ff7 100644 --- a/ui/i18n/jquery.ui.datepicker-uk.js +++ b/ui/i18n/jquery.ui.datepicker-uk.js @@ -21,4 +21,4 @@ jQuery(function($){ showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['uk']); -}); \ No newline at end of file +}); diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 4643af2eb..7dacbc7c1 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -116,7 +116,7 @@ function Datepicker() { $.extend(Datepicker.prototype, { /* Class name added to elements to indicate already configured with a date picker. */ markerClassName: 'hasDatepicker', - + //Keep track of the maximum number of rows displayed (see #7043) maxRows: 4, @@ -125,7 +125,7 @@ $.extend(Datepicker.prototype, { if (this.debug) console.log.apply('', arguments); }, - + // TODO rename to "widget" when switching to widget factory _widgetDatepicker: function() { return this.dpDiv; @@ -235,7 +235,7 @@ $.extend(Datepicker.prototype, { if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) $.datepicker._hideDatepicker(); else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) { - $.datepicker._hideDatepicker(); + $.datepicker._hideDatepicker(); $.datepicker._showDatepicker(input[0]); } else $.datepicker._showDatepicker(input[0]); @@ -531,7 +531,7 @@ $.extend(Datepicker.prototype, { case 9: $.datepicker._hideDatepicker(); handled = false; break; // hide on tab out - case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + + case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + $.datepicker._currentClass + ')', inst.dpDiv); if (sel[0]) $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); @@ -629,7 +629,7 @@ $.extend(Datepicker.prototype, { }, /* Pop-up the date picker for a given input field. - If false returned from beforeShow event handler do not show. + If false returned from beforeShow event handler do not show. @param input element - the input field attached to the date picker or event - if triggered by focus */ _showDatepicker: function(input) { @@ -733,7 +733,7 @@ $.extend(Datepicker.prototype, { // this breaks the change event in IE inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement) inst.input.focus(); - // deffered render of the years select (to avoid flashes on Firefox) + // deffered render of the years select (to avoid flashes on Firefox) if( inst.yearshtml ){ var origyearshtml = inst.yearshtml; setTimeout(function(){ @@ -1442,7 +1442,7 @@ $.extend(Datepicker.prototype, { $(this).bind(this.getAttribute('data-event'), handler[this.getAttribute('data-handler')]); }); }, - + /* Generate the HTML for the current state of the date picker. */ _generateHTML: function(inst) { var today = new Date(); @@ -1599,7 +1599,7 @@ $.extend(Datepicker.prototype, { drawMonth = 0; drawYear++; } - calender += '' + (isMultiMonth ? '' + + calender += '' + (isMultiMonth ? '' + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
' : '') : ''); group += calender; } @@ -1663,7 +1663,7 @@ $.extend(Datepicker.prototype, { '>' + year + ''; } inst.yearshtml += ''; - + html += inst.yearshtml; inst.yearshtml = null; } @@ -1774,7 +1774,7 @@ $.extend(Datepicker.prototype, { * Bind hover events for datepicker elements. * Done via delegate so the binding only occurs once in the lifetime of the parent div. * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. - */ + */ function bindHover(dpDiv) { var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; return dpDiv.delegate(selector, 'mouseout', function() { @@ -1806,12 +1806,12 @@ function extendRemove(target, props) { Object - settings for attaching new datepicker functionality @return jQuery object */ $.fn.datepicker = function(options){ - + /* Verify an empty collection wasn't passed - Fixes #6976 */ if ( !this.length ) { return this; } - + /* Initialise the date picker. */ if (!$.datepicker.initialized) { $(document).mousedown($.datepicker._checkExternalClick). diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 5d91a3d94..aa6275252 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -73,7 +73,7 @@ $.widget("ui.draggable", $.ui.mouse, { this.handle = this._getHandle(event); if (!this.handle) return false; - + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { $('
') .css({ @@ -157,12 +157,12 @@ $.widget("ui.draggable", $.ui.mouse, { if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, event); - + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position - + //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event); - + return true; }, @@ -201,7 +201,7 @@ $.widget("ui.draggable", $.ui.mouse, { dropped = this.dropped; this.dropped = false; } - + //if the original element is no longer in the DOM don't bother to continue (see #8269) var element = this.element[0], elementInDom = false; while ( element && (element = element.parentNode) ) { @@ -227,29 +227,29 @@ $.widget("ui.draggable", $.ui.mouse, { return false; }, - + _mouseUp: function(event) { //Remove frame helpers - $("div.ui-draggable-iframeFix").each(function() { - this.parentNode.removeChild(this); + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); }); - + //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); - + return $.ui.mouse.prototype._mouseUp.call(this, event); }, - + cancel: function() { - + if(this.helper.is(".ui-draggable-dragging")) { this._mouseUp({}); } else { this._clear(); } - + return this; - + }, _getHandle: function(event) { @@ -570,14 +570,14 @@ $.ui.plugin.add("draggable", "connectToSortable", { }; $.each(inst.sortables, function(i) { - + var innermostIntersecting = false; var thisSortable = this; //Copy over some variables to allow calling the sortable's native _intersectsWith this.instance.positionAbs = inst.positionAbs; this.instance.helperProportions = inst.helperProportions; this.instance.offset.click = inst.offset.click; - + if(this.instance._intersectsWith(this.instance.containerCache)) { innermostIntersecting = true; $.each(inst.sortables, function () { @@ -634,13 +634,13 @@ $.ui.plugin.add("draggable", "connectToSortable", { this.instance.isOver = 0; this.instance.cancelHelperRemoval = true; - + //Prevent reverting on this forced stop this.instance.options.revert = false; - + // The out event needs to be triggered independently this.instance._trigger('out', event, this.instance._uiHash(this.instance)); - + this.instance._mouseStop(event, true); this.instance.options.helper = this.instance.options._helper; @@ -810,7 +810,7 @@ $.ui.plugin.add("draggable", "stack", { return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); }); if (!group.length) { return; } - + var min = parseInt(group[0].style.zIndex) || 0; $(group).each(function(i) { this.style.zIndex = min + i; diff --git a/ui/jquery.ui.effect-highlight.js b/ui/jquery.ui.effect-highlight.js index 0b0dbd988..99c41de2f 100644 --- a/ui/jquery.ui.effect-highlight.js +++ b/ui/jquery.ui.effect-highlight.js @@ -26,7 +26,7 @@ $.effects.effect.highlight = function( o, done ) { } $.effects.save( elem, props ); - + elem .show() .css({ diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index f5069d00c..cdc063f91 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -104,7 +104,7 @@ $.widget("ui.mouse", { .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); event.preventDefault(); - + mouseHandled = true; return true; }, diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index c1fd676d9..fc4868c37 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -574,7 +574,7 @@ $.ui.plugin.add("resizable", "alsoResize", { _alsoResize = function (exp, c) { $(exp).each(function() { - var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; $.each(css, function (i, prop) { -- cgit v1.2.3 From d73edfff769603681a0889585b45062cdf98743e Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 26 Oct 2012 15:48:37 -0400 Subject: Resizable: Removed pixel shifting for IE6. --- ui/jquery.ui.resizable.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'ui/jquery.ui.resizable.js') diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index fc4868c37..c282f2950 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -464,16 +464,12 @@ $.widget("ui.resizable", $.ui.mouse, { this.helper = this.helper || $('
'); - // fix ie6 offset TODO: This seems broken - var ie6offset = ($.ui.ie6 ? 1 : 0), - pxyoffset = ( $.ui.ie6 ? 2 : -1 ); - this.helper.addClass(this._helper).css({ - width: this.element.outerWidth() + pxyoffset, - height: this.element.outerHeight() + pxyoffset, + width: this.element.outerWidth() - 1, + height: this.element.outerHeight() - 1, position: 'absolute', - left: this.elementOffset.left - ie6offset +'px', - top: this.elementOffset.top - ie6offset +'px', + left: this.elementOffset.left +'px', + top: this.elementOffset.top +'px', zIndex: ++o.zIndex //TODO: Don't modify option }); -- cgit v1.2.3 From d85b0160f2bd9030e2abc1a5d1d166602423cb11 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Wed, 31 Oct 2012 08:30:01 -0400 Subject: Dev: Standardized the resizable test suite. Fixed #8754 - Dev: Get resizable test suite to pass --- build/tasks/testswarm.js | 2 +- grunt.js | 4 +- tests/unit/all-active.html | 2 +- tests/unit/all.html | 2 +- tests/unit/resizable/resizable_core.js | 52 ++++++++++---------- tests/unit/resizable/resizable_options.js | 52 ++++++++++---------- ui/jquery.ui.droppable.js | 2 - ui/jquery.ui.resizable.js | 82 +++++++++++++++---------------- 8 files changed, 99 insertions(+), 99 deletions(-) (limited to 'ui/jquery.ui.resizable.js') diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index 65266a826..77ee6bfcc 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -21,7 +21,7 @@ var versions = { "Menu": "menu/menu.html", "Position": "position/position.html", "Progressbar": "progressbar/progressbar.html", - //"Resizable": "resizable/resizable.html", + "Resizable": "resizable/resizable.html", "Selectable": "selectable/selectable.html", //"Slider": "slider/slider.html", //"Sortable": "sortable/sortable.html", diff --git a/grunt.js b/grunt.js index cba7eb53f..85ec8611c 100644 --- a/grunt.js +++ b/grunt.js @@ -281,13 +281,13 @@ grunt.initConfig({ files: grunt.file.expandFiles( "tests/unit/**/*.html" ).filter(function( file ) { // disabling everything that doesn't (quite) work with PhantomJS for now // TODO except for all|index|test, try to include more as we go - return !( /(all|all-active|index|test|resizable|sortable|dialog|slider|datepicker|tabs|tooltip)\.html$/ ).test( file ); + return !( /(all|all-active|index|test|sortable|dialog|slider|datepicker|tabs|tooltip)\.html$/ ).test( file ); }) }, lint: { ui: grunt.file.expandFiles( "ui/*.js" ).filter(function( file ) { // TODO remove items from this list once rewritten - return !( /(mouse|datepicker|resizable|sortable)\.js$/ ).test( file ); + return !( /(mouse|datepicker|sortable)\.js$/ ).test( file ); }), grunt: [ "grunt.js", "build/**/*.js" ], tests: "tests/unit/**/*.js" diff --git a/tests/unit/all-active.html b/tests/unit/all-active.html index 0c2c2d4f5..8dc945de4 100644 --- a/tests/unit/all-active.html +++ b/tests/unit/all-active.html @@ -28,7 +28,7 @@ "menu/menu.html", "position/position.html", "progressbar/progressbar.html", - //"resizable/resizable.html", + "resizable/resizable.html", "selectable/selectable.html", //"slider/slider.html", //"sortable/sortable.html", diff --git a/tests/unit/all.html b/tests/unit/all.html index 3858e9ef0..70a841376 100644 --- a/tests/unit/all.html +++ b/tests/unit/all.html @@ -28,7 +28,7 @@ "menu/menu.html", "position/position.html", "progressbar/progressbar.html", - //"resizable/resizable.html", + "resizable/resizable.html", "selectable/selectable.html", "slider/slider.html", //"sortable/sortable.html", diff --git a/tests/unit/resizable/resizable_core.js b/tests/unit/resizable/resizable_core.js index 8cc6cec82..f4e6cdedd 100644 --- a/tests/unit/resizable/resizable_core.js +++ b/tests/unit/resizable/resizable_core.js @@ -2,18 +2,20 @@ * resizable_core.js */ -TestHelpers.resizableDrag = function(el, dx, dy, complete) { +TestHelpers.resizable = { + drag: function(el, dx, dy, complete) { - // speed = sync -> Drag syncrhonously. - // speed = fast|slow -> Drag asyncrhonously - animated. + // speed = sync -> Drag syncrhonously. + // speed = fast|slow -> Drag asyncrhonously - animated. - //this mouseover is to work around a limitation in resizable - //TODO: fix resizable so handle doesn't require mouseover in order to be used - $(el).simulate("mouseover"); + //this mouseover is to work around a limitation in resizable + //TODO: fix resizable so handle doesn't require mouseover in order to be used + $(el).simulate("mouseover"); - return $(el).simulate("drag", { - dx: dx||0, dy: dy||0, speed: 'sync', complete: complete - }); + return $(el).simulate("drag", { + dx: dx||0, dy: dy||0, speed: 'sync', complete: complete + }); + } }; (function($) { @@ -44,10 +46,10 @@ test("n", function() { var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ handles: 'all' }); - TestHelpers.resizableDrag(handle, 0, -50); + TestHelpers.resizable.drag(handle, 0, -50); equal( target.height(), 150, "compare height" ); - TestHelpers.resizableDrag(handle, 0, 50); + TestHelpers.resizable.drag(handle, 0, 50); equal( target.height(), 100, "compare height" ); }); @@ -56,10 +58,10 @@ test("s", function() { var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ handles: 'all' }); - TestHelpers.resizableDrag(handle, 0, 50); + TestHelpers.resizable.drag(handle, 0, 50); equal( target.height(), 150, "compare height" ); - TestHelpers.resizableDrag(handle, 0, -50); + TestHelpers.resizable.drag(handle, 0, -50); equal( target.height(), 100, "compare height" ); }); @@ -68,10 +70,10 @@ test("e", function() { var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ handles: 'all' }); - TestHelpers.resizableDrag(handle, 50); + TestHelpers.resizable.drag(handle, 50); equal( target.width(), 150, "compare width"); - TestHelpers.resizableDrag(handle, -50); + TestHelpers.resizable.drag(handle, -50); equal( target.width(), 100, "compare width" ); }); @@ -80,10 +82,10 @@ test("w", function() { var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ handles: 'all' }); - TestHelpers.resizableDrag(handle, -50); + TestHelpers.resizable.drag(handle, -50); equal( target.width(), 150, "compare width" ); - TestHelpers.resizableDrag(handle, 50); + TestHelpers.resizable.drag(handle, 50); equal( target.width(), 100, "compare width" ); }); @@ -92,11 +94,11 @@ test("ne", function() { var handle = '.ui-resizable-ne', target = $('#resizable1').css({ overflow: 'hidden' }).resizable({ handles: 'all' }); - TestHelpers.resizableDrag(handle, -50, -50); + TestHelpers.resizable.drag(handle, -50, -50); equal( target.width(), 50, "compare width" ); equal( target.height(), 150, "compare height" ); - TestHelpers.resizableDrag(handle, 50, 50); + TestHelpers.resizable.drag(handle, 50, 50); equal( target.width(), 100, "compare width" ); equal( target.height(), 100, "compare height" ); }); @@ -106,11 +108,11 @@ test("se", function() { var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all' }); - TestHelpers.resizableDrag(handle, 50, 50); + TestHelpers.resizable.drag(handle, 50, 50); equal( target.width(), 150, "compare width" ); equal( target.height(), 150, "compare height" ); - TestHelpers.resizableDrag(handle, -50, -50); + TestHelpers.resizable.drag(handle, -50, -50); equal( target.width(), 100, "compare width" ); equal( target.height(), 100, "compare height" ); }); @@ -120,11 +122,11 @@ test("sw", function() { var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all' }); - TestHelpers.resizableDrag(handle, -50, -50); + TestHelpers.resizable.drag(handle, -50, -50); equal( target.width(), 150, "compare width" ); equal( target.height(), 50, "compare height" ); - TestHelpers.resizableDrag(handle, 50, 50); + TestHelpers.resizable.drag(handle, 50, 50); equal( target.width(), 100, "compare width" ); equal( target.height(), 100, "compare height" ); }); @@ -134,11 +136,11 @@ test("nw", function() { var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all' }); - TestHelpers.resizableDrag(handle, -50, -50); + TestHelpers.resizable.drag(handle, -50, -50); equal( target.width(), 150, "compare width" ); equal( target.height(), 150, "compare height" ); - TestHelpers.resizableDrag(handle, 50, 50); + TestHelpers.resizable.drag(handle, 50, 50); equal( target.width(), 100, "compare width" ); equal( target.height(), 100, "compare height" ); }); diff --git a/tests/unit/resizable/resizable_options.js b/tests/unit/resizable/resizable_options.js index c17f329fd..730a3389a 100644 --- a/tests/unit/resizable/resizable_options.js +++ b/tests/unit/resizable/resizable_options.js @@ -10,11 +10,11 @@ test("aspectRatio: 'preserve' (e)", function() { var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); - TestHelpers.resizableDrag(handle, 80); + TestHelpers.resizable.drag(handle, 80); equal( target.width(), 130, "compare maxWidth"); equal( target.height(), 130, "compare maxHeight"); - TestHelpers.resizableDrag(handle, -130); + TestHelpers.resizable.drag(handle, -130); equal( target.width(), 70, "compare minWidth"); equal( target.height(), 70, "compare minHeight"); }); @@ -24,11 +24,11 @@ test("aspectRatio: 'preserve' (w)", function() { var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); - TestHelpers.resizableDrag(handle, -80); + TestHelpers.resizable.drag(handle, -80); equal( target.width(), 130, "compare maxWidth"); equal( target.height(), 130, "compare maxHeight"); - TestHelpers.resizableDrag(handle, 130); + TestHelpers.resizable.drag(handle, 130); equal( target.width(), 70, "compare minWidth"); equal( target.height(), 70, "compare minHeight"); }); @@ -38,11 +38,11 @@ test("aspectRatio: 'preserve' (n)", function() { var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); - TestHelpers.resizableDrag(handle, 0, -80); + TestHelpers.resizable.drag(handle, 0, -80); equal( target.width(), 130, "compare maxWidth"); equal( target.height(), 130, "compare maxHeight"); - TestHelpers.resizableDrag(handle, 0, 80); + TestHelpers.resizable.drag(handle, 0, 80); equal( target.width(), 70, "compare minWidth"); equal( target.height(), 70, "compare minHeight"); }); @@ -52,11 +52,11 @@ test("aspectRatio: 'preserve' (s)", function() { var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); - TestHelpers.resizableDrag(handle, 0, 80); + TestHelpers.resizable.drag(handle, 0, 80); equal( target.width(), 130, "compare maxWidth"); equal( target.height(), 130, "compare maxHeight"); - TestHelpers.resizableDrag(handle, 0, -80); + TestHelpers.resizable.drag(handle, 0, -80); equal( target.width(), 70, "compare minWidth"); equal( target.height(), 70, "compare minHeight"); }); @@ -66,11 +66,11 @@ test("aspectRatio: 'preserve' (se)", function() { var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); - TestHelpers.resizableDrag(handle, 80, 80); + TestHelpers.resizable.drag(handle, 80, 80); equal( target.width(), 130, "compare maxWidth"); equal( target.height(), 130, "compare maxHeight"); - TestHelpers.resizableDrag(handle, -80, -80); + TestHelpers.resizable.drag(handle, -80, -80); equal( target.width(), 70, "compare minWidth"); equal( target.height(), 70, "compare minHeight"); }); @@ -80,11 +80,11 @@ test("aspectRatio: 'preserve' (sw)", function() { var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); - TestHelpers.resizableDrag(handle, -80, 80); + TestHelpers.resizable.drag(handle, -80, 80); equal( target.width(), 130, "compare maxWidth"); equal( target.height(), 130, "compare maxHeight"); - TestHelpers.resizableDrag(handle, 80, -80); + TestHelpers.resizable.drag(handle, 80, -80); equal( target.width(), 70, "compare minWidth"); equal( target.height(), 70, "compare minHeight"); }); @@ -94,11 +94,11 @@ test("aspectRatio: 'preserve' (ne)", function() { var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); - TestHelpers.resizableDrag(handle, 80, -80); + TestHelpers.resizable.drag(handle, 80, -80); equal( target.width(), 130, "compare maxWidth"); equal( target.height(), 130, "compare maxHeight"); - TestHelpers.resizableDrag(handle, -80, 80); + TestHelpers.resizable.drag(handle, -80, 80); equal( target.width(), 70, "compare minWidth"); equal( target.height(), 70, "compare minHeight"); }); @@ -108,11 +108,11 @@ test("grid", function() { var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', grid: [0, 20] }); - TestHelpers.resizableDrag(handle, 3, 9); + TestHelpers.resizable.drag(handle, 3, 9); equal( target.width(), 103, "compare width"); equal( target.height(), 100, "compare height"); - TestHelpers.resizableDrag(handle, 15, 11); + TestHelpers.resizable.drag(handle, 15, 11); equal( target.width(), 118, "compare width"); equal( target.height(), 120, "compare height"); }); @@ -122,11 +122,11 @@ test("grid (wrapped)", function() { var handle = '.ui-resizable-se', target = $('#resizable2').resizable({ handles: 'all', grid: [0, 20] }); - TestHelpers.resizableDrag(handle, 3, 9); + TestHelpers.resizable.drag(handle, 3, 9); equal( target.width(), 103, "compare width"); equal( target.height(), 100, "compare height"); - TestHelpers.resizableDrag(handle, 15, 11); + TestHelpers.resizable.drag(handle, 15, 11); equal( target.width(), 118, "compare width"); equal( target.height(), 120, "compare height"); }); @@ -136,11 +136,11 @@ test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1 var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }); - TestHelpers.resizableDrag(handle, -50, -50); + TestHelpers.resizable.drag(handle, -50, -50); equal( target.width(), 60, "compare minWidth" ); equal( target.height(), 60, "compare minHeight" ); - TestHelpers.resizableDrag(handle, 70, 70); + TestHelpers.resizable.drag(handle, 70, 70); equal( target.width(), 100, "compare maxWidth" ); equal( target.height(), 100, "compare maxHeight" ); }); @@ -150,11 +150,11 @@ test("ui-resizable-sw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1 var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }); - TestHelpers.resizableDrag(handle, 50, -50); + TestHelpers.resizable.drag(handle, 50, -50); equal( target.width(), 60, "compare minWidth" ); equal( target.height(), 60, "compare minHeight" ); - TestHelpers.resizableDrag(handle, -70, 70); + TestHelpers.resizable.drag(handle, -70, 70); equal( target.width(), 100, "compare maxWidth" ); equal( target.height(), 100, "compare maxHeight" ); }); @@ -164,11 +164,11 @@ test("ui-resizable-ne { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1 var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }); - TestHelpers.resizableDrag(handle, -50, 50); + TestHelpers.resizable.drag(handle, -50, 50); equal( target.width(), 60, "compare minWidth" ); equal( target.height(), 60, "compare minHeight" ); - TestHelpers.resizableDrag(handle, 70, -70); + TestHelpers.resizable.drag(handle, 70, -70); equal( target.width(), 100, "compare maxWidth" ); equal( target.height(), 100, "compare maxHeight" ); }); @@ -178,11 +178,11 @@ test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1 var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }); - TestHelpers.resizableDrag(handle, 70, 70); + TestHelpers.resizable.drag(handle, 70, 70); equal( target.width(), 60, "compare minWidth" ); equal( target.height(), 60, "compare minHeight" ); - TestHelpers.resizableDrag(handle, -70, -70); + TestHelpers.resizable.drag(handle, -70, -70); equal( target.width(), 100, "compare maxWidth" ); equal( target.height(), 100, "compare maxHeight" ); }); diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 9086a68f2..7a346dab5 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -14,8 +14,6 @@ * jquery.ui.mouse.js * jquery.ui.draggable.js */ - - (function( $, undefined ) { /*jshint onevar: false, curly: false, eqeqeq: false, laxbreak: true */ diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index c282f2950..13f6c71d0 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -15,6 +15,16 @@ */ (function( $, undefined ) { +/*jshint onevar: false, curly: false, eqeqeq: false, funcscope: true, loopfunc: true */ + +function num(v) { + return parseInt(v, 10) || 0; +} + +function isNumber(value) { + return !isNaN(parseInt(value, 10)); +} + $.widget("ui.resizable", $.ui.mouse, { version: "@VERSION", widgetEventPrefix: "resize", @@ -106,7 +116,7 @@ $.widget("ui.resizable", $.ui.mouse, { //TODO : What's going on here? if ('se' == handle) { axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); - }; + } //Insert into internal handles object and append to element this.handles[handle] = '.ui-resizable-'+handle; @@ -275,8 +285,8 @@ $.widget("ui.resizable", $.ui.mouse, { _mouseDrag: function(event) { //Increase performance, avoid regex - var el = this.helper, o = this.options, props = {}, - that = this, smp = this.originalMousePosition, a = this.axis; + var el = this.helper, + smp = this.originalMousePosition, a = this.axis; var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; var trigger = this._change[a]; @@ -372,7 +382,6 @@ $.widget("ui.resizable", $.ui.mouse, { }, _updateCache: function(data) { - var o = this.options; this.offset = this.helper.offset(); if (isNumber(data.left)) this.position.left = data.left; if (isNumber(data.top)) this.position.top = data.top; @@ -380,9 +389,9 @@ $.widget("ui.resizable", $.ui.mouse, { if (isNumber(data.width)) this.size.width = data.width; }, - _updateRatio: function(data, event) { + _updateRatio: function( data ) { - var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + var cpos = this.position, csize = this.size, a = this.axis; if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); @@ -399,11 +408,11 @@ $.widget("ui.resizable", $.ui.mouse, { return data; }, - _respectSize: function(data, event) { + _respectSize: function( data ) { - var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, - ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), - isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + var o = this._vBoundaries, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); if (isminw) data.width = o.minWidth; if (isminh) data.height = o.minHeight; @@ -428,7 +437,6 @@ $.widget("ui.resizable", $.ui.mouse, { _proportionallyResize: function() { - var o = this.options; if (!this._proportionallyResizeElements.length) return; var element = this.helper || this.element; @@ -451,7 +459,7 @@ $.widget("ui.resizable", $.ui.mouse, { width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 }); - }; + } }, @@ -484,15 +492,15 @@ $.widget("ui.resizable", $.ui.mouse, { }, _change: { - e: function(event, dx, dy) { + e: function(event, dx) { return { width: this.originalSize.width + dx }; }, - w: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; + w: function(event, dx) { + var cs = this.originalSize, sp = this.originalPosition; return { left: sp.left + dx, width: cs.width - dx }; }, n: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; + var cs = this.originalSize, sp = this.originalPosition; return { top: sp.top + dy, height: cs.height - dy }; }, s: function(event, dx, dy) { @@ -539,7 +547,7 @@ $.widget("ui.resizable", $.ui.mouse, { $.ui.plugin.add("resizable", "alsoResize", { - start: function (event, ui) { + start: function () { var that = $(this).data("resizable"), o = that.options; var _store = function (exp) { @@ -590,14 +598,14 @@ $.ui.plugin.add("resizable", "alsoResize", { } }, - stop: function (event, ui) { + stop: function () { $(this).removeData("resizable-alsoresize"); } }); $.ui.plugin.add("resizable", "animate", { - stop: function(event, ui) { + stop: function( event ) { var that = $(this).data("resizable"), o = that.options; var pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), @@ -636,7 +644,7 @@ $.ui.plugin.add("resizable", "animate", { $.ui.plugin.add("resizable", "containment", { - start: function(event, ui) { + start: function() { var that = $(this).data("resizable"), o = that.options, el = that.element; var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; if (!ce) return; @@ -671,10 +679,10 @@ $.ui.plugin.add("resizable", "containment", { } }, - resize: function(event, ui) { + resize: function( event ) { var that = $(this).data("resizable"), o = that.options, - ps = that.containerSize, co = that.containerOffset, cs = that.size, cp = that.position, - pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement; + co = that.containerOffset, cp = that.position, + pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement; if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; @@ -712,8 +720,8 @@ $.ui.plugin.add("resizable", "containment", { } }, - stop: function(event, ui){ - var that = $(this).data("resizable"), o = that.options, cp = that.position, + stop: function(){ + var that = $(this).data("resizable"), o = that.options, co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement; var helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height; @@ -729,13 +737,13 @@ $.ui.plugin.add("resizable", "containment", { $.ui.plugin.add("resizable", "ghost", { - start: function(event, ui) { + start: function() { var that = $(this).data("resizable"), o = that.options, cs = that.size; that.ghost = that.originalElement.clone(); that.ghost - .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .css({ opacity: 0.25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) .addClass('ui-resizable-ghost') .addClass(typeof o.ghost == 'string' ? o.ghost : ''); @@ -743,13 +751,13 @@ $.ui.plugin.add("resizable", "ghost", { }, - resize: function(event, ui){ - var that = $(this).data("resizable"), o = that.options; + resize: function(){ + var that = $(this).data("resizable"); if (that.ghost) that.ghost.css({ position: 'relative', height: that.size.height, width: that.size.width }); }, - stop: function(event, ui){ - var that = $(this).data("resizable"), o = that.options; + stop: function() { + var that = $(this).data("resizable"); if (that.ghost && that.helper) that.helper.get(0).removeChild(that.ghost.get(0)); } @@ -757,8 +765,8 @@ $.ui.plugin.add("resizable", "ghost", { $.ui.plugin.add("resizable", "grid", { - resize: function(event, ui) { - var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, ratio = o._aspectRatio || event.shiftKey; + resize: function() { + var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis; o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); @@ -786,12 +794,4 @@ $.ui.plugin.add("resizable", "grid", { }); -var num = function(v) { - return parseInt(v, 10) || 0; -}; - -var isNumber = function(value) { - return !isNaN(parseInt(value, 10)); -}; - })(jQuery); -- cgit v1.2.3 From 0bff32a2b1c2273e46dc0f70bc1058ad304ebcc5 Mon Sep 17 00:00:00 2001 From: Mathias Stenbom Date: Fri, 2 Nov 2012 09:59:46 +0100 Subject: Resizable: Made handles work with complex markup. Fixes #8756 - Resizable: Complex markup for handles. --- tests/unit/resizable/resizable_core.js | 20 ++++++++++++++++++++ ui/jquery.ui.resizable.js | 9 +++++---- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'ui/jquery.ui.resizable.js') diff --git a/tests/unit/resizable/resizable_core.js b/tests/unit/resizable/resizable_core.js index 01f15bd4b..a1ac22272 100644 --- a/tests/unit/resizable/resizable_core.js +++ b/tests/unit/resizable/resizable_core.js @@ -129,4 +129,24 @@ test("nw", function() { equal( target.height(), 100, "compare height" ); }); +test("handle with complex markup (#8756)", function() { + expect(2); + + $('#resizable1') + .append( + $('
') + .addClass("ui-resizable-handle") + .addClass("ui-resizable-w") + .append($('
')) + ); + + var handle = '.ui-resizable-w div', target = $('#resizable1').resizable({ handles: 'all' }); + + TestHelpers.resizable.drag(handle, -50); + equal( target.width(), 150, "compare width" ); + + TestHelpers.resizable.drag(handle, 50); + equal( target.width(), 100, "compare width" ); +}); + })(jQuery); diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index 13f6c71d0..c2ad28716 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -231,14 +231,15 @@ $.widget("ui.resizable", $.ui.mouse, { }, _mouseCapture: function(event) { - var handle = false; + var capture = false; for (var i in this.handles) { - if ($(this.handles[i])[0] == event.target) { - handle = true; + var handle = $(this.handles[i])[0]; + if (handle == event.target || $.contains(handle, event.target)) { + capture = true; } } - return !this.options.disabled && handle; + return !this.options.disabled && capture; }, _mouseStart: function(event) { -- cgit v1.2.3 From 6e0a0553ce85997e4f37597800b440b1e4371b5b Mon Sep 17 00:00:00 2001 From: Ethan Romba Date: Tue, 10 Jul 2012 10:21:56 -0700 Subject: Resizable: Grid now respects min/max dimensions. Fixed #8435 - grid does not respect min/max dimensions --- tests/unit/resizable/resizable_options.js | 14 ++++++++++ ui/jquery.ui.resizable.js | 44 ++++++++++++++++++++----------- 2 files changed, 43 insertions(+), 15 deletions(-) (limited to 'ui/jquery.ui.resizable.js') diff --git a/tests/unit/resizable/resizable_options.js b/tests/unit/resizable/resizable_options.js index 730a3389a..4b47762ab 100644 --- a/tests/unit/resizable/resizable_options.js +++ b/tests/unit/resizable/resizable_options.js @@ -117,6 +117,20 @@ test("grid", function() { equal( target.height(), 120, "compare height"); }); +test("grid (min/max dimensions)", function() { + expect(4); + + var handle = ".ui-resizable-se", target = $("#resizable1").resizable({ handles: "all", grid: 20, minWidth: 65, minHeight: 65, maxWidth: 135, maxHeight: 135 }); + + TestHelpers.resizable.drag(handle, 50, 50); + equal( target.width(), 120, "grid should respect maxWidth"); + equal( target.height(), 120, "grid should respect maxHeight"); + + TestHelpers.resizable.drag(handle, -100, -100); + equal( target.width(), 80, "grid should respect minWidth"); + equal( target.height(), 80, "grid should respect minHeight"); +}); + test("grid (wrapped)", function() { expect(4); diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index c2ad28716..c701c06be 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -769,25 +769,39 @@ $.ui.plugin.add("resizable", "grid", { resize: function() { var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis; o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; - var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + var gridX = (o.grid[0]||1), gridY = (o.grid[1]||1), + ox = Math.round((cs.width - os.width) / gridX) * gridX, oy = Math.round((cs.height - os.height) / gridY) * gridY, + newWidth = os.width + ox, newHeight = os.height + oy, + isMaxWidth = o.maxWidth && (o.maxWidth < newWidth), isMaxHeight = o.maxHeight && (o.maxHeight < newHeight), + isMinWidth = o.minWidth && (o.minWidth > newWidth), isMinHeight = o.minHeight && (o.minHeight > newHeight); + + if (isMinWidth) { + newWidth = newWidth + gridX; + } + if (isMinHeight) { + newHeight = newHeight + gridY; + } + if (isMaxWidth) { + newWidth = newWidth - gridX; + } + if (isMaxHeight) { + newHeight = newHeight - gridY; + } if (/^(se|s|e)$/.test(a)) { - that.size.width = os.width + ox; - that.size.height = os.height + oy; - } - else if (/^(ne)$/.test(a)) { - that.size.width = os.width + ox; - that.size.height = os.height + oy; + that.size.width = newWidth; + that.size.height = newHeight; + } else if (/^(ne)$/.test(a)) { + that.size.width = newWidth; + that.size.height = newHeight; that.position.top = op.top - oy; - } - else if (/^(sw)$/.test(a)) { - that.size.width = os.width + ox; - that.size.height = os.height + oy; + } else if (/^(sw)$/.test(a)) { + that.size.width = newWidth; + that.size.height = newHeight; that.position.left = op.left - ox; - } - else { - that.size.width = os.width + ox; - that.size.height = os.height + oy; + } else { + that.size.width = newWidth; + that.size.height = newHeight; that.position.top = op.top - oy; that.position.left = op.left - ox; } -- cgit v1.2.3 From f5870712c1f73c474a6980bb16d12768f4150984 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 9 Nov 2012 13:28:13 -0500 Subject: Updated all widgets to use proper data keys when getting plugin instances. --- tests/unit/autocomplete/autocomplete_core.js | 4 ++-- tests/unit/dialog/dialog_events.js | 4 ++-- tests/unit/draggable/draggable_events.js | 2 +- tests/unit/tabs/tabs_core.js | 6 ++--- tests/unit/tabs/tabs_options.js | 4 ++-- ui/jquery.ui.autocomplete.js | 2 +- ui/jquery.ui.button.js | 2 +- ui/jquery.ui.dialog.js | 8 +++---- ui/jquery.ui.draggable.js | 34 ++++++++++++++-------------- ui/jquery.ui.droppable.js | 12 +++++----- ui/jquery.ui.resizable.js | 26 ++++++++++----------- ui/jquery.ui.sortable.js | 4 ++-- 12 files changed, 54 insertions(+), 54 deletions(-) (limited to 'ui/jquery.ui.resizable.js') diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js index f2062cacd..845a3b19d 100644 --- a/tests/unit/autocomplete/autocomplete_core.js +++ b/tests/unit/autocomplete/autocomplete_core.js @@ -99,7 +99,7 @@ test( "allow form submit on enter when menu is not active", function() { delay: 0, minLength: 0 }); - element.data( "autocomplete" )._move = function() { + element.data( "ui-autocomplete" )._move = function() { didMove = true; }; element.simulate( "keydown", { keyCode: ( isKeyUp ? $.ui.keyCode.UP : $.ui.keyCode.DOWN ) } ); @@ -114,7 +114,7 @@ test( "allow form submit on enter when menu is not active", function() { delay: 0, minLength: 0 }); - element.data( "autocomplete" )._move = function() { + element.data( "ui-autocomplete" )._move = function() { ok( true, "repsond to arrow" ); }; element.autocomplete( "search" ); diff --git a/tests/unit/dialog/dialog_events.js b/tests/unit/dialog/dialog_events.js index c5090d8f6..ee7a8bcb3 100644 --- a/tests/unit/dialog/dialog_events.js +++ b/tests/unit/dialog/dialog_events.js @@ -11,7 +11,7 @@ test("open", function() { var el = $("
"); el.dialog({ open: function(ev, ui) { - ok(el.data("dialog")._isOpen, "interal _isOpen flag is set"); + ok(el.data("ui-dialog")._isOpen, "interal _isOpen flag is set"); ok(true, 'autoOpen: true fires open callback'); equal(this, el[0], "context of callback"); equal(ev.type, 'dialogopen', 'event type in callback'); @@ -30,7 +30,7 @@ test("open", function() { deepEqual(ui, {}, 'ui hash in callback'); } }).bind('dialogopen', function(ev, ui) { - ok(el.data("dialog")._isOpen, "interal _isOpen flag is set"); + ok(el.data("ui-dialog")._isOpen, "interal _isOpen flag is set"); ok(true, 'dialog("open") fires open event'); equal(this, el[0], 'context of event'); deepEqual(ui, {}, 'ui hash in event'); diff --git a/tests/unit/draggable/draggable_events.js b/tests/unit/draggable/draggable_events.js index 6b1136cb0..5eab97713 100644 --- a/tests/unit/draggable/draggable_events.js +++ b/tests/unit/draggable/draggable_events.js @@ -79,7 +79,7 @@ test("stopping the stop callback", function() { TestHelpers.draggable.drag(el, 10, 10); - ok($("#draggable2").data('draggable').helper, "the clone should not be deleted if the stop callback is stopped"); + ok($("#draggable2").data('ui-draggable').helper, "the clone should not be deleted if the stop callback is stopped"); }); diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js index 6307c4488..20364a37d 100644 --- a/tests/unit/tabs/tabs_core.js +++ b/tests/unit/tabs/tabs_core.js @@ -33,7 +33,7 @@ test( "nested list", function() { expect( 1 ); var element = $( "#tabs6" ).tabs(); - equal( element.data( "tabs" ).anchors.length, 2, "should contain 2 tab" ); + equal( element.data( "ui-tabs" ).anchors.length, 2, "should contain 2 tab" ); }); test( "disconnected from DOM", function() { @@ -155,7 +155,7 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER", panels = element.find( ".ui-tabs-panel" ), keyCode = $.ui.keyCode; - element.data( "tabs" ).delay = 50; + element.data( "ui-tabs" ).delay = 50; equal( tabs.filter( ".ui-state-focus" ).length, 0, "no tabs focused on init" ); tabs.eq( 0 ).simulate( "focus" ); @@ -306,7 +306,7 @@ asyncTest( "keyboard support - CTRL navigation", function() { panels = element.find( ".ui-tabs-panel" ), keyCode = $.ui.keyCode; - element.data( "tabs" ).delay = 50; + element.data( "ui-tabs" ).delay = 50; equal( tabs.filter( ".ui-state-focus" ).length, 0, "no tabs focused on init" ); tabs.eq( 0 ).simulate( "focus" ); diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js index c320c9d46..f6e89e84f 100644 --- a/tests/unit/tabs/tabs_options.js +++ b/tests/unit/tabs/tabs_options.js @@ -290,7 +290,7 @@ test( "hide and show: false", function() { show: false, hide: false }), - widget = element.data( "tabs" ), + widget = element.data( "ui-tabs" ), panels = element.find( ".ui-tabs-panel" ); widget._show = function() { ok( false, "_show() called" ); @@ -311,7 +311,7 @@ asyncTest( "hide and show - animation", function() { show: "drop", hide: 2000 }), - widget = element.data( "tabs" ), + widget = element.data( "ui-tabs" ), panels = element.find( ".ui-tabs-panel" ); widget._show = function( element, options, callback ) { strictEqual( element[ 0 ], panels[ 1 ], "correct element in _show()" ); diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 1da5a6b25..f5ab57bd4 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -190,7 +190,7 @@ $.widget( "ui.autocomplete", { }) .zIndex( this.element.zIndex() + 1 ) .hide() - .data( "menu" ); + .data( "ui-menu" ); this._on( this.menu.element, { mousedown: function( event ) { diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index f253464df..6d7b94a38 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -358,7 +358,7 @@ $.widget( "ui.button", { $.widget( "ui.buttonset", { version: "@VERSION", options: { - items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)" + items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)" }, _create: function() { diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 203618fc2..07c5c7cb6 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -516,7 +516,7 @@ $.widget("ui.dialog", { if ( resize ) { this._size(); } - if ( this.uiDialog.is( ":data(resizable)" ) ) { + if ( this.uiDialog.is( ":data(ui-resizable)" ) ) { this.uiDialog.resizable( "option", resizableOptions ); } }, @@ -546,7 +546,7 @@ $.widget("ui.dialog", { } break; case "draggable": - isDraggable = uiDialog.is( ":data(draggable)" ); + isDraggable = uiDialog.is( ":data(ui-draggable)" ); if ( isDraggable && !value ) { uiDialog.draggable( "destroy" ); } @@ -560,7 +560,7 @@ $.widget("ui.dialog", { break; case "resizable": // currently resizable, becoming non-resizable - isResizable = uiDialog.is( ":data(resizable)" ); + isResizable = uiDialog.is( ":data(ui-resizable)" ); if ( isResizable && !value ) { uiDialog.resizable( "destroy" ); } @@ -621,7 +621,7 @@ $.widget("ui.dialog", { this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); } - if (this.uiDialog.is( ":data(resizable)" ) ) { + if (this.uiDialog.is( ":data(ui-resizable)" ) ) { this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); } } diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 7a6d8e2e6..1f3c8d52c 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -506,11 +506,11 @@ $.widget("ui.draggable", $.ui.mouse, { $.ui.plugin.add("draggable", "connectToSortable", { start: function(event, ui) { - var inst = $(this).data("draggable"), o = inst.options, + var inst = $(this).data("ui-draggable"), o = inst.options, uiSortable = $.extend({}, ui, { item: inst.element }); inst.sortables = []; $(o.connectToSortable).each(function() { - var sortable = $.data(this, 'sortable'); + var sortable = $.data(this, 'ui-sortable'); if (sortable && !sortable.options.disabled) { inst.sortables.push({ instance: sortable, @@ -525,7 +525,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { stop: function(event, ui) { //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper - var inst = $(this).data("draggable"), + var inst = $(this).data("ui-draggable"), uiSortable = $.extend({}, ui, { item: inst.element }); $.each(inst.sortables, function() { @@ -558,7 +558,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { }, drag: function(event, ui) { - var inst = $(this).data("draggable"), that = this; + var inst = $(this).data("ui-draggable"), that = this; $.each(inst.sortables, function() { @@ -592,7 +592,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { //Now we fake the start of dragging for the sortable instance, //by cloning the list group item, appending it to the sortable and using it as inst.currentItem //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) - this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("ui-sortable-item", true); this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it this.instance.options.helper = function() { return ui.helper[0]; }; @@ -652,36 +652,36 @@ $.ui.plugin.add("draggable", "connectToSortable", { $.ui.plugin.add("draggable", "cursor", { start: function() { - var t = $('body'), o = $(this).data('draggable').options; + var t = $('body'), o = $(this).data('ui-draggable').options; if (t.css("cursor")) o._cursor = t.css("cursor"); t.css("cursor", o.cursor); }, stop: function() { - var o = $(this).data('draggable').options; + var o = $(this).data('ui-draggable').options; if (o._cursor) $('body').css("cursor", o._cursor); } }); $.ui.plugin.add("draggable", "opacity", { start: function(event, ui) { - var t = $(ui.helper), o = $(this).data('draggable').options; + var t = $(ui.helper), o = $(this).data('ui-draggable').options; if(t.css("opacity")) o._opacity = t.css("opacity"); t.css('opacity', o.opacity); }, stop: function(event, ui) { - var o = $(this).data('draggable').options; + var o = $(this).data('ui-draggable').options; if(o._opacity) $(ui.helper).css('opacity', o._opacity); } }); $.ui.plugin.add("draggable", "scroll", { start: function() { - var i = $(this).data("draggable"); + var i = $(this).data("ui-draggable"); if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); }, drag: function( event ) { - var i = $(this).data("draggable"), o = i.options, scrolled = false; + var i = $(this).data("ui-draggable"), o = i.options, scrolled = false; if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { @@ -726,10 +726,10 @@ $.ui.plugin.add("draggable", "scroll", { $.ui.plugin.add("draggable", "snap", { start: function() { - var i = $(this).data("draggable"), o = i.options; + var i = $(this).data("ui-draggable"), o = i.options; i.snapElements = []; - $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + $(o.snap.constructor != String ? ( o.snap.items || ':data(ui-draggable)' ) : o.snap).each(function() { var $t = $(this); var $o = $t.offset(); if(this != i.element[0]) i.snapElements.push({ item: this, @@ -741,7 +741,7 @@ $.ui.plugin.add("draggable", "snap", { }, drag: function(event, ui) { - var inst = $(this).data("draggable"), o = inst.options; + var inst = $(this).data("ui-draggable"), o = inst.options; var d = o.snapTolerance; var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, @@ -795,7 +795,7 @@ $.ui.plugin.add("draggable", "snap", { $.ui.plugin.add("draggable", "stack", { start: function() { - var o = $(this).data("draggable").options; + var o = $(this).data("ui-draggable").options; var group = $.makeArray($(o.stack)).sort(function(a,b) { return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); @@ -814,12 +814,12 @@ $.ui.plugin.add("draggable", "stack", { $.ui.plugin.add("draggable", "zIndex", { start: function(event, ui) { - var t = $(ui.helper), o = $(this).data("draggable").options; + var t = $(ui.helper), o = $(this).data("ui-draggable").options; if(t.css("zIndex")) o._zIndex = t.css("zIndex"); t.css('zIndex', o.zIndex); }, stop: function(event, ui) { - var o = $(this).data("draggable").options; + var o = $(this).data("ui-draggable").options; if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); } }); diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 7a346dab5..f27d56b85 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -110,8 +110,8 @@ $.widget("ui.droppable", { if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element var childrenIntersection = false; - this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() { - var inst = $.data(this, 'droppable'); + this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'ui-droppable'); if( inst.options.greedy && !inst.options.disabled @@ -193,7 +193,7 @@ $.ui.ddmanager = { var m = $.ui.ddmanager.droppables[t.options.scope] || []; var type = event ? event.type : null; // workaround for #2317 - var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); + var list = (t.currentItem || t.element).find(":data(ui-droppable)").andSelf(); droppablesLoop: for (var i = 0; i < m.length; i++) { @@ -257,12 +257,12 @@ $.ui.ddmanager = { if (this.options.greedy) { // find droppable parents with same scope var scope = this.options.scope; - var parent = this.element.parents(':data(droppable)').filter(function () { - return $.data(this, 'droppable').options.scope === scope; + var parent = this.element.parents(':data(ui-droppable)').filter(function () { + return $.data(this, 'ui-droppable').options.scope === scope; }); if (parent.length) { - parentInstance = $.data(parent[0], 'droppable'); + parentInstance = $.data(parent[0], 'ui-droppable'); parentInstance.greedyChild = (c == 'isover' ? 1 : 0); } } diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index c701c06be..fba9216e1 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -75,7 +75,7 @@ $.widget("ui.resizable", $.ui.mouse, { //Overwrite the original this.element this.element = this.element.parent().data( - "resizable", this.element.data('resizable') + "ui-resizable", this.element.data('ui-resizable') ); this.elementIsWrapper = true; @@ -549,12 +549,12 @@ $.widget("ui.resizable", $.ui.mouse, { $.ui.plugin.add("resizable", "alsoResize", { start: function () { - var that = $(this).data("resizable"), o = that.options; + var that = $(this).data("ui-resizable"), o = that.options; var _store = function (exp) { $(exp).each(function() { var el = $(this); - el.data("resizable-alsoresize", { + el.data("ui-resizable-alsoresize", { width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10) }); @@ -570,7 +570,7 @@ $.ui.plugin.add("resizable", "alsoResize", { }, resize: function (event, ui) { - var that = $(this).data("resizable"), o = that.options, os = that.originalSize, op = that.originalPosition; + var that = $(this).data("ui-resizable"), o = that.options, os = that.originalSize, op = that.originalPosition; var delta = { height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0, @@ -579,7 +579,7 @@ $.ui.plugin.add("resizable", "alsoResize", { _alsoResize = function (exp, c) { $(exp).each(function() { - var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {}, css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; $.each(css, function (i, prop) { @@ -607,7 +607,7 @@ $.ui.plugin.add("resizable", "alsoResize", { $.ui.plugin.add("resizable", "animate", { stop: function( event ) { - var that = $(this).data("resizable"), o = that.options; + var that = $(this).data("ui-resizable"), o = that.options; var pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height, @@ -646,7 +646,7 @@ $.ui.plugin.add("resizable", "animate", { $.ui.plugin.add("resizable", "containment", { start: function() { - var that = $(this).data("resizable"), o = that.options, el = that.element; + var that = $(this).data("ui-resizable"), o = that.options, el = that.element; var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; if (!ce) return; @@ -681,7 +681,7 @@ $.ui.plugin.add("resizable", "containment", { }, resize: function( event ) { - var that = $(this).data("resizable"), o = that.options, + var that = $(this).data("ui-resizable"), o = that.options, co = that.containerOffset, cp = that.position, pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement; @@ -722,7 +722,7 @@ $.ui.plugin.add("resizable", "containment", { }, stop: function(){ - var that = $(this).data("resizable"), o = that.options, + var that = $(this).data("ui-resizable"), o = that.options, co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement; var helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height; @@ -740,7 +740,7 @@ $.ui.plugin.add("resizable", "ghost", { start: function() { - var that = $(this).data("resizable"), o = that.options, cs = that.size; + var that = $(this).data("ui-resizable"), o = that.options, cs = that.size; that.ghost = that.originalElement.clone(); that.ghost @@ -753,12 +753,12 @@ $.ui.plugin.add("resizable", "ghost", { }, resize: function(){ - var that = $(this).data("resizable"); + var that = $(this).data("ui-resizable"); if (that.ghost) that.ghost.css({ position: 'relative', height: that.size.height, width: that.size.width }); }, stop: function() { - var that = $(this).data("resizable"); + var that = $(this).data("ui-resizable"); if (that.ghost && that.helper) that.helper.get(0).removeChild(that.ghost.get(0)); } @@ -767,7 +767,7 @@ $.ui.plugin.add("resizable", "ghost", { $.ui.plugin.add("resizable", "grid", { resize: function() { - var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis; + var that = $(this).data("ui-resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis; o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; var gridX = (o.grid[0]||1), gridY = (o.grid[1]||1), ox = Math.round((cs.width - os.width) / gridX) * gridX, oy = Math.round((cs.height - os.height) / gridY) * gridY, diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index a95c80c68..a98e46632 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -541,7 +541,7 @@ $.widget("ui.sortable", $.ui.mouse, { for (var i = connectWith.length - 1; i >= 0; i--){ var cur = $(connectWith[i]); for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], this.widgetName); + var inst = $.data(cur[j], this.widgetFullName); if(inst && inst != this && !inst.options.disabled) { queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); } @@ -587,7 +587,7 @@ $.widget("ui.sortable", $.ui.mouse, { for (var i = connectWith.length - 1; i >= 0; i--){ var cur = $(connectWith[i]); for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], this.widgetName); + var inst = $.data(cur[j], this.widgetFullName); if(inst && inst != this && !inst.options.disabled) { queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); this.containers.push(inst); -- cgit v1.2.3