govuk_publishing_components 11.2.0 → 12.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/favicon-example.png +0 -0
- data/app/assets/images/govuk_publishing_components/favicon-production.png +0 -0
- data/app/assets/javascripts/component_guide/application.js +1 -1
- data/app/assets/javascripts/component_guide/no_slimmer.js +15 -0
- data/app/assets/javascripts/govuk_publishing_components/admin_scripts.js +2 -4
- data/app/assets/javascripts/govuk_publishing_components/all_components.js +4 -0
- data/app/assets/stylesheets/component_guide/application.scss +80 -74
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +26 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +21 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +7 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +24 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +19 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +11 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +12 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +9 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +11 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +7 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +9 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +4 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +12 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +16 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +8 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +30 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +14 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss +2 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-navigation.scss +10 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +7 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +24 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +47 -13
- data/app/controllers/govuk_publishing_components/application_controller.rb +5 -6
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +2 -2
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +9 -9
- data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_feedback.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +4 -7
- data/app/views/govuk_publishing_components/components/_notice.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_taxonomy_navigation.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/fieldset.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +7 -7
- data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +3 -3
- data/app/views/layouts/govuk_publishing_components/application.html.erb +43 -44
- data/config/initializers/assets.rb +2 -0
- data/lib/govuk_publishing_components/app_helpers/environment.rb +1 -0
- data/lib/govuk_publishing_components/config.rb +1 -1
- data/lib/govuk_publishing_components/engine.rb +0 -1
- data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +1 -1
- data/lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/jquery/AUTHORS.txt +266 -0
- data/node_modules/jquery/LICENSE.txt +36 -0
- data/node_modules/jquery/README.md +65 -0
- data/node_modules/jquery/bower.json +14 -0
- data/node_modules/jquery/dist/jquery.js +11008 -0
- data/node_modules/jquery/dist/jquery.min.js +5 -0
- data/node_modules/jquery/dist/jquery.min.map +1 -0
- data/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.js +2143 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/node_modules/jquery/package.json +157 -0
- data/node_modules/jquery/src/ajax.js +842 -0
- data/node_modules/jquery/src/ajax/jsonp.js +100 -0
- data/node_modules/jquery/src/ajax/load.js +83 -0
- data/node_modules/jquery/src/ajax/parseJSON.js +53 -0
- data/node_modules/jquery/src/ajax/parseXML.js +31 -0
- data/node_modules/jquery/src/ajax/script.js +95 -0
- data/node_modules/jquery/src/ajax/var/location.js +3 -0
- data/node_modules/jquery/src/ajax/var/nonce.js +5 -0
- data/node_modules/jquery/src/ajax/var/rquery.js +3 -0
- data/node_modules/jquery/src/ajax/xhr.js +229 -0
- data/node_modules/jquery/src/attributes.js +11 -0
- data/node_modules/jquery/src/attributes/attr.js +281 -0
- data/node_modules/jquery/src/attributes/classes.js +174 -0
- data/node_modules/jquery/src/attributes/prop.js +156 -0
- data/node_modules/jquery/src/attributes/support.js +70 -0
- data/node_modules/jquery/src/attributes/val.js +191 -0
- data/node_modules/jquery/src/callbacks.js +232 -0
- data/node_modules/jquery/src/core.js +529 -0
- data/node_modules/jquery/src/core/access.js +65 -0
- data/node_modules/jquery/src/core/init.js +140 -0
- data/node_modules/jquery/src/core/parseHTML.js +41 -0
- data/node_modules/jquery/src/core/ready.js +163 -0
- data/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
- data/node_modules/jquery/src/css.js +563 -0
- data/node_modules/jquery/src/css/addGetHookIf.js +24 -0
- data/node_modules/jquery/src/css/adjustCSS.js +65 -0
- data/node_modules/jquery/src/css/curCSS.js +137 -0
- data/node_modules/jquery/src/css/defaultDisplay.js +72 -0
- data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +42 -0
- data/node_modules/jquery/src/css/showHide.js +45 -0
- data/node_modules/jquery/src/css/support.js +184 -0
- data/node_modules/jquery/src/css/var/cssExpand.js +3 -0
- data/node_modules/jquery/src/css/var/isHidden.js +16 -0
- data/node_modules/jquery/src/css/var/rmargin.js +3 -0
- data/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
- data/node_modules/jquery/src/css/var/swap.js +24 -0
- data/node_modules/jquery/src/data.js +342 -0
- data/node_modules/jquery/src/data/support.js +23 -0
- data/node_modules/jquery/src/data/var/acceptData.js +20 -0
- data/node_modules/jquery/src/deferred.js +159 -0
- data/node_modules/jquery/src/deprecated.js +34 -0
- data/node_modules/jquery/src/dimensions.js +56 -0
- data/node_modules/jquery/src/effects.js +640 -0
- data/node_modules/jquery/src/effects/Tween.js +121 -0
- data/node_modules/jquery/src/effects/animatedSelector.js +13 -0
- data/node_modules/jquery/src/effects/support.js +58 -0
- data/node_modules/jquery/src/event.js +1134 -0
- data/node_modules/jquery/src/event/ajax.js +20 -0
- data/node_modules/jquery/src/event/alias.js +25 -0
- data/node_modules/jquery/src/event/support.js +28 -0
- data/node_modules/jquery/src/exports/amd.js +24 -0
- data/node_modules/jquery/src/exports/global.js +26 -0
- data/node_modules/jquery/src/intro.js +44 -0
- data/node_modules/jquery/src/jquery.js +37 -0
- data/node_modules/jquery/src/manipulation.js +585 -0
- data/node_modules/jquery/src/manipulation/_evalUrl.js +21 -0
- data/node_modules/jquery/src/manipulation/buildFragment.js +157 -0
- data/node_modules/jquery/src/manipulation/createSafeFragment.js +20 -0
- data/node_modules/jquery/src/manipulation/getAll.js +33 -0
- data/node_modules/jquery/src/manipulation/setGlobalEval.js +19 -0
- data/node_modules/jquery/src/manipulation/support.js +72 -0
- data/node_modules/jquery/src/manipulation/var/nodeNames.js +5 -0
- data/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
- data/node_modules/jquery/src/manipulation/wrapMap.js +30 -0
- data/node_modules/jquery/src/offset.js +219 -0
- data/node_modules/jquery/src/outro.js +2 -0
- data/node_modules/jquery/src/queue.js +144 -0
- data/node_modules/jquery/src/queue/delay.js +22 -0
- data/node_modules/jquery/src/selector-sizzle.js +14 -0
- data/node_modules/jquery/src/selector.js +1 -0
- data/node_modules/jquery/src/serialize.js +125 -0
- data/node_modules/jquery/src/support.js +63 -0
- data/node_modules/jquery/src/traversing.js +179 -0
- data/node_modules/jquery/src/traversing/findFilter.js +100 -0
- data/node_modules/jquery/src/traversing/var/dir.js +20 -0
- data/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/node_modules/jquery/src/traversing/var/siblings.js +15 -0
- data/node_modules/jquery/src/var/class2type.js +5 -0
- data/node_modules/jquery/src/var/concat.js +5 -0
- data/node_modules/jquery/src/var/deletedIds.js +3 -0
- data/node_modules/jquery/src/var/document.js +3 -0
- data/node_modules/jquery/src/var/documentElement.js +5 -0
- data/node_modules/jquery/src/var/hasOwn.js +5 -0
- data/node_modules/jquery/src/var/indexOf.js +5 -0
- data/node_modules/jquery/src/var/pnum.js +3 -0
- data/node_modules/jquery/src/var/push.js +5 -0
- data/node_modules/jquery/src/var/rcssNum.js +7 -0
- data/node_modules/jquery/src/var/rnotwhite.js +3 -0
- data/node_modules/jquery/src/var/slice.js +5 -0
- data/node_modules/jquery/src/var/support.js +5 -0
- data/node_modules/jquery/src/var/toString.js +5 -0
- data/node_modules/jquery/src/wrap.js +77 -0
- metadata +111 -19
- data/app/assets/images/govuk_publishing_components/favicon-test.png +0 -0
- data/app/assets/stylesheets/govuk_publishing_components/admin_styles_ie8.scss +0 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_touch-friendly-links.scss +0 -11
@@ -0,0 +1,65 @@
|
|
1
|
+
define( [
|
2
|
+
"../core"
|
3
|
+
], function( jQuery ) {
|
4
|
+
|
5
|
+
// Multifunctional method to get and set values of a collection
|
6
|
+
// The value/s can optionally be executed if it's a function
|
7
|
+
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
8
|
+
var i = 0,
|
9
|
+
length = elems.length,
|
10
|
+
bulk = key == null;
|
11
|
+
|
12
|
+
// Sets many values
|
13
|
+
if ( jQuery.type( key ) === "object" ) {
|
14
|
+
chainable = true;
|
15
|
+
for ( i in key ) {
|
16
|
+
access( elems, fn, i, key[ i ], true, emptyGet, raw );
|
17
|
+
}
|
18
|
+
|
19
|
+
// Sets one value
|
20
|
+
} else if ( value !== undefined ) {
|
21
|
+
chainable = true;
|
22
|
+
|
23
|
+
if ( !jQuery.isFunction( value ) ) {
|
24
|
+
raw = true;
|
25
|
+
}
|
26
|
+
|
27
|
+
if ( bulk ) {
|
28
|
+
|
29
|
+
// Bulk operations run against the entire set
|
30
|
+
if ( raw ) {
|
31
|
+
fn.call( elems, value );
|
32
|
+
fn = null;
|
33
|
+
|
34
|
+
// ...except when executing function values
|
35
|
+
} else {
|
36
|
+
bulk = fn;
|
37
|
+
fn = function( elem, key, value ) {
|
38
|
+
return bulk.call( jQuery( elem ), value );
|
39
|
+
};
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
if ( fn ) {
|
44
|
+
for ( ; i < length; i++ ) {
|
45
|
+
fn(
|
46
|
+
elems[ i ],
|
47
|
+
key,
|
48
|
+
raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) )
|
49
|
+
);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
return chainable ?
|
55
|
+
elems :
|
56
|
+
|
57
|
+
// Gets
|
58
|
+
bulk ?
|
59
|
+
fn.call( elems ) :
|
60
|
+
length ? fn( elems[ 0 ], key ) : emptyGet;
|
61
|
+
};
|
62
|
+
|
63
|
+
return access;
|
64
|
+
|
65
|
+
} );
|
@@ -0,0 +1,140 @@
|
|
1
|
+
// Initialize a jQuery object
|
2
|
+
define( [
|
3
|
+
"../core",
|
4
|
+
"../var/document",
|
5
|
+
"./var/rsingleTag",
|
6
|
+
"../traversing/findFilter"
|
7
|
+
], function( jQuery, document, rsingleTag ) {
|
8
|
+
|
9
|
+
// A central reference to the root jQuery(document)
|
10
|
+
var rootjQuery,
|
11
|
+
|
12
|
+
// A simple way to check for HTML strings
|
13
|
+
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
14
|
+
// Strict HTML recognition (#11290: must start with <)
|
15
|
+
rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
|
16
|
+
|
17
|
+
init = jQuery.fn.init = function( selector, context, root ) {
|
18
|
+
var match, elem;
|
19
|
+
|
20
|
+
// HANDLE: $(""), $(null), $(undefined), $(false)
|
21
|
+
if ( !selector ) {
|
22
|
+
return this;
|
23
|
+
}
|
24
|
+
|
25
|
+
// init accepts an alternate rootjQuery
|
26
|
+
// so migrate can support jQuery.sub (gh-2101)
|
27
|
+
root = root || rootjQuery;
|
28
|
+
|
29
|
+
// Handle HTML strings
|
30
|
+
if ( typeof selector === "string" ) {
|
31
|
+
if ( selector.charAt( 0 ) === "<" &&
|
32
|
+
selector.charAt( selector.length - 1 ) === ">" &&
|
33
|
+
selector.length >= 3 ) {
|
34
|
+
|
35
|
+
// Assume that strings that start and end with <> are HTML and skip the regex check
|
36
|
+
match = [ null, selector, null ];
|
37
|
+
|
38
|
+
} else {
|
39
|
+
match = rquickExpr.exec( selector );
|
40
|
+
}
|
41
|
+
|
42
|
+
// Match html or make sure no context is specified for #id
|
43
|
+
if ( match && ( match[ 1 ] || !context ) ) {
|
44
|
+
|
45
|
+
// HANDLE: $(html) -> $(array)
|
46
|
+
if ( match[ 1 ] ) {
|
47
|
+
context = context instanceof jQuery ? context[ 0 ] : context;
|
48
|
+
|
49
|
+
// scripts is true for back-compat
|
50
|
+
// Intentionally let the error be thrown if parseHTML is not present
|
51
|
+
jQuery.merge( this, jQuery.parseHTML(
|
52
|
+
match[ 1 ],
|
53
|
+
context && context.nodeType ? context.ownerDocument || context : document,
|
54
|
+
true
|
55
|
+
) );
|
56
|
+
|
57
|
+
// HANDLE: $(html, props)
|
58
|
+
if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
|
59
|
+
for ( match in context ) {
|
60
|
+
|
61
|
+
// Properties of context are called as methods if possible
|
62
|
+
if ( jQuery.isFunction( this[ match ] ) ) {
|
63
|
+
this[ match ]( context[ match ] );
|
64
|
+
|
65
|
+
// ...and otherwise set as attributes
|
66
|
+
} else {
|
67
|
+
this.attr( match, context[ match ] );
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
return this;
|
73
|
+
|
74
|
+
// HANDLE: $(#id)
|
75
|
+
} else {
|
76
|
+
elem = document.getElementById( match[ 2 ] );
|
77
|
+
|
78
|
+
// Check parentNode to catch when Blackberry 4.6 returns
|
79
|
+
// nodes that are no longer in the document #6963
|
80
|
+
if ( elem && elem.parentNode ) {
|
81
|
+
|
82
|
+
// Handle the case where IE and Opera return items
|
83
|
+
// by name instead of ID
|
84
|
+
if ( elem.id !== match[ 2 ] ) {
|
85
|
+
return rootjQuery.find( selector );
|
86
|
+
}
|
87
|
+
|
88
|
+
// Otherwise, we inject the element directly into the jQuery object
|
89
|
+
this.length = 1;
|
90
|
+
this[ 0 ] = elem;
|
91
|
+
}
|
92
|
+
|
93
|
+
this.context = document;
|
94
|
+
this.selector = selector;
|
95
|
+
return this;
|
96
|
+
}
|
97
|
+
|
98
|
+
// HANDLE: $(expr, $(...))
|
99
|
+
} else if ( !context || context.jquery ) {
|
100
|
+
return ( context || root ).find( selector );
|
101
|
+
|
102
|
+
// HANDLE: $(expr, context)
|
103
|
+
// (which is just equivalent to: $(context).find(expr)
|
104
|
+
} else {
|
105
|
+
return this.constructor( context ).find( selector );
|
106
|
+
}
|
107
|
+
|
108
|
+
// HANDLE: $(DOMElement)
|
109
|
+
} else if ( selector.nodeType ) {
|
110
|
+
this.context = this[ 0 ] = selector;
|
111
|
+
this.length = 1;
|
112
|
+
return this;
|
113
|
+
|
114
|
+
// HANDLE: $(function)
|
115
|
+
// Shortcut for document ready
|
116
|
+
} else if ( jQuery.isFunction( selector ) ) {
|
117
|
+
return typeof root.ready !== "undefined" ?
|
118
|
+
root.ready( selector ) :
|
119
|
+
|
120
|
+
// Execute immediately if ready is not present
|
121
|
+
selector( jQuery );
|
122
|
+
}
|
123
|
+
|
124
|
+
if ( selector.selector !== undefined ) {
|
125
|
+
this.selector = selector.selector;
|
126
|
+
this.context = selector.context;
|
127
|
+
}
|
128
|
+
|
129
|
+
return jQuery.makeArray( selector, this );
|
130
|
+
};
|
131
|
+
|
132
|
+
// Give the init function the jQuery prototype for later instantiation
|
133
|
+
init.prototype = jQuery.fn;
|
134
|
+
|
135
|
+
// Initialize central reference
|
136
|
+
rootjQuery = jQuery( document );
|
137
|
+
|
138
|
+
return init;
|
139
|
+
|
140
|
+
} );
|
@@ -0,0 +1,41 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../var/document",
|
4
|
+
"./var/rsingleTag",
|
5
|
+
"../manipulation/buildFragment"
|
6
|
+
], function( jQuery, document, rsingleTag, buildFragment ) {
|
7
|
+
|
8
|
+
// data: string of html
|
9
|
+
// context (optional): If specified, the fragment will be created in this context,
|
10
|
+
// defaults to document
|
11
|
+
// keepScripts (optional): If true, will include scripts passed in the html string
|
12
|
+
jQuery.parseHTML = function( data, context, keepScripts ) {
|
13
|
+
if ( !data || typeof data !== "string" ) {
|
14
|
+
return null;
|
15
|
+
}
|
16
|
+
if ( typeof context === "boolean" ) {
|
17
|
+
keepScripts = context;
|
18
|
+
context = false;
|
19
|
+
}
|
20
|
+
context = context || document;
|
21
|
+
|
22
|
+
var parsed = rsingleTag.exec( data ),
|
23
|
+
scripts = !keepScripts && [];
|
24
|
+
|
25
|
+
// Single tag
|
26
|
+
if ( parsed ) {
|
27
|
+
return [ context.createElement( parsed[ 1 ] ) ];
|
28
|
+
}
|
29
|
+
|
30
|
+
parsed = buildFragment( [ data ], context, scripts );
|
31
|
+
|
32
|
+
if ( scripts && scripts.length ) {
|
33
|
+
jQuery( scripts ).remove();
|
34
|
+
}
|
35
|
+
|
36
|
+
return jQuery.merge( [], parsed.childNodes );
|
37
|
+
};
|
38
|
+
|
39
|
+
return jQuery.parseHTML;
|
40
|
+
|
41
|
+
} );
|
@@ -0,0 +1,163 @@
|
|
1
|
+
define( [
|
2
|
+
"../core",
|
3
|
+
"../var/document",
|
4
|
+
"../core/init",
|
5
|
+
"../deferred"
|
6
|
+
], function( jQuery, document ) {
|
7
|
+
|
8
|
+
// The deferred used on DOM ready
|
9
|
+
var readyList;
|
10
|
+
|
11
|
+
jQuery.fn.ready = function( fn ) {
|
12
|
+
|
13
|
+
// Add the callback
|
14
|
+
jQuery.ready.promise().done( fn );
|
15
|
+
|
16
|
+
return this;
|
17
|
+
};
|
18
|
+
|
19
|
+
jQuery.extend( {
|
20
|
+
|
21
|
+
// Is the DOM ready to be used? Set to true once it occurs.
|
22
|
+
isReady: false,
|
23
|
+
|
24
|
+
// A counter to track how many items to wait for before
|
25
|
+
// the ready event fires. See #6781
|
26
|
+
readyWait: 1,
|
27
|
+
|
28
|
+
// Hold (or release) the ready event
|
29
|
+
holdReady: function( hold ) {
|
30
|
+
if ( hold ) {
|
31
|
+
jQuery.readyWait++;
|
32
|
+
} else {
|
33
|
+
jQuery.ready( true );
|
34
|
+
}
|
35
|
+
},
|
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
|
+
// Trigger any bound ready events
|
57
|
+
if ( jQuery.fn.triggerHandler ) {
|
58
|
+
jQuery( document ).triggerHandler( "ready" );
|
59
|
+
jQuery( document ).off( "ready" );
|
60
|
+
}
|
61
|
+
}
|
62
|
+
} );
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Clean-up method for dom ready events
|
66
|
+
*/
|
67
|
+
function detach() {
|
68
|
+
if ( document.addEventListener ) {
|
69
|
+
document.removeEventListener( "DOMContentLoaded", completed );
|
70
|
+
window.removeEventListener( "load", completed );
|
71
|
+
|
72
|
+
} else {
|
73
|
+
document.detachEvent( "onreadystatechange", completed );
|
74
|
+
window.detachEvent( "onload", completed );
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
/**
|
79
|
+
* The ready event handler and self cleanup method
|
80
|
+
*/
|
81
|
+
function completed() {
|
82
|
+
|
83
|
+
// readyState === "complete" is good enough for us to call the dom ready in oldIE
|
84
|
+
if ( document.addEventListener ||
|
85
|
+
window.event.type === "load" ||
|
86
|
+
document.readyState === "complete" ) {
|
87
|
+
|
88
|
+
detach();
|
89
|
+
jQuery.ready();
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
jQuery.ready.promise = function( obj ) {
|
94
|
+
if ( !readyList ) {
|
95
|
+
|
96
|
+
readyList = jQuery.Deferred();
|
97
|
+
|
98
|
+
// Catch cases where $(document).ready() is called
|
99
|
+
// after the browser event has already occurred.
|
100
|
+
// Support: IE6-10
|
101
|
+
// Older IE sometimes signals "interactive" too soon
|
102
|
+
if ( document.readyState === "complete" ||
|
103
|
+
( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
|
104
|
+
|
105
|
+
// Handle it asynchronously to allow scripts the opportunity to delay ready
|
106
|
+
window.setTimeout( jQuery.ready );
|
107
|
+
|
108
|
+
// Standards-based browsers support DOMContentLoaded
|
109
|
+
} else if ( document.addEventListener ) {
|
110
|
+
|
111
|
+
// Use the handy event callback
|
112
|
+
document.addEventListener( "DOMContentLoaded", completed );
|
113
|
+
|
114
|
+
// A fallback to window.onload, that will always work
|
115
|
+
window.addEventListener( "load", completed );
|
116
|
+
|
117
|
+
// If IE event model is used
|
118
|
+
} else {
|
119
|
+
|
120
|
+
// Ensure firing before onload, maybe late but safe also for iframes
|
121
|
+
document.attachEvent( "onreadystatechange", completed );
|
122
|
+
|
123
|
+
// A fallback to window.onload, that will always work
|
124
|
+
window.attachEvent( "onload", completed );
|
125
|
+
|
126
|
+
// If IE and not a frame
|
127
|
+
// continually check to see if the document is ready
|
128
|
+
var top = false;
|
129
|
+
|
130
|
+
try {
|
131
|
+
top = window.frameElement == null && document.documentElement;
|
132
|
+
} catch ( e ) {}
|
133
|
+
|
134
|
+
if ( top && top.doScroll ) {
|
135
|
+
( function doScrollCheck() {
|
136
|
+
if ( !jQuery.isReady ) {
|
137
|
+
|
138
|
+
try {
|
139
|
+
|
140
|
+
// Use the trick by Diego Perini
|
141
|
+
// http://javascript.nwbox.com/IEContentLoaded/
|
142
|
+
top.doScroll( "left" );
|
143
|
+
} catch ( e ) {
|
144
|
+
return window.setTimeout( doScrollCheck, 50 );
|
145
|
+
}
|
146
|
+
|
147
|
+
// detach all dom ready events
|
148
|
+
detach();
|
149
|
+
|
150
|
+
// and execute any waiting functions
|
151
|
+
jQuery.ready();
|
152
|
+
}
|
153
|
+
} )();
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
return readyList.promise( obj );
|
158
|
+
};
|
159
|
+
|
160
|
+
// Kick off the DOM ready check even if the user does not
|
161
|
+
jQuery.ready.promise();
|
162
|
+
|
163
|
+
} );
|
@@ -0,0 +1,563 @@
|
|
1
|
+
define( [
|
2
|
+
"./core",
|
3
|
+
"./var/pnum",
|
4
|
+
"./core/access",
|
5
|
+
"./css/var/rmargin",
|
6
|
+
"./var/document",
|
7
|
+
"./var/rcssNum",
|
8
|
+
"./css/var/rnumnonpx",
|
9
|
+
"./css/var/cssExpand",
|
10
|
+
"./css/var/isHidden",
|
11
|
+
"./css/var/swap",
|
12
|
+
"./css/curCSS",
|
13
|
+
"./css/adjustCSS",
|
14
|
+
"./css/defaultDisplay",
|
15
|
+
"./css/addGetHookIf",
|
16
|
+
"./css/support",
|
17
|
+
|
18
|
+
"./core/init",
|
19
|
+
"./core/ready",
|
20
|
+
"./selector" // contains
|
21
|
+
], function( jQuery, pnum, access, rmargin, document, rcssNum, rnumnonpx, cssExpand,
|
22
|
+
isHidden, swap, curCSS, adjustCSS, defaultDisplay, addGetHookIf, support ) {
|
23
|
+
|
24
|
+
var
|
25
|
+
|
26
|
+
// BuildExclude
|
27
|
+
getStyles = curCSS.getStyles,
|
28
|
+
ralpha = /alpha\([^)]*\)/i,
|
29
|
+
ropacity = /opacity\s*=\s*([^)]*)/i,
|
30
|
+
|
31
|
+
// swappable if display is none or starts with table except
|
32
|
+
// "table", "table-cell", or "table-caption"
|
33
|
+
// see here for display values:
|
34
|
+
// https://developer.mozilla.org/en-US/docs/CSS/display
|
35
|
+
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
36
|
+
rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
|
37
|
+
|
38
|
+
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
39
|
+
cssNormalTransform = {
|
40
|
+
letterSpacing: "0",
|
41
|
+
fontWeight: "400"
|
42
|
+
},
|
43
|
+
|
44
|
+
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
|
45
|
+
emptyStyle = document.createElement( "div" ).style;
|
46
|
+
|
47
|
+
// BuildExclude
|
48
|
+
curCSS = curCSS.curCSS;
|
49
|
+
|
50
|
+
// return a css property mapped to a potentially vendor prefixed property
|
51
|
+
function vendorPropName( name ) {
|
52
|
+
|
53
|
+
// shortcut for names that are not vendor prefixed
|
54
|
+
if ( name in emptyStyle ) {
|
55
|
+
return name;
|
56
|
+
}
|
57
|
+
|
58
|
+
// check for vendor prefixed names
|
59
|
+
var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),
|
60
|
+
i = cssPrefixes.length;
|
61
|
+
|
62
|
+
while ( i-- ) {
|
63
|
+
name = cssPrefixes[ i ] + capName;
|
64
|
+
if ( name in emptyStyle ) {
|
65
|
+
return name;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
function showHide( elements, show ) {
|
71
|
+
var display, elem, hidden,
|
72
|
+
values = [],
|
73
|
+
index = 0,
|
74
|
+
length = elements.length;
|
75
|
+
|
76
|
+
for ( ; index < length; index++ ) {
|
77
|
+
elem = elements[ index ];
|
78
|
+
if ( !elem.style ) {
|
79
|
+
continue;
|
80
|
+
}
|
81
|
+
|
82
|
+
values[ index ] = jQuery._data( elem, "olddisplay" );
|
83
|
+
display = elem.style.display;
|
84
|
+
if ( show ) {
|
85
|
+
|
86
|
+
// Reset the inline display of this element to learn if it is
|
87
|
+
// being hidden by cascaded rules or not
|
88
|
+
if ( !values[ index ] && display === "none" ) {
|
89
|
+
elem.style.display = "";
|
90
|
+
}
|
91
|
+
|
92
|
+
// Set elements which have been overridden with display: none
|
93
|
+
// in a stylesheet to whatever the default browser style is
|
94
|
+
// for such an element
|
95
|
+
if ( elem.style.display === "" && isHidden( elem ) ) {
|
96
|
+
values[ index ] =
|
97
|
+
jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) );
|
98
|
+
}
|
99
|
+
} else {
|
100
|
+
hidden = isHidden( elem );
|
101
|
+
|
102
|
+
if ( display && display !== "none" || !hidden ) {
|
103
|
+
jQuery._data(
|
104
|
+
elem,
|
105
|
+
"olddisplay",
|
106
|
+
hidden ? display : jQuery.css( elem, "display" )
|
107
|
+
);
|
108
|
+
}
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
// Set the display of most of the elements in a second loop
|
113
|
+
// to avoid the constant reflow
|
114
|
+
for ( index = 0; index < length; index++ ) {
|
115
|
+
elem = elements[ index ];
|
116
|
+
if ( !elem.style ) {
|
117
|
+
continue;
|
118
|
+
}
|
119
|
+
if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
|
120
|
+
elem.style.display = show ? values[ index ] || "" : "none";
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
return elements;
|
125
|
+
}
|
126
|
+
|
127
|
+
function setPositiveNumber( elem, value, subtract ) {
|
128
|
+
var matches = rnumsplit.exec( value );
|
129
|
+
return matches ?
|
130
|
+
|
131
|
+
// Guard against undefined "subtract", e.g., when used as in cssHooks
|
132
|
+
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
|
133
|
+
value;
|
134
|
+
}
|
135
|
+
|
136
|
+
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
|
137
|
+
var i = extra === ( isBorderBox ? "border" : "content" ) ?
|
138
|
+
|
139
|
+
// If we already have the right measurement, avoid augmentation
|
140
|
+
4 :
|
141
|
+
|
142
|
+
// Otherwise initialize for horizontal or vertical properties
|
143
|
+
name === "width" ? 1 : 0,
|
144
|
+
|
145
|
+
val = 0;
|
146
|
+
|
147
|
+
for ( ; i < 4; i += 2 ) {
|
148
|
+
|
149
|
+
// both box models exclude margin, so add it if we want it
|
150
|
+
if ( extra === "margin" ) {
|
151
|
+
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
|
152
|
+
}
|
153
|
+
|
154
|
+
if ( isBorderBox ) {
|
155
|
+
|
156
|
+
// border-box includes padding, so remove it if we want content
|
157
|
+
if ( extra === "content" ) {
|
158
|
+
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
159
|
+
}
|
160
|
+
|
161
|
+
// at this point, extra isn't border nor margin, so remove border
|
162
|
+
if ( extra !== "margin" ) {
|
163
|
+
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
164
|
+
}
|
165
|
+
} else {
|
166
|
+
|
167
|
+
// at this point, extra isn't content, so add padding
|
168
|
+
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
169
|
+
|
170
|
+
// at this point, extra isn't content nor padding, so add border
|
171
|
+
if ( extra !== "padding" ) {
|
172
|
+
val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
173
|
+
}
|
174
|
+
}
|
175
|
+
}
|
176
|
+
|
177
|
+
return val;
|
178
|
+
}
|
179
|
+
|
180
|
+
function getWidthOrHeight( elem, name, extra ) {
|
181
|
+
|
182
|
+
// Start with offset property, which is equivalent to the border-box value
|
183
|
+
var valueIsBorderBox = true,
|
184
|
+
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
185
|
+
styles = getStyles( elem ),
|
186
|
+
isBorderBox = support.boxSizing &&
|
187
|
+
jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
188
|
+
|
189
|
+
// some non-html elements return undefined for offsetWidth, so check for null/undefined
|
190
|
+
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
|
191
|
+
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
|
192
|
+
if ( val <= 0 || val == null ) {
|
193
|
+
|
194
|
+
// Fall back to computed then uncomputed css if necessary
|
195
|
+
val = curCSS( elem, name, styles );
|
196
|
+
if ( val < 0 || val == null ) {
|
197
|
+
val = elem.style[ name ];
|
198
|
+
}
|
199
|
+
|
200
|
+
// Computed unit is not pixels. Stop here and return.
|
201
|
+
if ( rnumnonpx.test( val ) ) {
|
202
|
+
return val;
|
203
|
+
}
|
204
|
+
|
205
|
+
// we need the check for style in case a browser which returns unreliable values
|
206
|
+
// for getComputedStyle silently falls back to the reliable elem.style
|
207
|
+
valueIsBorderBox = isBorderBox &&
|
208
|
+
( support.boxSizingReliable() || val === elem.style[ name ] );
|
209
|
+
|
210
|
+
// Normalize "", auto, and prepare for extra
|
211
|
+
val = parseFloat( val ) || 0;
|
212
|
+
}
|
213
|
+
|
214
|
+
// use the active box-sizing model to add/subtract irrelevant styles
|
215
|
+
return ( val +
|
216
|
+
augmentWidthOrHeight(
|
217
|
+
elem,
|
218
|
+
name,
|
219
|
+
extra || ( isBorderBox ? "border" : "content" ),
|
220
|
+
valueIsBorderBox,
|
221
|
+
styles
|
222
|
+
)
|
223
|
+
) + "px";
|
224
|
+
}
|
225
|
+
|
226
|
+
jQuery.extend( {
|
227
|
+
|
228
|
+
// Add in style property hooks for overriding the default
|
229
|
+
// behavior of getting and setting a style property
|
230
|
+
cssHooks: {
|
231
|
+
opacity: {
|
232
|
+
get: function( elem, computed ) {
|
233
|
+
if ( computed ) {
|
234
|
+
|
235
|
+
// We should always get a number back from opacity
|
236
|
+
var ret = curCSS( elem, "opacity" );
|
237
|
+
return ret === "" ? "1" : ret;
|
238
|
+
}
|
239
|
+
}
|
240
|
+
}
|
241
|
+
},
|
242
|
+
|
243
|
+
// Don't automatically add "px" to these possibly-unitless properties
|
244
|
+
cssNumber: {
|
245
|
+
"animationIterationCount": true,
|
246
|
+
"columnCount": true,
|
247
|
+
"fillOpacity": true,
|
248
|
+
"flexGrow": true,
|
249
|
+
"flexShrink": true,
|
250
|
+
"fontWeight": true,
|
251
|
+
"lineHeight": true,
|
252
|
+
"opacity": true,
|
253
|
+
"order": true,
|
254
|
+
"orphans": true,
|
255
|
+
"widows": true,
|
256
|
+
"zIndex": true,
|
257
|
+
"zoom": true
|
258
|
+
},
|
259
|
+
|
260
|
+
// Add in properties whose names you wish to fix before
|
261
|
+
// setting or getting the value
|
262
|
+
cssProps: {
|
263
|
+
|
264
|
+
// normalize float css property
|
265
|
+
"float": support.cssFloat ? "cssFloat" : "styleFloat"
|
266
|
+
},
|
267
|
+
|
268
|
+
// Get and set the style property on a DOM Node
|
269
|
+
style: function( elem, name, value, extra ) {
|
270
|
+
|
271
|
+
// Don't set styles on text and comment nodes
|
272
|
+
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
|
273
|
+
return;
|
274
|
+
}
|
275
|
+
|
276
|
+
// Make sure that we're working with the right name
|
277
|
+
var ret, type, hooks,
|
278
|
+
origName = jQuery.camelCase( name ),
|
279
|
+
style = elem.style;
|
280
|
+
|
281
|
+
name = jQuery.cssProps[ origName ] ||
|
282
|
+
( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
|
283
|
+
|
284
|
+
// gets hook for the prefixed version
|
285
|
+
// followed by the unprefixed version
|
286
|
+
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
|
287
|
+
|
288
|
+
// Check if we're setting a value
|
289
|
+
if ( value !== undefined ) {
|
290
|
+
type = typeof value;
|
291
|
+
|
292
|
+
// Convert "+=" or "-=" to relative numbers (#7345)
|
293
|
+
if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
|
294
|
+
value = adjustCSS( elem, name, ret );
|
295
|
+
|
296
|
+
// Fixes bug #9237
|
297
|
+
type = "number";
|
298
|
+
}
|
299
|
+
|
300
|
+
// Make sure that null and NaN values aren't set. See: #7116
|
301
|
+
if ( value == null || value !== value ) {
|
302
|
+
return;
|
303
|
+
}
|
304
|
+
|
305
|
+
// If a number was passed in, add the unit (except for certain CSS properties)
|
306
|
+
if ( type === "number" ) {
|
307
|
+
value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
|
308
|
+
}
|
309
|
+
|
310
|
+
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
|
311
|
+
// but it would mean to define eight
|
312
|
+
// (for every problematic property) identical functions
|
313
|
+
if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
|
314
|
+
style[ name ] = "inherit";
|
315
|
+
}
|
316
|
+
|
317
|
+
// If a hook was provided, use that value, otherwise just set the specified value
|
318
|
+
if ( !hooks || !( "set" in hooks ) ||
|
319
|
+
( value = hooks.set( elem, value, extra ) ) !== undefined ) {
|
320
|
+
|
321
|
+
// Support: IE
|
322
|
+
// Swallow errors from 'invalid' CSS values (#5509)
|
323
|
+
try {
|
324
|
+
style[ name ] = value;
|
325
|
+
} catch ( e ) {}
|
326
|
+
}
|
327
|
+
|
328
|
+
} else {
|
329
|
+
|
330
|
+
// If a hook was provided get the non-computed value from there
|
331
|
+
if ( hooks && "get" in hooks &&
|
332
|
+
( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
|
333
|
+
|
334
|
+
return ret;
|
335
|
+
}
|
336
|
+
|
337
|
+
// Otherwise just get the value from the style object
|
338
|
+
return style[ name ];
|
339
|
+
}
|
340
|
+
},
|
341
|
+
|
342
|
+
css: function( elem, name, extra, styles ) {
|
343
|
+
var num, val, hooks,
|
344
|
+
origName = jQuery.camelCase( name );
|
345
|
+
|
346
|
+
// Make sure that we're working with the right name
|
347
|
+
name = jQuery.cssProps[ origName ] ||
|
348
|
+
( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
|
349
|
+
|
350
|
+
// gets hook for the prefixed version
|
351
|
+
// followed by the unprefixed version
|
352
|
+
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
|
353
|
+
|
354
|
+
// If a hook was provided get the computed value from there
|
355
|
+
if ( hooks && "get" in hooks ) {
|
356
|
+
val = hooks.get( elem, true, extra );
|
357
|
+
}
|
358
|
+
|
359
|
+
// Otherwise, if a way to get the computed value exists, use that
|
360
|
+
if ( val === undefined ) {
|
361
|
+
val = curCSS( elem, name, styles );
|
362
|
+
}
|
363
|
+
|
364
|
+
//convert "normal" to computed value
|
365
|
+
if ( val === "normal" && name in cssNormalTransform ) {
|
366
|
+
val = cssNormalTransform[ name ];
|
367
|
+
}
|
368
|
+
|
369
|
+
// Return, converting to number if forced or a qualifier was provided and val looks numeric
|
370
|
+
if ( extra === "" || extra ) {
|
371
|
+
num = parseFloat( val );
|
372
|
+
return extra === true || isFinite( num ) ? num || 0 : val;
|
373
|
+
}
|
374
|
+
return val;
|
375
|
+
}
|
376
|
+
} );
|
377
|
+
|
378
|
+
jQuery.each( [ "height", "width" ], function( i, name ) {
|
379
|
+
jQuery.cssHooks[ name ] = {
|
380
|
+
get: function( elem, computed, extra ) {
|
381
|
+
if ( computed ) {
|
382
|
+
|
383
|
+
// certain elements can have dimension info if we invisibly show them
|
384
|
+
// however, it must have a current display style that would benefit from this
|
385
|
+
return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
|
386
|
+
elem.offsetWidth === 0 ?
|
387
|
+
swap( elem, cssShow, function() {
|
388
|
+
return getWidthOrHeight( elem, name, extra );
|
389
|
+
} ) :
|
390
|
+
getWidthOrHeight( elem, name, extra );
|
391
|
+
}
|
392
|
+
},
|
393
|
+
|
394
|
+
set: function( elem, value, extra ) {
|
395
|
+
var styles = extra && getStyles( elem );
|
396
|
+
return setPositiveNumber( elem, value, extra ?
|
397
|
+
augmentWidthOrHeight(
|
398
|
+
elem,
|
399
|
+
name,
|
400
|
+
extra,
|
401
|
+
support.boxSizing &&
|
402
|
+
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
403
|
+
styles
|
404
|
+
) : 0
|
405
|
+
);
|
406
|
+
}
|
407
|
+
};
|
408
|
+
} );
|
409
|
+
|
410
|
+
if ( !support.opacity ) {
|
411
|
+
jQuery.cssHooks.opacity = {
|
412
|
+
get: function( elem, computed ) {
|
413
|
+
|
414
|
+
// IE uses filters for opacity
|
415
|
+
return ropacity.test( ( computed && elem.currentStyle ?
|
416
|
+
elem.currentStyle.filter :
|
417
|
+
elem.style.filter ) || "" ) ?
|
418
|
+
( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
|
419
|
+
computed ? "1" : "";
|
420
|
+
},
|
421
|
+
|
422
|
+
set: function( elem, value ) {
|
423
|
+
var style = elem.style,
|
424
|
+
currentStyle = elem.currentStyle,
|
425
|
+
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
|
426
|
+
filter = currentStyle && currentStyle.filter || style.filter || "";
|
427
|
+
|
428
|
+
// IE has trouble with opacity if it does not have layout
|
429
|
+
// Force it by setting the zoom level
|
430
|
+
style.zoom = 1;
|
431
|
+
|
432
|
+
// if setting opacity to 1, and no other filters exist -
|
433
|
+
// attempt to remove filter attribute #6652
|
434
|
+
// if value === "", then remove inline opacity #12685
|
435
|
+
if ( ( value >= 1 || value === "" ) &&
|
436
|
+
jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
|
437
|
+
style.removeAttribute ) {
|
438
|
+
|
439
|
+
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
|
440
|
+
// if "filter:" is present at all, clearType is disabled, we want to avoid this
|
441
|
+
// style.removeAttribute is IE Only, but so apparently is this code path...
|
442
|
+
style.removeAttribute( "filter" );
|
443
|
+
|
444
|
+
// if there is no filter style applied in a css rule
|
445
|
+
// or unset inline opacity, we are done
|
446
|
+
if ( value === "" || currentStyle && !currentStyle.filter ) {
|
447
|
+
return;
|
448
|
+
}
|
449
|
+
}
|
450
|
+
|
451
|
+
// otherwise, set new filter values
|
452
|
+
style.filter = ralpha.test( filter ) ?
|
453
|
+
filter.replace( ralpha, opacity ) :
|
454
|
+
filter + " " + opacity;
|
455
|
+
}
|
456
|
+
};
|
457
|
+
}
|
458
|
+
|
459
|
+
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
|
460
|
+
function( elem, computed ) {
|
461
|
+
if ( computed ) {
|
462
|
+
return swap( elem, { "display": "inline-block" },
|
463
|
+
curCSS, [ elem, "marginRight" ] );
|
464
|
+
}
|
465
|
+
}
|
466
|
+
);
|
467
|
+
|
468
|
+
jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
|
469
|
+
function( elem, computed ) {
|
470
|
+
if ( computed ) {
|
471
|
+
return (
|
472
|
+
parseFloat( curCSS( elem, "marginLeft" ) ) ||
|
473
|
+
|
474
|
+
// Support: IE<=11+
|
475
|
+
// Running getBoundingClientRect on a disconnected node in IE throws an error
|
476
|
+
// Support: IE8 only
|
477
|
+
// getClientRects() errors on disconnected elems
|
478
|
+
( jQuery.contains( elem.ownerDocument, elem ) ?
|
479
|
+
elem.getBoundingClientRect().left -
|
480
|
+
swap( elem, { marginLeft: 0 }, function() {
|
481
|
+
return elem.getBoundingClientRect().left;
|
482
|
+
} ) :
|
483
|
+
0
|
484
|
+
)
|
485
|
+
) + "px";
|
486
|
+
}
|
487
|
+
}
|
488
|
+
);
|
489
|
+
|
490
|
+
// These hooks are used by animate to expand properties
|
491
|
+
jQuery.each( {
|
492
|
+
margin: "",
|
493
|
+
padding: "",
|
494
|
+
border: "Width"
|
495
|
+
}, function( prefix, suffix ) {
|
496
|
+
jQuery.cssHooks[ prefix + suffix ] = {
|
497
|
+
expand: function( value ) {
|
498
|
+
var i = 0,
|
499
|
+
expanded = {},
|
500
|
+
|
501
|
+
// assumes a single number if not a string
|
502
|
+
parts = typeof value === "string" ? value.split( " " ) : [ value ];
|
503
|
+
|
504
|
+
for ( ; i < 4; i++ ) {
|
505
|
+
expanded[ prefix + cssExpand[ i ] + suffix ] =
|
506
|
+
parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
|
507
|
+
}
|
508
|
+
|
509
|
+
return expanded;
|
510
|
+
}
|
511
|
+
};
|
512
|
+
|
513
|
+
if ( !rmargin.test( prefix ) ) {
|
514
|
+
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
|
515
|
+
}
|
516
|
+
} );
|
517
|
+
|
518
|
+
jQuery.fn.extend( {
|
519
|
+
css: function( name, value ) {
|
520
|
+
return access( this, function( elem, name, value ) {
|
521
|
+
var styles, len,
|
522
|
+
map = {},
|
523
|
+
i = 0;
|
524
|
+
|
525
|
+
if ( jQuery.isArray( name ) ) {
|
526
|
+
styles = getStyles( elem );
|
527
|
+
len = name.length;
|
528
|
+
|
529
|
+
for ( ; i < len; i++ ) {
|
530
|
+
map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
|
531
|
+
}
|
532
|
+
|
533
|
+
return map;
|
534
|
+
}
|
535
|
+
|
536
|
+
return value !== undefined ?
|
537
|
+
jQuery.style( elem, name, value ) :
|
538
|
+
jQuery.css( elem, name );
|
539
|
+
}, name, value, arguments.length > 1 );
|
540
|
+
},
|
541
|
+
show: function() {
|
542
|
+
return showHide( this, true );
|
543
|
+
},
|
544
|
+
hide: function() {
|
545
|
+
return showHide( this );
|
546
|
+
},
|
547
|
+
toggle: function( state ) {
|
548
|
+
if ( typeof state === "boolean" ) {
|
549
|
+
return state ? this.show() : this.hide();
|
550
|
+
}
|
551
|
+
|
552
|
+
return this.each( function() {
|
553
|
+
if ( isHidden( this ) ) {
|
554
|
+
jQuery( this ).show();
|
555
|
+
} else {
|
556
|
+
jQuery( this ).hide();
|
557
|
+
}
|
558
|
+
} );
|
559
|
+
}
|
560
|
+
} );
|
561
|
+
|
562
|
+
return jQuery;
|
563
|
+
} );
|