va_common 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
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,408 +0,0 @@
1
- ;(function ($, window, document, undefined) {
2
- 'use strict';
3
-
4
- Foundation.libs.abide = {
5
- name : 'abide',
6
-
7
- version : '5.5.2',
8
-
9
- settings : {
10
- live_validate : true,
11
- validate_on_blur : true,
12
- // validate_on: 'tab', // tab (when user tabs between fields), change (input changes), manual (call custom events)
13
- focus_on_invalid : true,
14
- error_labels : true, // labels with a for="inputId" will recieve an `error` class
15
- error_class : 'error',
16
- timeout : 1000,
17
- patterns : {
18
- alpha : /^[a-zA-Z]+$/,
19
- alpha_numeric : /^[a-zA-Z0-9]+$/,
20
- integer : /^[-+]?\d+$/,
21
- number : /^[-+]?\d*(?:[\.\,]\d+)?$/,
22
-
23
- // amex, visa, diners
24
- card : /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,
25
- cvv : /^([0-9]){3,4}$/,
26
-
27
- // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
28
- email : /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/,
29
-
30
- // http://blogs.lse.ac.uk/lti/2008/04/23/a-regular-expression-to-match-any-url/
31
- url: /^(https?|ftp|file|ssh):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?(\d+)?((\/[-\+~%\/\.\w]+)?\??([-\+=&;%@\.\w]+)?#?([\w]+)?)?/,
32
- // abc.de
33
- domain : /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
34
-
35
- datetime : /^([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))$/,
36
- // YYYY-MM-DD
37
- date : /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))$/,
38
- // HH:MM:SS
39
- time : /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
40
- dateISO : /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
41
- // MM/DD/YYYY
42
- month_day_year : /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
43
- // DD/MM/YYYY
44
- day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
45
-
46
- // #FFF or #FFFFFF
47
- color : /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
48
- },
49
- validators : {
50
- equalTo : function (el, required, parent) {
51
- var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value,
52
- to = el.value,
53
- valid = (from === to);
54
-
55
- return valid;
56
- }
57
- }
58
- },
59
-
60
- timer : null,
61
-
62
- init : function (scope, method, options) {
63
- this.bindings(method, options);
64
- },
65
-
66
- events : function (scope) {
67
- var self = this,
68
- form = self.S(scope).attr('novalidate', 'novalidate'),
69
- settings = form.data(this.attr_name(true) + '-init') || {};
70
-
71
- this.invalid_attr = this.add_namespace('data-invalid');
72
-
73
- function validate(originalSelf, e) {
74
- clearTimeout(self.timer);
75
- self.timer = setTimeout(function () {
76
- self.validate([originalSelf], e);
77
- }.bind(originalSelf), settings.timeout);
78
- }
79
-
80
-
81
- form
82
- .off('.abide')
83
- .on('submit.fndtn.abide', function (e) {
84
- var is_ajax = /ajax/i.test(self.S(this).attr(self.attr_name()));
85
- return self.validate(self.S(this).find('input, textarea, select').not(":hidden, [data-abide-ignore]").get(), e, is_ajax);
86
- })
87
- .on('validate.fndtn.abide', function (e) {
88
- if (settings.validate_on === 'manual') {
89
- self.validate([e.target], e);
90
- }
91
- })
92
- .on('reset', function (e) {
93
- return self.reset($(this), e);
94
- })
95
- .find('input, textarea, select').not(":hidden, [data-abide-ignore]")
96
- .off('.abide')
97
- .on('blur.fndtn.abide change.fndtn.abide', function (e) {
98
- // old settings fallback
99
- // will be deprecated with F6 release
100
- if (settings.validate_on_blur && settings.validate_on_blur === true) {
101
- validate(this, e);
102
- }
103
- // new settings combining validate options into one setting
104
- if (settings.validate_on === 'change') {
105
- validate(this, e);
106
- }
107
- })
108
- .on('keydown.fndtn.abide', function (e) {
109
- // old settings fallback
110
- // will be deprecated with F6 release
111
- if (settings.live_validate && settings.live_validate === true && e.which != 9) {
112
- validate(this, e);
113
- }
114
- // new settings combining validate options into one setting
115
- if (settings.validate_on === 'tab' && e.which === 9) {
116
- validate(this, e);
117
- }
118
- else if (settings.validate_on === 'change') {
119
- validate(this, e);
120
- }
121
- })
122
- .on('focus', function (e) {
123
- if (navigator.userAgent.match(/iPad|iPhone|Android|BlackBerry|Windows Phone|webOS/i)) {
124
- $('html, body').animate({
125
- scrollTop: $(e.target).offset().top
126
- }, 100);
127
- }
128
- });
129
- },
130
-
131
- reset : function (form, e) {
132
- var self = this;
133
- form.removeAttr(self.invalid_attr);
134
-
135
- $('[' + self.invalid_attr + ']', form).removeAttr(self.invalid_attr);
136
- $('.' + self.settings.error_class, form).not('small').removeClass(self.settings.error_class);
137
- $(':input', form).not(':button, :submit, :reset, :hidden, [data-abide-ignore]').val('').removeAttr(self.invalid_attr);
138
- },
139
-
140
- validate : function (els, e, is_ajax) {
141
- var validations = this.parse_patterns(els),
142
- validation_count = validations.length,
143
- form = this.S(els[0]).closest('form'),
144
- submit_event = /submit/.test(e.type);
145
-
146
- // Has to count up to make sure the focus gets applied to the top error
147
- for (var i = 0; i < validation_count; i++) {
148
- if (!validations[i] && (submit_event || is_ajax)) {
149
- if (this.settings.focus_on_invalid) {
150
- els[i].focus();
151
- }
152
- form.trigger('invalid.fndtn.abide');
153
- this.S(els[i]).closest('form').attr(this.invalid_attr, '');
154
- return false;
155
- }
156
- }
157
-
158
- if (submit_event || is_ajax) {
159
- form.trigger('valid.fndtn.abide');
160
- }
161
-
162
- form.removeAttr(this.invalid_attr);
163
-
164
- if (is_ajax) {
165
- return false;
166
- }
167
-
168
- return true;
169
- },
170
-
171
- parse_patterns : function (els) {
172
- var i = els.length,
173
- el_patterns = [];
174
-
175
- while (i--) {
176
- el_patterns.push(this.pattern(els[i]));
177
- }
178
-
179
- return this.check_validation_and_apply_styles(el_patterns);
180
- },
181
-
182
- pattern : function (el) {
183
- var type = el.getAttribute('type'),
184
- required = typeof el.getAttribute('required') === 'string';
185
-
186
- var pattern = el.getAttribute('pattern') || '';
187
-
188
- if (this.settings.patterns.hasOwnProperty(pattern) && pattern.length > 0) {
189
- return [el, this.settings.patterns[pattern], required];
190
- } else if (pattern.length > 0) {
191
- return [el, new RegExp(pattern), required];
192
- }
193
-
194
- if (this.settings.patterns.hasOwnProperty(type)) {
195
- return [el, this.settings.patterns[type], required];
196
- }
197
-
198
- pattern = /.*/;
199
-
200
- return [el, pattern, required];
201
- },
202
-
203
- // TODO: Break this up into smaller methods, getting hard to read.
204
- check_validation_and_apply_styles : function (el_patterns) {
205
- var i = el_patterns.length,
206
- validations = [],
207
- form = this.S(el_patterns[0][0]).closest('[data-' + this.attr_name(true) + ']'),
208
- settings = form.data(this.attr_name(true) + '-init') || {};
209
- while (i--) {
210
- var el = el_patterns[i][0],
211
- required = el_patterns[i][2],
212
- value = el.value.trim(),
213
- direct_parent = this.S(el).parent(),
214
- validator = el.getAttribute(this.add_namespace('data-abide-validator')),
215
- is_radio = el.type === 'radio',
216
- is_checkbox = el.type === 'checkbox',
217
- label = this.S('label[for="' + el.getAttribute('id') + '"]'),
218
- valid_length = (required) ? (el.value.length > 0) : true,
219
- el_validations = [];
220
-
221
- var parent, valid;
222
-
223
- // support old way to do equalTo validations
224
- if (el.getAttribute(this.add_namespace('data-equalto'))) { validator = 'equalTo' }
225
-
226
- if (!direct_parent.is('label')) {
227
- parent = direct_parent;
228
- } else {
229
- parent = direct_parent.parent();
230
- }
231
-
232
- if (is_radio && required) {
233
- el_validations.push(this.valid_radio(el, required));
234
- } else if (is_checkbox && required) {
235
- el_validations.push(this.valid_checkbox(el, required));
236
-
237
- } else if (validator) {
238
- // Validate using each of the specified (space-delimited) validators.
239
- var validators = validator.split(' ');
240
- var last_valid = true, all_valid = true;
241
- for (var iv = 0; iv < validators.length; iv++) {
242
- valid = this.settings.validators[validators[iv]].apply(this, [el, required, parent])
243
- el_validations.push(valid);
244
- all_valid = valid && last_valid;
245
- last_valid = valid;
246
- }
247
- if (all_valid) {
248
- this.S(el).removeAttr(this.invalid_attr);
249
- parent.removeClass('error');
250
- if (label.length > 0 && this.settings.error_labels) {
251
- label.removeClass(this.settings.error_class).removeAttr('role');
252
- }
253
- $(el).triggerHandler('valid');
254
- } else {
255
- this.S(el).attr(this.invalid_attr, '');
256
- parent.addClass('error');
257
- if (label.length > 0 && this.settings.error_labels) {
258
- label.addClass(this.settings.error_class).attr('role', 'alert');
259
- }
260
- $(el).triggerHandler('invalid');
261
- }
262
- } else {
263
-
264
- if (el_patterns[i][1].test(value) && valid_length ||
265
- !required && el.value.length < 1 || $(el).attr('disabled')) {
266
- el_validations.push(true);
267
- } else {
268
- el_validations.push(false);
269
- }
270
-
271
- el_validations = [el_validations.every(function (valid) {return valid;})];
272
- if (el_validations[0]) {
273
- this.S(el).removeAttr(this.invalid_attr);
274
- el.setAttribute('aria-invalid', 'false');
275
- el.removeAttribute('aria-describedby');
276
- parent.removeClass(this.settings.error_class);
277
- if (label.length > 0 && this.settings.error_labels) {
278
- label.removeClass(this.settings.error_class).removeAttr('role');
279
- }
280
- $(el).triggerHandler('valid');
281
- } else {
282
- this.S(el).attr(this.invalid_attr, '');
283
- el.setAttribute('aria-invalid', 'true');
284
-
285
- // Try to find the error associated with the input
286
- var errorElem = parent.find('small.' + this.settings.error_class, 'span.' + this.settings.error_class);
287
- var errorID = errorElem.length > 0 ? errorElem[0].id : '';
288
- if (errorID.length > 0) {
289
- el.setAttribute('aria-describedby', errorID);
290
- }
291
-
292
- // el.setAttribute('aria-describedby', $(el).find('.error')[0].id);
293
- parent.addClass(this.settings.error_class);
294
- if (label.length > 0 && this.settings.error_labels) {
295
- label.addClass(this.settings.error_class).attr('role', 'alert');
296
- }
297
- $(el).triggerHandler('invalid');
298
- }
299
- }
300
- validations = validations.concat(el_validations);
301
- }
302
- return validations;
303
- },
304
-
305
- valid_checkbox : function (el, required) {
306
- var el = this.S(el),
307
- valid = (el.is(':checked') || !required || el.get(0).getAttribute('disabled'));
308
-
309
- if (valid) {
310
- el.removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
311
- $(el).triggerHandler('valid');
312
- } else {
313
- el.attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
314
- $(el).triggerHandler('invalid');
315
- }
316
-
317
- return valid;
318
- },
319
-
320
- valid_radio : function (el, required) {
321
- var name = el.getAttribute('name'),
322
- group = this.S(el).closest('[data-' + this.attr_name(true) + ']').find("[name='" + name + "']"),
323
- count = group.length,
324
- valid = false,
325
- disabled = false;
326
-
327
- // Has to count up to make sure the focus gets applied to the top error
328
- for (var i=0; i < count; i++) {
329
- if( group[i].getAttribute('disabled') ){
330
- disabled=true;
331
- valid=true;
332
- } else {
333
- if (group[i].checked){
334
- valid = true;
335
- } else {
336
- if( disabled ){
337
- valid = false;
338
- }
339
- }
340
- }
341
- }
342
-
343
- // Has to count up to make sure the focus gets applied to the top error
344
- for (var i = 0; i < count; i++) {
345
- if (valid) {
346
- this.S(group[i]).removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
347
- $(group[i]).triggerHandler('valid');
348
- } else {
349
- this.S(group[i]).attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
350
- $(group[i]).triggerHandler('invalid');
351
- }
352
- }
353
-
354
- return valid;
355
- },
356
-
357
- valid_equal : function (el, required, parent) {
358
- var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value,
359
- to = el.value,
360
- valid = (from === to);
361
-
362
- if (valid) {
363
- this.S(el).removeAttr(this.invalid_attr);
364
- parent.removeClass(this.settings.error_class);
365
- if (label.length > 0 && settings.error_labels) {
366
- label.removeClass(this.settings.error_class);
367
- }
368
- } else {
369
- this.S(el).attr(this.invalid_attr, '');
370
- parent.addClass(this.settings.error_class);
371
- if (label.length > 0 && settings.error_labels) {
372
- label.addClass(this.settings.error_class);
373
- }
374
- }
375
-
376
- return valid;
377
- },
378
-
379
- valid_oneof : function (el, required, parent, doNotValidateOthers) {
380
- var el = this.S(el),
381
- others = this.S('[' + this.add_namespace('data-oneof') + ']'),
382
- valid = others.filter(':checked').length > 0;
383
-
384
- if (valid) {
385
- el.removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
386
- } else {
387
- el.attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
388
- }
389
-
390
- if (!doNotValidateOthers) {
391
- var _this = this;
392
- others.each(function () {
393
- _this.valid_oneof.call(_this, this, null, null, true);
394
- });
395
- }
396
-
397
- return valid;
398
- },
399
-
400
- reflow : function(scope, options) {
401
- var self = this,
402
- form = self.S('[' + this.attr_name() + ']').attr('novalidate', 'novalidate');
403
- self.S(form).each(function (idx, el) {
404
- self.events(el);
405
- });
406
- }
407
- };
408
- }(jQuery, window, window.document));
@@ -1,88 +0,0 @@
1
- ;(function ($, window, document, undefined) {
2
- 'use strict';
3
-
4
- Foundation.libs.accordion = {
5
- name : 'accordion',
6
-
7
- version : '5.5.2',
8
-
9
- settings : {
10
- content_class : 'content',
11
- active_class : 'active',
12
- multi_expand : false,
13
- toggleable : true,
14
- callback : function () {}
15
- },
16
-
17
- init : function (scope, method, options) {
18
- this.bindings(method, options);
19
- },
20
-
21
- events : function (instance) {
22
- var self = this;
23
- var S = this.S;
24
- self.create(this.S(instance));
25
-
26
- S(this.scope)
27
- .off('.fndtn.accordion')
28
- .on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a, [' + this.attr_name() + '] > li > a', function (e) {
29
- var accordion = S(this).closest('[' + self.attr_name() + ']'),
30
- groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
31
- settings = accordion.data(self.attr_name(true) + '-init') || self.settings,
32
- target = S('#' + this.href.split('#')[1]),
33
- aunts = $('> dd, > li', accordion),
34
- siblings = aunts.children('.' + settings.content_class),
35
- active_content = siblings.filter('.' + settings.active_class);
36
-
37
- e.preventDefault();
38
-
39
- if (accordion.attr(self.attr_name())) {
40
- siblings = siblings.add('[' + groupSelector + '] dd > ' + '.' + settings.content_class + ', [' + groupSelector + '] li > ' + '.' + settings.content_class);
41
- aunts = aunts.add('[' + groupSelector + '] dd, [' + groupSelector + '] li');
42
- }
43
-
44
- if (settings.toggleable && target.is(active_content)) {
45
- target.parent('dd, li').toggleClass(settings.active_class, false);
46
- target.toggleClass(settings.active_class, false);
47
- S(this).attr('aria-expanded', function(i, attr){
48
- return attr === 'true' ? 'false' : 'true';
49
- });
50
- settings.callback(target);
51
- target.triggerHandler('toggled', [accordion]);
52
- accordion.triggerHandler('toggled', [target]);
53
- return;
54
- }
55
-
56
- if (!settings.multi_expand) {
57
- siblings.removeClass(settings.active_class);
58
- aunts.removeClass(settings.active_class);
59
- aunts.children('a').attr('aria-expanded','false');
60
- }
61
-
62
- target.addClass(settings.active_class).parent().addClass(settings.active_class);
63
- settings.callback(target);
64
- target.triggerHandler('toggled', [accordion]);
65
- accordion.triggerHandler('toggled', [target]);
66
- S(this).attr('aria-expanded','true');
67
- });
68
- },
69
-
70
- create: function($instance) {
71
- var self = this,
72
- accordion = $instance,
73
- aunts = $('> .accordion-navigation', accordion),
74
- settings = accordion.data(self.attr_name(true) + '-init') || self.settings;
75
-
76
- aunts.children('a').attr('aria-expanded','false');
77
- aunts.has('.' + settings.content_class + '.' + settings.active_class).children('a').attr('aria-expanded','true');
78
-
79
- if (settings.multi_expand) {
80
- $instance.attr('aria-multiselectable','true');
81
- }
82
- },
83
-
84
- off : function () {},
85
-
86
- reflow : function () {}
87
- };
88
- }(jQuery, window, window.document));
@@ -1,43 +0,0 @@
1
- ;(function ($, window, document, undefined) {
2
- 'use strict';
3
-
4
- Foundation.libs.alert = {
5
- name : 'alert',
6
-
7
- version : '5.5.2',
8
-
9
- settings : {
10
- callback : function () {}
11
- },
12
-
13
- init : function (scope, method, options) {
14
- this.bindings(method, options);
15
- },
16
-
17
- events : function () {
18
- var self = this,
19
- S = this.S;
20
-
21
- $(this.scope).off('.alert').on('click.fndtn.alert', '[' + this.attr_name() + '] .close', function (e) {
22
- var alertBox = S(this).closest('[' + self.attr_name() + ']'),
23
- settings = alertBox.data(self.attr_name(true) + '-init') || self.settings;
24
-
25
- e.preventDefault();
26
- if (Modernizr.csstransitions) {
27
- alertBox.addClass('alert-close');
28
- alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function (e) {
29
- S(this).trigger('close.fndtn.alert').remove();
30
- settings.callback();
31
- });
32
- } else {
33
- alertBox.fadeOut(300, function () {
34
- S(this).trigger('close.fndtn.alert').remove();
35
- settings.callback();
36
- });
37
- }
38
- });
39
- },
40
-
41
- reflow : function () {}
42
- };
43
- }(jQuery, window, window.document));