Initial Commit
This commit is contained in:
25
node_modules/jquery/src/manipulation/_evalUrl.js
generated
vendored
Normal file
25
node_modules/jquery/src/manipulation/_evalUrl.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { jQuery } from "../ajax.js";
|
||||
|
||||
jQuery._evalUrl = function( url, options, doc ) {
|
||||
return jQuery.ajax( {
|
||||
url: url,
|
||||
|
||||
// Make this explicit, since user can override this through ajaxSetup (trac-11264)
|
||||
type: "GET",
|
||||
dataType: "script",
|
||||
cache: true,
|
||||
async: false,
|
||||
global: false,
|
||||
scriptAttrs: options.crossOrigin ? { "crossOrigin": options.crossOrigin } : undefined,
|
||||
|
||||
// Only evaluate the response if it is successful (gh-4126)
|
||||
// dataFilter is not invoked for failure responses, so using it instead
|
||||
// of the default converter is kludgy but it works.
|
||||
converters: {
|
||||
"text script": function() {}
|
||||
},
|
||||
dataFilter: function( response ) {
|
||||
jQuery.globalEval( response, options, doc );
|
||||
}
|
||||
} );
|
||||
};
|
||||
97
node_modules/jquery/src/manipulation/buildFragment.js
generated
vendored
Normal file
97
node_modules/jquery/src/manipulation/buildFragment.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { toType } from "../core/toType.js";
|
||||
import { isAttached } from "../core/isAttached.js";
|
||||
import { arr } from "../var/arr.js";
|
||||
import { rtagName } from "./var/rtagName.js";
|
||||
import { rscriptType } from "./var/rscriptType.js";
|
||||
import { wrapMap } from "./wrapMap.js";
|
||||
import { getAll } from "./getAll.js";
|
||||
import { setGlobalEval } from "./setGlobalEval.js";
|
||||
import { isArrayLike } from "../core/isArrayLike.js";
|
||||
|
||||
var rhtml = /<|&#?\w+;/;
|
||||
|
||||
export function buildFragment( elems, context, scripts, selection, ignored ) {
|
||||
var elem, tmp, tag, wrap, attached, j,
|
||||
fragment = context.createDocumentFragment(),
|
||||
nodes = [],
|
||||
i = 0,
|
||||
l = elems.length;
|
||||
|
||||
for ( ; i < l; i++ ) {
|
||||
elem = elems[ i ];
|
||||
|
||||
if ( elem || elem === 0 ) {
|
||||
|
||||
// Add nodes directly
|
||||
if ( toType( elem ) === "object" && ( elem.nodeType || isArrayLike( elem ) ) ) {
|
||||
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
|
||||
|
||||
// Convert non-html into a text node
|
||||
} else if ( !rhtml.test( elem ) ) {
|
||||
nodes.push( context.createTextNode( elem ) );
|
||||
|
||||
// Convert html into DOM nodes
|
||||
} else {
|
||||
tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
|
||||
|
||||
// Deserialize a standard representation
|
||||
tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
|
||||
wrap = wrapMap[ tag ] || arr;
|
||||
|
||||
// Create wrappers & descend into them.
|
||||
j = wrap.length;
|
||||
while ( --j > -1 ) {
|
||||
tmp = tmp.appendChild( context.createElement( wrap[ j ] ) );
|
||||
}
|
||||
|
||||
tmp.innerHTML = jQuery.htmlPrefilter( elem );
|
||||
|
||||
jQuery.merge( nodes, tmp.childNodes );
|
||||
|
||||
// Remember the top-level container
|
||||
tmp = fragment.firstChild;
|
||||
|
||||
// Ensure the created nodes are orphaned (trac-12392)
|
||||
tmp.textContent = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove wrapper from fragment
|
||||
fragment.textContent = "";
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
attached = isAttached( elem );
|
||||
|
||||
// Append to fragment
|
||||
tmp = getAll( fragment.appendChild( elem ), "script" );
|
||||
|
||||
// Preserve script evaluation history
|
||||
if ( attached ) {
|
||||
setGlobalEval( tmp );
|
||||
}
|
||||
|
||||
// Capture executables
|
||||
if ( scripts ) {
|
||||
j = 0;
|
||||
while ( ( elem = tmp[ j++ ] ) ) {
|
||||
if ( rscriptType.test( elem.type || "" ) ) {
|
||||
scripts.push( elem );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fragment;
|
||||
}
|
||||
107
node_modules/jquery/src/manipulation/domManip.js
generated
vendored
Normal file
107
node_modules/jquery/src/manipulation/domManip.js
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { flat } from "../var/flat.js";
|
||||
import { rscriptType } from "./var/rscriptType.js";
|
||||
import { getAll } from "./getAll.js";
|
||||
import { buildFragment } from "./buildFragment.js";
|
||||
import { dataPriv } from "../data/var/dataPriv.js";
|
||||
import { DOMEval } from "../core/DOMEval.js";
|
||||
|
||||
// Replace/restore the type attribute of script elements for safe DOM manipulation
|
||||
function disableScript( elem ) {
|
||||
elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
|
||||
return elem;
|
||||
}
|
||||
function restoreScript( elem ) {
|
||||
if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
|
||||
elem.type = elem.type.slice( 5 );
|
||||
} else {
|
||||
elem.removeAttribute( "type" );
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
export function domManip( collection, args, callback, ignored ) {
|
||||
|
||||
// Flatten any nested arrays
|
||||
args = flat( args );
|
||||
|
||||
var fragment, first, scripts, hasScripts, node, doc,
|
||||
i = 0,
|
||||
l = collection.length,
|
||||
iNoClone = l - 1,
|
||||
value = args[ 0 ],
|
||||
valueIsFunction = typeof value === "function";
|
||||
|
||||
if ( valueIsFunction ) {
|
||||
return collection.each( function( index ) {
|
||||
var self = collection.eq( index );
|
||||
args[ 0 ] = value.call( this, index, self.html() );
|
||||
domManip( self, args, callback, ignored );
|
||||
} );
|
||||
}
|
||||
|
||||
if ( l ) {
|
||||
fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
|
||||
first = fragment.firstChild;
|
||||
|
||||
if ( fragment.childNodes.length === 1 ) {
|
||||
fragment = first;
|
||||
}
|
||||
|
||||
// Require either new content or an interest in ignored elements to invoke the callback
|
||||
if ( first || ignored ) {
|
||||
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
|
||||
hasScripts = scripts.length;
|
||||
|
||||
// Use the original fragment for the last item
|
||||
// instead of the first because it can end up
|
||||
// being emptied incorrectly in certain situations (trac-8070).
|
||||
for ( ; i < l; i++ ) {
|
||||
node = fragment;
|
||||
|
||||
if ( i !== iNoClone ) {
|
||||
node = jQuery.clone( node, true, true );
|
||||
|
||||
// Keep references to cloned scripts for later restoration
|
||||
if ( hasScripts ) {
|
||||
jQuery.merge( scripts, getAll( node, "script" ) );
|
||||
}
|
||||
}
|
||||
|
||||
callback.call( collection[ i ], node, i );
|
||||
}
|
||||
|
||||
if ( hasScripts ) {
|
||||
doc = scripts[ scripts.length - 1 ].ownerDocument;
|
||||
|
||||
// Re-enable scripts
|
||||
jQuery.map( scripts, restoreScript );
|
||||
|
||||
// Evaluate executable scripts on first document insertion
|
||||
for ( i = 0; i < hasScripts; i++ ) {
|
||||
node = scripts[ i ];
|
||||
if ( rscriptType.test( node.type || "" ) &&
|
||||
!dataPriv.get( node, "globalEval" ) &&
|
||||
jQuery.contains( doc, node ) ) {
|
||||
|
||||
if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
|
||||
|
||||
// Optional AJAX dependency, but won't run scripts if not present
|
||||
if ( jQuery._evalUrl && !node.noModule ) {
|
||||
jQuery._evalUrl( node.src, {
|
||||
nonce: node.nonce,
|
||||
crossOrigin: node.crossOrigin
|
||||
}, doc );
|
||||
}
|
||||
} else {
|
||||
DOMEval( node.textContent, node, doc );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return collection;
|
||||
}
|
||||
28
node_modules/jquery/src/manipulation/getAll.js
generated
vendored
Normal file
28
node_modules/jquery/src/manipulation/getAll.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { nodeName } from "../core/nodeName.js";
|
||||
import { arr } from "../var/arr.js";
|
||||
|
||||
export function getAll( context, tag ) {
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
|
||||
var ret;
|
||||
|
||||
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
||||
|
||||
// Use slice to snapshot the live collection from gEBTN
|
||||
ret = arr.slice.call( context.getElementsByTagName( tag || "*" ) );
|
||||
|
||||
} else if ( typeof context.querySelectorAll !== "undefined" ) {
|
||||
ret = context.querySelectorAll( tag || "*" );
|
||||
|
||||
} else {
|
||||
ret = [];
|
||||
}
|
||||
|
||||
if ( tag === undefined || tag && nodeName( context, tag ) ) {
|
||||
return jQuery.merge( [ context ], ret );
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
15
node_modules/jquery/src/manipulation/setGlobalEval.js
generated
vendored
Normal file
15
node_modules/jquery/src/manipulation/setGlobalEval.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { dataPriv } from "../data/var/dataPriv.js";
|
||||
|
||||
// Mark scripts as having already been evaluated
|
||||
export function setGlobalEval( elems, refElements ) {
|
||||
var i = 0,
|
||||
l = elems.length;
|
||||
|
||||
for ( ; i < l; i++ ) {
|
||||
dataPriv.set(
|
||||
elems[ i ],
|
||||
"globalEval",
|
||||
!refElements || dataPriv.get( refElements[ i ], "globalEval" )
|
||||
);
|
||||
}
|
||||
}
|
||||
1
node_modules/jquery/src/manipulation/var/rscriptType.js
generated
vendored
Normal file
1
node_modules/jquery/src/manipulation/var/rscriptType.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
|
||||
4
node_modules/jquery/src/manipulation/var/rtagName.js
generated
vendored
Normal file
4
node_modules/jquery/src/manipulation/var/rtagName.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
// rtagName captures the name from the first start tag in a string of HTML
|
||||
// https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state
|
||||
// https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state
|
||||
export var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
|
||||
15
node_modules/jquery/src/manipulation/wrapMap.js
generated
vendored
Normal file
15
node_modules/jquery/src/manipulation/wrapMap.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export var wrapMap = {
|
||||
|
||||
// Table parts need to be wrapped with `<table>` or they're
|
||||
// stripped to their contents when put in a div.
|
||||
// XHTML parsers do not magically insert elements in the
|
||||
// same way that tag soup parsers do, so we cannot shorten
|
||||
// this by omitting <tbody> or other required elements.
|
||||
thead: [ "table" ],
|
||||
col: [ "colgroup", "table" ],
|
||||
tr: [ "tbody", "table" ],
|
||||
td: [ "tr", "tbody", "table" ]
|
||||
};
|
||||
|
||||
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
||||
wrapMap.th = wrapMap.td;
|
||||
Reference in New Issue
Block a user