From ffb671c61a24a9086343b54bad080e145ff33fc5 Mon Sep 17 00:00:00 2001 From: Dererk Date: Tue, 15 Nov 2016 14:18:46 -0300 Subject: New upstream version 7.8.1 --- .../jquery/src/manipulation/_evalUrl.js | 11 +- .../jquery/src/manipulation/buildFragment.js | 157 +++++++++++++++++++++ .../jquery/src/manipulation/createSafeFragment.js | 20 +++ bower_components/jquery/src/manipulation/getAll.js | 33 +++++ .../jquery/src/manipulation/setGlobalEval.js | 19 +++ .../jquery/src/manipulation/support.js | 58 ++++---- .../jquery/src/manipulation/var/nodeNames.js | 5 + .../jquery/src/manipulation/var/rcheckableType.js | 6 +- .../src/manipulation/var/rleadingWhitespace.js | 3 + .../jquery/src/manipulation/var/rscriptType.js | 3 + .../jquery/src/manipulation/var/rtagName.js | 3 + .../jquery/src/manipulation/wrapMap.js | 30 ++++ 12 files changed, 310 insertions(+), 38 deletions(-) create mode 100644 bower_components/jquery/src/manipulation/buildFragment.js create mode 100644 bower_components/jquery/src/manipulation/createSafeFragment.js create mode 100644 bower_components/jquery/src/manipulation/getAll.js create mode 100644 bower_components/jquery/src/manipulation/setGlobalEval.js create mode 100644 bower_components/jquery/src/manipulation/var/nodeNames.js create mode 100644 bower_components/jquery/src/manipulation/var/rleadingWhitespace.js create mode 100644 bower_components/jquery/src/manipulation/var/rscriptType.js create mode 100644 bower_components/jquery/src/manipulation/var/rtagName.js create mode 100644 bower_components/jquery/src/manipulation/wrapMap.js (limited to 'bower_components/jquery/src/manipulation') diff --git a/bower_components/jquery/src/manipulation/_evalUrl.js b/bower_components/jquery/src/manipulation/_evalUrl.js index 6704749..572fe30 100644 --- a/bower_components/jquery/src/manipulation/_evalUrl.js +++ b/bower_components/jquery/src/manipulation/_evalUrl.js @@ -1,18 +1,21 @@ -define([ +define( [ "../ajax" ], function( jQuery ) { jQuery._evalUrl = function( url ) { - return jQuery.ajax({ + return jQuery.ajax( { url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) type: "GET", dataType: "script", + cache: true, async: false, global: false, "throws": true - }); + } ); }; return jQuery._evalUrl; -}); +} ); diff --git a/bower_components/jquery/src/manipulation/buildFragment.js b/bower_components/jquery/src/manipulation/buildFragment.js new file mode 100644 index 0000000..df58bc8 --- /dev/null +++ b/bower_components/jquery/src/manipulation/buildFragment.js @@ -0,0 +1,157 @@ +define( [ + "../core", + "./var/rcheckableType", + "./var/rtagName", + "./var/rscriptType", + "./var/rleadingWhitespace", + "./createSafeFragment", + "./wrapMap", + "./getAll", + "./setGlobalEval", + "./support" +], function( jQuery, rcheckableType, rtagName, rscriptType, rleadingWhitespace, + createSafeFragment, wrapMap, getAll, setGlobalEval, support ) { + +var rhtml = /<|&#?\w+;/, + rtbody = / from table fragments + if ( !support.tbody ) { + + // String was a , *may* have spurious + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare or + wrap[ 1 ] === "
" && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && + !tbody.childNodes.length ) { + + elem.removeChild( tbody ); + } + } + } + + jQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !support.appendChecked ) { + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + tmp = null; + + return safe; +} + +return buildFragment; +} ); diff --git a/bower_components/jquery/src/manipulation/createSafeFragment.js b/bower_components/jquery/src/manipulation/createSafeFragment.js new file mode 100644 index 0000000..5b766d4 --- /dev/null +++ b/bower_components/jquery/src/manipulation/createSafeFragment.js @@ -0,0 +1,20 @@ +define( [ + "./var/nodeNames" +], function( nodeNames ) { + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +return createSafeFragment; +} ); diff --git a/bower_components/jquery/src/manipulation/getAll.js b/bower_components/jquery/src/manipulation/getAll.js new file mode 100644 index 0000000..d049b79 --- /dev/null +++ b/bower_components/jquery/src/manipulation/getAll.js @@ -0,0 +1,33 @@ +define( [ + "../core" +], function( jQuery ) { + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== "undefined" ? + context.querySelectorAll( tag || "*" ) : + undefined; + + if ( !found ) { + for ( found = [], elems = context.childNodes || context; + ( elem = elems[ i ] ) != null; + i++ + ) { + if ( !tag || jQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + jQuery.merge( found, getAll( elem, tag ) ); + } + } + } + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], found ) : + found; +} + +return getAll; +} ); diff --git a/bower_components/jquery/src/manipulation/setGlobalEval.js b/bower_components/jquery/src/manipulation/setGlobalEval.js new file mode 100644 index 0000000..277a8e8 --- /dev/null +++ b/bower_components/jquery/src/manipulation/setGlobalEval.js @@ -0,0 +1,19 @@ +define( [ + "../core" +], function( jQuery ) { + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; ( elem = elems[ i ] ) != null; i++ ) { + jQuery._data( + elem, + "globalEval", + !refElements || jQuery._data( refElements[ i ], "globalEval" ) + ); + } +} + +return setGlobalEval; +} ); diff --git a/bower_components/jquery/src/manipulation/support.js b/bower_components/jquery/src/manipulation/support.js index 2567d7e..4147a33 100644 --- a/bower_components/jquery/src/manipulation/support.js +++ b/bower_components/jquery/src/manipulation/support.js @@ -1,12 +1,13 @@ -define([ +define( [ + "../core", + "../var/document", "../var/support" -], function( support ) { +], function( jQuery, document, support ) { -(function() { - // Minified: var a,b,c - var input = document.createElement( "input" ), - div = document.createElement( "div" ), - fragment = document.createDocumentFragment(); +( function() { + var div = document.createElement( "div" ), + fragment = document.createDocumentFragment(), + input = document.createElement( "input" ); // Setup div.innerHTML = "
a"; @@ -41,36 +42,31 @@ define([ // #11217 - WebKit loses check when the name is after the checked attribute fragment.appendChild( div ); - div.innerHTML = ""; + + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input = document.createElement( "input" ); + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // old WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - support.noCloneEvent = true; - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } -})(); + // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ + support.noCloneEvent = !!div.addEventListener; + + // Support: IE<9 + // Since attributes and properties are the same in IE, + // cleanData must set properties to undefined rather than use removeAttribute + div[ jQuery.expando ] = 1; + support.attributes = !div.getAttribute( jQuery.expando ); +} )(); return support; -}); +} ); diff --git a/bower_components/jquery/src/manipulation/var/nodeNames.js b/bower_components/jquery/src/manipulation/var/nodeNames.js new file mode 100644 index 0000000..05bb604 --- /dev/null +++ b/bower_components/jquery/src/manipulation/var/nodeNames.js @@ -0,0 +1,5 @@ +define( function() { + return "abbr|article|aside|audio|bdi|canvas|data|datalist|" + + "details|dialog|figcaption|figure|footer|header|hgroup|main|" + + "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; +} ); diff --git a/bower_components/jquery/src/manipulation/var/rcheckableType.js b/bower_components/jquery/src/manipulation/var/rcheckableType.js index c27a15d..4c95394 100644 --- a/bower_components/jquery/src/manipulation/var/rcheckableType.js +++ b/bower_components/jquery/src/manipulation/var/rcheckableType.js @@ -1,3 +1,3 @@ -define(function() { - return (/^(?:checkbox|radio)$/i); -}); +define( function() { + return ( /^(?:checkbox|radio)$/i ); +} ); diff --git a/bower_components/jquery/src/manipulation/var/rleadingWhitespace.js b/bower_components/jquery/src/manipulation/var/rleadingWhitespace.js new file mode 100644 index 0000000..96ef95f --- /dev/null +++ b/bower_components/jquery/src/manipulation/var/rleadingWhitespace.js @@ -0,0 +1,3 @@ +define( function() { + return ( /^\s+/ ); +} ); diff --git a/bower_components/jquery/src/manipulation/var/rscriptType.js b/bower_components/jquery/src/manipulation/var/rscriptType.js new file mode 100644 index 0000000..0c77c8a --- /dev/null +++ b/bower_components/jquery/src/manipulation/var/rscriptType.js @@ -0,0 +1,3 @@ +define( function() { + return ( /^$|\/(?:java|ecma)script/i ); +} ); diff --git a/bower_components/jquery/src/manipulation/var/rtagName.js b/bower_components/jquery/src/manipulation/var/rtagName.js new file mode 100644 index 0000000..9e54269 --- /dev/null +++ b/bower_components/jquery/src/manipulation/var/rtagName.js @@ -0,0 +1,3 @@ +define( function() { + return ( /<([\w:-]+)/ ); +} ); diff --git a/bower_components/jquery/src/manipulation/wrapMap.js b/bower_components/jquery/src/manipulation/wrapMap.js new file mode 100644 index 0000000..d40685a --- /dev/null +++ b/bower_components/jquery/src/manipulation/wrapMap.js @@ -0,0 +1,30 @@ +define( [ + "./support" +], function( support ) { + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + area: [ 1, "", "" ], + + // Support: IE8 + param: [ 1, "", "" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + col: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] +}; + +// Support: IE8-IE9 +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +return wrapMap; +} ); -- cgit v1.2.3