Blame jquery/jquery.ui-1.8.18.core.js

Packit Service 50c9f2
/*!
Packit Service 50c9f2
 * jQuery UI 1.8.18
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
Packit Service 50c9f2
 * Dual licensed under the MIT or GPL Version 2 licenses.
Packit Service 50c9f2
 * http://jquery.org/license
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * http://docs.jquery.com/UI
Packit Service 50c9f2
 */
Packit Service 50c9f2
(function( $, undefined ) {
Packit Service 50c9f2
Packit Service 50c9f2
// prevent duplicate loading
Packit Service 50c9f2
// this is only a problem because we proxy existing functions
Packit Service 50c9f2
// and we don't want to double proxy them
Packit Service 50c9f2
$.ui = $.ui || {};
Packit Service 50c9f2
if ( $.ui.version ) {
Packit Service 50c9f2
	return;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
$.extend( $.ui, {
Packit Service 50c9f2
	version: "1.8.18",
Packit Service 50c9f2
Packit Service 50c9f2
	keyCode: {
Packit Service 50c9f2
		ALT: 18,
Packit Service 50c9f2
		BACKSPACE: 8,
Packit Service 50c9f2
		CAPS_LOCK: 20,
Packit Service 50c9f2
		COMMA: 188,
Packit Service 50c9f2
		COMMAND: 91,
Packit Service 50c9f2
		COMMAND_LEFT: 91, // COMMAND
Packit Service 50c9f2
		COMMAND_RIGHT: 93,
Packit Service 50c9f2
		CONTROL: 17,
Packit Service 50c9f2
		DELETE: 46,
Packit Service 50c9f2
		DOWN: 40,
Packit Service 50c9f2
		END: 35,
Packit Service 50c9f2
		ENTER: 13,
Packit Service 50c9f2
		ESCAPE: 27,
Packit Service 50c9f2
		HOME: 36,
Packit Service 50c9f2
		INSERT: 45,
Packit Service 50c9f2
		LEFT: 37,
Packit Service 50c9f2
		MENU: 93, // COMMAND_RIGHT
Packit Service 50c9f2
		NUMPAD_ADD: 107,
Packit Service 50c9f2
		NUMPAD_DECIMAL: 110,
Packit Service 50c9f2
		NUMPAD_DIVIDE: 111,
Packit Service 50c9f2
		NUMPAD_ENTER: 108,
Packit Service 50c9f2
		NUMPAD_MULTIPLY: 106,
Packit Service 50c9f2
		NUMPAD_SUBTRACT: 109,
Packit Service 50c9f2
		PAGE_DOWN: 34,
Packit Service 50c9f2
		PAGE_UP: 33,
Packit Service 50c9f2
		PERIOD: 190,
Packit Service 50c9f2
		RIGHT: 39,
Packit Service 50c9f2
		SHIFT: 16,
Packit Service 50c9f2
		SPACE: 32,
Packit Service 50c9f2
		TAB: 9,
Packit Service 50c9f2
		UP: 38,
Packit Service 50c9f2
		WINDOWS: 91 // COMMAND
Packit Service 50c9f2
	}
Packit Service 50c9f2
});
Packit Service 50c9f2
Packit Service 50c9f2
// plugins
Packit Service 50c9f2
$.fn.extend({
Packit Service 50c9f2
	propAttr: $.fn.prop || $.fn.attr,
Packit Service 50c9f2
Packit Service 50c9f2
	_focus: $.fn.focus,
Packit Service 50c9f2
	focus: function( delay, fn ) {
Packit Service 50c9f2
		return typeof delay === "number" ?
Packit Service 50c9f2
			this.each(function() {
Packit Service 50c9f2
				var elem = this;
Packit Service 50c9f2
				setTimeout(function() {
Packit Service 50c9f2
					$( elem ).focus();
Packit Service 50c9f2
					if ( fn ) {
Packit Service 50c9f2
						fn.call( elem );
Packit Service 50c9f2
					}
Packit Service 50c9f2
				}, delay );
Packit Service 50c9f2
			}) :
Packit Service 50c9f2
			this._focus.apply( this, arguments );
Packit Service 50c9f2
	},
Packit Service 50c9f2
Packit Service 50c9f2
	scrollParent: function() {
Packit Service 50c9f2
		var scrollParent;
Packit Service 50c9f2
		if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
Packit Service 50c9f2
			scrollParent = this.parents().filter(function() {
Packit Service 50c9f2
				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));
Packit Service 50c9f2
			}).eq(0);
Packit Service 50c9f2
		} else {
Packit Service 50c9f2
			scrollParent = this.parents().filter(function() {
Packit Service 50c9f2
				return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
Packit Service 50c9f2
			}).eq(0);
Packit Service 50c9f2
		}
Packit Service 50c9f2
Packit Service 50c9f2
		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
Packit Service 50c9f2
	},
Packit Service 50c9f2
Packit Service 50c9f2
	zIndex: function( zIndex ) {
Packit Service 50c9f2
		if ( zIndex !== undefined ) {
Packit Service 50c9f2
			return this.css( "zIndex", zIndex );
Packit Service 50c9f2
		}
Packit Service 50c9f2
Packit Service 50c9f2
		if ( this.length ) {
Packit Service 50c9f2
			var elem = $( this[ 0 ] ), position, value;
Packit Service 50c9f2
			while ( elem.length && elem[ 0 ] !== document ) {
Packit Service 50c9f2
				// Ignore z-index if position is set to a value where z-index is ignored by the browser
Packit Service 50c9f2
				// This makes behavior of this function consistent across browsers
Packit Service 50c9f2
				// WebKit always returns auto if the element is positioned
Packit Service 50c9f2
				position = elem.css( "position" );
Packit Service 50c9f2
				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
Packit Service 50c9f2
					// IE returns 0 when zIndex is not specified
Packit Service 50c9f2
					// other browsers return a string
Packit Service 50c9f2
					// we ignore the case of nested elements with an explicit value of 0
Packit Service 50c9f2
					// 
Packit Service 50c9f2
					value = parseInt( elem.css( "zIndex" ), 10 );
Packit Service 50c9f2
					if ( !isNaN( value ) && value !== 0 ) {
Packit Service 50c9f2
						return value;
Packit Service 50c9f2
					}
Packit Service 50c9f2
				}
Packit Service 50c9f2
				elem = elem.parent();
Packit Service 50c9f2
			}
Packit Service 50c9f2
		}
Packit Service 50c9f2
Packit Service 50c9f2
		return 0;
Packit Service 50c9f2
	},
Packit Service 50c9f2
Packit Service 50c9f2
	disableSelection: function() {
Packit Service 50c9f2
		return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
Packit Service 50c9f2
			".ui-disableSelection", function( event ) {
Packit Service 50c9f2
				event.preventDefault();
Packit Service 50c9f2
			});
Packit Service 50c9f2
	},
Packit Service 50c9f2
Packit Service 50c9f2
	enableSelection: function() {
Packit Service 50c9f2
		return this.unbind( ".ui-disableSelection" );
Packit Service 50c9f2
	}
Packit Service 50c9f2
});
Packit Service 50c9f2
Packit Service 50c9f2
$.each( [ "Width", "Height" ], function( i, name ) {
Packit Service 50c9f2
	var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
Packit Service 50c9f2
		type = name.toLowerCase(),
Packit Service 50c9f2
		orig = {
Packit Service 50c9f2
			innerWidth: $.fn.innerWidth,
Packit Service 50c9f2
			innerHeight: $.fn.innerHeight,
Packit Service 50c9f2
			outerWidth: $.fn.outerWidth,
Packit Service 50c9f2
			outerHeight: $.fn.outerHeight
Packit Service 50c9f2
		};
Packit Service 50c9f2
Packit Service 50c9f2
	function reduce( elem, size, border, margin ) {
Packit Service 50c9f2
		$.each( side, function() {
Packit Service 50c9f2
			size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
Packit Service 50c9f2
			if ( border ) {
Packit Service 50c9f2
				size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
Packit Service 50c9f2
			}
Packit Service 50c9f2
			if ( margin ) {
Packit Service 50c9f2
				size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
Packit Service 50c9f2
			}
Packit Service 50c9f2
		});
Packit Service 50c9f2
		return size;
Packit Service 50c9f2
	}
Packit Service 50c9f2
Packit Service 50c9f2
	$.fn[ "inner" + name ] = function( size ) {
Packit Service 50c9f2
		if ( size === undefined ) {
Packit Service 50c9f2
			return orig[ "inner" + name ].call( this );
Packit Service 50c9f2
		}
Packit Service 50c9f2
Packit Service 50c9f2
		return this.each(function() {
Packit Service 50c9f2
			$( this ).css( type, reduce( this, size ) + "px" );
Packit Service 50c9f2
		});
Packit Service 50c9f2
	};
Packit Service 50c9f2
Packit Service 50c9f2
	$.fn[ "outer" + name] = function( size, margin ) {
Packit Service 50c9f2
		if ( typeof size !== "number" ) {
Packit Service 50c9f2
			return orig[ "outer" + name ].call( this, size );
Packit Service 50c9f2
		}
Packit Service 50c9f2
Packit Service 50c9f2
		return this.each(function() {
Packit Service 50c9f2
			$( this).css( type, reduce( this, size, true, margin ) + "px" );
Packit Service 50c9f2
		});
Packit Service 50c9f2
	};
Packit Service 50c9f2
});
Packit Service 50c9f2
Packit Service 50c9f2
// selectors
Packit Service 50c9f2
function focusable( element, isTabIndexNotNaN ) {
Packit Service 50c9f2
	var nodeName = element.nodeName.toLowerCase();
Packit Service 50c9f2
	if ( "area" === nodeName ) {
Packit Service 50c9f2
		var map = element.parentNode,
Packit Service 50c9f2
			mapName = map.name,
Packit Service 50c9f2
			img;
Packit Service 50c9f2
		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
Packit Service 50c9f2
			return false;
Packit Service 50c9f2
		}
Packit Service 50c9f2
		img = $( "img[usemap=#" + mapName + "]" )[0];
Packit Service 50c9f2
		return !!img && visible( img );
Packit Service 50c9f2
	}
Packit Service 50c9f2
	return ( /input|select|textarea|button|object/.test( nodeName )
Packit Service 50c9f2
		? !element.disabled
Packit Service 50c9f2
		: "a" == nodeName
Packit Service 50c9f2
			? element.href || isTabIndexNotNaN
Packit Service 50c9f2
			: isTabIndexNotNaN)
Packit Service 50c9f2
		// the element and all of its ancestors must be visible
Packit Service 50c9f2
		&& visible( element );
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
function visible( element ) {
Packit Service 50c9f2
	return !$( element ).parents().andSelf().filter(function() {
Packit Service 50c9f2
		return $.curCSS( this, "visibility" ) === "hidden" ||
Packit Service 50c9f2
			$.expr.filters.hidden( this );
Packit Service 50c9f2
	}).length;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
$.extend( $.expr[ ":" ], {
Packit Service 50c9f2
	data: function( elem, i, match ) {
Packit Service 50c9f2
		return !!$.data( elem, match[ 3 ] );
Packit Service 50c9f2
	},
Packit Service 50c9f2
Packit Service 50c9f2
	focusable: function( element ) {
Packit Service 50c9f2
		return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
Packit Service 50c9f2
	},
Packit Service 50c9f2
Packit Service 50c9f2
	tabbable: function( element ) {
Packit Service 50c9f2
		var tabIndex = $.attr( element, "tabindex" ),
Packit Service 50c9f2
			isTabIndexNaN = isNaN( tabIndex );
Packit Service 50c9f2
		return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
Packit Service 50c9f2
	}
Packit Service 50c9f2
});
Packit Service 50c9f2
Packit Service 50c9f2
// support
Packit Service 50c9f2
$(function() {
Packit Service 50c9f2
	var body = document.body,
Packit Service 50c9f2
		div = body.appendChild( div = document.createElement( "div" ) );
Packit Service 50c9f2
Packit Service 50c9f2
	// access offsetHeight before setting the style to prevent a layout bug
Packit Service 50c9f2
	// in IE 9 which causes the element to continue to take up space even
Packit Service 50c9f2
	// after it is removed from the DOM (#8026)
Packit Service 50c9f2
	div.offsetHeight;
Packit Service 50c9f2
Packit Service 50c9f2
	$.extend( div.style, {
Packit Service 50c9f2
		minHeight: "100px",
Packit Service 50c9f2
		height: "auto",
Packit Service 50c9f2
		padding: 0,
Packit Service 50c9f2
		borderWidth: 0
Packit Service 50c9f2
	});
Packit Service 50c9f2
Packit Service 50c9f2
	$.support.minHeight = div.offsetHeight === 100;
Packit Service 50c9f2
	$.support.selectstart = "onselectstart" in div;
Packit Service 50c9f2
Packit Service 50c9f2
	// set display to none to avoid a layout bug in IE
Packit Service 50c9f2
	// http://dev.jquery.com/ticket/4014
Packit Service 50c9f2
	body.removeChild( div ).style.display = "none";
Packit Service 50c9f2
});
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
// deprecated
Packit Service 50c9f2
$.extend( $.ui, {
Packit Service 50c9f2
	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
Packit Service 50c9f2
	plugin: {
Packit Service 50c9f2
		add: function( module, option, set ) {
Packit Service 50c9f2
			var proto = $.ui[ module ].prototype;
Packit Service 50c9f2
			for ( var i in set ) {
Packit Service 50c9f2
				proto.plugins[ i ] = proto.plugins[ i ] || [];
Packit Service 50c9f2
				proto.plugins[ i ].push( [ option, set[ i ] ] );
Packit Service 50c9f2
			}
Packit Service 50c9f2
		},
Packit Service 50c9f2
		call: function( instance, name, args ) {
Packit Service 50c9f2
			var set = instance.plugins[ name ];
Packit Service 50c9f2
			if ( !set || !instance.element[ 0 ].parentNode ) {
Packit Service 50c9f2
				return;
Packit Service 50c9f2
			}
Packit Service 50c9f2
	
Packit Service 50c9f2
			for ( var i = 0; i < set.length; i++ ) {
Packit Service 50c9f2
				if ( instance.options[ set[ i ][ 0 ] ] ) {
Packit Service 50c9f2
					set[ i ][ 1 ].apply( instance.element, args );
Packit Service 50c9f2
				}
Packit Service 50c9f2
			}
Packit Service 50c9f2
		}
Packit Service 50c9f2
	},
Packit Service 50c9f2
	
Packit Service 50c9f2
	// will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
Packit Service 50c9f2
	contains: function( a, b ) {
Packit Service 50c9f2
		return document.compareDocumentPosition ?
Packit Service 50c9f2
			a.compareDocumentPosition( b ) & 16 :
Packit Service 50c9f2
			a !== b && a.contains( b );
Packit Service 50c9f2
	},
Packit Service 50c9f2
	
Packit Service 50c9f2
	// only used by resizable
Packit Service 50c9f2
	hasScroll: function( el, a ) {
Packit Service 50c9f2
	
Packit Service 50c9f2
		//If overflow is hidden, the element might have extra content, but the user wants to hide it
Packit Service 50c9f2
		if ( $( el ).css( "overflow" ) === "hidden") {
Packit Service 50c9f2
			return false;
Packit Service 50c9f2
		}
Packit Service 50c9f2
	
Packit Service 50c9f2
		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
Packit Service 50c9f2
			has = false;
Packit Service 50c9f2
	
Packit Service 50c9f2
		if ( el[ scroll ] > 0 ) {
Packit Service 50c9f2
			return true;
Packit Service 50c9f2
		}
Packit Service 50c9f2
	
Packit Service 50c9f2
		// TODO: determine which cases actually cause this to happen
Packit Service 50c9f2
		// if the element doesn't have the scroll set, see if it's possible to
Packit Service 50c9f2
		// set the scroll
Packit Service 50c9f2
		el[ scroll ] = 1;
Packit Service 50c9f2
		has = ( el[ scroll ] > 0 );
Packit Service 50c9f2
		el[ scroll ] = 0;
Packit Service 50c9f2
		return has;
Packit Service 50c9f2
	},
Packit Service 50c9f2
	
Packit Service 50c9f2
	// these are odd functions, fix the API or move into individual plugins
Packit Service 50c9f2
	isOverAxis: function( x, reference, size ) {
Packit Service 50c9f2
		//Determines when x coordinate is over "b" element axis
Packit Service 50c9f2
		return ( x > reference ) && ( x < ( reference + size ) );
Packit Service 50c9f2
	},
Packit Service 50c9f2
	isOver: function( y, x, top, left, height, width ) {
Packit Service 50c9f2
		//Determines when x, y coordinates is over "b" element
Packit Service 50c9f2
		return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
Packit Service 50c9f2
	}
Packit Service 50c9f2
});
Packit Service 50c9f2
Packit Service 50c9f2
})( jQuery );