aboutsummaryrefslogtreecommitdiffstats
path: root/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2018-07-06 05:16:40 -0400
committerxudan <xudan16@huawei.com>2018-07-06 05:21:42 -0400
commitb3e40f026d655501bfa581452c447784604ecb05 (patch)
tree406f8bfc1abc1b33f98153d03abd34ef7b0e2fe9 /3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation
parentb1b0ea32d1a296c7d055c5391261dcad6be48c63 (diff)
Move all web portal code to the new repo dovetail-webportal
This is only the first step to simply copy the file here. There still need some more work to make sure all work well. All the changes will be submitted with other patches to make it easily to review. JIRA: DOVETAIL-671 Change-Id: I64d32a9df562184166b6199e2719f298687d1a0a Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to '3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation')
-rw-r--r--3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/_evalUrl.js23
-rw-r--r--3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/buildFragment.js104
-rw-r--r--3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/getAll.js32
-rw-r--r--3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/setGlobalEval.js22
-rw-r--r--3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/support.js35
-rw-r--r--3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/wrapMap.js29
6 files changed, 245 insertions, 0 deletions
diff --git a/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/_evalUrl.js b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/_evalUrl.js
new file mode 100644
index 0000000..f9ec702
--- /dev/null
+++ b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/_evalUrl.js
@@ -0,0 +1,23 @@
+define( [
+ "../ajax"
+], function( jQuery ) {
+
+"use strict";
+
+jQuery._evalUrl = function( url ) {
+ 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/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/buildFragment.js b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/buildFragment.js
new file mode 100644
index 0000000..bcb5085
--- /dev/null
+++ b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/buildFragment.js
@@ -0,0 +1,104 @@
+define( [
+ "../core",
+ "./var/rtagName",
+ "./var/rscriptType",
+ "./wrapMap",
+ "./getAll",
+ "./setGlobalEval"
+], function( jQuery, rtagName, rscriptType, wrapMap, getAll, setGlobalEval ) {
+
+"use strict";
+
+var rhtml = /<|&#?\w+;/;
+
+function buildFragment( elems, context, scripts, selection, ignored ) {
+ var elem, tmp, tag, wrap, contains, 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 ( jQuery.type( elem ) === "object" ) {
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
+ 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 ] || wrapMap._default;
+ tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
+
+ // Descend through wrappers to the right content
+ j = wrap[ 0 ];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Remember the top-level container
+ tmp = fragment.firstChild;
+
+ // Ensure the created nodes are orphaned (#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;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( fragment.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 );
+ }
+ }
+ }
+ }
+
+ return fragment;
+}
+
+return buildFragment;
+} );
diff --git a/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/getAll.js b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/getAll.js
new file mode 100644
index 0000000..fede6c7
--- /dev/null
+++ b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/getAll.js
@@ -0,0 +1,32 @@
+define( [
+ "../core",
+ "../core/nodeName"
+], function( jQuery, nodeName ) {
+
+"use strict";
+
+function getAll( context, tag ) {
+
+ // Support: IE <=9 - 11 only
+ // Use typeof to avoid zero-argument method invocation on host objects (#15151)
+ var ret;
+
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ ret = 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;
+}
+
+return getAll;
+} );
diff --git a/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/setGlobalEval.js b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/setGlobalEval.js
new file mode 100644
index 0000000..cf95240
--- /dev/null
+++ b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/setGlobalEval.js
@@ -0,0 +1,22 @@
+define( [
+ "../data/var/dataPriv"
+], function( dataPriv ) {
+
+"use strict";
+
+// Mark scripts as having already been evaluated
+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" )
+ );
+ }
+}
+
+return setGlobalEval;
+} );
diff --git a/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/support.js b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/support.js
new file mode 100644
index 0000000..4a5d9af
--- /dev/null
+++ b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/support.js
@@ -0,0 +1,35 @@
+define( [
+ "../var/document",
+ "../var/support"
+], function( document, support ) {
+
+"use strict";
+
+( function() {
+ var fragment = document.createDocumentFragment(),
+ div = fragment.appendChild( document.createElement( "div" ) ),
+ input = document.createElement( "input" );
+
+ // Support: Android 4.0 - 4.3 only
+ // Check state lost if the name is set (#11217)
+ // Support: Windows Web Apps (WWA)
+ // `name` and `type` must use .setAttribute for WWA (#14901)
+ input.setAttribute( "type", "radio" );
+ input.setAttribute( "checked", "checked" );
+ input.setAttribute( "name", "t" );
+
+ div.appendChild( input );
+
+ // Support: Android <=4.1 only
+ // Older WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE <=11 only
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ div.innerHTML = "<textarea>x</textarea>";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+} )();
+
+return support;
+
+} );
diff --git a/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/wrapMap.js b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/wrapMap.js
new file mode 100644
index 0000000..1f446f7
--- /dev/null
+++ b/3rd_party/static/testapi-ui/assets/lib/jquery/src/manipulation/wrapMap.js
@@ -0,0 +1,29 @@
+define( function() {
+
+"use strict";
+
+// We have to close these tags to support XHTML (#13200)
+var wrapMap = {
+
+ // Support: IE <=9 only
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+
+ // 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: [ 1, "<table>", "</table>" ],
+ col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+
+ _default: [ 0, "", "" ]
+};
+
+// Support: IE <=9 only
+wrapMap.optgroup = wrapMap.option;
+
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+return wrapMap;
+} );