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