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.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/favicon-example.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/favicon-production.png +0 -0
  4. data/app/assets/javascripts/component_guide/application.js +1 -1
  5. data/app/assets/javascripts/component_guide/no_slimmer.js +15 -0
  6. data/app/assets/javascripts/govuk_publishing_components/admin_scripts.js +2 -4
  7. data/app/assets/javascripts/govuk_publishing_components/all_components.js +4 -0
  8. data/app/assets/stylesheets/component_guide/application.scss +80 -74
  9. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +4 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +26 -5
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +21 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +7 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +2 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +24 -5
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +2 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +19 -7
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +11 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +12 -0
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +9 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +2 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +11 -0
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +7 -2
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +9 -8
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +4 -2
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +12 -1
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +6 -0
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +16 -2
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -0
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +8 -2
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +2 -0
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +5 -0
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +30 -7
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +14 -4
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +2 -0
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss +2 -1
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-navigation.scss +10 -0
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +4 -0
  40. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +7 -2
  41. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +4 -0
  42. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +24 -8
  43. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +47 -13
  44. data/app/controllers/govuk_publishing_components/application_controller.rb +5 -6
  45. data/app/views/govuk_publishing_components/component_guide/index.html.erb +2 -2
  46. data/app/views/govuk_publishing_components/component_guide/show.html.erb +9 -9
  47. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
  48. data/app/views/govuk_publishing_components/components/_feedback.html.erb +2 -2
  49. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
  50. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +4 -7
  51. data/app/views/govuk_publishing_components/components/_notice.html.erb +2 -2
  52. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +2 -2
  53. data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -1
  54. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +1 -1
  55. data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +2 -2
  56. data/app/views/govuk_publishing_components/components/_taxonomy_navigation.html.erb +2 -2
  57. data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +1 -1
  58. data/app/views/govuk_publishing_components/components/docs/fieldset.yml +1 -1
  59. data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +1 -0
  60. data/app/views/govuk_publishing_components/components/docs/tabs.yml +7 -7
  61. data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +1 -1
  62. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +3 -3
  63. data/app/views/layouts/govuk_publishing_components/application.html.erb +43 -44
  64. data/config/initializers/assets.rb +2 -0
  65. data/lib/govuk_publishing_components/app_helpers/environment.rb +1 -0
  66. data/lib/govuk_publishing_components/config.rb +1 -1
  67. data/lib/govuk_publishing_components/engine.rb +0 -1
  68. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +1 -1
  69. data/lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb +1 -1
  70. data/lib/govuk_publishing_components/version.rb +1 -1
  71. data/node_modules/jquery/AUTHORS.txt +266 -0
  72. data/node_modules/jquery/LICENSE.txt +36 -0
  73. data/node_modules/jquery/README.md +65 -0
  74. data/node_modules/jquery/bower.json +14 -0
  75. data/node_modules/jquery/dist/jquery.js +11008 -0
  76. data/node_modules/jquery/dist/jquery.min.js +5 -0
  77. data/node_modules/jquery/dist/jquery.min.map +1 -0
  78. data/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
  79. data/node_modules/jquery/external/sizzle/dist/sizzle.js +2143 -0
  80. data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  81. data/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  82. data/node_modules/jquery/package.json +157 -0
  83. data/node_modules/jquery/src/ajax.js +842 -0
  84. data/node_modules/jquery/src/ajax/jsonp.js +100 -0
  85. data/node_modules/jquery/src/ajax/load.js +83 -0
  86. data/node_modules/jquery/src/ajax/parseJSON.js +53 -0
  87. data/node_modules/jquery/src/ajax/parseXML.js +31 -0
  88. data/node_modules/jquery/src/ajax/script.js +95 -0
  89. data/node_modules/jquery/src/ajax/var/location.js +3 -0
  90. data/node_modules/jquery/src/ajax/var/nonce.js +5 -0
  91. data/node_modules/jquery/src/ajax/var/rquery.js +3 -0
  92. data/node_modules/jquery/src/ajax/xhr.js +229 -0
  93. data/node_modules/jquery/src/attributes.js +11 -0
  94. data/node_modules/jquery/src/attributes/attr.js +281 -0
  95. data/node_modules/jquery/src/attributes/classes.js +174 -0
  96. data/node_modules/jquery/src/attributes/prop.js +156 -0
  97. data/node_modules/jquery/src/attributes/support.js +70 -0
  98. data/node_modules/jquery/src/attributes/val.js +191 -0
  99. data/node_modules/jquery/src/callbacks.js +232 -0
  100. data/node_modules/jquery/src/core.js +529 -0
  101. data/node_modules/jquery/src/core/access.js +65 -0
  102. data/node_modules/jquery/src/core/init.js +140 -0
  103. data/node_modules/jquery/src/core/parseHTML.js +41 -0
  104. data/node_modules/jquery/src/core/ready.js +163 -0
  105. data/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
  106. data/node_modules/jquery/src/css.js +563 -0
  107. data/node_modules/jquery/src/css/addGetHookIf.js +24 -0
  108. data/node_modules/jquery/src/css/adjustCSS.js +65 -0
  109. data/node_modules/jquery/src/css/curCSS.js +137 -0
  110. data/node_modules/jquery/src/css/defaultDisplay.js +72 -0
  111. data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +42 -0
  112. data/node_modules/jquery/src/css/showHide.js +45 -0
  113. data/node_modules/jquery/src/css/support.js +184 -0
  114. data/node_modules/jquery/src/css/var/cssExpand.js +3 -0
  115. data/node_modules/jquery/src/css/var/isHidden.js +16 -0
  116. data/node_modules/jquery/src/css/var/rmargin.js +3 -0
  117. data/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
  118. data/node_modules/jquery/src/css/var/swap.js +24 -0
  119. data/node_modules/jquery/src/data.js +342 -0
  120. data/node_modules/jquery/src/data/support.js +23 -0
  121. data/node_modules/jquery/src/data/var/acceptData.js +20 -0
  122. data/node_modules/jquery/src/deferred.js +159 -0
  123. data/node_modules/jquery/src/deprecated.js +34 -0
  124. data/node_modules/jquery/src/dimensions.js +56 -0
  125. data/node_modules/jquery/src/effects.js +640 -0
  126. data/node_modules/jquery/src/effects/Tween.js +121 -0
  127. data/node_modules/jquery/src/effects/animatedSelector.js +13 -0
  128. data/node_modules/jquery/src/effects/support.js +58 -0
  129. data/node_modules/jquery/src/event.js +1134 -0
  130. data/node_modules/jquery/src/event/ajax.js +20 -0
  131. data/node_modules/jquery/src/event/alias.js +25 -0
  132. data/node_modules/jquery/src/event/support.js +28 -0
  133. data/node_modules/jquery/src/exports/amd.js +24 -0
  134. data/node_modules/jquery/src/exports/global.js +26 -0
  135. data/node_modules/jquery/src/intro.js +44 -0
  136. data/node_modules/jquery/src/jquery.js +37 -0
  137. data/node_modules/jquery/src/manipulation.js +585 -0
  138. data/node_modules/jquery/src/manipulation/_evalUrl.js +21 -0
  139. data/node_modules/jquery/src/manipulation/buildFragment.js +157 -0
  140. data/node_modules/jquery/src/manipulation/createSafeFragment.js +20 -0
  141. data/node_modules/jquery/src/manipulation/getAll.js +33 -0
  142. data/node_modules/jquery/src/manipulation/setGlobalEval.js +19 -0
  143. data/node_modules/jquery/src/manipulation/support.js +72 -0
  144. data/node_modules/jquery/src/manipulation/var/nodeNames.js +5 -0
  145. data/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
  146. data/node_modules/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
  147. data/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
  148. data/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
  149. data/node_modules/jquery/src/manipulation/wrapMap.js +30 -0
  150. data/node_modules/jquery/src/offset.js +219 -0
  151. data/node_modules/jquery/src/outro.js +2 -0
  152. data/node_modules/jquery/src/queue.js +144 -0
  153. data/node_modules/jquery/src/queue/delay.js +22 -0
  154. data/node_modules/jquery/src/selector-sizzle.js +14 -0
  155. data/node_modules/jquery/src/selector.js +1 -0
  156. data/node_modules/jquery/src/serialize.js +125 -0
  157. data/node_modules/jquery/src/support.js +63 -0
  158. data/node_modules/jquery/src/traversing.js +179 -0
  159. data/node_modules/jquery/src/traversing/findFilter.js +100 -0
  160. data/node_modules/jquery/src/traversing/var/dir.js +20 -0
  161. data/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
  162. data/node_modules/jquery/src/traversing/var/siblings.js +15 -0
  163. data/node_modules/jquery/src/var/class2type.js +5 -0
  164. data/node_modules/jquery/src/var/concat.js +5 -0
  165. data/node_modules/jquery/src/var/deletedIds.js +3 -0
  166. data/node_modules/jquery/src/var/document.js +3 -0
  167. data/node_modules/jquery/src/var/documentElement.js +5 -0
  168. data/node_modules/jquery/src/var/hasOwn.js +5 -0
  169. data/node_modules/jquery/src/var/indexOf.js +5 -0
  170. data/node_modules/jquery/src/var/pnum.js +3 -0
  171. data/node_modules/jquery/src/var/push.js +5 -0
  172. data/node_modules/jquery/src/var/rcssNum.js +7 -0
  173. data/node_modules/jquery/src/var/rnotwhite.js +3 -0
  174. data/node_modules/jquery/src/var/slice.js +5 -0
  175. data/node_modules/jquery/src/var/support.js +5 -0
  176. data/node_modules/jquery/src/var/toString.js +5 -0
  177. data/node_modules/jquery/src/wrap.js +77 -0
  178. metadata +111 -19
  179. data/app/assets/images/govuk_publishing_components/favicon-test.png +0 -0
  180. data/app/assets/stylesheets/govuk_publishing_components/admin_styles_ie8.scss +0 -3
  181. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_touch-friendly-links.scss +0 -11
@@ -0,0 +1,24 @@
1
+ define( function() {
2
+
3
+ function addGetHookIf( conditionFn, hookFn ) {
4
+
5
+ // Define the hook, we'll check on the first run if it's really needed.
6
+ return {
7
+ get: function() {
8
+ if ( conditionFn() ) {
9
+
10
+ // Hook not needed (or it's not possible to use it due
11
+ // to missing dependency), remove it.
12
+ delete this.get;
13
+ return;
14
+ }
15
+
16
+ // Hook needed; redefine it so that the support test is not executed again.
17
+ return ( this.get = hookFn ).apply( this, arguments );
18
+ }
19
+ };
20
+ }
21
+
22
+ return addGetHookIf;
23
+
24
+ } );
@@ -0,0 +1,65 @@
1
+ define( [
2
+ "../core",
3
+ "../var/rcssNum"
4
+ ], function( jQuery, rcssNum ) {
5
+
6
+ function adjustCSS( elem, prop, valueParts, tween ) {
7
+ var adjusted,
8
+ scale = 1,
9
+ maxIterations = 20,
10
+ currentValue = tween ?
11
+ function() { return tween.cur(); } :
12
+ function() { return jQuery.css( elem, prop, "" ); },
13
+ initial = currentValue(),
14
+ unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
15
+
16
+ // Starting value computation is required for potential unit mismatches
17
+ initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
18
+ rcssNum.exec( jQuery.css( elem, prop ) );
19
+
20
+ if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
21
+
22
+ // Trust units reported by jQuery.css
23
+ unit = unit || initialInUnit[ 3 ];
24
+
25
+ // Make sure we update the tween properties later on
26
+ valueParts = valueParts || [];
27
+
28
+ // Iteratively approximate from a nonzero starting point
29
+ initialInUnit = +initial || 1;
30
+
31
+ do {
32
+
33
+ // If previous iteration zeroed out, double until we get *something*.
34
+ // Use string for doubling so we don't accidentally see scale as unchanged below
35
+ scale = scale || ".5";
36
+
37
+ // Adjust and apply
38
+ initialInUnit = initialInUnit / scale;
39
+ jQuery.style( elem, prop, initialInUnit + unit );
40
+
41
+ // Update scale, tolerating zero or NaN from tween.cur()
42
+ // Break the loop if scale is unchanged or perfect, or if we've just had enough.
43
+ } while (
44
+ scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
45
+ );
46
+ }
47
+
48
+ if ( valueParts ) {
49
+ initialInUnit = +initialInUnit || +initial || 0;
50
+
51
+ // Apply relative offset (+=/-=) if specified
52
+ adjusted = valueParts[ 1 ] ?
53
+ initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
54
+ +valueParts[ 2 ];
55
+ if ( tween ) {
56
+ tween.unit = unit;
57
+ tween.start = initialInUnit;
58
+ tween.end = adjusted;
59
+ }
60
+ }
61
+ return adjusted;
62
+ }
63
+
64
+ return adjustCSS;
65
+ } );
@@ -0,0 +1,137 @@
1
+ define( [
2
+ "exports",
3
+ "../core",
4
+ "../var/documentElement",
5
+ "./var/rnumnonpx",
6
+ "./var/rmargin",
7
+ "./support",
8
+ "../selector" // contains
9
+ ], function( exports, jQuery, documentElement, rnumnonpx, rmargin, support ) {
10
+
11
+ var getStyles, curCSS,
12
+ rposition = /^(top|right|bottom|left)$/;
13
+
14
+ if ( window.getComputedStyle ) {
15
+ getStyles = function( elem ) {
16
+
17
+ // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
18
+ // IE throws on elements created in popups
19
+ // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
20
+ var view = elem.ownerDocument.defaultView;
21
+
22
+ if ( !view || !view.opener ) {
23
+ view = window;
24
+ }
25
+
26
+ return view.getComputedStyle( elem );
27
+ };
28
+
29
+ curCSS = function( elem, name, computed ) {
30
+ var width, minWidth, maxWidth, ret,
31
+ style = elem.style;
32
+
33
+ computed = computed || getStyles( elem );
34
+
35
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
36
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
37
+
38
+ // Support: Opera 12.1x only
39
+ // Fall back to style even without computed
40
+ // computed is undefined for elems on document fragments
41
+ if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
42
+ ret = jQuery.style( elem, name );
43
+ }
44
+
45
+ if ( computed ) {
46
+
47
+ // A tribute to the "awesome hack by Dean Edwards"
48
+ // Chrome < 17 and Safari 5.0 uses "computed value"
49
+ // instead of "used value" for margin-right
50
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values,
51
+ // but width seems to be reliably pixels
52
+ // this is against the CSSOM draft spec:
53
+ // http://dev.w3.org/csswg/cssom/#resolved-values
54
+ if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
55
+
56
+ // Remember the original values
57
+ width = style.width;
58
+ minWidth = style.minWidth;
59
+ maxWidth = style.maxWidth;
60
+
61
+ // Put in the new values to get a computed value out
62
+ style.minWidth = style.maxWidth = style.width = ret;
63
+ ret = computed.width;
64
+
65
+ // Revert the changed values
66
+ style.width = width;
67
+ style.minWidth = minWidth;
68
+ style.maxWidth = maxWidth;
69
+ }
70
+ }
71
+
72
+ // Support: IE
73
+ // IE returns zIndex value as an integer.
74
+ return ret === undefined ?
75
+ ret :
76
+ ret + "";
77
+ };
78
+ } else if ( documentElement.currentStyle ) {
79
+ getStyles = function( elem ) {
80
+ return elem.currentStyle;
81
+ };
82
+
83
+ curCSS = function( elem, name, computed ) {
84
+ var left, rs, rsLeft, ret,
85
+ style = elem.style;
86
+
87
+ computed = computed || getStyles( elem );
88
+ ret = computed ? computed[ name ] : undefined;
89
+
90
+ // Avoid setting ret to empty string here
91
+ // so we don't default to auto
92
+ if ( ret == null && style && style[ name ] ) {
93
+ ret = style[ name ];
94
+ }
95
+
96
+ // From the awesome hack by Dean Edwards
97
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
98
+
99
+ // If we're not dealing with a regular pixel number
100
+ // but a number that has a weird ending, we need to convert it to pixels
101
+ // but not position css attributes, as those are
102
+ // proportional to the parent element instead
103
+ // and we can't measure the parent instead because it
104
+ // might trigger a "stacking dolls" problem
105
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
106
+
107
+ // Remember the original values
108
+ left = style.left;
109
+ rs = elem.runtimeStyle;
110
+ rsLeft = rs && rs.left;
111
+
112
+ // Put in the new values to get a computed value out
113
+ if ( rsLeft ) {
114
+ rs.left = elem.currentStyle.left;
115
+ }
116
+ style.left = name === "fontSize" ? "1em" : ret;
117
+ ret = style.pixelLeft + "px";
118
+
119
+ // Revert the changed values
120
+ style.left = left;
121
+ if ( rsLeft ) {
122
+ rs.left = rsLeft;
123
+ }
124
+ }
125
+
126
+ // Support: IE
127
+ // IE returns zIndex value as an integer.
128
+ return ret === undefined ?
129
+ ret :
130
+ ret + "" || "auto";
131
+ };
132
+ }
133
+
134
+ exports.getStyles = getStyles;
135
+ exports.curCSS = curCSS;
136
+
137
+ } );
@@ -0,0 +1,72 @@
1
+ define( [
2
+ "../core",
3
+ "../var/document",
4
+ "../manipulation" // appendTo
5
+ ], function( jQuery, document ) {
6
+
7
+ var iframe,
8
+ elemdisplay = {
9
+
10
+ // Support: Firefox
11
+ // We have to pre-define these values for FF (#10227)
12
+ HTML: "block",
13
+ BODY: "block"
14
+ };
15
+
16
+ /**
17
+ * Retrieve the actual display of a element
18
+ * @param {String} name nodeName of the element
19
+ * @param {Object} doc Document object
20
+ */
21
+
22
+ // Called only from within defaultDisplay
23
+ function actualDisplay( name, doc ) {
24
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
25
+
26
+ display = jQuery.css( elem[ 0 ], "display" );
27
+
28
+ // We don't have any data stored on the element,
29
+ // so use "detach" method as fast way to get rid of the element
30
+ elem.detach();
31
+
32
+ return display;
33
+ }
34
+
35
+ /**
36
+ * Try to determine the default display value of an element
37
+ * @param {String} nodeName
38
+ */
39
+ function defaultDisplay( nodeName ) {
40
+ var doc = document,
41
+ display = elemdisplay[ nodeName ];
42
+
43
+ if ( !display ) {
44
+ display = actualDisplay( nodeName, doc );
45
+
46
+ // If the simple way fails, read from inside an iframe
47
+ if ( display === "none" || !display ) {
48
+
49
+ // Use the already-created iframe if possible
50
+ iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
51
+ .appendTo( doc.documentElement );
52
+
53
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
54
+ doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
55
+
56
+ // Support: IE
57
+ doc.write();
58
+ doc.close();
59
+
60
+ display = actualDisplay( nodeName, doc );
61
+ iframe.detach();
62
+ }
63
+
64
+ // Store the correct default display
65
+ elemdisplay[ nodeName ] = display;
66
+ }
67
+
68
+ return display;
69
+ }
70
+
71
+ return defaultDisplay;
72
+ } );
@@ -0,0 +1,42 @@
1
+ define( [
2
+ "../core",
3
+ "../var/document",
4
+ "./support",
5
+ "../selector",
6
+ "../css"
7
+ ], function( jQuery, document, support ) {
8
+
9
+ function getDisplay( elem ) {
10
+ return elem.style && elem.style.display || jQuery.css( elem, "display" );
11
+ }
12
+
13
+ function filterHidden( elem ) {
14
+
15
+ // Disconnected elements are considered hidden
16
+ if ( !jQuery.contains( elem.ownerDocument || document, elem ) ) {
17
+ return true;
18
+ }
19
+ while ( elem && elem.nodeType === 1 ) {
20
+ if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) {
21
+ return true;
22
+ }
23
+ elem = elem.parentNode;
24
+ }
25
+ return false;
26
+ }
27
+
28
+ jQuery.expr.filters.hidden = function( elem ) {
29
+
30
+ // Support: Opera <= 12.12
31
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
32
+ return support.reliableHiddenOffsets() ?
33
+ ( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 &&
34
+ !elem.getClientRects().length ) :
35
+ filterHidden( elem );
36
+ };
37
+
38
+ jQuery.expr.filters.visible = function( elem ) {
39
+ return !jQuery.expr.filters.hidden( elem );
40
+ };
41
+
42
+ } );
@@ -0,0 +1,45 @@
1
+ define( [], function() {
2
+ function showHide( elements, show ) {
3
+ var display, elem,
4
+ values = [],
5
+ index = 0,
6
+ length = elements.length;
7
+
8
+ // Determine new display value for elements that need to change
9
+ for ( ; index < length; index++ ) {
10
+ elem = elements[ index ];
11
+ if ( !elem.style ) {
12
+ continue;
13
+ }
14
+
15
+ display = elem.style.display;
16
+ if ( show ) {
17
+ if ( display === "none" ) {
18
+
19
+ // Restore a pre-hide() value if we have one
20
+ values[ index ] = jQuery._data( elem, "display" ) || "";
21
+ }
22
+ } else {
23
+ if ( display !== "none" ) {
24
+ values[ index ] = "none";
25
+
26
+ // Remember the value we're replacing
27
+ jQuery._data( elem, "display", display );
28
+ }
29
+ }
30
+ }
31
+
32
+ // Set the display of the elements in a second loop
33
+ // to avoid the constant reflow
34
+ for ( index = 0; index < length; index++ ) {
35
+ if ( values[ index ] != null ) {
36
+ elements[ index ].style.display = values[ index ];
37
+ }
38
+ }
39
+
40
+ return elements;
41
+ }
42
+
43
+ return showHide;
44
+
45
+ } );
@@ -0,0 +1,184 @@
1
+ define( [
2
+ "../core",
3
+ "../var/document",
4
+ "../var/documentElement",
5
+ "../var/support"
6
+ ], function( jQuery, document, documentElement, support ) {
7
+
8
+ ( function() {
9
+ var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal,
10
+ reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal,
11
+ container = document.createElement( "div" ),
12
+ div = document.createElement( "div" );
13
+
14
+ // Finish early in limited (non-browser) environments
15
+ if ( !div.style ) {
16
+ return;
17
+ }
18
+
19
+ div.style.cssText = "float:left;opacity:.5";
20
+
21
+ // Support: IE<9
22
+ // Make sure that element opacity exists (as opposed to filter)
23
+ support.opacity = div.style.opacity === "0.5";
24
+
25
+ // Verify style float existence
26
+ // (IE uses styleFloat instead of cssFloat)
27
+ support.cssFloat = !!div.style.cssFloat;
28
+
29
+ div.style.backgroundClip = "content-box";
30
+ div.cloneNode( true ).style.backgroundClip = "";
31
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
32
+
33
+ container = document.createElement( "div" );
34
+ container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
35
+ "padding:0;margin-top:1px;position:absolute";
36
+ div.innerHTML = "";
37
+ container.appendChild( div );
38
+
39
+ // Support: Firefox<29, Android 2.3
40
+ // Vendor-prefix box-sizing
41
+ support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" ||
42
+ div.style.WebkitBoxSizing === "";
43
+
44
+ jQuery.extend( support, {
45
+ reliableHiddenOffsets: function() {
46
+ if ( pixelPositionVal == null ) {
47
+ computeStyleTests();
48
+ }
49
+ return reliableHiddenOffsetsVal;
50
+ },
51
+
52
+ boxSizingReliable: function() {
53
+
54
+ // We're checking for pixelPositionVal here instead of boxSizingReliableVal
55
+ // since that compresses better and they're computed together anyway.
56
+ if ( pixelPositionVal == null ) {
57
+ computeStyleTests();
58
+ }
59
+ return boxSizingReliableVal;
60
+ },
61
+
62
+ pixelMarginRight: function() {
63
+
64
+ // Support: Android 4.0-4.3
65
+ if ( pixelPositionVal == null ) {
66
+ computeStyleTests();
67
+ }
68
+ return pixelMarginRightVal;
69
+ },
70
+
71
+ pixelPosition: function() {
72
+ if ( pixelPositionVal == null ) {
73
+ computeStyleTests();
74
+ }
75
+ return pixelPositionVal;
76
+ },
77
+
78
+ reliableMarginRight: function() {
79
+
80
+ // Support: Android 2.3
81
+ if ( pixelPositionVal == null ) {
82
+ computeStyleTests();
83
+ }
84
+ return reliableMarginRightVal;
85
+ },
86
+
87
+ reliableMarginLeft: function() {
88
+
89
+ // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
90
+ if ( pixelPositionVal == null ) {
91
+ computeStyleTests();
92
+ }
93
+ return reliableMarginLeftVal;
94
+ }
95
+ } );
96
+
97
+ function computeStyleTests() {
98
+ var contents, divStyle,
99
+ documentElement = document.documentElement;
100
+
101
+ // Setup
102
+ documentElement.appendChild( container );
103
+
104
+ div.style.cssText =
105
+
106
+ // Support: Android 2.3
107
+ // Vendor-prefix box-sizing
108
+ "-webkit-box-sizing:border-box;box-sizing:border-box;" +
109
+ "position:relative;display:block;" +
110
+ "margin:auto;border:1px;padding:1px;" +
111
+ "top:1%;width:50%";
112
+
113
+ // Support: IE<9
114
+ // Assume reasonable values in the absence of getComputedStyle
115
+ pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false;
116
+ pixelMarginRightVal = reliableMarginRightVal = true;
117
+
118
+ // Check for getComputedStyle so that this code is not run in IE<9.
119
+ if ( window.getComputedStyle ) {
120
+ divStyle = window.getComputedStyle( div );
121
+ pixelPositionVal = ( divStyle || {} ).top !== "1%";
122
+ reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px";
123
+ boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px";
124
+
125
+ // Support: Android 4.0 - 4.3 only
126
+ // Some styles come back with percentage values, even though they shouldn't
127
+ div.style.marginRight = "50%";
128
+ pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px";
129
+
130
+ // Support: Android 2.3 only
131
+ // Div with explicit width and no margin-right incorrectly
132
+ // gets computed margin-right based on width of container (#3333)
133
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
134
+ contents = div.appendChild( document.createElement( "div" ) );
135
+
136
+ // Reset CSS: box-sizing; display; margin; border; padding
137
+ contents.style.cssText = div.style.cssText =
138
+
139
+ // Support: Android 2.3
140
+ // Vendor-prefix box-sizing
141
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
142
+ "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
143
+ contents.style.marginRight = contents.style.width = "0";
144
+ div.style.width = "1px";
145
+
146
+ reliableMarginRightVal =
147
+ !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight );
148
+
149
+ div.removeChild( contents );
150
+ }
151
+
152
+ // Support: IE6-8
153
+ // First check that getClientRects works as expected
154
+ // Check if table cells still have offsetWidth/Height when they are set
155
+ // to display:none and there are still other visible table cells in a
156
+ // table row; if so, offsetWidth/Height are not reliable for use when
157
+ // determining if an element has been hidden directly using
158
+ // display:none (it is still safe to use offsets if a parent element is
159
+ // hidden; don safety goggles and see bug #4512 for more information).
160
+ div.style.display = "none";
161
+ reliableHiddenOffsetsVal = div.getClientRects().length === 0;
162
+ if ( reliableHiddenOffsetsVal ) {
163
+ div.style.display = "";
164
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
165
+ div.childNodes[ 0 ].style.borderCollapse = "separate";
166
+ contents = div.getElementsByTagName( "td" );
167
+ contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
168
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
169
+ if ( reliableHiddenOffsetsVal ) {
170
+ contents[ 0 ].style.display = "";
171
+ contents[ 1 ].style.display = "none";
172
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
173
+ }
174
+ }
175
+
176
+ // Teardown
177
+ documentElement.removeChild( container );
178
+ }
179
+
180
+ } )();
181
+
182
+ return support;
183
+
184
+ } );