/*!
 * jQuery Mobile v@VERSION
 * http://jquerymobile.com/
 *
 * Copyright 2010, jQuery Project
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 */

(function( $, window, undefined ) {

	//jQuery.mobile configurable options
	$.extend( $.mobile, {

		//namespace used framework-wide for data-attrs. Default is no namespace
		ns: "",

		//define the url parameter used for referencing widget-generated sub-pages.
		//Translates to to example.html&ui-page=subpageIdentifier
		//hash segment before &ui-page= is used to make Ajax request
		subPageUrlKey: "ui-page",

		//anchor links with a data-rel, or pages with a  data-role, that match these selectors will be untrackable in history
		//(no change in URL, not bookmarkable)
		nonHistorySelectors: "dialog",

		//class assigned to page currently in view, and during transitions
		activePageClass: "ui-page-active",

		//class used for "active" button state, from CSS framework
		activeBtnClass: "ui-btn-active",

		//automatically handle clicks and form submissions through Ajax, when same-domain
		ajaxEnabled: true,

		//automatically load and show pages based on location.hash
		hashListeningEnabled: true,

		// TODO: deprecated - remove at 1.0
		//automatically handle link clicks through Ajax, when possible
		ajaxLinksEnabled: true,

		// TODO: deprecated - remove at 1.0
		//automatically handle form submissions through Ajax, when possible
		ajaxFormsEnabled: true,

		//set default transition - 'none' for no transitions
		defaultTransition: "slide",

		//show loading message during Ajax requests
		//if false, message will not appear, but loading classes will still be toggled on html el
		loadingMessage: "loading",

		//configure meta viewport tag's content attr:
		//note: this feature is deprecated in A4 in favor of adding
		//the meta viewport element directly in the markup
		metaViewportContent: "width=device-width, minimum-scale=1, maximum-scale=1",

		//support conditions that must be met in order to proceed
		//default enhanced qualifications are media query support OR IE 7+
		gradeA: function(){
			return $.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7;
		},

		//TODO might be useful upstream in jquery itself ?
		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,
			NUMPAD_ENTER: 108,
			NUMPAD_MULTIPLY: 106,
			NUMPAD_SUBTRACT: 109,
			PAGE_DOWN: 34,
			PAGE_UP: 33,
			PERIOD: 190,
			RIGHT: 39,
			SHIFT: 16,
			SPACE: 32,
			TAB: 9,
			UP: 38,
			WINDOWS: 91 // COMMAND
		},

		//scroll page vertically: scroll to 0 to hide iOS address bar, or pass a Y value
		silentScroll: function( ypos ) {
			ypos = ypos || 0;
			// prevent scrollstart and scrollstop events
			$.event.special.scrollstart.enabled = false;

			setTimeout(function() {
				window.scrollTo( 0, ypos );
				$(document).trigger( "silentscroll", { x: 0, y: ypos });
			},20);

			setTimeout(function() {
				$.event.special.scrollstart.enabled = true;
			}, 150 );
		}
	});

	//mobile version of data() method
	//treats namespaced data-attrs the same as non-namespaced ones
    $.fn.mobileData = function( prop, value ){
    	var pUndef = prop === undefined,
    		vUndef = value === undefined;

    	if( pUndef || vUndef ){
	    	var ret,
	    		nsret;
	    	//if no args are passed, a data hash is expected. Remap non-namespaced props
	    	if( pUndef ){
	    		ret = this.data();
	    		$.each( ret, function( i ){
	    			var nsIndex = i.indexOf( $.mobile.ns );
	    			if( nsIndex == 0 ){
	    				ret[ i.substr( $.mobile.ns.length ) ] = ret[ i ];
	    			}
	    		});
	    	}
	    	//if it's a prop get, try namepaced version if prop is undefined
	    	else if( vUndef ){
	    		ret = this.data( prop );
	    		if( ret === undefined ){
	    			nsret = this.data( $.mobile.ns + prop );
	    			if( nsret !== undefined ){
	    				ret = nsret;
	    			}
	    		}
	    	}
	    	return ret;
	    }
    };

	// Monkey-patching Sizzle to filter the :jqdata selector
	var oldFind = jQuery.find;

	jQuery.find = function( selector, context, ret ) {
		selector = selector.replace(/:jqdata\(([^)]*)\)/g, "[data-" + (jQuery.mobile.ns || "") + "$1]");

		return oldFind.call( this, selector, context, ret );
	};

	jQuery.extend( jQuery.find, oldFind );
})( jQuery, this );

@@ -4365,16 +4365,23 @@
 ext, ret
+, extra
  ) %7B%0A%09%09s
@@ -4528,16 +4528,23 @@
 ext, ret
+, extra
  );%0A%09%7D;%0A
@@ -4583,16 +4583,237 @@
 dFind );
+%0A%0A%09jQuery.find.matches = function( expr, set ) %7B%0A%09%09return jQuery.find( expr, null, null, set );%0A%09%7D;%0A%0A%09jQuery.find.matchesSelector = function( node, expr ) %7B%0A%09%09return jQuery.find( expr, null, null, %5Bnode%5D ).length %3E 0;%0A%09%7D;
 %0A%7D)( jQu

Make sure that the :jqdata() selector also works for filtered items.