trusty-cms 4.2.2 → 4.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/Gemfile.lock +98 -89
- data/app/assets/config/trusty-cms/manifest.js +7 -0
- data/app/assets/javascripts/admin/custom_file_upload.js +7 -0
- data/app/controllers/admin/assets_controller.rb +1 -1
- data/app/models/page.rb +2 -2
- data/app/views/admin/assets/new.html.haml +2 -0
- data/config/database.yml +4 -0
- data/config/initializers/assets.rb +0 -4
- data/coverage/index.html +155 -155
- data/lib/trusty_cms.rb +1 -1
- data/node_modules/hosted-git-info/CHANGELOG.md +10 -0
- data/node_modules/hosted-git-info/index.js +2 -2
- data/node_modules/hosted-git-info/package.json +1 -1
- data/node_modules/lodash/README.md +2 -2
- data/node_modules/lodash/_baseClone.js +2 -1
- data/node_modules/lodash/_baseOrderBy.js +17 -2
- data/node_modules/lodash/_baseSet.js +4 -0
- data/node_modules/lodash/_baseSortedIndexBy.js +7 -4
- data/node_modules/lodash/_baseTrim.js +19 -0
- data/node_modules/lodash/_equalArrays.js +5 -4
- data/node_modules/lodash/_equalObjects.js +5 -4
- data/node_modules/lodash/_trimmedEndIndex.js +19 -0
- data/node_modules/lodash/core.js +48 -6
- data/node_modules/lodash/core.min.js +9 -9
- data/node_modules/lodash/filter.js +4 -0
- data/node_modules/lodash/flake.lock +40 -0
- data/node_modules/lodash/flake.nix +20 -0
- data/node_modules/lodash/lodash.js +59 -11
- data/node_modules/lodash/lodash.min.js +126 -125
- data/node_modules/lodash/matches.js +7 -0
- data/node_modules/lodash/matchesProperty.js +7 -0
- data/node_modules/lodash/overEvery.js +4 -0
- data/node_modules/lodash/overSome.js +7 -0
- data/node_modules/lodash/package.json +1 -1
- data/node_modules/lodash/parseInt.js +1 -1
- data/node_modules/lodash/release.md +48 -0
- data/node_modules/lodash/sortBy.js +3 -3
- data/node_modules/lodash/template.js +24 -5
- data/node_modules/lodash/toNumber.js +3 -5
- data/node_modules/lodash/trim.js +2 -4
- data/node_modules/lodash/trimEnd.js +3 -5
- data/node_modules/lodash/trimStart.js +1 -1
- data/spec/dummy/log/development.log +9 -163
- data/spec/dummy/log/test.log +536 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/AUTHORS.txt +333 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/LICENSE.txt +43 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/external/jquery/jquery.js +11008 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_444444_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_555555_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_777620_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_777777_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_cc0000_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_ffffff_256x240.png +0 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/index.html +559 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.css +1312 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.js +18706 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.min.css +7 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.min.js +13 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.structure.css +886 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.structure.min.css +5 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.theme.css +443 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.theme.min.css +5 -0
- data/spec/dummy/node_modules/jquery-ui-bundle/package.json +33 -0
- data/spec/dummy/node_modules/jquery-ujs/CONTRIBUTING.md +109 -0
- data/spec/dummy/node_modules/jquery-ujs/MIT-LICENSE +20 -0
- data/spec/dummy/node_modules/jquery-ujs/README.md +86 -0
- data/spec/dummy/node_modules/jquery-ujs/RELEASE.md +23 -0
- data/spec/dummy/node_modules/jquery-ujs/bower.json +19 -0
- data/spec/dummy/node_modules/jquery-ujs/package.json +26 -0
- data/spec/dummy/node_modules/jquery-ujs/src/rails.js +555 -0
- data/spec/dummy/node_modules/jquery/AUTHORS.txt +327 -0
- data/spec/dummy/node_modules/jquery/LICENSE.txt +20 -0
- data/spec/dummy/node_modules/jquery/README.md +62 -0
- data/spec/dummy/node_modules/jquery/bower.json +14 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.js +10872 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.min.js +2 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.min.map +1 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.slim.js +8777 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.slim.min.js +2 -0
- data/spec/dummy/node_modules/jquery/dist/jquery.slim.min.map +1 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.js +2478 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/spec/dummy/node_modules/jquery/package.json +117 -0
- data/spec/dummy/node_modules/jquery/src/ajax.js +873 -0
- data/spec/dummy/node_modules/jquery/src/ajax/jsonp.js +103 -0
- data/spec/dummy/node_modules/jquery/src/ajax/load.js +77 -0
- data/spec/dummy/node_modules/jquery/src/ajax/script.js +74 -0
- data/spec/dummy/node_modules/jquery/src/ajax/var/location.js +5 -0
- data/spec/dummy/node_modules/jquery/src/ajax/var/nonce.js +5 -0
- data/spec/dummy/node_modules/jquery/src/ajax/var/rquery.js +5 -0
- data/spec/dummy/node_modules/jquery/src/ajax/xhr.js +170 -0
- data/spec/dummy/node_modules/jquery/src/attributes.js +13 -0
- data/spec/dummy/node_modules/jquery/src/attributes/attr.js +141 -0
- data/spec/dummy/node_modules/jquery/src/attributes/classes.js +186 -0
- data/spec/dummy/node_modules/jquery/src/attributes/prop.js +143 -0
- data/spec/dummy/node_modules/jquery/src/attributes/support.js +33 -0
- data/spec/dummy/node_modules/jquery/src/attributes/val.js +191 -0
- data/spec/dummy/node_modules/jquery/src/callbacks.js +236 -0
- data/spec/dummy/node_modules/jquery/src/core.js +400 -0
- data/spec/dummy/node_modules/jquery/src/core/DOMEval.js +43 -0
- data/spec/dummy/node_modules/jquery/src/core/access.js +72 -0
- data/spec/dummy/node_modules/jquery/src/core/camelCase.js +23 -0
- data/spec/dummy/node_modules/jquery/src/core/init.js +129 -0
- data/spec/dummy/node_modules/jquery/src/core/isAttached.js +26 -0
- data/spec/dummy/node_modules/jquery/src/core/nodeName.js +13 -0
- data/spec/dummy/node_modules/jquery/src/core/parseHTML.js +65 -0
- data/spec/dummy/node_modules/jquery/src/core/parseXML.js +30 -0
- data/spec/dummy/node_modules/jquery/src/core/ready-no-deferred.js +97 -0
- data/spec/dummy/node_modules/jquery/src/core/ready.js +86 -0
- data/spec/dummy/node_modules/jquery/src/core/readyException.js +13 -0
- data/spec/dummy/node_modules/jquery/src/core/stripAndCollapse.js +14 -0
- data/spec/dummy/node_modules/jquery/src/core/support.js +20 -0
- data/spec/dummy/node_modules/jquery/src/core/toType.js +20 -0
- data/spec/dummy/node_modules/jquery/src/core/var/rsingleTag.js +7 -0
- data/spec/dummy/node_modules/jquery/src/css.js +494 -0
- data/spec/dummy/node_modules/jquery/src/css/addGetHookIf.js +26 -0
- data/spec/dummy/node_modules/jquery/src/css/adjustCSS.js +74 -0
- data/spec/dummy/node_modules/jquery/src/css/curCSS.js +65 -0
- data/spec/dummy/node_modules/jquery/src/css/finalPropName.js +42 -0
- data/spec/dummy/node_modules/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/spec/dummy/node_modules/jquery/src/css/showHide.js +105 -0
- data/spec/dummy/node_modules/jquery/src/css/support.js +133 -0
- data/spec/dummy/node_modules/jquery/src/css/var/cssExpand.js +5 -0
- data/spec/dummy/node_modules/jquery/src/css/var/getStyles.js +17 -0
- data/spec/dummy/node_modules/jquery/src/css/var/isHiddenWithinTree.js +34 -0
- data/spec/dummy/node_modules/jquery/src/css/var/rboxStyle.js +7 -0
- data/spec/dummy/node_modules/jquery/src/css/var/rnumnonpx.js +7 -0
- data/spec/dummy/node_modules/jquery/src/css/var/swap.js +26 -0
- data/spec/dummy/node_modules/jquery/src/data.js +180 -0
- data/spec/dummy/node_modules/jquery/src/data/Data.js +162 -0
- data/spec/dummy/node_modules/jquery/src/data/var/acceptData.js +19 -0
- data/spec/dummy/node_modules/jquery/src/data/var/dataPriv.js +7 -0
- data/spec/dummy/node_modules/jquery/src/data/var/dataUser.js +7 -0
- data/spec/dummy/node_modules/jquery/src/deferred.js +399 -0
- data/spec/dummy/node_modules/jquery/src/deferred/exceptionHook.js +21 -0
- data/spec/dummy/node_modules/jquery/src/deprecated.js +87 -0
- data/spec/dummy/node_modules/jquery/src/deprecated/ajax-event-alias.js +22 -0
- data/spec/dummy/node_modules/jquery/src/deprecated/event.js +48 -0
- data/spec/dummy/node_modules/jquery/src/dimensions.js +57 -0
- data/spec/dummy/node_modules/jquery/src/effects.js +701 -0
- data/spec/dummy/node_modules/jquery/src/effects/Tween.js +125 -0
- data/spec/dummy/node_modules/jquery/src/effects/animatedSelector.js +15 -0
- data/spec/dummy/node_modules/jquery/src/event.js +892 -0
- data/spec/dummy/node_modules/jquery/src/event/focusin.js +58 -0
- data/spec/dummy/node_modules/jquery/src/event/support.js +11 -0
- data/spec/dummy/node_modules/jquery/src/event/trigger.js +201 -0
- data/spec/dummy/node_modules/jquery/src/exports/amd.js +26 -0
- data/spec/dummy/node_modules/jquery/src/exports/global.js +34 -0
- data/spec/dummy/node_modules/jquery/src/jquery.js +41 -0
- data/spec/dummy/node_modules/jquery/src/manipulation.js +480 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/_evalUrl.js +32 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/buildFragment.js +106 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/getAll.js +32 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/setGlobalEval.js +22 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/support.js +41 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/var/rscriptType.js +5 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/var/rtagName.js +8 -0
- data/spec/dummy/node_modules/jquery/src/manipulation/wrapMap.js +30 -0
- data/spec/dummy/node_modules/jquery/src/offset.js +238 -0
- data/spec/dummy/node_modules/jquery/src/queue.js +145 -0
- data/spec/dummy/node_modules/jquery/src/queue/delay.js +24 -0
- data/spec/dummy/node_modules/jquery/src/selector-native.js +241 -0
- data/spec/dummy/node_modules/jquery/src/selector-sizzle.js +19 -0
- data/spec/dummy/node_modules/jquery/src/selector.js +3 -0
- data/spec/dummy/node_modules/jquery/src/serialize.js +136 -0
- data/spec/dummy/node_modules/jquery/src/traversing.js +198 -0
- data/spec/dummy/node_modules/jquery/src/traversing/findFilter.js +97 -0
- data/spec/dummy/node_modules/jquery/src/traversing/var/dir.js +22 -0
- data/spec/dummy/node_modules/jquery/src/traversing/var/rneedsContext.js +8 -0
- data/spec/dummy/node_modules/jquery/src/traversing/var/siblings.js +17 -0
- data/spec/dummy/node_modules/jquery/src/var/ObjectFunctionString.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/arr.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/class2type.js +6 -0
- data/spec/dummy/node_modules/jquery/src/var/document.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/documentElement.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/flat.js +16 -0
- data/spec/dummy/node_modules/jquery/src/var/fnToString.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/getProto.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/hasOwn.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/indexOf.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/isFunction.js +13 -0
- data/spec/dummy/node_modules/jquery/src/var/isWindow.js +8 -0
- data/spec/dummy/node_modules/jquery/src/var/pnum.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/push.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/rcheckableType.js +5 -0
- data/spec/dummy/node_modules/jquery/src/var/rcssNum.js +9 -0
- data/spec/dummy/node_modules/jquery/src/var/rnothtmlwhite.js +8 -0
- data/spec/dummy/node_modules/jquery/src/var/slice.js +7 -0
- data/spec/dummy/node_modules/jquery/src/var/support.js +6 -0
- data/spec/dummy/node_modules/jquery/src/var/toString.js +7 -0
- data/spec/dummy/node_modules/jquery/src/wrap.js +78 -0
- data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +5 -0
- data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +1 -0
- data/trusty_cms.gemspec +3 -2
- data/yarn.lock +9 -9
- metadata +354 -50
@@ -0,0 +1,23 @@
|
|
1
|
+
define( [], function() {
|
2
|
+
|
3
|
+
"use strict";
|
4
|
+
|
5
|
+
// Matches dashed string for camelizing
|
6
|
+
var rmsPrefix = /^-ms-/,
|
7
|
+
rdashAlpha = /-([a-z])/g;
|
8
|
+
|
9
|
+
// Used by camelCase as callback to replace()
|
10
|
+
function fcamelCase( _all, letter ) {
|
11
|
+
return letter.toUpperCase();
|
12
|
+
}
|
13
|
+
|
14
|
+
// Convert dashed to camelCase; used by the css and data modules
|
15
|
+
// Support: IE <=9 - 11, Edge 12 - 15
|
16
|
+
// Microsoft forgot to hump their vendor prefix (#9572)
|
17
|
+
function camelCase( string ) {
|
18
|
+
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
19
|
+
}
|
20
|
+
|
21
|
+
return camelCase;
|
22
|
+
|
23
|
+
} );
|
@@ -0,0 +1,129 @@
|
|
1
|
+
// Initialize a jQuery object
|
2
|
+
define( [
|
3
|
+
"../core",
|
4
|
+
"../var/document",
|
5
|
+
"../var/isFunction",
|
6
|
+
"./var/rsingleTag",
|
7
|
+
|
8
|
+
"../traversing/findFilter"
|
9
|
+
], function( jQuery, document, isFunction, rsingleTag ) {
|
10
|
+
|
11
|
+
"use strict";
|
12
|
+
|
13
|
+
// A central reference to the root jQuery(document)
|
14
|
+
var rootjQuery,
|
15
|
+
|
16
|
+
// A simple way to check for HTML strings
|
17
|
+
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
18
|
+
// Strict HTML recognition (#11290: must start with <)
|
19
|
+
// Shortcut simple #id case for speed
|
20
|
+
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
|
21
|
+
|
22
|
+
init = jQuery.fn.init = function( selector, context, root ) {
|
23
|
+
var match, elem;
|
24
|
+
|
25
|
+
// HANDLE: $(""), $(null), $(undefined), $(false)
|
26
|
+
if ( !selector ) {
|
27
|
+
return this;
|
28
|
+
}
|
29
|
+
|
30
|
+
// Method init() accepts an alternate rootjQuery
|
31
|
+
// so migrate can support jQuery.sub (gh-2101)
|
32
|
+
root = root || rootjQuery;
|
33
|
+
|
34
|
+
// Handle HTML strings
|
35
|
+
if ( typeof selector === "string" ) {
|
36
|
+
if ( selector[ 0 ] === "<" &&
|
37
|
+
selector[ selector.length - 1 ] === ">" &&
|
38
|
+
selector.length >= 3 ) {
|
39
|
+
|
40
|
+
// Assume that strings that start and end with <> are HTML and skip the regex check
|
41
|
+
match = [ null, selector, null ];
|
42
|
+
|
43
|
+
} else {
|
44
|
+
match = rquickExpr.exec( selector );
|
45
|
+
}
|
46
|
+
|
47
|
+
// Match html or make sure no context is specified for #id
|
48
|
+
if ( match && ( match[ 1 ] || !context ) ) {
|
49
|
+
|
50
|
+
// HANDLE: $(html) -> $(array)
|
51
|
+
if ( match[ 1 ] ) {
|
52
|
+
context = context instanceof jQuery ? context[ 0 ] : context;
|
53
|
+
|
54
|
+
// Option to run scripts is true for back-compat
|
55
|
+
// Intentionally let the error be thrown if parseHTML is not present
|
56
|
+
jQuery.merge( this, jQuery.parseHTML(
|
57
|
+
match[ 1 ],
|
58
|
+
context && context.nodeType ? context.ownerDocument || context : document,
|
59
|
+
true
|
60
|
+
) );
|
61
|
+
|
62
|
+
// HANDLE: $(html, props)
|
63
|
+
if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
|
64
|
+
for ( match in context ) {
|
65
|
+
|
66
|
+
// Properties of context are called as methods if possible
|
67
|
+
if ( isFunction( this[ match ] ) ) {
|
68
|
+
this[ match ]( context[ match ] );
|
69
|
+
|
70
|
+
// ...and otherwise set as attributes
|
71
|
+
} else {
|
72
|
+
this.attr( match, context[ match ] );
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
return this;
|
78
|
+
|
79
|
+
// HANDLE: $(#id)
|
80
|
+
} else {
|
81
|
+
elem = document.getElementById( match[ 2 ] );
|
82
|
+
|
83
|
+
if ( elem ) {
|
84
|
+
|
85
|
+
// Inject the element directly into the jQuery object
|
86
|
+
this[ 0 ] = elem;
|
87
|
+
this.length = 1;
|
88
|
+
}
|
89
|
+
return this;
|
90
|
+
}
|
91
|
+
|
92
|
+
// HANDLE: $(expr, $(...))
|
93
|
+
} else if ( !context || context.jquery ) {
|
94
|
+
return ( context || root ).find( selector );
|
95
|
+
|
96
|
+
// HANDLE: $(expr, context)
|
97
|
+
// (which is just equivalent to: $(context).find(expr)
|
98
|
+
} else {
|
99
|
+
return this.constructor( context ).find( selector );
|
100
|
+
}
|
101
|
+
|
102
|
+
// HANDLE: $(DOMElement)
|
103
|
+
} else if ( selector.nodeType ) {
|
104
|
+
this[ 0 ] = selector;
|
105
|
+
this.length = 1;
|
106
|
+
return this;
|
107
|
+
|
108
|
+
// HANDLE: $(function)
|
109
|
+
// Shortcut for document ready
|
110
|
+
} else if ( isFunction( selector ) ) {
|
111
|
+
return root.ready !== undefined ?
|
112
|
+
root.ready( selector ) :
|
113
|
+
|
114
|
+
// Execute immediately if ready is not present
|
115
|
+
selector( jQuery );
|
116
|
+
}
|
117
|
+
|
118
|
+
return jQuery.makeArray( selector, this );
|
119
|
+
};
|
120
|
+
|
121
|
+
// Give the init function the jQuery prototype for later instantiation
|
122
|
+
init.prototype = jQuery.fn;
|
123
|
+
|
124
|
+
// Initialize central reference
|
125
|
+
rootjQuery = jQuery( document );
|
126
|
+
|
127
|
+
return init;
|
128
|
+
|
129
|
+
} );
|
@@ -0,0 +1,26 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../var/documentElement",
|
4
|
+
"../selector" // jQuery.contains
|
5
|
+
], function( jQuery, documentElement ) {
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
var isAttached = function( elem ) {
|
9
|
+
return jQuery.contains( elem.ownerDocument, elem );
|
10
|
+
},
|
11
|
+
composed = { composed: true };
|
12
|
+
|
13
|
+
// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
|
14
|
+
// Check attachment across shadow DOM boundaries when possible (gh-3504)
|
15
|
+
// Support: iOS 10.0-10.2 only
|
16
|
+
// Early iOS 10 versions support `attachShadow` but not `getRootNode`,
|
17
|
+
// leading to errors. We need to check for `getRootNode`.
|
18
|
+
if ( documentElement.getRootNode ) {
|
19
|
+
isAttached = function( elem ) {
|
20
|
+
return jQuery.contains( elem.ownerDocument, elem ) ||
|
21
|
+
elem.getRootNode( composed ) === elem.ownerDocument;
|
22
|
+
};
|
23
|
+
}
|
24
|
+
|
25
|
+
return isAttached;
|
26
|
+
} );
|
@@ -0,0 +1,65 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../var/document",
|
4
|
+
"./var/rsingleTag",
|
5
|
+
"../manipulation/buildFragment",
|
6
|
+
|
7
|
+
// This is the only module that needs core/support
|
8
|
+
"./support"
|
9
|
+
], function( jQuery, document, rsingleTag, buildFragment, support ) {
|
10
|
+
|
11
|
+
"use strict";
|
12
|
+
|
13
|
+
// Argument "data" should be string of html
|
14
|
+
// context (optional): If specified, the fragment will be created in this context,
|
15
|
+
// defaults to document
|
16
|
+
// keepScripts (optional): If true, will include scripts passed in the html string
|
17
|
+
jQuery.parseHTML = function( data, context, keepScripts ) {
|
18
|
+
if ( typeof data !== "string" ) {
|
19
|
+
return [];
|
20
|
+
}
|
21
|
+
if ( typeof context === "boolean" ) {
|
22
|
+
keepScripts = context;
|
23
|
+
context = false;
|
24
|
+
}
|
25
|
+
|
26
|
+
var base, parsed, scripts;
|
27
|
+
|
28
|
+
if ( !context ) {
|
29
|
+
|
30
|
+
// Stop scripts or inline event handlers from being executed immediately
|
31
|
+
// by using document.implementation
|
32
|
+
if ( support.createHTMLDocument ) {
|
33
|
+
context = document.implementation.createHTMLDocument( "" );
|
34
|
+
|
35
|
+
// Set the base href for the created document
|
36
|
+
// so any parsed elements with URLs
|
37
|
+
// are based on the document's URL (gh-2965)
|
38
|
+
base = context.createElement( "base" );
|
39
|
+
base.href = document.location.href;
|
40
|
+
context.head.appendChild( base );
|
41
|
+
} else {
|
42
|
+
context = document;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
parsed = rsingleTag.exec( data );
|
47
|
+
scripts = !keepScripts && [];
|
48
|
+
|
49
|
+
// Single tag
|
50
|
+
if ( parsed ) {
|
51
|
+
return [ context.createElement( parsed[ 1 ] ) ];
|
52
|
+
}
|
53
|
+
|
54
|
+
parsed = buildFragment( [ data ], context, scripts );
|
55
|
+
|
56
|
+
if ( scripts && scripts.length ) {
|
57
|
+
jQuery( scripts ).remove();
|
58
|
+
}
|
59
|
+
|
60
|
+
return jQuery.merge( [], parsed.childNodes );
|
61
|
+
};
|
62
|
+
|
63
|
+
return jQuery.parseHTML;
|
64
|
+
|
65
|
+
} );
|
@@ -0,0 +1,30 @@
|
|
1
|
+
define( [
|
2
|
+
"../core"
|
3
|
+
], function( jQuery ) {
|
4
|
+
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
// Cross-browser xml parsing
|
8
|
+
jQuery.parseXML = function( data ) {
|
9
|
+
var xml;
|
10
|
+
if ( !data || typeof data !== "string" ) {
|
11
|
+
return null;
|
12
|
+
}
|
13
|
+
|
14
|
+
// Support: IE 9 - 11 only
|
15
|
+
// IE throws on parseFromString with invalid input.
|
16
|
+
try {
|
17
|
+
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
|
18
|
+
} catch ( e ) {
|
19
|
+
xml = undefined;
|
20
|
+
}
|
21
|
+
|
22
|
+
if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
|
23
|
+
jQuery.error( "Invalid XML: " + data );
|
24
|
+
}
|
25
|
+
return xml;
|
26
|
+
};
|
27
|
+
|
28
|
+
return jQuery.parseXML;
|
29
|
+
|
30
|
+
} );
|
@@ -0,0 +1,97 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../var/document",
|
4
|
+
"../var/isFunction"
|
5
|
+
], function( jQuery, document, isFunction ) {
|
6
|
+
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
var readyCallbacks = [],
|
10
|
+
whenReady = function( fn ) {
|
11
|
+
readyCallbacks.push( fn );
|
12
|
+
},
|
13
|
+
executeReady = function( fn ) {
|
14
|
+
|
15
|
+
// Prevent errors from freezing future callback execution (gh-1823)
|
16
|
+
// Not backwards-compatible as this does not execute sync
|
17
|
+
window.setTimeout( function() {
|
18
|
+
fn.call( document, jQuery );
|
19
|
+
} );
|
20
|
+
};
|
21
|
+
|
22
|
+
jQuery.fn.ready = function( fn ) {
|
23
|
+
whenReady( fn );
|
24
|
+
return this;
|
25
|
+
};
|
26
|
+
|
27
|
+
jQuery.extend( {
|
28
|
+
|
29
|
+
// Is the DOM ready to be used? Set to true once it occurs.
|
30
|
+
isReady: false,
|
31
|
+
|
32
|
+
// A counter to track how many items to wait for before
|
33
|
+
// the ready event fires. See #6781
|
34
|
+
readyWait: 1,
|
35
|
+
|
36
|
+
ready: function( wait ) {
|
37
|
+
|
38
|
+
// Abort if there are pending holds or we're already ready
|
39
|
+
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
// Remember that the DOM is ready
|
44
|
+
jQuery.isReady = true;
|
45
|
+
|
46
|
+
// If a normal DOM Ready event fired, decrement, and wait if need be
|
47
|
+
if ( wait !== true && --jQuery.readyWait > 0 ) {
|
48
|
+
return;
|
49
|
+
}
|
50
|
+
|
51
|
+
whenReady = function( fn ) {
|
52
|
+
readyCallbacks.push( fn );
|
53
|
+
|
54
|
+
while ( readyCallbacks.length ) {
|
55
|
+
fn = readyCallbacks.shift();
|
56
|
+
if ( isFunction( fn ) ) {
|
57
|
+
executeReady( fn );
|
58
|
+
}
|
59
|
+
}
|
60
|
+
};
|
61
|
+
|
62
|
+
whenReady();
|
63
|
+
}
|
64
|
+
} );
|
65
|
+
|
66
|
+
// Make jQuery.ready Promise consumable (gh-1778)
|
67
|
+
jQuery.ready.then = jQuery.fn.ready;
|
68
|
+
|
69
|
+
/**
|
70
|
+
* The ready event handler and self cleanup method
|
71
|
+
*/
|
72
|
+
function completed() {
|
73
|
+
document.removeEventListener( "DOMContentLoaded", completed );
|
74
|
+
window.removeEventListener( "load", completed );
|
75
|
+
jQuery.ready();
|
76
|
+
}
|
77
|
+
|
78
|
+
// Catch cases where $(document).ready() is called
|
79
|
+
// after the browser event has already occurred.
|
80
|
+
// Support: IE9-10 only
|
81
|
+
// Older IE sometimes signals "interactive" too soon
|
82
|
+
if ( document.readyState === "complete" ||
|
83
|
+
( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
|
84
|
+
|
85
|
+
// Handle it asynchronously to allow scripts the opportunity to delay ready
|
86
|
+
window.setTimeout( jQuery.ready );
|
87
|
+
|
88
|
+
} else {
|
89
|
+
|
90
|
+
// Use the handy event callback
|
91
|
+
document.addEventListener( "DOMContentLoaded", completed );
|
92
|
+
|
93
|
+
// A fallback to window.onload, that will always work
|
94
|
+
window.addEventListener( "load", completed );
|
95
|
+
}
|
96
|
+
|
97
|
+
} );
|
@@ -0,0 +1,86 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../var/document",
|
4
|
+
"../core/readyException",
|
5
|
+
"../deferred"
|
6
|
+
], function( jQuery, document ) {
|
7
|
+
|
8
|
+
"use strict";
|
9
|
+
|
10
|
+
// The deferred used on DOM ready
|
11
|
+
var readyList = jQuery.Deferred();
|
12
|
+
|
13
|
+
jQuery.fn.ready = function( fn ) {
|
14
|
+
|
15
|
+
readyList
|
16
|
+
.then( fn )
|
17
|
+
|
18
|
+
// Wrap jQuery.readyException in a function so that the lookup
|
19
|
+
// happens at the time of error handling instead of callback
|
20
|
+
// registration.
|
21
|
+
.catch( function( error ) {
|
22
|
+
jQuery.readyException( error );
|
23
|
+
} );
|
24
|
+
|
25
|
+
return this;
|
26
|
+
};
|
27
|
+
|
28
|
+
jQuery.extend( {
|
29
|
+
|
30
|
+
// Is the DOM ready to be used? Set to true once it occurs.
|
31
|
+
isReady: false,
|
32
|
+
|
33
|
+
// A counter to track how many items to wait for before
|
34
|
+
// the ready event fires. See #6781
|
35
|
+
readyWait: 1,
|
36
|
+
|
37
|
+
// Handle when the DOM is ready
|
38
|
+
ready: function( wait ) {
|
39
|
+
|
40
|
+
// Abort if there are pending holds or we're already ready
|
41
|
+
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
|
45
|
+
// Remember that the DOM is ready
|
46
|
+
jQuery.isReady = true;
|
47
|
+
|
48
|
+
// If a normal DOM Ready event fired, decrement, and wait if need be
|
49
|
+
if ( wait !== true && --jQuery.readyWait > 0 ) {
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
|
53
|
+
// If there are functions bound, to execute
|
54
|
+
readyList.resolveWith( document, [ jQuery ] );
|
55
|
+
}
|
56
|
+
} );
|
57
|
+
|
58
|
+
jQuery.ready.then = readyList.then;
|
59
|
+
|
60
|
+
// The ready event handler and self cleanup method
|
61
|
+
function completed() {
|
62
|
+
document.removeEventListener( "DOMContentLoaded", completed );
|
63
|
+
window.removeEventListener( "load", completed );
|
64
|
+
jQuery.ready();
|
65
|
+
}
|
66
|
+
|
67
|
+
// Catch cases where $(document).ready() is called
|
68
|
+
// after the browser event has already occurred.
|
69
|
+
// Support: IE <=9 - 10 only
|
70
|
+
// Older IE sometimes signals "interactive" too soon
|
71
|
+
if ( document.readyState === "complete" ||
|
72
|
+
( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
|
73
|
+
|
74
|
+
// Handle it asynchronously to allow scripts the opportunity to delay ready
|
75
|
+
window.setTimeout( jQuery.ready );
|
76
|
+
|
77
|
+
} else {
|
78
|
+
|
79
|
+
// Use the handy event callback
|
80
|
+
document.addEventListener( "DOMContentLoaded", completed );
|
81
|
+
|
82
|
+
// A fallback to window.onload, that will always work
|
83
|
+
window.addEventListener( "load", completed );
|
84
|
+
}
|
85
|
+
|
86
|
+
} );
|