summaryrefslogtreecommitdiff
path: root/xstatic/pkg/jquery_ui/data/ui/jquery.ui.core.js
diff options
context:
space:
mode:
Diffstat (limited to 'xstatic/pkg/jquery_ui/data/ui/jquery.ui.core.js')
-rw-r--r--xstatic/pkg/jquery_ui/data/ui/jquery.ui.core.js246
1 files changed, 134 insertions, 112 deletions
diff --git a/xstatic/pkg/jquery_ui/data/ui/jquery.ui.core.js b/xstatic/pkg/jquery_ui/data/ui/jquery.ui.core.js
index b36c1ac..4ef4b76 100644
--- a/xstatic/pkg/jquery_ui/data/ui/jquery.ui.core.js
+++ b/xstatic/pkg/jquery_ui/data/ui/jquery.ui.core.js
@@ -1,14 +1,18 @@
/*!
- * jQuery UI 1.8.24
+ * jQuery UI Core 1.9.2
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
* http://jquery.org/license
*
- * http://docs.jquery.com/UI
+ * http://api.jqueryui.com/category/ui-core/
*/
(function( $, undefined ) {
+var uuid = 0,
+ runiqueId = /^ui-id-\d+$/;
+
// prevent duplicate loading
// this is only a problem because we proxy existing functions
// and we don't want to double proxy them
@@ -18,26 +22,18 @@ if ( $.ui.version ) {
}
$.extend( $.ui, {
- version: "1.8.24",
+ version: "1.9.2",
keyCode: {
- ALT: 18,
BACKSPACE: 8,
- CAPS_LOCK: 20,
COMMA: 188,
- COMMAND: 91,
- COMMAND_LEFT: 91, // COMMAND
- COMMAND_RIGHT: 93,
- CONTROL: 17,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
- INSERT: 45,
LEFT: 37,
- MENU: 93, // COMMAND_RIGHT
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
@@ -48,18 +44,14 @@ $.extend( $.ui, {
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
- SHIFT: 16,
SPACE: 32,
TAB: 9,
- UP: 38,
- WINDOWS: 91 // COMMAND
+ UP: 38
}
});
// plugins
$.fn.extend({
- propAttr: $.fn.prop || $.fn.attr,
-
_focus: $.fn.focus,
focus: function( delay, fn ) {
return typeof delay === "number" ?
@@ -77,13 +69,13 @@ $.fn.extend({
scrollParent: function() {
var scrollParent;
- if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+ if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
scrollParent = this.parents().filter(function() {
- return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
}).eq(0);
} else {
scrollParent = this.parents().filter(function() {
- return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
+ return (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
}).eq(0);
}
@@ -119,92 +111,50 @@ $.fn.extend({
return 0;
},
- disableSelection: function() {
- return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
- ".ui-disableSelection", function( event ) {
- event.preventDefault();
- });
+ uniqueId: function() {
+ return this.each(function() {
+ if ( !this.id ) {
+ this.id = "ui-id-" + (++uuid);
+ }
+ });
},
- enableSelection: function() {
- return this.unbind( ".ui-disableSelection" );
+ removeUniqueId: function() {
+ return this.each(function() {
+ if ( runiqueId.test( this.id ) ) {
+ $( this ).removeAttr( "id" );
+ }
+ });
}
});
-// support: jQuery <1.8
-if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
- $.each( [ "Width", "Height" ], function( i, name ) {
- var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
- type = name.toLowerCase(),
- orig = {
- innerWidth: $.fn.innerWidth,
- innerHeight: $.fn.innerHeight,
- outerWidth: $.fn.outerWidth,
- outerHeight: $.fn.outerHeight
- };
-
- function reduce( elem, size, border, margin ) {
- $.each( side, function() {
- size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
- if ( border ) {
- size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
- }
- if ( margin ) {
- size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
- }
- });
- return size;
- }
-
- $.fn[ "inner" + name ] = function( size ) {
- if ( size === undefined ) {
- return orig[ "inner" + name ].call( this );
- }
-
- return this.each(function() {
- $( this ).css( type, reduce( this, size ) + "px" );
- });
- };
-
- $.fn[ "outer" + name] = function( size, margin ) {
- if ( typeof size !== "number" ) {
- return orig[ "outer" + name ].call( this, size );
- }
-
- return this.each(function() {
- $( this).css( type, reduce( this, size, true, margin ) + "px" );
- });
- };
- });
-}
-
// selectors
function focusable( element, isTabIndexNotNaN ) {
- var nodeName = element.nodeName.toLowerCase();
+ var map, mapName, img,
+ nodeName = element.nodeName.toLowerCase();
if ( "area" === nodeName ) {
- var map = element.parentNode,
- mapName = map.name,
- img;
+ map = element.parentNode;
+ mapName = map.name;
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
return false;
}
img = $( "img[usemap=#" + mapName + "]" )[0];
return !!img && visible( img );
}
- return ( /input|select|textarea|button|object/.test( nodeName )
- ? !element.disabled
- : "a" == nodeName
- ? element.href || isTabIndexNotNaN
- : isTabIndexNotNaN)
+ return ( /input|select|textarea|button|object/.test( nodeName ) ?
+ !element.disabled :
+ "a" === nodeName ?
+ element.href || isTabIndexNotNaN :
+ isTabIndexNotNaN) &&
// the element and all of its ancestors must be visible
- && visible( element );
+ visible( element );
}
function visible( element ) {
- return !$( element ).parents().andSelf().filter(function() {
- return $.curCSS( this, "visibility" ) === "hidden" ||
- $.expr.filters.hidden( this );
- }).length;
+ return $.expr.filters.visible( element ) &&
+ !$( element ).parents().andSelf().filter(function() {
+ return $.css( this, "visibility" ) === "hidden";
+ }).length;
}
$.extend( $.expr[ ":" ], {
@@ -236,7 +186,7 @@ $(function() {
div = body.appendChild( div = document.createElement( "div" ) );
// access offsetHeight before setting the style to prevent a layout bug
- // in IE 9 which causes the elemnt to continue to take up space even
+ // in IE 9 which causes the element to continue to take up space even
// after it is removed from the DOM (#8026)
div.offsetHeight;
@@ -255,9 +205,64 @@ $(function() {
body.removeChild( div ).style.display = "none";
});
-// jQuery <1.4.3 uses curCSS, in 1.4.3 - 1.7.2 curCSS = css, 1.8+ only has css
-if ( !$.curCSS ) {
- $.curCSS = $.css;
+// support: jQuery <1.8
+if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
+ $.each( [ "Width", "Height" ], function( i, name ) {
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
+ type = name.toLowerCase(),
+ orig = {
+ innerWidth: $.fn.innerWidth,
+ innerHeight: $.fn.innerHeight,
+ outerWidth: $.fn.outerWidth,
+ outerHeight: $.fn.outerHeight
+ };
+
+ function reduce( elem, size, border, margin ) {
+ $.each( side, function() {
+ size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
+ if ( border ) {
+ size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( margin ) {
+ size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
+ }
+ });
+ return size;
+ }
+
+ $.fn[ "inner" + name ] = function( size ) {
+ if ( size === undefined ) {
+ return orig[ "inner" + name ].call( this );
+ }
+
+ return this.each(function() {
+ $( this ).css( type, reduce( this, size ) + "px" );
+ });
+ };
+
+ $.fn[ "outer" + name] = function( size, margin ) {
+ if ( typeof size !== "number" ) {
+ return orig[ "outer" + name ].call( this, size );
+ }
+
+ return this.each(function() {
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
+ });
+ };
+ });
+}
+
+// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
+if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
+ $.fn.removeData = (function( removeData ) {
+ return function( key ) {
+ if ( arguments.length ) {
+ return removeData.call( this, $.camelCase( key ) );
+ } else {
+ return removeData.call( this );
+ }
+ };
+ })( $.fn.removeData );
}
@@ -265,52 +270,69 @@ if ( !$.curCSS ) {
// deprecated
+
+(function() {
+ var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || [];
+ $.ui.ie = uaMatch.length ? true : false;
+ $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6;
+})();
+
+$.fn.extend({
+ disableSelection: function() {
+ return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
+ ".ui-disableSelection", function( event ) {
+ event.preventDefault();
+ });
+ },
+
+ enableSelection: function() {
+ return this.unbind( ".ui-disableSelection" );
+ }
+});
+
$.extend( $.ui, {
// $.ui.plugin is deprecated. Use the proxy pattern instead.
plugin: {
add: function( module, option, set ) {
- var proto = $.ui[ module ].prototype;
- for ( var i in set ) {
+ var i,
+ proto = $.ui[ module ].prototype;
+ for ( i in set ) {
proto.plugins[ i ] = proto.plugins[ i ] || [];
proto.plugins[ i ].push( [ option, set[ i ] ] );
}
},
call: function( instance, name, args ) {
- var set = instance.plugins[ name ];
- if ( !set || !instance.element[ 0 ].parentNode ) {
+ var i,
+ set = instance.plugins[ name ];
+ if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
return;
}
-
- for ( var i = 0; i < set.length; i++ ) {
+
+ for ( i = 0; i < set.length; i++ ) {
if ( instance.options[ set[ i ][ 0 ] ] ) {
set[ i ][ 1 ].apply( instance.element, args );
}
}
}
},
-
- // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
- contains: function( a, b ) {
- return document.compareDocumentPosition ?
- a.compareDocumentPosition( b ) & 16 :
- a !== b && a.contains( b );
- },
-
+
+ contains: $.contains,
+
// only used by resizable
hasScroll: function( el, a ) {
-
+
//If overflow is hidden, the element might have extra content, but the user wants to hide it
if ( $( el ).css( "overflow" ) === "hidden") {
return false;
}
-
+
var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
has = false;
-
+
if ( el[ scroll ] > 0 ) {
return true;
}
-
+
// TODO: determine which cases actually cause this to happen
// if the element doesn't have the scroll set, see if it's possible to
// set the scroll
@@ -319,7 +341,7 @@ $.extend( $.ui, {
el[ scroll ] = 0;
return has;
},
-
+
// these are odd functions, fix the API or move into individual plugins
isOverAxis: function( x, reference, size ) {
//Determines when x coordinate is over "b" element axis