va_common 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -4
  3. data/app/assets/js/va_common_main.js +16 -1
  4. data/lib/va_common/version.rb +1 -1
  5. data/lib/va_common.rb +4 -0
  6. data/va_common.gemspec +15 -0
  7. metadata +200 -177
  8. data/app/assets/js/foundation/foundation.abide.js +0 -408
  9. data/app/assets/js/foundation/foundation.accordion.js +0 -88
  10. data/app/assets/js/foundation/foundation.alert.js +0 -43
  11. data/app/assets/js/foundation/foundation.clearing.js +0 -586
  12. data/app/assets/js/foundation/foundation.dropdown.js +0 -463
  13. data/app/assets/js/foundation/foundation.equalizer.js +0 -104
  14. data/app/assets/js/foundation/foundation.interchange.js +0 -359
  15. data/app/assets/js/foundation/foundation.joyride.js +0 -932
  16. data/app/assets/js/foundation/foundation.js +0 -725
  17. data/app/assets/js/foundation/foundation.magellan.js +0 -215
  18. data/app/assets/js/foundation/foundation.offcanvas.js +0 -152
  19. data/app/assets/js/foundation/foundation.orbit.js +0 -476
  20. data/app/assets/js/foundation/foundation.reveal.js +0 -498
  21. data/app/assets/js/foundation/foundation.slider.js +0 -281
  22. data/app/assets/js/foundation/foundation.tab.js +0 -249
  23. data/app/assets/js/foundation/foundation.tooltip.js +0 -339
  24. data/app/assets/js/foundation/foundation.topbar.js +0 -458
  25. data/app/assets/js/foundation.min.js +0 -6376
  26. data/app/assets/js/vendor/html5shiv.js +0 -8
  27. data/app/assets/js/vendor/jquery-1.11.0.min.js +0 -4
  28. data/app/assets/js/vendor/jquery.js +0 -9789
  29. data/app/assets/js/vendor/jquery.smooth-scroll.js +0 -255
  30. data/app/assets/js/vendor/jquery.stellar.js +0 -651
  31. data/app/assets/js/vendor/jquery.tipsy.js +0 -258
  32. data/app/assets/js/vendor/menu.js +0 -40
  33. data/app/assets/js/vendor/modernizr.custom.js +0 -4
  34. data/app/assets/js/vendor/respond.min.js +0 -6
  35. data/app/assets/js/vendor/selectivizr-1.0.3b.js +0 -560
  36. data/app/assets/js/vendor/tota11y.min.js +0 -28
  37. data/app/assets/js/vendor/wow.min.js +0 -2
  38. data/app/assets/stylesheets/foundation/_functions.scss +0 -146
  39. data/app/assets/stylesheets/foundation/_settings.scss +0 -1467
  40. data/app/assets/stylesheets/foundation/_variables.scss +0 -1286
  41. data/app/assets/stylesheets/foundation/components/_accordion.scss +0 -157
  42. data/app/assets/stylesheets/foundation/components/_alert-boxes.scss +0 -128
  43. data/app/assets/stylesheets/foundation/components/_block-grid.scss +0 -132
  44. data/app/assets/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
  45. data/app/assets/stylesheets/foundation/components/_button-groups.scss +0 -200
  46. data/app/assets/stylesheets/foundation/components/_buttons.scss +0 -259
  47. data/app/assets/stylesheets/foundation/components/_clearing.scss +0 -256
  48. data/app/assets/stylesheets/foundation/components/_dropdown-buttons.scss +0 -131
  49. data/app/assets/stylesheets/foundation/components/_dropdown.scss +0 -262
  50. data/app/assets/stylesheets/foundation/components/_flex-video.scss +0 -51
  51. data/app/assets/stylesheets/foundation/components/_forms.scss +0 -570
  52. data/app/assets/stylesheets/foundation/components/_global.scss +0 -481
  53. data/app/assets/stylesheets/foundation/components/_grid.scss +0 -289
  54. data/app/assets/stylesheets/foundation/components/_icon-bar.scss +0 -358
  55. data/app/assets/stylesheets/foundation/components/_inline-lists.scss +0 -57
  56. data/app/assets/stylesheets/foundation/components/_joyride.scss +0 -222
  57. data/app/assets/stylesheets/foundation/components/_keystrokes.scss +0 -61
  58. data/app/assets/stylesheets/foundation/components/_labels.scss +0 -106
  59. data/app/assets/stylesheets/foundation/components/_magellan.scss +0 -34
  60. data/app/assets/stylesheets/foundation/components/_offcanvas.scss +0 -515
  61. data/app/assets/stylesheets/foundation/components/_orbit.scss +0 -368
  62. data/app/assets/stylesheets/foundation/components/_pagination.scss +0 -162
  63. data/app/assets/stylesheets/foundation/components/_panels.scss +0 -101
  64. data/app/assets/stylesheets/foundation/components/_pricing-tables.scss +0 -150
  65. data/app/assets/stylesheets/foundation/components/_progress-bars.scss +0 -79
  66. data/app/assets/stylesheets/foundation/components/_range-slider.scss +0 -169
  67. data/app/assets/stylesheets/foundation/components/_reveal.scss +0 -202
  68. data/app/assets/stylesheets/foundation/components/_side-nav.scss +0 -116
  69. data/app/assets/stylesheets/foundation/components/_split-buttons.scss +0 -199
  70. data/app/assets/stylesheets/foundation/components/_sub-nav.scss +0 -123
  71. data/app/assets/stylesheets/foundation/components/_switches.scss +0 -238
  72. data/app/assets/stylesheets/foundation/components/_tables.scss +0 -135
  73. data/app/assets/stylesheets/foundation/components/_tabs.scss +0 -123
  74. data/app/assets/stylesheets/foundation/components/_thumbs.scss +0 -66
  75. data/app/assets/stylesheets/foundation/components/_toolbar.scss +0 -70
  76. data/app/assets/stylesheets/foundation/components/_tooltips.scss +0 -142
  77. data/app/assets/stylesheets/foundation/components/_top-bar.scss +0 -691
  78. data/app/assets/stylesheets/foundation/components/_type.scss +0 -525
  79. data/app/assets/stylesheets/foundation/components/_visibility.scss +0 -408
  80. data/app/assets/stylesheets/lib/_normalize.scss +0 -427
  81. data/app/assets/stylesheets/lib/bourbon/_bourbon-deprecated-upcoming.scss +0 -411
  82. data/app/assets/stylesheets/lib/bourbon/_bourbon.scss +0 -87
  83. data/app/assets/stylesheets/lib/bourbon/addons/_border-color.scss +0 -26
  84. data/app/assets/stylesheets/lib/bourbon/addons/_border-radius.scss +0 -48
  85. data/app/assets/stylesheets/lib/bourbon/addons/_border-style.scss +0 -25
  86. data/app/assets/stylesheets/lib/bourbon/addons/_border-width.scss +0 -25
  87. data/app/assets/stylesheets/lib/bourbon/addons/_buttons.scss +0 -64
  88. data/app/assets/stylesheets/lib/bourbon/addons/_clearfix.scss +0 -25
  89. data/app/assets/stylesheets/lib/bourbon/addons/_ellipsis.scss +0 -30
  90. data/app/assets/stylesheets/lib/bourbon/addons/_font-stacks.scss +0 -31
  91. data/app/assets/stylesheets/lib/bourbon/addons/_hide-text.scss +0 -27
  92. data/app/assets/stylesheets/lib/bourbon/addons/_margin.scss +0 -26
  93. data/app/assets/stylesheets/lib/bourbon/addons/_padding.scss +0 -26
  94. data/app/assets/stylesheets/lib/bourbon/addons/_position.scss +0 -48
  95. data/app/assets/stylesheets/lib/bourbon/addons/_prefixer.scss +0 -66
  96. data/app/assets/stylesheets/lib/bourbon/addons/_retina-image.scss +0 -25
  97. data/app/assets/stylesheets/lib/bourbon/addons/_size.scss +0 -51
  98. data/app/assets/stylesheets/lib/bourbon/addons/_text-inputs.scss +0 -112
  99. data/app/assets/stylesheets/lib/bourbon/addons/_timing-functions.scss +0 -34
  100. data/app/assets/stylesheets/lib/bourbon/addons/_triangle.scss +0 -63
  101. data/app/assets/stylesheets/lib/bourbon/addons/_word-wrap.scss +0 -29
  102. data/app/assets/stylesheets/lib/bourbon/css3/_animation.scss +0 -43
  103. data/app/assets/stylesheets/lib/bourbon/css3/_appearance.scss +0 -3
  104. data/app/assets/stylesheets/lib/bourbon/css3/_backface-visibility.scss +0 -3
  105. data/app/assets/stylesheets/lib/bourbon/css3/_background-image.scss +0 -42
  106. data/app/assets/stylesheets/lib/bourbon/css3/_background.scss +0 -55
  107. data/app/assets/stylesheets/lib/bourbon/css3/_border-image.scss +0 -59
  108. data/app/assets/stylesheets/lib/bourbon/css3/_calc.scss +0 -4
  109. data/app/assets/stylesheets/lib/bourbon/css3/_columns.scss +0 -47
  110. data/app/assets/stylesheets/lib/bourbon/css3/_filter.scss +0 -4
  111. data/app/assets/stylesheets/lib/bourbon/css3/_flex-box.scss +0 -287
  112. data/app/assets/stylesheets/lib/bourbon/css3/_font-face.scss +0 -24
  113. data/app/assets/stylesheets/lib/bourbon/css3/_font-feature-settings.scss +0 -4
  114. data/app/assets/stylesheets/lib/bourbon/css3/_hidpi-media-query.scss +0 -10
  115. data/app/assets/stylesheets/lib/bourbon/css3/_hyphens.scss +0 -4
  116. data/app/assets/stylesheets/lib/bourbon/css3/_image-rendering.scss +0 -14
  117. data/app/assets/stylesheets/lib/bourbon/css3/_keyframes.scss +0 -36
  118. data/app/assets/stylesheets/lib/bourbon/css3/_linear-gradient.scss +0 -38
  119. data/app/assets/stylesheets/lib/bourbon/css3/_perspective.scss +0 -8
  120. data/app/assets/stylesheets/lib/bourbon/css3/_placeholder.scss +0 -8
  121. data/app/assets/stylesheets/lib/bourbon/css3/_radial-gradient.scss +0 -39
  122. data/app/assets/stylesheets/lib/bourbon/css3/_selection.scss +0 -42
  123. data/app/assets/stylesheets/lib/bourbon/css3/_text-decoration.scss +0 -19
  124. data/app/assets/stylesheets/lib/bourbon/css3/_transform.scss +0 -15
  125. data/app/assets/stylesheets/lib/bourbon/css3/_transition.scss +0 -71
  126. data/app/assets/stylesheets/lib/bourbon/css3/_user-select.scss +0 -3
  127. data/app/assets/stylesheets/lib/bourbon/functions/_assign-inputs.scss +0 -11
  128. data/app/assets/stylesheets/lib/bourbon/functions/_contains-falsy.scss +0 -20
  129. data/app/assets/stylesheets/lib/bourbon/functions/_contains.scss +0 -26
  130. data/app/assets/stylesheets/lib/bourbon/functions/_is-length.scss +0 -11
  131. data/app/assets/stylesheets/lib/bourbon/functions/_is-light.scss +0 -21
  132. data/app/assets/stylesheets/lib/bourbon/functions/_is-number.scss +0 -11
  133. data/app/assets/stylesheets/lib/bourbon/functions/_is-size.scss +0 -13
  134. data/app/assets/stylesheets/lib/bourbon/functions/_modular-scale.scss +0 -69
  135. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-em.scss +0 -13
  136. data/app/assets/stylesheets/lib/bourbon/functions/_px-to-rem.scss +0 -15
  137. data/app/assets/stylesheets/lib/bourbon/functions/_shade.scss +0 -24
  138. data/app/assets/stylesheets/lib/bourbon/functions/_strip-units.scss +0 -17
  139. data/app/assets/stylesheets/lib/bourbon/functions/_tint.scss +0 -24
  140. data/app/assets/stylesheets/lib/bourbon/functions/_transition-property-name.scss +0 -22
  141. data/app/assets/stylesheets/lib/bourbon/functions/_unpack.scss +0 -27
  142. data/app/assets/stylesheets/lib/bourbon/helpers/_convert-units.scss +0 -21
  143. data/app/assets/stylesheets/lib/bourbon/helpers/_directional-values.scss +0 -96
  144. data/app/assets/stylesheets/lib/bourbon/helpers/_font-source-declaration.scss +0 -43
  145. data/app/assets/stylesheets/lib/bourbon/helpers/_gradient-positions-parser.scss +0 -13
  146. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-angle-parser.scss +0 -25
  147. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-gradient-parser.scss +0 -41
  148. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-positions-parser.scss +0 -61
  149. data/app/assets/stylesheets/lib/bourbon/helpers/_linear-side-corner-parser.scss +0 -31
  150. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-arg-parser.scss +0 -69
  151. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-gradient-parser.scss +0 -50
  152. data/app/assets/stylesheets/lib/bourbon/helpers/_radial-positions-parser.scss +0 -18
  153. data/app/assets/stylesheets/lib/bourbon/helpers/_render-gradients.scss +0 -26
  154. data/app/assets/stylesheets/lib/bourbon/helpers/_shape-size-stripper.scss +0 -10
  155. data/app/assets/stylesheets/lib/bourbon/helpers/_str-to-num.scss +0 -50
  156. data/app/assets/stylesheets/lib/bourbon/settings/_asset-pipeline.scss +0 -7
  157. data/app/assets/stylesheets/lib/bourbon/settings/_prefixer.scss +0 -9
  158. data/app/assets/stylesheets/lib/bourbon/settings/_px-to-em.scss +0 -1
  159. data/app/assets/stylesheets/lib/neat/_neat-helpers.scss +0 -8
  160. data/app/assets/stylesheets/lib/neat/_neat.scss +0 -23
  161. data/app/assets/stylesheets/lib/neat/functions/_new-breakpoint.scss +0 -49
  162. data/app/assets/stylesheets/lib/neat/functions/_private.scss +0 -114
  163. data/app/assets/stylesheets/lib/neat/grid/_box-sizing.scss +0 -15
  164. data/app/assets/stylesheets/lib/neat/grid/_direction-context.scss +0 -33
  165. data/app/assets/stylesheets/lib/neat/grid/_display-context.scss +0 -28
  166. data/app/assets/stylesheets/lib/neat/grid/_fill-parent.scss +0 -22
  167. data/app/assets/stylesheets/lib/neat/grid/_media.scss +0 -92
  168. data/app/assets/stylesheets/lib/neat/grid/_omega.scss +0 -87
  169. data/app/assets/stylesheets/lib/neat/grid/_outer-container.scss +0 -38
  170. data/app/assets/stylesheets/lib/neat/grid/_pad.scss +0 -25
  171. data/app/assets/stylesheets/lib/neat/grid/_private.scss +0 -35
  172. data/app/assets/stylesheets/lib/neat/grid/_row.scss +0 -52
  173. data/app/assets/stylesheets/lib/neat/grid/_shift.scss +0 -50
  174. data/app/assets/stylesheets/lib/neat/grid/_span-columns.scss +0 -94
  175. data/app/assets/stylesheets/lib/neat/grid/_to-deprecate.scss +0 -97
  176. data/app/assets/stylesheets/lib/neat/grid/_visual-grid.scss +0 -42
  177. data/app/assets/stylesheets/lib/neat/settings/_disable-warnings.scss +0 -13
  178. data/app/assets/stylesheets/lib/neat/settings/_grid.scss +0 -51
  179. data/app/assets/stylesheets/lib/neat/settings/_visual-grid.scss +0 -27
  180. data/app/assets/stylesheets/va_common_main.css.scss +0 -18
  181. /data/app/assets/js/{vendor/scroll-settings.js → scroll-settings.js} +0 -0
  182. /data/app/assets/js/{vendor/stellar-settings.js → stellar-settings.js} +0 -0
@@ -1,725 +0,0 @@
1
- /*
2
- * Foundation Responsive Library
3
- * http://foundation.zurb.com
4
- * Copyright 2014, ZURB
5
- * Free to use under the MIT license.
6
- * http://www.opensource.org/licenses/mit-license.php
7
- */
8
-
9
- (function ($, window, document, undefined) {
10
- 'use strict';
11
-
12
- var header_helpers = function (class_array) {
13
- var i = class_array.length;
14
- var head = $('head');
15
-
16
- while (i--) {
17
- if (head.has('.' + class_array[i]).length === 0) {
18
- head.append('<meta class="' + class_array[i] + '" />');
19
- }
20
- }
21
- };
22
-
23
- header_helpers([
24
- 'foundation-mq-small',
25
- 'foundation-mq-small-only',
26
- 'foundation-mq-medium',
27
- 'foundation-mq-medium-only',
28
- 'foundation-mq-large',
29
- 'foundation-mq-large-only',
30
- 'foundation-mq-xlarge',
31
- 'foundation-mq-xlarge-only',
32
- 'foundation-mq-xxlarge',
33
- 'foundation-data-attribute-namespace']);
34
-
35
- // Enable FastClick if present
36
-
37
- $(function () {
38
- if (typeof FastClick !== 'undefined') {
39
- // Don't attach to body if undefined
40
- if (typeof document.body !== 'undefined') {
41
- FastClick.attach(document.body);
42
- }
43
- }
44
- });
45
-
46
- // private Fast Selector wrapper,
47
- // returns jQuery object. Only use where
48
- // getElementById is not available.
49
- var S = function (selector, context) {
50
- if (typeof selector === 'string') {
51
- if (context) {
52
- var cont;
53
- if (context.jquery) {
54
- cont = context[0];
55
- if (!cont) {
56
- return context;
57
- }
58
- } else {
59
- cont = context;
60
- }
61
- return $(cont.querySelectorAll(selector));
62
- }
63
-
64
- return $(document.querySelectorAll(selector));
65
- }
66
-
67
- return $(selector, context);
68
- };
69
-
70
- // Namespace functions.
71
-
72
- var attr_name = function (init) {
73
- var arr = [];
74
- if (!init) {
75
- arr.push('data');
76
- }
77
- if (this.namespace.length > 0) {
78
- arr.push(this.namespace);
79
- }
80
- arr.push(this.name);
81
-
82
- return arr.join('-');
83
- };
84
-
85
- var add_namespace = function (str) {
86
- var parts = str.split('-'),
87
- i = parts.length,
88
- arr = [];
89
-
90
- while (i--) {
91
- if (i !== 0) {
92
- arr.push(parts[i]);
93
- } else {
94
- if (this.namespace.length > 0) {
95
- arr.push(this.namespace, parts[i]);
96
- } else {
97
- arr.push(parts[i]);
98
- }
99
- }
100
- }
101
-
102
- return arr.reverse().join('-');
103
- };
104
-
105
- // Event binding and data-options updating.
106
-
107
- var bindings = function (method, options) {
108
- var self = this,
109
- bind = function(){
110
- var $this = S(this),
111
- should_bind_events = !$this.data(self.attr_name(true) + '-init');
112
- $this.data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options($this)));
113
-
114
- if (should_bind_events) {
115
- self.events(this);
116
- }
117
- };
118
-
119
- if (S(this.scope).is('[' + this.attr_name() +']')) {
120
- bind.call(this.scope);
121
- } else {
122
- S('[' + this.attr_name() +']', this.scope).each(bind);
123
- }
124
- // # Patch to fix #5043 to move this *after* the if/else clause in order for Backbone and similar frameworks to have improved control over event binding and data-options updating.
125
- if (typeof method === 'string') {
126
- return this[method].call(this, options);
127
- }
128
-
129
- };
130
-
131
- var single_image_loaded = function (image, callback) {
132
- function loaded () {
133
- callback(image[0]);
134
- }
135
-
136
- function bindLoad () {
137
- this.one('load', loaded);
138
-
139
- if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
140
- var src = this.attr( 'src' ),
141
- param = src.match( /\?/ ) ? '&' : '?';
142
-
143
- param += 'random=' + (new Date()).getTime();
144
- this.attr('src', src + param);
145
- }
146
- }
147
-
148
- if (!image.attr('src')) {
149
- loaded();
150
- return;
151
- }
152
-
153
- if (image[0].complete || image[0].readyState === 4) {
154
- loaded();
155
- } else {
156
- bindLoad.call(image);
157
- }
158
- };
159
-
160
- /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
161
-
162
- window.matchMedia || (window.matchMedia = function() {
163
- "use strict";
164
-
165
- // For browsers that support matchMedium api such as IE 9 and webkit
166
- var styleMedia = (window.styleMedia || window.media);
167
-
168
- // For those that don't support matchMedium
169
- if (!styleMedia) {
170
- var style = document.createElement('style'),
171
- script = document.getElementsByTagName('script')[0],
172
- info = null;
173
-
174
- style.type = 'text/css';
175
- style.id = 'matchmediajs-test';
176
-
177
- script.parentNode.insertBefore(style, script);
178
-
179
- // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
180
- info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
181
-
182
- styleMedia = {
183
- matchMedium: function(media) {
184
- var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
185
-
186
- // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
187
- if (style.styleSheet) {
188
- style.styleSheet.cssText = text;
189
- } else {
190
- style.textContent = text;
191
- }
192
-
193
- // Test if media query is true or false
194
- return info.width === '1px';
195
- }
196
- };
197
- }
198
-
199
- return function(media) {
200
- return {
201
- matches: styleMedia.matchMedium(media || 'all'),
202
- media: media || 'all'
203
- };
204
- };
205
- }());
206
-
207
- /*
208
- * jquery.requestAnimationFrame
209
- * https://github.com/gnarf37/jquery-requestAnimationFrame
210
- * Requires jQuery 1.8+
211
- *
212
- * Copyright (c) 2012 Corey Frang
213
- * Licensed under the MIT license.
214
- */
215
-
216
- (function(jQuery) {
217
-
218
-
219
- // requestAnimationFrame polyfill adapted from Erik Möller
220
- // fixes from Paul Irish and Tino Zijdel
221
- // http://paulirish.com/2011/requestanimationframe-for-smart-animating/
222
- // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
223
-
224
- var animating,
225
- lastTime = 0,
226
- vendors = ['webkit', 'moz'],
227
- requestAnimationFrame = window.requestAnimationFrame,
228
- cancelAnimationFrame = window.cancelAnimationFrame,
229
- jqueryFxAvailable = 'undefined' !== typeof jQuery.fx;
230
-
231
- for (; lastTime < vendors.length && !requestAnimationFrame; lastTime++) {
232
- requestAnimationFrame = window[ vendors[lastTime] + 'RequestAnimationFrame' ];
233
- cancelAnimationFrame = cancelAnimationFrame ||
234
- window[ vendors[lastTime] + 'CancelAnimationFrame' ] ||
235
- window[ vendors[lastTime] + 'CancelRequestAnimationFrame' ];
236
- }
237
-
238
- function raf() {
239
- if (animating) {
240
- requestAnimationFrame(raf);
241
-
242
- if (jqueryFxAvailable) {
243
- jQuery.fx.tick();
244
- }
245
- }
246
- }
247
-
248
- if (requestAnimationFrame) {
249
- // use rAF
250
- window.requestAnimationFrame = requestAnimationFrame;
251
- window.cancelAnimationFrame = cancelAnimationFrame;
252
-
253
- if (jqueryFxAvailable) {
254
- jQuery.fx.timer = function (timer) {
255
- if (timer() && jQuery.timers.push(timer) && !animating) {
256
- animating = true;
257
- raf();
258
- }
259
- };
260
-
261
- jQuery.fx.stop = function () {
262
- animating = false;
263
- };
264
- }
265
- } else {
266
- // polyfill
267
- window.requestAnimationFrame = function (callback) {
268
- var currTime = new Date().getTime(),
269
- timeToCall = Math.max(0, 16 - (currTime - lastTime)),
270
- id = window.setTimeout(function () {
271
- callback(currTime + timeToCall);
272
- }, timeToCall);
273
- lastTime = currTime + timeToCall;
274
- return id;
275
- };
276
-
277
- window.cancelAnimationFrame = function (id) {
278
- clearTimeout(id);
279
- };
280
-
281
- }
282
-
283
- }( $ ));
284
-
285
- function removeQuotes (string) {
286
- if (typeof string === 'string' || string instanceof String) {
287
- string = string.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g, '');
288
- }
289
-
290
- return string;
291
- }
292
-
293
- window.Foundation = {
294
- name : 'Foundation',
295
-
296
- version : '5.5.2',
297
-
298
- media_queries : {
299
- 'small' : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
300
- 'small-only' : S('.foundation-mq-small-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
301
- 'medium' : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
302
- 'medium-only' : S('.foundation-mq-medium-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
303
- 'large' : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
304
- 'large-only' : S('.foundation-mq-large-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
305
- 'xlarge' : S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
306
- 'xlarge-only' : S('.foundation-mq-xlarge-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
307
- 'xxlarge' : S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '')
308
- },
309
-
310
- stylesheet : $('<style></style>').appendTo('head')[0].sheet,
311
-
312
- global : {
313
- namespace : undefined
314
- },
315
-
316
- init : function (scope, libraries, method, options, response) {
317
- var args = [scope, method, options, response],
318
- responses = [];
319
-
320
- // check RTL
321
- this.rtl = /rtl/i.test(S('html').attr('dir'));
322
-
323
- // set foundation global scope
324
- this.scope = scope || this.scope;
325
-
326
- this.set_namespace();
327
-
328
- if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) {
329
- if (this.libs.hasOwnProperty(libraries)) {
330
- responses.push(this.init_lib(libraries, args));
331
- }
332
- } else {
333
- for (var lib in this.libs) {
334
- responses.push(this.init_lib(lib, libraries));
335
- }
336
- }
337
-
338
- S(window).load(function () {
339
- S(window)
340
- .trigger('resize.fndtn.clearing')
341
- .trigger('resize.fndtn.dropdown')
342
- .trigger('resize.fndtn.equalizer')
343
- .trigger('resize.fndtn.interchange')
344
- .trigger('resize.fndtn.joyride')
345
- .trigger('resize.fndtn.magellan')
346
- .trigger('resize.fndtn.topbar')
347
- .trigger('resize.fndtn.slider');
348
- });
349
-
350
- return scope;
351
- },
352
-
353
- init_lib : function (lib, args) {
354
- if (this.libs.hasOwnProperty(lib)) {
355
- this.patch(this.libs[lib]);
356
-
357
- if (args && args.hasOwnProperty(lib)) {
358
- if (typeof this.libs[lib].settings !== 'undefined') {
359
- $.extend(true, this.libs[lib].settings, args[lib]);
360
- } else if (typeof this.libs[lib].defaults !== 'undefined') {
361
- $.extend(true, this.libs[lib].defaults, args[lib]);
362
- }
363
- return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]);
364
- }
365
-
366
- args = args instanceof Array ? args : new Array(args);
367
- return this.libs[lib].init.apply(this.libs[lib], args);
368
- }
369
-
370
- return function () {};
371
- },
372
-
373
- patch : function (lib) {
374
- lib.scope = this.scope;
375
- lib.namespace = this.global.namespace;
376
- lib.rtl = this.rtl;
377
- lib['data_options'] = this.utils.data_options;
378
- lib['attr_name'] = attr_name;
379
- lib['add_namespace'] = add_namespace;
380
- lib['bindings'] = bindings;
381
- lib['S'] = this.utils.S;
382
- },
383
-
384
- inherit : function (scope, methods) {
385
- var methods_arr = methods.split(' '),
386
- i = methods_arr.length;
387
-
388
- while (i--) {
389
- if (this.utils.hasOwnProperty(methods_arr[i])) {
390
- scope[methods_arr[i]] = this.utils[methods_arr[i]];
391
- }
392
- }
393
- },
394
-
395
- set_namespace : function () {
396
-
397
- // Description:
398
- // Don't bother reading the namespace out of the meta tag
399
- // if the namespace has been set globally in javascript
400
- //
401
- // Example:
402
- // Foundation.global.namespace = 'my-namespace';
403
- // or make it an empty string:
404
- // Foundation.global.namespace = '';
405
- //
406
- //
407
-
408
- // If the namespace has not been set (is undefined), try to read it out of the meta element.
409
- // Otherwise use the globally defined namespace, even if it's empty ('')
410
- var namespace = ( this.global.namespace === undefined ) ? $('.foundation-data-attribute-namespace').css('font-family') : this.global.namespace;
411
-
412
- // Finally, if the namsepace is either undefined or false, set it to an empty string.
413
- // Otherwise use the namespace value.
414
- this.global.namespace = ( namespace === undefined || /false/i.test(namespace) ) ? '' : namespace;
415
- },
416
-
417
- libs : {},
418
-
419
- // methods that can be inherited in libraries
420
- utils : {
421
-
422
- // Description:
423
- // Fast Selector wrapper returns jQuery object. Only use where getElementById
424
- // is not available.
425
- //
426
- // Arguments:
427
- // Selector (String): CSS selector describing the element(s) to be
428
- // returned as a jQuery object.
429
- //
430
- // Scope (String): CSS selector describing the area to be searched. Default
431
- // is document.
432
- //
433
- // Returns:
434
- // Element (jQuery Object): jQuery object containing elements matching the
435
- // selector within the scope.
436
- S : S,
437
-
438
- // Description:
439
- // Executes a function a max of once every n milliseconds
440
- //
441
- // Arguments:
442
- // Func (Function): Function to be throttled.
443
- //
444
- // Delay (Integer): Function execution threshold in milliseconds.
445
- //
446
- // Returns:
447
- // Lazy_function (Function): Function with throttling applied.
448
- throttle : function (func, delay) {
449
- var timer = null;
450
-
451
- return function () {
452
- var context = this, args = arguments;
453
-
454
- if (timer == null) {
455
- timer = setTimeout(function () {
456
- func.apply(context, args);
457
- timer = null;
458
- }, delay);
459
- }
460
- };
461
- },
462
-
463
- // Description:
464
- // Executes a function when it stops being invoked for n seconds
465
- // Modified version of _.debounce() http://underscorejs.org
466
- //
467
- // Arguments:
468
- // Func (Function): Function to be debounced.
469
- //
470
- // Delay (Integer): Function execution threshold in milliseconds.
471
- //
472
- // Immediate (Bool): Whether the function should be called at the beginning
473
- // of the delay instead of the end. Default is false.
474
- //
475
- // Returns:
476
- // Lazy_function (Function): Function with debouncing applied.
477
- debounce : function (func, delay, immediate) {
478
- var timeout, result;
479
- return function () {
480
- var context = this, args = arguments;
481
- var later = function () {
482
- timeout = null;
483
- if (!immediate) {
484
- result = func.apply(context, args);
485
- }
486
- };
487
- var callNow = immediate && !timeout;
488
- clearTimeout(timeout);
489
- timeout = setTimeout(later, delay);
490
- if (callNow) {
491
- result = func.apply(context, args);
492
- }
493
- return result;
494
- };
495
- },
496
-
497
- // Description:
498
- // Parses data-options attribute
499
- //
500
- // Arguments:
501
- // El (jQuery Object): Element to be parsed.
502
- //
503
- // Returns:
504
- // Options (Javascript Object): Contents of the element's data-options
505
- // attribute.
506
- data_options : function (el, data_attr_name) {
507
- data_attr_name = data_attr_name || 'options';
508
- var opts = {}, ii, p, opts_arr,
509
- data_options = function (el) {
510
- var namespace = Foundation.global.namespace;
511
-
512
- if (namespace.length > 0) {
513
- return el.data(namespace + '-' + data_attr_name);
514
- }
515
-
516
- return el.data(data_attr_name);
517
- };
518
-
519
- var cached_options = data_options(el);
520
-
521
- if (typeof cached_options === 'object') {
522
- return cached_options;
523
- }
524
-
525
- opts_arr = (cached_options || ':').split(';');
526
- ii = opts_arr.length;
527
-
528
- function isNumber (o) {
529
- return !isNaN (o - 0) && o !== null && o !== '' && o !== false && o !== true;
530
- }
531
-
532
- function trim (str) {
533
- if (typeof str === 'string') {
534
- return $.trim(str);
535
- }
536
- return str;
537
- }
538
-
539
- while (ii--) {
540
- p = opts_arr[ii].split(':');
541
- p = [p[0], p.slice(1).join(':')];
542
-
543
- if (/true/i.test(p[1])) {
544
- p[1] = true;
545
- }
546
- if (/false/i.test(p[1])) {
547
- p[1] = false;
548
- }
549
- if (isNumber(p[1])) {
550
- if (p[1].indexOf('.') === -1) {
551
- p[1] = parseInt(p[1], 10);
552
- } else {
553
- p[1] = parseFloat(p[1]);
554
- }
555
- }
556
-
557
- if (p.length === 2 && p[0].length > 0) {
558
- opts[trim(p[0])] = trim(p[1]);
559
- }
560
- }
561
-
562
- return opts;
563
- },
564
-
565
- // Description:
566
- // Adds JS-recognizable media queries
567
- //
568
- // Arguments:
569
- // Media (String): Key string for the media query to be stored as in
570
- // Foundation.media_queries
571
- //
572
- // Class (String): Class name for the generated <meta> tag
573
- register_media : function (media, media_class) {
574
- if (Foundation.media_queries[media] === undefined) {
575
- $('head').append('<meta class="' + media_class + '"/>');
576
- Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family'));
577
- }
578
- },
579
-
580
- // Description:
581
- // Add custom CSS within a JS-defined media query
582
- //
583
- // Arguments:
584
- // Rule (String): CSS rule to be appended to the document.
585
- //
586
- // Media (String): Optional media query string for the CSS rule to be
587
- // nested under.
588
- add_custom_rule : function (rule, media) {
589
- if (media === undefined && Foundation.stylesheet) {
590
- Foundation.stylesheet.insertRule(rule, Foundation.stylesheet.cssRules.length);
591
- } else {
592
- var query = Foundation.media_queries[media];
593
-
594
- if (query !== undefined) {
595
- Foundation.stylesheet.insertRule('@media ' +
596
- Foundation.media_queries[media] + '{ ' + rule + ' }', Foundation.stylesheet.cssRules.length);
597
- }
598
- }
599
- },
600
-
601
- // Description:
602
- // Performs a callback function when an image is fully loaded
603
- //
604
- // Arguments:
605
- // Image (jQuery Object): Image(s) to check if loaded.
606
- //
607
- // Callback (Function): Function to execute when image is fully loaded.
608
- image_loaded : function (images, callback) {
609
- var self = this,
610
- unloaded = images.length;
611
-
612
- function pictures_has_height(images) {
613
- var pictures_number = images.length;
614
-
615
- for (var i = pictures_number - 1; i >= 0; i--) {
616
- if(images.attr('height') === undefined) {
617
- return false;
618
- };
619
- };
620
-
621
- return true;
622
- }
623
-
624
- if (unloaded === 0 || pictures_has_height(images)) {
625
- callback(images);
626
- }
627
-
628
- images.each(function () {
629
- single_image_loaded(self.S(this), function () {
630
- unloaded -= 1;
631
- if (unloaded === 0) {
632
- callback(images);
633
- }
634
- });
635
- });
636
- },
637
-
638
- // Description:
639
- // Returns a random, alphanumeric string
640
- //
641
- // Arguments:
642
- // Length (Integer): Length of string to be generated. Defaults to random
643
- // integer.
644
- //
645
- // Returns:
646
- // Rand (String): Pseudo-random, alphanumeric string.
647
- random_str : function () {
648
- if (!this.fidx) {
649
- this.fidx = 0;
650
- }
651
- this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-');
652
-
653
- return this.prefix + (this.fidx++).toString(36);
654
- },
655
-
656
- // Description:
657
- // Helper for window.matchMedia
658
- //
659
- // Arguments:
660
- // mq (String): Media query
661
- //
662
- // Returns:
663
- // (Boolean): Whether the media query passes or not
664
- match : function (mq) {
665
- return window.matchMedia(mq).matches;
666
- },
667
-
668
- // Description:
669
- // Helpers for checking Foundation default media queries with JS
670
- //
671
- // Returns:
672
- // (Boolean): Whether the media query passes or not
673
-
674
- is_small_up : function () {
675
- return this.match(Foundation.media_queries.small);
676
- },
677
-
678
- is_medium_up : function () {
679
- return this.match(Foundation.media_queries.medium);
680
- },
681
-
682
- is_large_up : function () {
683
- return this.match(Foundation.media_queries.large);
684
- },
685
-
686
- is_xlarge_up : function () {
687
- return this.match(Foundation.media_queries.xlarge);
688
- },
689
-
690
- is_xxlarge_up : function () {
691
- return this.match(Foundation.media_queries.xxlarge);
692
- },
693
-
694
- is_small_only : function () {
695
- return !this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up();
696
- },
697
-
698
- is_medium_only : function () {
699
- return this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up();
700
- },
701
-
702
- is_large_only : function () {
703
- return this.is_medium_up() && this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up();
704
- },
705
-
706
- is_xlarge_only : function () {
707
- return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && !this.is_xxlarge_up();
708
- },
709
-
710
- is_xxlarge_only : function () {
711
- return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && this.is_xxlarge_up();
712
- }
713
- }
714
- };
715
-
716
- $.fn.foundation = function () {
717
- var args = Array.prototype.slice.call(arguments, 0);
718
-
719
- return this.each(function () {
720
- Foundation.init.apply(Foundation, [this].concat(args));
721
- return this;
722
- });
723
- };
724
-
725
- }(jQuery, window, window.document));