corrade-http-templates – Blame information for rev 62

Subversion Repositories:
Rev:
Rev Author Line No. Line
62 office 1 define( [
2 "../core",
3 "../core/toType",
4 "./var/rtagName",
5 "./var/rscriptType",
6 "./wrapMap",
7 "./getAll",
8 "./setGlobalEval"
9 ], function( jQuery, toType, rtagName, rscriptType, wrapMap, getAll, setGlobalEval ) {
10  
11 "use strict";
12  
13 var rhtml = /<|&#?\w+;/;
14  
15 <|&#?\w+;/function buildFragment( elems, context, scripts, selection, ignored ) {
16 <|&#?\w+;/ var elem, tmp, tag, wrap, contains, j,
17 <|&#?\w+;/ fragment = context.createDocumentFragment(),
18 <|&#?\w+;/ nodes = [],
19 <|&#?\w+;/ i = 0,
20 <|&#?\w+;/ l = elems.length;
21  
22 <|&#?\w+;/ for ( ; i < l; i++ ) {
23 <|&#?\w+;/ elem = elems[ i ];
24  
25 <|&#?\w+;/ if ( elem || elem === 0 ) {
26  
27 <|&#?\w+;/ // Add nodes directly
28 <|&#?\w+;/ if ( toType( elem ) === "object" ) {
29  
30 <|&#?\w+;/ // Support: Android <=4.0 only, PhantomJS 1 only
31 <|&#?\w+;/ // push.apply(_, arraylike) throws on ancient WebKit
32 <|&#?\w+;/ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
33  
34 <|&#?\w+;/ // Convert non-html into a text node
35 <|&#?\w+;/ } else if ( !rhtml.test( elem ) ) {
36 <|&#?\w+;/ nodes.push( context.createTextNode( elem ) );
37  
38 <|&#?\w+;/ // Convert html into DOM nodes
39 <|&#?\w+;/ } else {
40 <|&#?\w+;/ tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
41  
42 <|&#?\w+;/ // Deserialize a standard representation
43 <|&#?\w+;/ tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
44 <|&#?\w+;/ wrap = wrapMap[ tag ] || wrapMap._default;
45 <|&#?\w+;/ tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
46  
47 <|&#?\w+;/ // Descend through wrappers to the right content
48 <|&#?\w+;/ j = wrap[ 0 ];
49 <|&#?\w+;/ while ( j-- ) {
50 <|&#?\w+;/ tmp = tmp.lastChild;
51 <|&#?\w+;/ }
52  
53 <|&#?\w+;/ // Support: Android <=4.0 only, PhantomJS 1 only
54 <|&#?\w+;/ // push.apply(_, arraylike) throws on ancient WebKit
55 <|&#?\w+;/ jQuery.merge( nodes, tmp.childNodes );
56  
57 <|&#?\w+;/ // Remember the top-level container
58 <|&#?\w+;/ tmp = fragment.firstChild;
59  
60 <|&#?\w+;/ // Ensure the created nodes are orphaned (#12392)
61 <|&#?\w+;/ tmp.textContent = "";
62 <|&#?\w+;/ }
63 <|&#?\w+;/ }
64 <|&#?\w+;/ }
65  
66 <|&#?\w+;/ // Remove wrapper from fragment
67 <|&#?\w+;/ fragment.textContent = "";
68  
69 <|&#?\w+;/ i = 0;
70 <|&#?\w+;/ while ( ( elem = nodes[ i++ ] ) ) {
71  
72 <|&#?\w+;/ // Skip elements already in the context collection (trac-4087)
73 <|&#?\w+;/ if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
74 <|&#?\w+;/ if ( ignored ) {
75 <|&#?\w+;/ ignored.push( elem );
76 <|&#?\w+;/ }
77 <|&#?\w+;/ continue;
78 <|&#?\w+;/ }
79  
80 <|&#?\w+;/ contains = jQuery.contains( elem.ownerDocument, elem );
81  
82 <|&#?\w+;/ // Append to fragment
83 <|&#?\w+;/ tmp = getAll( fragment.appendChild( elem ), "script" );
84  
85 <|&#?\w+;/ // Preserve script evaluation history
86 <|&#?\w+;/ if ( contains ) {
87 <|&#?\w+;/ setGlobalEval( tmp );
88 <|&#?\w+;/ }
89  
90 <|&#?\w+;/ // Capture executables
91 <|&#?\w+;/ if ( scripts ) {
92 <|&#?\w+;/ j = 0;
93 <|&#?\w+;/ while ( ( elem = tmp[ j++ ] ) ) {
94 <|&#?\w+;/ if ( rscriptType.test( elem.type || "" ) ) {
95 <|&#?\w+;/ scripts.push( elem );
96 <|&#?\w+;/ }
97 <|&#?\w+;/ }
98 <|&#?\w+;/ }
99 <|&#?\w+;/ }
100  
101 <|&#?\w+;/ return fragment;
102 <|&#?\w+;/}
103  
104 <|&#?\w+;/return buildFragment;
105 <|&#?\w+;/} );