forked from openlp/openlp
[remotes] Upgrade jQuery and jQuery Mobile, add jQuery Migrate because Mobile needs it
This commit is contained in:
parent
37e92d00a2
commit
00ede5aeae
|
@ -27,17 +27,6 @@
|
|||
<link rel="stylesheet" href="/files/jquery.mobile.min.css" />
|
||||
<link rel="stylesheet" href="/files/openlp.css" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/files/images/favicon.ico">
|
||||
<script type="text/javascript" src="/files/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/files/openlp.js"></script>
|
||||
<script type="text/javascript" src="/files/jquery.mobile.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
translationStrings = {
|
||||
"go_live": "${go_live}",
|
||||
"add_to_service": "${add_to_service}",
|
||||
"no_results": "${no_results}",
|
||||
"home": "${home}"
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div data-role="page" id="home">
|
||||
|
@ -173,5 +162,17 @@
|
|||
<a href="#" id="add-and-go-to-service" data-role="button">${add_and_go_to_service}</a>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/files/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/files/jquery-migrate.min.js"></script>
|
||||
<script type="text/javascript" src="/files/jquery.mobile.min.js"></script>
|
||||
<script type="text/javascript" src="/files/openlp.js"></script>
|
||||
<script type="text/javascript">
|
||||
translationStrings = {
|
||||
"go_live": "${go_live}",
|
||||
"add_to_service": "${add_to_service}",
|
||||
"no_results": "${no_results}",
|
||||
"home": "${home}"
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,752 @@
|
|||
/*!
|
||||
* jQuery Migrate - v1.4.1 - 2016-05-19
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
*/
|
||||
(function( jQuery, window, undefined ) {
|
||||
// See http://bugs.jquery.com/ticket/13335
|
||||
// "use strict";
|
||||
|
||||
|
||||
jQuery.migrateVersion = "1.4.1";
|
||||
|
||||
|
||||
var warnedAbout = {};
|
||||
|
||||
// List of warnings already given; public read only
|
||||
jQuery.migrateWarnings = [];
|
||||
|
||||
// Set to true to prevent console output; migrateWarnings still maintained
|
||||
// jQuery.migrateMute = false;
|
||||
|
||||
// Show a message on the console so devs know we're active
|
||||
if ( window.console && window.console.log ) {
|
||||
window.console.log( "JQMIGRATE: Migrate is installed" +
|
||||
( jQuery.migrateMute ? "" : " with logging active" ) +
|
||||
", version " + jQuery.migrateVersion );
|
||||
}
|
||||
|
||||
// Set to false to disable traces that appear with warnings
|
||||
if ( jQuery.migrateTrace === undefined ) {
|
||||
jQuery.migrateTrace = true;
|
||||
}
|
||||
|
||||
// Forget any warnings we've already given; public
|
||||
jQuery.migrateReset = function() {
|
||||
warnedAbout = {};
|
||||
jQuery.migrateWarnings.length = 0;
|
||||
};
|
||||
|
||||
function migrateWarn( msg) {
|
||||
var console = window.console;
|
||||
if ( !warnedAbout[ msg ] ) {
|
||||
warnedAbout[ msg ] = true;
|
||||
jQuery.migrateWarnings.push( msg );
|
||||
if ( console && console.warn && !jQuery.migrateMute ) {
|
||||
console.warn( "JQMIGRATE: " + msg );
|
||||
if ( jQuery.migrateTrace && console.trace ) {
|
||||
console.trace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function migrateWarnProp( obj, prop, value, msg ) {
|
||||
if ( Object.defineProperty ) {
|
||||
// On ES5 browsers (non-oldIE), warn if the code tries to get prop;
|
||||
// allow property to be overwritten in case some other plugin wants it
|
||||
try {
|
||||
Object.defineProperty( obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
migrateWarn( msg );
|
||||
return value;
|
||||
},
|
||||
set: function( newValue ) {
|
||||
migrateWarn( msg );
|
||||
value = newValue;
|
||||
}
|
||||
});
|
||||
return;
|
||||
} catch( err ) {
|
||||
// IE8 is a dope about Object.defineProperty, can't warn there
|
||||
}
|
||||
}
|
||||
|
||||
// Non-ES5 (or broken) browser; just set the property
|
||||
jQuery._definePropertyBroken = true;
|
||||
obj[ prop ] = value;
|
||||
}
|
||||
|
||||
if ( document.compatMode === "BackCompat" ) {
|
||||
// jQuery has never supported or tested Quirks Mode
|
||||
migrateWarn( "jQuery is not compatible with Quirks Mode" );
|
||||
}
|
||||
|
||||
|
||||
var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,
|
||||
oldAttr = jQuery.attr,
|
||||
valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
|
||||
function() { return null; },
|
||||
valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
|
||||
function() { return undefined; },
|
||||
rnoType = /^(?:input|button)$/i,
|
||||
rnoAttrNodeType = /^[238]$/,
|
||||
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
|
||||
ruseDefault = /^(?:checked|selected)$/i;
|
||||
|
||||
// jQuery.attrFn
|
||||
migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );
|
||||
|
||||
jQuery.attr = function( elem, name, value, pass ) {
|
||||
var lowerName = name.toLowerCase(),
|
||||
nType = elem && elem.nodeType;
|
||||
|
||||
if ( pass ) {
|
||||
// Since pass is used internally, we only warn for new jQuery
|
||||
// versions where there isn't a pass arg in the formal params
|
||||
if ( oldAttr.length < 4 ) {
|
||||
migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
|
||||
}
|
||||
if ( elem && !rnoAttrNodeType.test( nType ) &&
|
||||
(attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {
|
||||
return jQuery( elem )[ name ]( value );
|
||||
}
|
||||
}
|
||||
|
||||
// Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
|
||||
// for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
|
||||
if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {
|
||||
migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
|
||||
}
|
||||
|
||||
// Restore boolHook for boolean property/attribute synchronization
|
||||
if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
|
||||
jQuery.attrHooks[ lowerName ] = {
|
||||
get: function( elem, name ) {
|
||||
// Align boolean attributes with corresponding properties
|
||||
// Fall back to attribute presence where some booleans are not supported
|
||||
var attrNode,
|
||||
property = jQuery.prop( elem, name );
|
||||
return property === true || typeof property !== "boolean" &&
|
||||
( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
|
||||
|
||||
name.toLowerCase() :
|
||||
undefined;
|
||||
},
|
||||
set: function( elem, value, name ) {
|
||||
var propName;
|
||||
if ( value === false ) {
|
||||
// Remove boolean attributes when set to false
|
||||
jQuery.removeAttr( elem, name );
|
||||
} else {
|
||||
// value is true since we know at this point it's type boolean and not false
|
||||
// Set boolean attributes to the same name and set the DOM property
|
||||
propName = jQuery.propFix[ name ] || name;
|
||||
if ( propName in elem ) {
|
||||
// Only set the IDL specifically if it already exists on the element
|
||||
elem[ propName ] = true;
|
||||
}
|
||||
|
||||
elem.setAttribute( name, name.toLowerCase() );
|
||||
}
|
||||
return name;
|
||||
}
|
||||
};
|
||||
|
||||
// Warn only for attributes that can remain distinct from their properties post-1.9
|
||||
if ( ruseDefault.test( lowerName ) ) {
|
||||
migrateWarn( "jQuery.fn.attr('" + lowerName + "') might use property instead of attribute" );
|
||||
}
|
||||
}
|
||||
|
||||
return oldAttr.call( jQuery, elem, name, value );
|
||||
};
|
||||
|
||||
// attrHooks: value
|
||||
jQuery.attrHooks.value = {
|
||||
get: function( elem, name ) {
|
||||
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
||||
if ( nodeName === "button" ) {
|
||||
return valueAttrGet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("jQuery.fn.attr('value') no longer gets properties");
|
||||
}
|
||||
return name in elem ?
|
||||
elem.value :
|
||||
null;
|
||||
},
|
||||
set: function( elem, value ) {
|
||||
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
||||
if ( nodeName === "button" ) {
|
||||
return valueAttrSet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
|
||||
}
|
||||
// Does not return so that setAttribute is also used
|
||||
elem.value = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var matched, browser,
|
||||
oldInit = jQuery.fn.init,
|
||||
oldFind = jQuery.find,
|
||||
oldParseJSON = jQuery.parseJSON,
|
||||
rspaceAngle = /^\s*</,
|
||||
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
|
||||
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,
|
||||
// Note: XSS check is done below after string is trimmed
|
||||
rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
|
||||
|
||||
// $(html) "looks like html" rule change
|
||||
jQuery.fn.init = function( selector, context, rootjQuery ) {
|
||||
var match, ret;
|
||||
|
||||
if ( selector && typeof selector === "string" ) {
|
||||
if ( !jQuery.isPlainObject( context ) &&
|
||||
(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
|
||||
|
||||
// This is an HTML string according to the "old" rules; is it still?
|
||||
if ( !rspaceAngle.test( selector ) ) {
|
||||
migrateWarn("$(html) HTML strings must start with '<' character");
|
||||
}
|
||||
if ( match[ 3 ] ) {
|
||||
migrateWarn("$(html) HTML text after last tag is ignored");
|
||||
}
|
||||
|
||||
// Consistently reject any HTML-like string starting with a hash (gh-9521)
|
||||
// Note that this may break jQuery 1.6.x code that otherwise would work.
|
||||
if ( match[ 0 ].charAt( 0 ) === "#" ) {
|
||||
migrateWarn("HTML string cannot start with a '#' character");
|
||||
jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
|
||||
}
|
||||
|
||||
// Now process using loose rules; let pre-1.8 play too
|
||||
// Is this a jQuery context? parseHTML expects a DOM element (#178)
|
||||
if ( context && context.context && context.context.nodeType ) {
|
||||
context = context.context;
|
||||
}
|
||||
|
||||
if ( jQuery.parseHTML ) {
|
||||
return oldInit.call( this,
|
||||
jQuery.parseHTML( match[ 2 ], context && context.ownerDocument ||
|
||||
context || document, true ), context, rootjQuery );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ret = oldInit.apply( this, arguments );
|
||||
|
||||
// Fill in selector and context properties so .live() works
|
||||
if ( selector && selector.selector !== undefined ) {
|
||||
// A jQuery object, copy its properties
|
||||
ret.selector = selector.selector;
|
||||
ret.context = selector.context;
|
||||
|
||||
} else {
|
||||
ret.selector = typeof selector === "string" ? selector : "";
|
||||
if ( selector ) {
|
||||
ret.context = selector.nodeType? selector : context || document;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
jQuery.find = function( selector ) {
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
// Support: PhantomJS 1.x
|
||||
// String#match fails to match when used with a //g RegExp, only on some strings
|
||||
if ( typeof selector === "string" && rattrHashTest.test( selector ) ) {
|
||||
|
||||
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
|
||||
// First see if qS thinks it's a valid selector, if so avoid a false positive
|
||||
try {
|
||||
document.querySelector( selector );
|
||||
} catch ( err1 ) {
|
||||
|
||||
// Didn't *look* valid to qSA, warn and try quoting what we think is the value
|
||||
selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) {
|
||||
return "[" + attr + op + "\"" + value + "\"]";
|
||||
} );
|
||||
|
||||
// If the regexp *may* have created an invalid selector, don't update it
|
||||
// Note that there may be false alarms if selector uses jQuery extensions
|
||||
try {
|
||||
document.querySelector( selector );
|
||||
migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] );
|
||||
args[ 0 ] = selector;
|
||||
} catch ( err2 ) {
|
||||
migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return oldFind.apply( this, args );
|
||||
};
|
||||
|
||||
// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
|
||||
var findProp;
|
||||
for ( findProp in oldFind ) {
|
||||
if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) {
|
||||
jQuery.find[ findProp ] = oldFind[ findProp ];
|
||||
}
|
||||
}
|
||||
|
||||
// Let $.parseJSON(falsy_value) return null
|
||||
jQuery.parseJSON = function( json ) {
|
||||
if ( !json ) {
|
||||
migrateWarn("jQuery.parseJSON requires a valid JSON string");
|
||||
return null;
|
||||
}
|
||||
return oldParseJSON.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.uaMatch = function( ua ) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(msie) ([\w.]+)/.exec( ua ) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
||||
[];
|
||||
|
||||
return {
|
||||
browser: match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0"
|
||||
};
|
||||
};
|
||||
|
||||
// Don't clobber any existing jQuery.browser in case it's different
|
||||
if ( !jQuery.browser ) {
|
||||
matched = jQuery.uaMatch( navigator.userAgent );
|
||||
browser = {};
|
||||
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
}
|
||||
|
||||
// Chrome is Webkit, but Webkit is also Safari.
|
||||
if ( browser.chrome ) {
|
||||
browser.webkit = true;
|
||||
} else if ( browser.webkit ) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
jQuery.browser = browser;
|
||||
}
|
||||
|
||||
// Warn if the code tries to get jQuery.browser
|
||||
migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
|
||||
|
||||
// jQuery.boxModel deprecated in 1.3, jQuery.support.boxModel deprecated in 1.7
|
||||
jQuery.boxModel = jQuery.support.boxModel = (document.compatMode === "CSS1Compat");
|
||||
migrateWarnProp( jQuery, "boxModel", jQuery.boxModel, "jQuery.boxModel is deprecated" );
|
||||
migrateWarnProp( jQuery.support, "boxModel", jQuery.support.boxModel, "jQuery.support.boxModel is deprecated" );
|
||||
|
||||
jQuery.sub = function() {
|
||||
function jQuerySub( selector, context ) {
|
||||
return new jQuerySub.fn.init( selector, context );
|
||||
}
|
||||
jQuery.extend( true, jQuerySub, this );
|
||||
jQuerySub.superclass = this;
|
||||
jQuerySub.fn = jQuerySub.prototype = this();
|
||||
jQuerySub.fn.constructor = jQuerySub;
|
||||
jQuerySub.sub = this.sub;
|
||||
jQuerySub.fn.init = function init( selector, context ) {
|
||||
var instance = jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
||||
return instance instanceof jQuerySub ?
|
||||
instance :
|
||||
jQuerySub( instance );
|
||||
};
|
||||
jQuerySub.fn.init.prototype = jQuerySub.fn;
|
||||
var rootjQuerySub = jQuerySub(document);
|
||||
migrateWarn( "jQuery.sub() is deprecated" );
|
||||
return jQuerySub;
|
||||
};
|
||||
|
||||
// The number of elements contained in the matched element set
|
||||
jQuery.fn.size = function() {
|
||||
migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" );
|
||||
return this.length;
|
||||
};
|
||||
|
||||
|
||||
var internalSwapCall = false;
|
||||
|
||||
// If this version of jQuery has .swap(), don't false-alarm on internal uses
|
||||
if ( jQuery.swap ) {
|
||||
jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) {
|
||||
var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;
|
||||
|
||||
if ( oldHook ) {
|
||||
jQuery.cssHooks[ name ].get = function() {
|
||||
var ret;
|
||||
|
||||
internalSwapCall = true;
|
||||
ret = oldHook.apply( this, arguments );
|
||||
internalSwapCall = false;
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery.swap = function( elem, options, callback, args ) {
|
||||
var ret, name,
|
||||
old = {};
|
||||
|
||||
if ( !internalSwapCall ) {
|
||||
migrateWarn( "jQuery.swap() is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Remember the old values, and insert the new ones
|
||||
for ( name in options ) {
|
||||
old[ name ] = elem.style[ name ];
|
||||
elem.style[ name ] = options[ name ];
|
||||
}
|
||||
|
||||
ret = callback.apply( elem, args || [] );
|
||||
|
||||
// Revert the old values
|
||||
for ( name in options ) {
|
||||
elem.style[ name ] = old[ name ];
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
// Ensure that $.ajax gets the new parseJSON defined in core.js
|
||||
jQuery.ajaxSetup({
|
||||
converters: {
|
||||
"text json": jQuery.parseJSON
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var oldFnData = jQuery.fn.data;
|
||||
|
||||
jQuery.fn.data = function( name ) {
|
||||
var ret, evt,
|
||||
elem = this[0];
|
||||
|
||||
// Handles 1.7 which has this behavior and 1.8 which doesn't
|
||||
if ( elem && name === "events" && arguments.length === 1 ) {
|
||||
ret = jQuery.data( elem, name );
|
||||
evt = jQuery._data( elem, name );
|
||||
if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {
|
||||
migrateWarn("Use of jQuery.fn.data('events') is deprecated");
|
||||
return evt;
|
||||
}
|
||||
}
|
||||
return oldFnData.apply( this, arguments );
|
||||
};
|
||||
|
||||
|
||||
var rscriptType = /\/(java|ecma)script/i;
|
||||
|
||||
// Since jQuery.clean is used internally on older versions, we only shim if it's missing
|
||||
if ( !jQuery.clean ) {
|
||||
jQuery.clean = function( elems, context, fragment, scripts ) {
|
||||
// Set context per 1.8 logic
|
||||
context = context || document;
|
||||
context = !context.nodeType && context[0] || context;
|
||||
context = context.ownerDocument || context;
|
||||
|
||||
migrateWarn("jQuery.clean() is deprecated");
|
||||
|
||||
var i, elem, handleScript, jsTags,
|
||||
ret = [];
|
||||
|
||||
jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );
|
||||
|
||||
// Complex logic lifted directly from jQuery 1.8
|
||||
if ( fragment ) {
|
||||
// Special handling of each script element
|
||||
handleScript = function( elem ) {
|
||||
// Check if we consider it executable
|
||||
if ( !elem.type || rscriptType.test( elem.type ) ) {
|
||||
// Detach the script and store it in the scripts array (if provided) or the fragment
|
||||
// Return truthy to indicate that it has been handled
|
||||
return scripts ?
|
||||
scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
|
||||
fragment.appendChild( elem );
|
||||
}
|
||||
};
|
||||
|
||||
for ( i = 0; (elem = ret[i]) != null; i++ ) {
|
||||
// Check if we're done after handling an executable script
|
||||
if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
|
||||
// Append to fragment and handle embedded scripts
|
||||
fragment.appendChild( elem );
|
||||
if ( typeof elem.getElementsByTagName !== "undefined" ) {
|
||||
// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
|
||||
jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
|
||||
|
||||
// Splice the scripts into ret after their former ancestor and advance our index beyond them
|
||||
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
|
||||
i += jsTags.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
|
||||
var eventAdd = jQuery.event.add,
|
||||
eventRemove = jQuery.event.remove,
|
||||
eventTrigger = jQuery.event.trigger,
|
||||
oldToggle = jQuery.fn.toggle,
|
||||
oldLive = jQuery.fn.live,
|
||||
oldDie = jQuery.fn.die,
|
||||
oldLoad = jQuery.fn.load,
|
||||
ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
|
||||
rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
|
||||
rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
|
||||
hoverHack = function( events ) {
|
||||
if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {
|
||||
return events;
|
||||
}
|
||||
if ( rhoverHack.test( events ) ) {
|
||||
migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");
|
||||
}
|
||||
return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
|
||||
};
|
||||
|
||||
// Event props removed in 1.9, put them back if needed; no practical way to warn them
|
||||
if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
|
||||
jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" );
|
||||
}
|
||||
|
||||
// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
|
||||
if ( jQuery.event.dispatch ) {
|
||||
migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Support for 'hover' pseudo-event and ajax event warnings
|
||||
jQuery.event.add = function( elem, types, handler, data, selector ){
|
||||
if ( elem !== document && rajaxEvent.test( types ) ) {
|
||||
migrateWarn( "AJAX events should be attached to document: " + types );
|
||||
}
|
||||
eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector );
|
||||
};
|
||||
jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
|
||||
eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
|
||||
};
|
||||
|
||||
jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
|
||||
|
||||
jQuery.fn[ name ] = function() {
|
||||
var args = Array.prototype.slice.call( arguments, 0 );
|
||||
|
||||
// If this is an ajax load() the first arg should be the string URL;
|
||||
// technically this could also be the "Anything" arg of the event .load()
|
||||
// which just goes to show why this dumb signature has been deprecated!
|
||||
// jQuery custom builds that exclude the Ajax module justifiably die here.
|
||||
if ( name === "load" && typeof args[ 0 ] === "string" ) {
|
||||
return oldLoad.apply( this, args );
|
||||
}
|
||||
|
||||
migrateWarn( "jQuery.fn." + name + "() is deprecated" );
|
||||
|
||||
args.splice( 0, 0, name );
|
||||
if ( arguments.length ) {
|
||||
return this.bind.apply( this, args );
|
||||
}
|
||||
|
||||
// Use .triggerHandler here because:
|
||||
// - load and unload events don't need to bubble, only applied to window or image
|
||||
// - error event should not bubble to window, although it does pre-1.7
|
||||
// See http://bugs.jquery.com/ticket/11820
|
||||
this.triggerHandler.apply( this, args );
|
||||
return this;
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
jQuery.fn.toggle = function( fn, fn2 ) {
|
||||
|
||||
// Don't mess with animation or css toggles
|
||||
if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
|
||||
return oldToggle.apply( this, arguments );
|
||||
}
|
||||
migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");
|
||||
|
||||
// Save reference to arguments for access in closure
|
||||
var args = arguments,
|
||||
guid = fn.guid || jQuery.guid++,
|
||||
i = 0,
|
||||
toggler = function( event ) {
|
||||
// Figure out which function to execute
|
||||
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
|
||||
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
|
||||
|
||||
// Make sure that clicks stop
|
||||
event.preventDefault();
|
||||
|
||||
// and execute the function
|
||||
return args[ lastToggle ].apply( this, arguments ) || false;
|
||||
};
|
||||
|
||||
// link all the functions, so any of them can unbind this click handler
|
||||
toggler.guid = guid;
|
||||
while ( i < args.length ) {
|
||||
args[ i++ ].guid = guid;
|
||||
}
|
||||
|
||||
return this.click( toggler );
|
||||
};
|
||||
|
||||
jQuery.fn.live = function( types, data, fn ) {
|
||||
migrateWarn("jQuery.fn.live() is deprecated");
|
||||
if ( oldLive ) {
|
||||
return oldLive.apply( this, arguments );
|
||||
}
|
||||
jQuery( this.context ).on( types, this.selector, data, fn );
|
||||
return this;
|
||||
};
|
||||
|
||||
jQuery.fn.die = function( types, fn ) {
|
||||
migrateWarn("jQuery.fn.die() is deprecated");
|
||||
if ( oldDie ) {
|
||||
return oldDie.apply( this, arguments );
|
||||
}
|
||||
jQuery( this.context ).off( types, this.selector || "**", fn );
|
||||
return this;
|
||||
};
|
||||
|
||||
// Turn global events into document-triggered events
|
||||
jQuery.event.trigger = function( event, data, elem, onlyHandlers ){
|
||||
if ( !elem && !rajaxEvent.test( event ) ) {
|
||||
migrateWarn( "Global events are undocumented and deprecated" );
|
||||
}
|
||||
return eventTrigger.call( this, event, data, elem || document, onlyHandlers );
|
||||
};
|
||||
jQuery.each( ajaxEvents.split("|"),
|
||||
function( _, name ) {
|
||||
jQuery.event.special[ name ] = {
|
||||
setup: function() {
|
||||
var elem = this;
|
||||
|
||||
// The document needs no shimming; must be !== for oldIE
|
||||
if ( elem !== document ) {
|
||||
jQuery.event.add( document, name + "." + jQuery.guid, function() {
|
||||
jQuery.event.trigger( name, Array.prototype.slice.call( arguments, 1 ), elem, true );
|
||||
});
|
||||
jQuery._data( this, name, jQuery.guid++ );
|
||||
}
|
||||
return false;
|
||||
},
|
||||
teardown: function() {
|
||||
if ( this !== document ) {
|
||||
jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
jQuery.event.special.ready = {
|
||||
setup: function() {
|
||||
if ( this === document ) {
|
||||
migrateWarn( "'ready' event is deprecated" );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
|
||||
oldFnFind = jQuery.fn.find;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
|
||||
return oldSelf.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.fn.find = function( selector ) {
|
||||
var ret = oldFnFind.apply( this, arguments );
|
||||
ret.context = this.context;
|
||||
ret.selector = this.selector ? this.selector + " " + selector : selector;
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
// jQuery 1.6 did not support Callbacks, do not warn there
|
||||
if ( jQuery.Callbacks ) {
|
||||
|
||||
var oldDeferred = jQuery.Deferred,
|
||||
tuples = [
|
||||
// action, add listener, callbacks, .then handlers, final state
|
||||
[ "resolve", "done", jQuery.Callbacks("once memory"),
|
||||
jQuery.Callbacks("once memory"), "resolved" ],
|
||||
[ "reject", "fail", jQuery.Callbacks("once memory"),
|
||||
jQuery.Callbacks("once memory"), "rejected" ],
|
||||
[ "notify", "progress", jQuery.Callbacks("memory"),
|
||||
jQuery.Callbacks("memory") ]
|
||||
];
|
||||
|
||||
jQuery.Deferred = function( func ) {
|
||||
var deferred = oldDeferred(),
|
||||
promise = deferred.promise();
|
||||
|
||||
deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {
|
||||
var fns = arguments;
|
||||
|
||||
migrateWarn( "deferred.pipe() is deprecated" );
|
||||
|
||||
return jQuery.Deferred(function( newDefer ) {
|
||||
jQuery.each( tuples, function( i, tuple ) {
|
||||
var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
|
||||
// deferred.done(function() { bind to newDefer or newDefer.resolve })
|
||||
// deferred.fail(function() { bind to newDefer or newDefer.reject })
|
||||
// deferred.progress(function() { bind to newDefer or newDefer.notify })
|
||||
deferred[ tuple[1] ](function() {
|
||||
var returned = fn && fn.apply( this, arguments );
|
||||
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
||||
returned.promise()
|
||||
.done( newDefer.resolve )
|
||||
.fail( newDefer.reject )
|
||||
.progress( newDefer.notify );
|
||||
} else {
|
||||
newDefer[ tuple[ 0 ] + "With" ](
|
||||
this === promise ? newDefer.promise() : this,
|
||||
fn ? [ returned ] : arguments
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
fns = null;
|
||||
}).promise();
|
||||
|
||||
};
|
||||
|
||||
deferred.isResolved = function() {
|
||||
migrateWarn( "deferred.isResolved is deprecated" );
|
||||
return deferred.state() === "resolved";
|
||||
};
|
||||
|
||||
deferred.isRejected = function() {
|
||||
migrateWarn( "deferred.isRejected is deprecated" );
|
||||
return deferred.state() === "rejected";
|
||||
};
|
||||
|
||||
if ( func ) {
|
||||
func.call( deferred, deferred );
|
||||
}
|
||||
|
||||
return deferred;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
})( jQuery, window );
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* jQuery Mobile Framework Git Build: SHA1: 27e3c18acfebab2d47ee7ed37bd50fc4942c8838 <> Date: Fri Mar 22 08:50:04 2013 -0600
|
||||
* jQuery Mobile Framework Git Build: SHA1: b49cc06499abf8f987cf90f35349cfac0918c939 <> Date: Tue Oct 2 11:22:34 2012 -0700
|
||||
* http://jquerymobile.com
|
||||
*
|
||||
* Copyright 2010, 2013 jQuery Foundation, Inc. and other contributors
|
||||
* Copyright 2012 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
|
@ -29,7 +29,7 @@
|
|||
$.mobile = $.extend( {}, {
|
||||
|
||||
// Version of the jQuery Mobile Framework
|
||||
version: "1.2.1",
|
||||
version: "1.2.0",
|
||||
|
||||
// Namespace used framework-wide for data-attrs. Default is no namespace
|
||||
ns: "",
|
||||
|
@ -134,9 +134,6 @@
|
|||
WINDOWS: 91 // COMMAND
|
||||
},
|
||||
|
||||
// Place to store various widget extensions
|
||||
behaviors: {},
|
||||
|
||||
// Scroll page vertically: scroll to 0 to hide iOS address bar, or pass a Y value
|
||||
silentScroll: function( ypos ) {
|
||||
if ( $.type( ypos ) !== "number" ) {
|
||||
|
@ -1000,7 +997,7 @@ $.widget( "mobile.widget", {
|
|||
this.fakeFixLoader();
|
||||
$window
|
||||
.unbind( "scroll", this.checkLoaderPosition )
|
||||
.bind( "scroll", $.proxy( this.fakeFixLoader, this ) );
|
||||
.bind( "scroll", this.fakeFixLoader );
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1085,8 +1082,8 @@ $.widget( "mobile.widget", {
|
|||
this.element.removeClass( "ui-loader-fakefix" );
|
||||
}
|
||||
|
||||
$( window ).unbind( "scroll", this.fakeFixLoader );
|
||||
$( window ).unbind( "scroll", this.checkLoaderPosition );
|
||||
$( window ).unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
|
||||
$( window ).unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -3538,7 +3535,6 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
.jqmData( "url", dataUrl );
|
||||
}
|
||||
|
||||
|
||||
// If we failed to find a page in the DOM, check the URL to see if it
|
||||
// refers to the first page in the application. If it isn't a reference
|
||||
// to the first page and refers to non-existent embedded page, error out.
|
||||
|
@ -3560,7 +3556,7 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
return deferred.promise();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If the page we are interested in is already in the DOM,
|
||||
// and the caller did not indicate that we should force a
|
||||
// reload of the file, we are done. Otherwise, track the
|
||||
|
@ -3569,14 +3565,11 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
if ( !settings.reloadPage ) {
|
||||
enhancePage( page, settings.role );
|
||||
deferred.resolve( absUrl, options, page );
|
||||
//if we are reloading the page make sure we update the base if its not a prefetch
|
||||
if( base && !options.prefetch ){
|
||||
base.set(url);
|
||||
}
|
||||
return deferred.promise();
|
||||
}
|
||||
dupCachedPage = page;
|
||||
}
|
||||
|
||||
var mpc = settings.pageContainer,
|
||||
pblEvent = new $.Event( "pagebeforeload" ),
|
||||
triggerData = { url: url, absUrl: absUrl, dataUrl: dataUrl, deferred: deferred, options: settings };
|
||||
|
@ -3606,9 +3599,9 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
$.mobile.hidePageLoadingMsg();
|
||||
};
|
||||
}
|
||||
|
||||
// Reset base to the default document base.
|
||||
// only reset if we are not prefetching
|
||||
if ( base && typeof options.prefetch === "undefined" ) {
|
||||
if ( base ) {
|
||||
base.reset();
|
||||
}
|
||||
|
||||
|
@ -3642,8 +3635,8 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
RegExp.$1 ) {
|
||||
url = fileUrl = path.getFilePath( $( "<div>" + RegExp.$1 + "</div>" ).text() );
|
||||
}
|
||||
//dont update the base tag if we are prefetching
|
||||
if ( base && typeof options.prefetch === "undefined") {
|
||||
|
||||
if ( base ) {
|
||||
base.set( fileUrl );
|
||||
}
|
||||
|
||||
|
@ -3828,6 +3821,7 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
$.mobile.changePage( newPage, options );
|
||||
})
|
||||
.fail(function( url, options ) {
|
||||
isPageTransitioning = false;
|
||||
|
||||
//clear out the active button state
|
||||
removeActiveLinkClass( true );
|
||||
|
@ -3931,7 +3925,7 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
// However, if a dialog is already displayed at this point, and we're
|
||||
// about to display another dialog, then we must add another hash and
|
||||
// history entry on top so that one may navigate back to the original dialog
|
||||
if ( active.url && active.url.indexOf( dialogHashKey ) > -1 && !$.mobile.activePage.is( ".ui-dialog" ) ) {
|
||||
if ( active.url.indexOf( dialogHashKey ) > -1 && !$.mobile.activePage.is( ".ui-dialog" ) ) {
|
||||
settings.changeHash = false;
|
||||
alreadyThere = true;
|
||||
}
|
||||
|
@ -4062,7 +4056,7 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
//The following event bindings should be bound after mobileinit has been triggered
|
||||
//the following deferred is resolved in the init file
|
||||
$.mobile.navreadyDeferred = $.Deferred();
|
||||
$.mobile._registerInternalEvents = function() {
|
||||
$.mobile.navreadyDeferred.done(function() {
|
||||
//bind to form submit events, handle with Ajax
|
||||
$( document ).delegate( "form", "submit", function( event ) {
|
||||
var $this = $( this );
|
||||
|
@ -4250,7 +4244,7 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
if ( url && $.inArray( url, urls ) === -1 ) {
|
||||
urls.push( url );
|
||||
|
||||
$.mobile.loadPage( url, { role: $link.attr( "data-" + $.mobile.ns + "rel" ),prefetch: true } );
|
||||
$.mobile.loadPage( url, { role: $link.attr( "data-" + $.mobile.ns + "rel" ) } );
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -4364,8 +4358,7 @@ $.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defau
|
|||
$( document ).bind( "pageshow", resetActivePageHeight );
|
||||
$( window ).bind( "throttledresize", resetActivePageHeight );
|
||||
|
||||
};//navreadyDeferred done callback
|
||||
$.mobile.navreadyDeferred.done( function() { $.mobile._registerInternalEvents(); } );
|
||||
});//navreadyDeferred done callback
|
||||
|
||||
})( jQuery );
|
||||
|
||||
|
@ -4671,9 +4664,9 @@ $.widget( "mobile.dialog", $.mobile.widget, {
|
|||
$el
|
||||
.wrapInner( dialogWrap )
|
||||
.children()
|
||||
.find( ":jqmData(role='header')" ).first()
|
||||
.find( ":jqmData(role='header')" )
|
||||
.prepend( headerCloseButton )
|
||||
.end().end()
|
||||
.end()
|
||||
.children( ':first-child')
|
||||
.addClass( "ui-corner-top" )
|
||||
.end()
|
||||
|
@ -4916,20 +4909,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
|
||||
(function( $, undefined ) {
|
||||
|
||||
$.mobile.behaviors.formReset = {
|
||||
_handleFormReset: function() {
|
||||
this._on( this.element.closest( "form" ), {
|
||||
reset: function() {
|
||||
this._delay( "_reset" );
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})( jQuery );
|
||||
|
||||
(function( $, undefined ) {
|
||||
|
||||
$.fn.buttonMarkup = function( options ) {
|
||||
var $workingSet = this,
|
||||
mapToDataAttr = function( key, value ) {
|
||||
|
@ -5229,8 +5208,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
|
|||
o.expandedIcon = collapsibleSet.jqmData( "expanded-icon" );
|
||||
}
|
||||
// Gets the preference icon position in the set
|
||||
if ( !o.iconpos ) {
|
||||
o.iconpos = collapsibleSet.jqmData( "iconpos" );
|
||||
if ( !o.iconPos ) {
|
||||
o.iconPos = collapsibleSet.jqmData( "iconpos" );
|
||||
}
|
||||
// Inherit the preference for inset from collapsible-set or set the default value to ensure equalty within a set
|
||||
if ( collapsibleSet.jqmData( "inset" ) !== undefined ) {
|
||||
|
@ -5270,7 +5249,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
|
|||
.buttonMarkup({
|
||||
shadow: false,
|
||||
corners: false,
|
||||
iconpos: $el.jqmData( "iconpos" ) || o.iconpos || "left",
|
||||
iconpos: $el.jqmData( "iconpos" ) || o.iconPos || "left",
|
||||
icon: collapsedIcon,
|
||||
mini: o.mini,
|
||||
theme: o.theme
|
||||
|
@ -5512,7 +5491,6 @@ $.widget( "mobile.listview", $.mobile.widget, {
|
|||
countTheme: "c",
|
||||
headerTheme: "b",
|
||||
dividerTheme: "b",
|
||||
icon: "arrow-r",
|
||||
splitIcon: "arrow-r",
|
||||
splitTheme: "b",
|
||||
inset: false,
|
||||
|
@ -5655,7 +5633,6 @@ $.widget( "mobile.listview", $.mobile.widget, {
|
|||
dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
|
||||
listsplittheme = $list.jqmData( "splittheme" ),
|
||||
listspliticon = $list.jqmData( "spliticon" ),
|
||||
listicon = $list.jqmData( "icon" ),
|
||||
li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ),
|
||||
ol = !!$.nodeName( $list[ 0 ], "ol" ),
|
||||
jsCount = !$.support.cssPseudoElement,
|
||||
|
@ -5704,7 +5681,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
|
|||
shadow: false,
|
||||
corners: false,
|
||||
iconpos: "right",
|
||||
icon: a.length > 1 || icon === false ? false : icon || listicon || o.icon,
|
||||
icon: a.length > 1 || icon === false ? false : icon || "arrow-r",
|
||||
theme: itemTheme
|
||||
});
|
||||
|
||||
|
@ -5942,7 +5919,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
$.mobile.listview.prototype.options.autodividers = false;
|
||||
$.mobile.listview.prototype.options.autodividersSelector = function( elt ) {
|
||||
// look for the text in the given element
|
||||
var text = $.trim( elt.text() ) || null;
|
||||
var text = elt.text() || null;
|
||||
|
||||
if ( !text ) {
|
||||
return null;
|
||||
|
@ -6005,13 +5982,11 @@ $( document ).delegate( "ul,ol", "listviewcreate", function() {
|
|||
$.widget( "mobile.checkboxradio", $.mobile.widget, {
|
||||
options: {
|
||||
theme: null,
|
||||
mini: false,
|
||||
initSelector: "input[type='checkbox'],input[type='radio']"
|
||||
},
|
||||
_create: function() {
|
||||
var self = this,
|
||||
input = this.element,
|
||||
o = this.options,
|
||||
inheritAttr = function( input, dataAttr ) {
|
||||
return input.jqmData( dataAttr ) || input.closest( "form, fieldset" ).jqmData( dataAttr );
|
||||
},
|
||||
|
@ -6020,7 +5995,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
parentLabel = $( input ).closest( "label" ),
|
||||
label = parentLabel.length ? parentLabel : $( input ).closest( "form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')" ).find( "label" ).filter( "[for='" + input[0].id + "']" ).first(),
|
||||
inputtype = input[0].type,
|
||||
mini = inheritAttr( input, "mini" ) || o.mini,
|
||||
mini = inheritAttr( input, "mini" ),
|
||||
checkedState = inputtype + "-on",
|
||||
uncheckedState = inputtype + "-off",
|
||||
icon = input.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState,
|
||||
|
@ -6046,12 +6021,12 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
});
|
||||
|
||||
// If there's no selected theme check the data attr
|
||||
if ( !o.theme ) {
|
||||
o.theme = $.mobile.getInheritedTheme( this.element, "c" );
|
||||
if ( !this.options.theme ) {
|
||||
this.options.theme = $.mobile.getInheritedTheme( this.element, "c" );
|
||||
}
|
||||
|
||||
label.buttonMarkup({
|
||||
theme: o.theme,
|
||||
theme: this.options.theme,
|
||||
icon: icon,
|
||||
shadow: false,
|
||||
mini: mini,
|
||||
|
@ -6129,9 +6104,6 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
}
|
||||
});
|
||||
|
||||
if ( this._handleFormReset ) {
|
||||
this._handleFormReset();
|
||||
}
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
|
@ -6164,10 +6136,6 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
.checkboxradio( "refresh" );
|
||||
},
|
||||
|
||||
_reset: function() {
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
var input = this.element[0],
|
||||
label = this.label,
|
||||
|
@ -6197,8 +6165,6 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
}
|
||||
});
|
||||
|
||||
$.widget( "mobile.checkboxradio", $.mobile.checkboxradio, $.mobile.behaviors.formReset );
|
||||
|
||||
//auto self-init widgets
|
||||
$( document ).bind( "pagecreate create", function( e ) {
|
||||
$.mobile.checkboxradio.prototype.enhanceWithin( e.target, true );
|
||||
|
@ -6499,7 +6465,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
}
|
||||
},
|
||||
|
||||
_expectResizeEvent: function() {
|
||||
_maybeRefreshTimeout: function() {
|
||||
var winCoords = windowCoords();
|
||||
|
||||
if ( this._resizeData ) {
|
||||
|
@ -6524,21 +6490,14 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
},
|
||||
|
||||
_resizeTimeout: function() {
|
||||
if ( this._isOpen ) {
|
||||
if ( !this._expectResizeEvent() ) {
|
||||
if ( this._ui.container.hasClass( "ui-popup-hidden" ) ) {
|
||||
// effectively rapid-open the popup while leaving the screen intact
|
||||
this._trigger( "beforeposition" );
|
||||
this._ui.container
|
||||
.removeClass( "ui-popup-hidden" )
|
||||
.offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
|
||||
}
|
||||
if ( !this._maybeRefreshTimeout() ) {
|
||||
// effectively rapid-open the popup while leaving the screen intact
|
||||
this._trigger( "beforeposition" );
|
||||
this._ui.container
|
||||
.removeClass( "ui-selectmenu-hidden" )
|
||||
.offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
|
||||
|
||||
this._resizeScreen();
|
||||
this._resizeData = null;
|
||||
this._orientationchangeInProgress = false;
|
||||
}
|
||||
} else {
|
||||
this._resizeScreen();
|
||||
this._resizeData = null;
|
||||
this._orientationchangeInProgress = false;
|
||||
}
|
||||
|
@ -6546,19 +6505,18 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
|
||||
_handleWindowResize: function( e ) {
|
||||
if ( this._isOpen ) {
|
||||
if ( ( this._expectResizeEvent() || this._orientationchangeInProgress ) &&
|
||||
!this._ui.container.hasClass( "ui-popup-hidden" ) ) {
|
||||
// effectively rapid-close the popup while leaving the screen intact
|
||||
this._ui.container
|
||||
.addClass( "ui-popup-hidden" )
|
||||
.removeAttr( "style" );
|
||||
}
|
||||
this._maybeRefreshTimeout();
|
||||
}
|
||||
},
|
||||
|
||||
_handleWindowOrientationchange: function( e ) {
|
||||
if ( !this._orientationchangeInProgress && this._isOpen ) {
|
||||
this._expectResizeEvent();
|
||||
|
||||
if ( !this._orientationchangeInProgress ) {
|
||||
// effectively rapid-close the popup while leaving the screen intact
|
||||
this._ui.container
|
||||
.addClass( "ui-selectmenu-hidden" )
|
||||
.removeAttr( "style" );
|
||||
|
||||
this._orientationchangeInProgress = true;
|
||||
}
|
||||
},
|
||||
|
@ -6567,7 +6525,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
var ui = {
|
||||
screen: $( "<div class='ui-screen-hidden ui-popup-screen'></div>" ),
|
||||
placeholder: $( "<div style='display: none;'><!-- placeholder --></div>" ),
|
||||
container: $( "<div class='ui-popup-container ui-popup-hidden'></div>" )
|
||||
container: $( "<div class='ui-popup-container ui-selectmenu-hidden'></div>" )
|
||||
},
|
||||
thisPage = this.element.closest( ".ui-page" ),
|
||||
myId = this.element.attr( "id" ),
|
||||
|
@ -6603,7 +6561,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
|
||||
// Define instance variables
|
||||
$.extend( this, {
|
||||
_scrollTop: 0,
|
||||
_page: thisPage,
|
||||
_ui: ui,
|
||||
_fallbackTransition: "",
|
||||
|
@ -6689,9 +6646,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
this._ui.container.removeClass( this._fallbackTransition );
|
||||
if ( value && value !== "none" ) {
|
||||
this._fallbackTransition = $.mobile._maybeDegradeTransition( value );
|
||||
if ( this._fallbackTransition === "none" ) {
|
||||
this._fallbackTransition = "";
|
||||
}
|
||||
this._ui.container.addClass( this._fallbackTransition );
|
||||
}
|
||||
},
|
||||
|
@ -6860,7 +6814,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
|
||||
_animate: function( args ) {
|
||||
// NOTE before removing the default animation of the screen
|
||||
// this had an animate callback that would resolve the deferred
|
||||
// this had an animate callback that would relove the deferred
|
||||
// now the deferred is resolved immediately
|
||||
// TODO remove the dependency on the screen deferred
|
||||
this._ui.screen
|
||||
|
@ -6873,16 +6827,13 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
if ( args.applyTransition ) {
|
||||
this._applyTransition( args.transition );
|
||||
}
|
||||
if ( this._fallbackTransition ) {
|
||||
this._ui.container
|
||||
.animationComplete( $.proxy( args.prereqs.container, "resolve" ) )
|
||||
.addClass( args.containerClassToAdd )
|
||||
.removeClass( args.classToRemove );
|
||||
return;
|
||||
}
|
||||
this._ui.container
|
||||
.animationComplete( $.proxy( args.prereqs.container, "resolve" ) )
|
||||
.addClass( args.containerClassToAdd )
|
||||
.removeClass( args.classToRemove );
|
||||
} else {
|
||||
args.prereqs.container.resolve();
|
||||
}
|
||||
this._ui.container.removeClass( args.classToRemove );
|
||||
args.prereqs.container.resolve();
|
||||
},
|
||||
|
||||
// The desired coordinates passed in will be returned untouched if no reference element can be identified via
|
||||
|
@ -6941,7 +6892,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
// the "blue flash" of element focus in android 4.0
|
||||
setTimeout(function(){
|
||||
self._ui.container.attr( "tabindex", "0" ).focus();
|
||||
self._expectResizeEvent();
|
||||
self._trigger( "afteropen" );
|
||||
});
|
||||
},
|
||||
|
@ -6998,7 +6948,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
this._ui.screen.removeClass( "ui-screen-hidden" );
|
||||
|
||||
this._ui.container
|
||||
.removeClass( "ui-popup-hidden" )
|
||||
.removeClass( "ui-selectmenu-hidden" )
|
||||
.offset( coords );
|
||||
|
||||
if ( this.options.overlayTheme && androidBlacklist ) {
|
||||
|
@ -7038,7 +6988,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
_closePrereqContainer: function() {
|
||||
this._ui.container
|
||||
.removeClass( "reverse out" )
|
||||
.addClass( "ui-popup-hidden" )
|
||||
.addClass( "ui-selectmenu-hidden" )
|
||||
.removeAttr( "style" );
|
||||
},
|
||||
|
||||
|
@ -7060,7 +7010,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
self._trigger( "afterclose" );
|
||||
},
|
||||
|
||||
_close: function( immediate ) {
|
||||
_close: function() {
|
||||
this._ui.container.removeClass( "ui-popup-active" );
|
||||
this._page.removeClass( "ui-popup-open" );
|
||||
|
||||
|
@ -7076,7 +7026,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
|
||||
this._animate( {
|
||||
additionalCondition: this._ui.screen.hasClass( "in" ),
|
||||
transition: ( immediate ? "none" : ( this._currentTransition || this.options.transition ) ),
|
||||
transition: ( this._currentTransition || this.options.transition ),
|
||||
classToRemove: "in",
|
||||
screenClassToAdd: "out",
|
||||
containerClassToAdd: "reverse out",
|
||||
|
@ -7085,19 +7035,15 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
});
|
||||
},
|
||||
|
||||
_unenhance: function() {
|
||||
_destroy: function() {
|
||||
var self = this;
|
||||
|
||||
// hide and remove bindings
|
||||
self._close();
|
||||
|
||||
// Put the element back to where the placeholder was and remove the "ui-popup" class
|
||||
self._setTheme( "none" );
|
||||
self.element
|
||||
// Cannot directly insertAfter() - we need to detach() first, because
|
||||
// insertAfter() will do nothing if the payload div was not attached
|
||||
// to the DOM at the time the widget was created, and so the payload
|
||||
// will remain inside the container even after we call insertAfter().
|
||||
// If that happens and we remove the container a few lines below, we
|
||||
// will cause an infinite recursion - #5244
|
||||
.detach()
|
||||
.insertAfter( self._ui.placeholder )
|
||||
.removeClass( "ui-popup ui-overlay-shadow ui-corner-all" );
|
||||
self._ui.screen.remove();
|
||||
|
@ -7112,46 +7058,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
});
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
if ( $.mobile.popup.active === this ) {
|
||||
this.element.one( "popupafterclose", $.proxy( this, "_unenhance" ) );
|
||||
this.close();
|
||||
} else {
|
||||
this._unenhance();
|
||||
}
|
||||
},
|
||||
|
||||
_closePopup: function( e, data ) {
|
||||
var parsedDst, toUrl;
|
||||
|
||||
window.scrollTo( 0, this._scrollTop );
|
||||
|
||||
if ( e.type === "pagebeforechange" && data ) {
|
||||
// Determine whether we need to rapid-close the popup, or whether we can
|
||||
// take the time to run the closing transition
|
||||
if ( typeof data.toPage === "string" ) {
|
||||
parsedDst = data.toPage;
|
||||
} else {
|
||||
parsedDst = data.toPage.jqmData( "url" );
|
||||
}
|
||||
parsedDst = $.mobile.path.parseUrl( parsedDst );
|
||||
toUrl = parsedDst.pathname + parsedDst.search + parsedDst.hash;
|
||||
|
||||
if ( this._myUrl !== toUrl ) {
|
||||
// Going to a different page - close immediately
|
||||
this.options.container.unbind( this.options.closeEvents );
|
||||
this._close( true );
|
||||
} else {
|
||||
this.close();
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this._close();
|
||||
},
|
||||
|
||||
// any navigation event after a popup is opened should close the popup
|
||||
// NOTE the pagebeforechange is bound to catch navigation events that don't
|
||||
// alter the url (eg, dialogs from popups)
|
||||
|
@ -7159,7 +7065,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
var self = this;
|
||||
|
||||
self.options.container
|
||||
.one( self.options.closeEvents, $.proxy( self, "_closePopup" ) );
|
||||
.one( self.options.closeEvents, $.proxy( self._close, self ));
|
||||
},
|
||||
|
||||
// TODO no clear deliniation of what should be here and
|
||||
|
@ -7174,7 +7080,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
|
||||
// set the global popup mutex
|
||||
$.mobile.popup.active = this;
|
||||
this._scrollTop = $( window ).scrollTop();
|
||||
|
||||
// if history alteration is disabled close on navigate events
|
||||
// and leave the url as is
|
||||
|
@ -7202,7 +7107,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
hashkey = $.mobile.dialogHashKey;
|
||||
activePage = $.mobile.activePage;
|
||||
currentIsDialog = activePage.is( ".ui-dialog" );
|
||||
this._myUrl = url = $.mobile.urlHistory.getActive().url;
|
||||
url = $.mobile.urlHistory.getActive().url;
|
||||
hasHash = ( url.indexOf( hashkey ) > -1 ) && !currentIsDialog;
|
||||
urlHistory = $.mobile.urlHistory;
|
||||
|
||||
|
@ -7212,7 +7117,13 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
return;
|
||||
}
|
||||
|
||||
url = url + hashkey;
|
||||
// if the current url has no dialog hash key proceed as normal
|
||||
// otherwise, if the page is a dialog simply tack on the hash key
|
||||
if ( url.indexOf( hashkey ) === -1 && !currentIsDialog ){
|
||||
url = url + hashkey;
|
||||
} else {
|
||||
url = $.mobile.path.parseLocation().hash + hashkey;
|
||||
}
|
||||
|
||||
// Tack on an extra hashkey if this is the first page and we've just reconstructed the initial hash
|
||||
if ( urlHistory.activeIndex === 0 && url === urlHistory.initialDst ) {
|
||||
|
@ -7241,8 +7152,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
return;
|
||||
}
|
||||
|
||||
this._scrollTop = $( window ).scrollTop();
|
||||
|
||||
if( this.options.history ) {
|
||||
$.mobile.back();
|
||||
} else {
|
||||
|
@ -7274,11 +7183,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
|
||||
//remove after delay
|
||||
setTimeout( function() {
|
||||
// Check if we are in a listview
|
||||
var $parent = $link.parent().parent();
|
||||
if ($parent.hasClass("ui-li")) {
|
||||
$link = $parent.parent();
|
||||
}
|
||||
$link.removeClass( $.mobile.activeBtnClass );
|
||||
}, 300 );
|
||||
};
|
||||
|
@ -7336,7 +7240,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
$.widget( "mobile.textinput", $.mobile.widget, {
|
||||
options: {
|
||||
theme: null,
|
||||
mini: false,
|
||||
// This option defaults to true on iOS devices.
|
||||
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
|
||||
initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])",
|
||||
|
@ -7351,7 +7254,8 @@ $.widget( "mobile.textinput", $.mobile.widget, {
|
|||
o = this.options,
|
||||
theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
|
||||
themeclass = " ui-body-" + theme,
|
||||
miniclass = o.mini ? " ui-mini" : "",
|
||||
mini = input.jqmData( "mini" ) === true,
|
||||
miniclass = mini ? " ui-mini" : "",
|
||||
focusedEl, clearbtn;
|
||||
|
||||
function toggleClear() {
|
||||
|
@ -7398,7 +7302,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
|
|||
iconpos: "notext",
|
||||
corners: true,
|
||||
shadow: true,
|
||||
mini: o.mini
|
||||
mini: mini
|
||||
});
|
||||
|
||||
toggleClear();
|
||||
|
@ -7507,7 +7411,7 @@ var defaultFilterCallback = function( text, searchValue, item ) {
|
|||
|
||||
$.mobile.listview.prototype.options.filterCallback = defaultFilterCallback;
|
||||
|
||||
$( document ).delegate( "ul, ol", "listviewcreate", function() {
|
||||
$( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function() {
|
||||
|
||||
var list = $( this ),
|
||||
listview = list.data( "listview" );
|
||||
|
@ -7519,9 +7423,6 @@ $( document ).delegate( "ul, ol", "listviewcreate", function() {
|
|||
var wrapper = $( "<form>", {
|
||||
"class": "ui-listview-filter ui-bar-" + listview.options.filterTheme,
|
||||
"role": "search"
|
||||
}).submit( function( e ) {
|
||||
e.preventDefault();
|
||||
search.blur();
|
||||
}),
|
||||
search = $( "<input>", {
|
||||
placeholder: listview.options.filterPlaceholder
|
||||
|
@ -7617,6 +7518,8 @@ $( document ).delegate( "ul, ol", "listviewcreate", function() {
|
|||
(function( $, undefined ) {
|
||||
|
||||
$.widget( "mobile.slider", $.mobile.widget, {
|
||||
widgetEventPrefix: "slide",
|
||||
|
||||
options: {
|
||||
theme: null,
|
||||
trackTheme: null,
|
||||
|
@ -7914,9 +7817,6 @@ $.widget( "mobile.slider", $.mobile.widget, {
|
|||
}
|
||||
});
|
||||
|
||||
if ( this._handleFormReset ) {
|
||||
this._handleFormReset();
|
||||
}
|
||||
this.refresh( undefined, undefined, true );
|
||||
},
|
||||
|
||||
|
@ -7931,11 +7831,6 @@ $.widget( "mobile.slider", $.mobile.widget, {
|
|||
parseFloat( this.element.val() ) : this.element[0].selectedIndex;
|
||||
},
|
||||
|
||||
|
||||
_reset: function() {
|
||||
this.refresh( undefined, false, true );
|
||||
},
|
||||
|
||||
refresh: function( val, isfromControl, preventInputUpdate ) {
|
||||
|
||||
// NOTE: we don't return here because we want to support programmatic
|
||||
|
@ -8057,13 +7952,6 @@ $.widget( "mobile.slider", $.mobile.widget, {
|
|||
|
||||
});
|
||||
|
||||
$.widget( "mobile.slider", $.mobile.slider, $.mobile.behaviors.formReset );
|
||||
|
||||
// FIXME: Move the declaration of widgetEventPrefix back to the top of the
|
||||
// initial declaration of the slider widget once we start using a version of
|
||||
// the widget factory that includes a fix for http://bugs.jqueryui.com/ticket/8724
|
||||
$.widget( "mobile.slider", $.mobile.slider, { widgetEventPrefix: "slide" } );
|
||||
|
||||
//auto self-init widgets
|
||||
$( document ).bind( "pagecreate create", function( e ) {
|
||||
$.mobile.slider.prototype.enhanceWithin( e.target, true );
|
||||
|
@ -8139,14 +8027,6 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
|
|||
}
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
var wrapper = this.element.parents( ".ui-select" );
|
||||
if ( wrapper.length > 0 ) {
|
||||
this.element.insertAfter( wrapper );
|
||||
wrapper.remove();
|
||||
}
|
||||
},
|
||||
|
||||
_create: function() {
|
||||
this._preExtension();
|
||||
|
||||
|
@ -8212,9 +8092,6 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
|
|||
self.refresh();
|
||||
});
|
||||
|
||||
if ( this._handleFormReset ) {
|
||||
this._handleFormReset();
|
||||
}
|
||||
this.build();
|
||||
},
|
||||
|
||||
|
@ -8251,32 +8128,15 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
|
|||
// In many situations, iOS will zoom into the select upon tap, this prevents that from happening
|
||||
self.button.bind( "vmousedown", function() {
|
||||
if ( self.options.preventFocusZoom ) {
|
||||
$.mobile.zoom.disable( true );
|
||||
$.mobile.zoom.disable( true );
|
||||
}
|
||||
});
|
||||
self.label.bind( "click focus", function() {
|
||||
}).bind( "mouseup", function() {
|
||||
if ( self.options.preventFocusZoom ) {
|
||||
$.mobile.zoom.disable( true );
|
||||
}
|
||||
});
|
||||
self.select.bind( "focus", function() {
|
||||
if ( self.options.preventFocusZoom ) {
|
||||
$.mobile.zoom.disable( true );
|
||||
}
|
||||
});
|
||||
self.button.bind( "mouseup", function() {
|
||||
if ( self.options.preventFocusZoom ) {
|
||||
setTimeout(function() {
|
||||
$.mobile.zoom.enable( true );
|
||||
}, 0 );
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
self.select.bind( "blur", function() {
|
||||
if ( self.options.preventFocusZoom ) {
|
||||
$.mobile.zoom.enable( true );
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
selected: function() {
|
||||
|
@ -8322,10 +8182,6 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
|
|||
}
|
||||
},
|
||||
|
||||
_reset: function() {
|
||||
this.refresh();
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
this.setButtonText();
|
||||
this.setButtonCount();
|
||||
|
@ -8347,8 +8203,6 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
|
|||
}
|
||||
});
|
||||
|
||||
$.widget( "mobile.selectmenu", $.mobile.selectmenu, $.mobile.behaviors.formReset );
|
||||
|
||||
//auto self-init widgets
|
||||
$( document ).bind( "pagecreate create", function( e ) {
|
||||
$.mobile.selectmenu.prototype.enhanceWithin( e.target, true );
|
||||
|
@ -8363,7 +8217,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
var extendSelect = function( widget ) {
|
||||
|
||||
var select = widget.select,
|
||||
origDestroy = widget._destroy,
|
||||
selectID = widget.selectID,
|
||||
label = widget.label,
|
||||
thisPage = widget.select.closest( ".ui-page" ),
|
||||
|
@ -8378,7 +8231,7 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
"<div data-" + $.mobile.ns + "role='content'></div>"+
|
||||
"</div>" ),
|
||||
|
||||
listbox = $( "<div>", { "class": "ui-selectmenu" } ).insertAfter( widget.select ).popup( { theme: widget.options.overlayTheme } ),
|
||||
listbox = $( "<div>", { "class": "ui-selectmenu" } ).insertAfter( widget.select ).popup( { theme: "a" } ),
|
||||
|
||||
list = $( "<ul>", {
|
||||
"class": "ui-selectmenu-list",
|
||||
|
@ -8433,17 +8286,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
// Create list from select, update state
|
||||
self.refresh();
|
||||
|
||||
if ( self._origTabIndex === undefined ) {
|
||||
self._origTabIndex = self.select.attr( "tabindex" );
|
||||
// Map undefined to false, because self._origTabIndex === undefined
|
||||
// indicates that we have not yet checked whether the select has
|
||||
// originally had a tabindex attribute, whereas false indicates that
|
||||
// we have checked the select for such an attribute, and have found
|
||||
// none present.
|
||||
if ( self._origTabIndex === undefined ) {
|
||||
self._origTabIndex = false;
|
||||
}
|
||||
}
|
||||
self.select.attr( "tabindex", "-1" ).focus(function() {
|
||||
$( this ).blur();
|
||||
self.button.focus();
|
||||
|
@ -8726,14 +8568,10 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
});
|
||||
}
|
||||
|
||||
self.menuPage
|
||||
.one( "pageshow", function() {
|
||||
focusMenuItem();
|
||||
self.isOpen = true;
|
||||
})
|
||||
.one( "pagehide", function() {
|
||||
self.isOpen = false;
|
||||
});
|
||||
self.menuPage.one( "pageshow", function() {
|
||||
focusMenuItem();
|
||||
self.isOpen = true;
|
||||
});
|
||||
|
||||
self.menuType = "page";
|
||||
self.menuPageContent.append( self.list );
|
||||
|
@ -8808,17 +8646,12 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
needPlaceholder = false;
|
||||
isPlaceholderItem = true;
|
||||
|
||||
// If we have identified a placeholder, record the fact that it was
|
||||
// us who have added the placeholder to the option and mark it
|
||||
// retroactively in the select as well
|
||||
if ( !option.hasAttribute( dataPlaceholderAttr ) ) {
|
||||
this._removePlaceholderAttr = true;
|
||||
}
|
||||
// If we have identified a placeholder, mark it retroactively in the select as well
|
||||
option.setAttribute( dataPlaceholderAttr, true );
|
||||
if ( o.hidePlaceholderMenuItems ) {
|
||||
classes.push( "ui-selectmenu-placeholder" );
|
||||
}
|
||||
if ( placeholder !== text ) {
|
||||
if (!placeholder) {
|
||||
placeholder = self.placeholder = text;
|
||||
}
|
||||
}
|
||||
|
@ -8864,30 +8697,6 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
// TODO value is undefined at creation
|
||||
"aria-owns": this.menuId
|
||||
});
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
this.close();
|
||||
|
||||
// Restore the tabindex attribute to its original value
|
||||
if ( this._origTabIndex !== undefined ) {
|
||||
if ( this._origTabIndex !== false ) {
|
||||
this.select.attr( "tabindex", this._origTabIndex );
|
||||
} else {
|
||||
this.select.removeAttr( "tabindex" );
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the placeholder attribute if we were the ones to add it
|
||||
if ( this._removePlaceholderAttr ) {
|
||||
this._selectOptions().removeAttr( "data-" + $.mobile.ns + "placeholder" );
|
||||
}
|
||||
|
||||
// Remove the popup
|
||||
this.listbox.remove();
|
||||
|
||||
// Chain up
|
||||
origDestroy.apply( this, arguments );
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -9150,13 +8959,9 @@ $( document ).bind( "pagecreate create", function( e ) {
|
|||
});
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
var $el = this.element,
|
||||
header = $el.is( ".ui-header" );
|
||||
|
||||
$el.closest( ".ui-page" ).css( "padding-" + ( header ? "top" : "bottom" ), "" );
|
||||
$el.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
|
||||
$el.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
|
||||
destroy: function() {
|
||||
this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
|
||||
this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
|
||||
}
|
||||
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -41,6 +41,8 @@ window.OpenLP = {
|
|||
$.getJSON(
|
||||
"/api/plugin/search",
|
||||
function (data, status) {
|
||||
console.log(data);
|
||||
console.log(status);
|
||||
var select = $("#search-plugin");
|
||||
select.html("");
|
||||
$.each(data.results.items, function (idx, value) {
|
||||
|
@ -345,40 +347,42 @@ $(document).bind("mobileinit", function(){
|
|||
$.mobile.defaultPageTransition = "none";
|
||||
});
|
||||
// Service Manager
|
||||
$("#service-manager").live("pagebeforeshow", OpenLP.loadService);
|
||||
$("#service-refresh").live("click", OpenLP.loadService);
|
||||
$("#service-next").live("click", OpenLP.nextItem);
|
||||
$("#service-previous").live("click", OpenLP.previousItem);
|
||||
$("#service-blank").live("click", OpenLP.blankDisplay);
|
||||
$("#service-theme").live("click", OpenLP.themeDisplay);
|
||||
$("#service-desktop").live("click", OpenLP.desktopDisplay);
|
||||
$("#service-show").live("click", OpenLP.showDisplay);
|
||||
$("#service-manager").on("pagebeforeshow", OpenLP.loadService);
|
||||
$("#service-refresh").on("click", OpenLP.loadService);
|
||||
$("#service-next").on("click", OpenLP.nextItem);
|
||||
$("#service-previous").on("click", OpenLP.previousItem);
|
||||
$("#service-blank").on("click", OpenLP.blankDisplay);
|
||||
$("#service-theme").on("click", OpenLP.themeDisplay);
|
||||
$("#service-desktop").on("click", OpenLP.desktopDisplay);
|
||||
$("#service-show").on("click", OpenLP.showDisplay);
|
||||
// Slide Controller
|
||||
$("#slide-controller").live("pagebeforeshow", OpenLP.loadController);
|
||||
$("#controller-refresh").live("click", OpenLP.loadController);
|
||||
$("#controller-next").live("click", OpenLP.nextSlide);
|
||||
$("#controller-previous").live("click", OpenLP.previousSlide);
|
||||
$("#controller-blank").live("click", OpenLP.blankDisplay);
|
||||
$("#controller-theme").live("click", OpenLP.themeDisplay);
|
||||
$("#controller-desktop").live("click", OpenLP.desktopDisplay);
|
||||
$("#controller-show").live("click", OpenLP.showDisplay);
|
||||
$("#slide-controller").on("pagebeforeshow", OpenLP.loadController);
|
||||
$("#controller-refresh").on("click", OpenLP.loadController);
|
||||
$("#controller-next").on("click", OpenLP.nextSlide);
|
||||
$("#controller-previous").on("click", OpenLP.previousSlide);
|
||||
$("#controller-blank").on("click", OpenLP.blankDisplay);
|
||||
$("#controller-theme").on("click", OpenLP.themeDisplay);
|
||||
$("#controller-desktop").on("click", OpenLP.desktopDisplay);
|
||||
$("#controller-show").on("click", OpenLP.showDisplay);
|
||||
// Alerts
|
||||
$("#alert-submit").live("click", OpenLP.showAlert);
|
||||
$("#alert-submit").on("click", OpenLP.showAlert);
|
||||
// Search
|
||||
$("#search-submit").live("click", OpenLP.search);
|
||||
$("#search-text").live("keypress", function(event) {
|
||||
$("#search-submit").on("click", OpenLP.search);
|
||||
$("#search-text").on("keypress", function(event) {
|
||||
if (event.which == 13)
|
||||
{
|
||||
OpenLP.search(event);
|
||||
}
|
||||
});
|
||||
$("#go-live").live("click", OpenLP.goLive);
|
||||
$("#add-to-service").live("click", OpenLP.addToService);
|
||||
$("#add-and-go-to-service").live("click", OpenLP.addAndGoToService);
|
||||
$("#go-live").on("click", OpenLP.goLive);
|
||||
$("#add-to-service").on("click", OpenLP.addToService);
|
||||
$("#add-and-go-to-service").on("click", OpenLP.addAndGoToService);
|
||||
// Poll the server twice a second to get any updates.
|
||||
$.ajaxSetup({cache: false});
|
||||
$("#search").live("pageinit", function (event) {
|
||||
console.log("hook");
|
||||
$("#search").on("pageinit", function (event) {
|
||||
console.log("Page init!");
|
||||
OpenLP.getSearchablePlugins();
|
||||
});
|
||||
setInterval("OpenLP.pollServer();", 500);
|
||||
setInterval(OpenLP.pollServer, 500);
|
||||
OpenLP.pollServer();
|
||||
|
|
Loading…
Reference in New Issue