catscope 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/bower.json +1 -0
- data/assets/bower_components/foundation/LICENSE +22 -0
- data/assets/bower_components/foundation/README.md +46 -0
- data/assets/bower_components/foundation/bower.json +2 -4
- data/assets/bower_components/foundation/css/foundation.css +1695 -1230
- data/assets/bower_components/foundation/css/foundation.css.map +1 -1
- data/assets/bower_components/foundation/css/foundation.min.css +1 -0
- data/assets/bower_components/foundation/css/normalize.css +9 -12
- data/assets/bower_components/foundation/css/normalize.css.map +1 -1
- data/assets/bower_components/foundation/css/normalize.min.css +1 -0
- data/assets/bower_components/foundation/js/foundation/foundation.abide.js +171 -75
- data/assets/bower_components/foundation/js/foundation/foundation.accordion.js +70 -12
- data/assets/bower_components/foundation/js/foundation/foundation.alert.js +5 -5
- data/assets/bower_components/foundation/js/foundation/foundation.clearing.js +84 -40
- data/assets/bower_components/foundation/js/foundation/foundation.dropdown.js +104 -79
- data/assets/bower_components/foundation/js/foundation/foundation.equalizer.js +57 -26
- data/assets/bower_components/foundation/js/foundation/foundation.interchange.js +50 -38
- data/assets/bower_components/foundation/js/foundation/foundation.joyride.js +121 -110
- data/assets/bower_components/foundation/js/foundation/foundation.js +121 -79
- data/assets/bower_components/foundation/js/foundation/foundation.magellan.js +75 -59
- data/assets/bower_components/foundation/js/foundation/foundation.offcanvas.js +95 -22
- data/assets/bower_components/foundation/js/foundation/foundation.orbit.js +127 -123
- data/assets/bower_components/foundation/js/foundation/foundation.reveal.js +147 -69
- data/assets/bower_components/foundation/js/foundation/foundation.slider.js +101 -72
- data/assets/bower_components/foundation/js/foundation/foundation.tab.js +52 -39
- data/assets/bower_components/foundation/js/foundation/foundation.tooltip.js +97 -49
- data/assets/bower_components/foundation/js/foundation/foundation.topbar.js +70 -57
- data/assets/bower_components/foundation/js/foundation.js +1544 -951
- data/assets/bower_components/foundation/js/foundation.min.js +5 -4
- data/assets/bower_components/foundation/js/vendor/fastclick.js +8 -9
- data/assets/bower_components/foundation/js/vendor/jquery.js +6 -6
- data/assets/bower_components/foundation/js/vendor/modernizr.js +1 -1
- data/assets/bower_components/foundation/package.json +57 -0
- data/assets/bower_components/foundation/scss/foundation/_functions.scss +53 -43
- data/assets/bower_components/foundation/scss/foundation/_settings.scss +59 -37
- data/assets/bower_components/foundation/scss/foundation/components/_accordion.scss +12 -8
- data/assets/bower_components/foundation/scss/foundation/components/_alert-boxes.scss +12 -12
- data/assets/bower_components/foundation/scss/foundation/components/_block-grid.scss +14 -13
- data/assets/bower_components/foundation/scss/foundation/components/_breadcrumbs.scss +19 -19
- data/assets/bower_components/foundation/scss/foundation/components/_button-groups.scss +33 -25
- data/assets/bower_components/foundation/scss/foundation/components/_buttons.scss +30 -28
- data/assets/bower_components/foundation/scss/foundation/components/_clearing.scss +51 -47
- data/assets/bower_components/foundation/scss/foundation/components/_dropdown-buttons.scss +10 -11
- data/assets/bower_components/foundation/scss/foundation/components/_dropdown.scss +45 -38
- data/assets/bower_components/foundation/scss/foundation/components/_flex-video.scss +7 -7
- data/assets/bower_components/foundation/scss/foundation/components/_forms.scss +99 -62
- data/assets/bower_components/foundation/scss/foundation/components/_global.scss +152 -67
- data/assets/bower_components/foundation/scss/foundation/components/_grid.scss +39 -36
- data/assets/bower_components/foundation/scss/foundation/components/_icon-bar.scss +337 -235
- data/assets/bower_components/foundation/scss/foundation/components/_inline-lists.scss +9 -8
- data/assets/bower_components/foundation/scss/foundation/components/_joyride.scss +40 -42
- data/assets/bower_components/foundation/scss/foundation/components/_keystrokes.scss +2 -3
- data/assets/bower_components/foundation/scss/foundation/components/_labels.scss +6 -6
- data/assets/bower_components/foundation/scss/foundation/components/_magellan.scss +2 -2
- data/assets/bower_components/foundation/scss/foundation/components/_offcanvas.scss +259 -168
- data/assets/bower_components/foundation/scss/foundation/components/_orbit.scss +82 -62
- data/assets/bower_components/foundation/scss/foundation/components/_pagination.scss +16 -15
- data/assets/bower_components/foundation/scss/foundation/components/_panels.scss +21 -15
- data/assets/bower_components/foundation/scss/foundation/components/_pricing-tables.scss +16 -16
- data/assets/bower_components/foundation/scss/foundation/components/_progress-bars.scss +10 -4
- data/assets/bower_components/foundation/scss/foundation/components/_range-slider.scss +28 -20
- data/assets/bower_components/foundation/scss/foundation/components/_reveal.scss +38 -28
- data/assets/bower_components/foundation/scss/foundation/components/_side-nav.scss +15 -11
- data/assets/bower_components/foundation/scss/foundation/components/_split-buttons.scss +22 -18
- data/assets/bower_components/foundation/scss/foundation/components/_sub-nav.scss +14 -12
- data/assets/bower_components/foundation/scss/foundation/components/_switches.scss +22 -19
- data/assets/bower_components/foundation/scss/foundation/components/_tables.scss +8 -8
- data/assets/bower_components/foundation/scss/foundation/components/_tabs.scss +50 -31
- data/assets/bower_components/foundation/scss/foundation/components/_thumbs.scss +8 -8
- data/assets/bower_components/foundation/scss/foundation/components/_tooltips.scss +25 -25
- data/assets/bower_components/foundation/scss/foundation/components/_top-bar.scss +176 -122
- data/assets/bower_components/foundation/scss/foundation/components/_type.scss +38 -38
- data/assets/bower_components/foundation/scss/foundation/components/_visibility.scss +33 -16
- data/assets/bower_components/foundation/scss/foundation.scss +37 -40
- data/assets/bower_components/foundation/scss/normalize.scss +8 -11
- data/assets/bower_components/jquery/bower.json +2 -1
- data/assets/bower_components/jquery/dist/jquery.js +9 -4
- data/assets/bower_components/jquery/dist/jquery.min.js +4 -4
- data/assets/bower_components/jquery/dist/jquery.min.map +1 -1
- data/assets/bower_components/jquery/src/core.js +6 -1
- data/assets/scss/_settings.scss +2 -0
- data/assets/stylesheets/app.css +3066 -2429
- data/lib/catscope/version.rb +1 -1
- data/lib/catscope/views/layout.erb +6 -2
- metadata +8 -4
- data/assets/bower_components/foundation/scss/foundation/components/_toolbar.scss +0 -70
@@ -4,20 +4,24 @@
|
|
4
4
|
Foundation.libs.abide = {
|
5
5
|
name : 'abide',
|
6
6
|
|
7
|
-
version : '5.5.
|
7
|
+
version : '5.5.3',
|
8
8
|
|
9
9
|
settings : {
|
10
|
-
live_validate : true,
|
11
|
-
validate_on_blur: true,
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
live_validate : true, // validate the form as you go
|
11
|
+
validate_on_blur : true, // validate whenever you focus/blur on an input field
|
12
|
+
// validate_on: 'tab', // tab (when user tabs between fields), change (input changes), manual (call custom events)
|
13
|
+
|
14
|
+
focus_on_invalid : true, // automatically bring the focus to an invalid input field
|
15
|
+
error_labels : true, // labels with a for="inputId" will receive an `error` class
|
16
|
+
error_class : 'error', // labels with a for="inputId" will receive an `error` class
|
17
|
+
// the amount of time Abide will take before it validates the form (in ms).
|
18
|
+
// smaller time will result in faster validation
|
15
19
|
timeout : 1000,
|
16
20
|
patterns : {
|
17
|
-
alpha: /^[a-zA-Z]+$/,
|
21
|
+
alpha : /^[a-zA-Z]+$/,
|
18
22
|
alpha_numeric : /^[a-zA-Z0-9]+$/,
|
19
|
-
integer: /^[-+]?\d+$/,
|
20
|
-
number: /^[-+]?\d*(?:[\.\,]\d+)?$/,
|
23
|
+
integer : /^[-+]?\d+$/,
|
24
|
+
number : /^[-+]?\d*(?:[\.\,]\d+)?$/,
|
21
25
|
|
22
26
|
// amex, visa, diners
|
23
27
|
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})$/,
|
@@ -26,26 +30,27 @@
|
|
26
30
|
// http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
|
27
31
|
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])?)+$/,
|
28
32
|
|
29
|
-
|
33
|
+
// http://blogs.lse.ac.uk/lti/2008/04/23/a-regular-expression-to-match-any-url/
|
34
|
+
url: /^(https?|ftp|file|ssh):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?(\d+)?((\/[-\+~%\/\.\w]+)?\??([-\+=&;%@\.\w]+)?#?([\w]+)?)?/,
|
30
35
|
// abc.de
|
31
|
-
domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
|
36
|
+
domain : /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,8}$/,
|
32
37
|
|
33
|
-
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))$/,
|
38
|
+
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))$/,
|
34
39
|
// YYYY-MM-DD
|
35
|
-
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))$/,
|
40
|
+
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))$/,
|
36
41
|
// HH:MM:SS
|
37
42
|
time : /^(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}$/,
|
38
|
-
dateISO: /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
|
43
|
+
dateISO : /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/,
|
39
44
|
// MM/DD/YYYY
|
40
45
|
month_day_year : /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d{4}$/,
|
41
46
|
// DD/MM/YYYY
|
42
47
|
day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
|
43
48
|
|
44
49
|
// #FFF or #FFFFFF
|
45
|
-
color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
|
50
|
+
color : /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
|
46
51
|
},
|
47
52
|
validators : {
|
48
|
-
equalTo: function(el, required, parent) {
|
53
|
+
equalTo : function (el, required, parent) {
|
49
54
|
var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value,
|
50
55
|
to = el.value,
|
51
56
|
valid = (from === to);
|
@@ -68,36 +73,82 @@
|
|
68
73
|
|
69
74
|
this.invalid_attr = this.add_namespace('data-invalid');
|
70
75
|
|
76
|
+
function validate(originalSelf, e) {
|
77
|
+
clearTimeout(self.timer);
|
78
|
+
self.timer = setTimeout(function () {
|
79
|
+
self.validate([originalSelf], e);
|
80
|
+
}.bind(originalSelf), settings.timeout);
|
81
|
+
}
|
82
|
+
|
71
83
|
form
|
72
84
|
.off('.abide')
|
73
|
-
.on('submit.fndtn.abide
|
85
|
+
.on('submit.fndtn.abide', function (e) {
|
74
86
|
var is_ajax = /ajax/i.test(self.S(this).attr(self.attr_name()));
|
75
|
-
return self.validate(self.S(this).find('input, textarea, select').get(), e, is_ajax);
|
87
|
+
return self.validate(self.S(this).find('input, textarea, select').not(":hidden, [data-abide-ignore]").get(), e, is_ajax);
|
76
88
|
})
|
77
|
-
.on('
|
78
|
-
|
89
|
+
.on('validate.fndtn.abide', function (e) {
|
90
|
+
if (settings.validate_on === 'manual') {
|
91
|
+
self.validate([e.target], e);
|
92
|
+
}
|
79
93
|
})
|
80
|
-
.
|
94
|
+
.on('reset', function (e) {
|
95
|
+
return self.reset($(this), e);
|
96
|
+
})
|
97
|
+
.find('input, textarea, select').not(":hidden, [data-abide-ignore]")
|
81
98
|
.off('.abide')
|
82
99
|
.on('blur.fndtn.abide change.fndtn.abide', function (e) {
|
83
|
-
|
84
|
-
|
100
|
+
var id = this.getAttribute('id'),
|
101
|
+
eqTo = form.find('[data-equalto="'+ id +'"]');
|
102
|
+
// old settings fallback
|
103
|
+
// will be deprecated with F6 release
|
104
|
+
if (settings.validate_on_blur && settings.validate_on_blur === true) {
|
105
|
+
validate(this, e);
|
106
|
+
}
|
107
|
+
// checks if there is an equalTo equivalent related by id
|
108
|
+
if(typeof eqTo.get(0) !== "undefined" && eqTo.val().length){
|
109
|
+
validate(eqTo.get(0),e);
|
110
|
+
}
|
111
|
+
// new settings combining validate options into one setting
|
112
|
+
if (settings.validate_on === 'change') {
|
113
|
+
validate(this, e);
|
85
114
|
}
|
86
115
|
})
|
87
116
|
.on('keydown.fndtn.abide', function (e) {
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
117
|
+
var id = this.getAttribute('id'),
|
118
|
+
eqTo = form.find('[data-equalto="'+ id +'"]');
|
119
|
+
// old settings fallback
|
120
|
+
// will be deprecated with F6 release
|
121
|
+
if (settings.live_validate && settings.live_validate === true && e.which != 9) {
|
122
|
+
validate(this, e);
|
123
|
+
}
|
124
|
+
// checks if there is an equalTo equivalent related by id
|
125
|
+
if(typeof eqTo.get(0) !== "undefined" && eqTo.val().length){
|
126
|
+
validate(eqTo.get(0),e);
|
127
|
+
}
|
128
|
+
// new settings combining validate options into one setting
|
129
|
+
if (settings.validate_on === 'tab' && e.which === 9) {
|
130
|
+
validate(this, e);
|
131
|
+
}
|
132
|
+
else if (settings.validate_on === 'change') {
|
133
|
+
validate(this, e);
|
134
|
+
}
|
135
|
+
})
|
136
|
+
.on('focus', function (e) {
|
137
|
+
if (navigator.userAgent.match(/iPad|iPhone|Android|BlackBerry|Windows Phone|webOS/i)) {
|
138
|
+
$('html, body').animate({
|
139
|
+
scrollTop: $(e.target).offset().top
|
140
|
+
}, 100);
|
93
141
|
}
|
94
142
|
});
|
95
143
|
},
|
96
144
|
|
97
|
-
reset : function (form) {
|
98
|
-
|
99
|
-
|
100
|
-
|
145
|
+
reset : function (form, e) {
|
146
|
+
var self = this;
|
147
|
+
form.removeAttr(self.invalid_attr);
|
148
|
+
|
149
|
+
$('[' + self.invalid_attr + ']', form).removeAttr(self.invalid_attr);
|
150
|
+
$('.' + self.settings.error_class, form).not('small').removeClass(self.settings.error_class);
|
151
|
+
$(':input', form).not(':button, :submit, :reset, :hidden, [data-abide-ignore]').val('').removeAttr(self.invalid_attr);
|
101
152
|
},
|
102
153
|
|
103
154
|
validate : function (els, e, is_ajax) {
|
@@ -107,22 +158,26 @@
|
|
107
158
|
submit_event = /submit/.test(e.type);
|
108
159
|
|
109
160
|
// Has to count up to make sure the focus gets applied to the top error
|
110
|
-
for (var i=0; i < validation_count; i++) {
|
161
|
+
for (var i = 0; i < validation_count; i++) {
|
111
162
|
if (!validations[i] && (submit_event || is_ajax)) {
|
112
|
-
if (this.settings.focus_on_invalid)
|
113
|
-
|
163
|
+
if (this.settings.focus_on_invalid) {
|
164
|
+
els[i].focus();
|
165
|
+
}
|
166
|
+
form.trigger('invalid.fndtn.abide');
|
114
167
|
this.S(els[i]).closest('form').attr(this.invalid_attr, '');
|
115
168
|
return false;
|
116
169
|
}
|
117
170
|
}
|
118
171
|
|
119
172
|
if (submit_event || is_ajax) {
|
120
|
-
form.trigger('valid
|
173
|
+
form.trigger('valid.fndtn.abide');
|
121
174
|
}
|
122
175
|
|
123
176
|
form.removeAttr(this.invalid_attr);
|
124
177
|
|
125
|
-
if (is_ajax)
|
178
|
+
if (is_ajax) {
|
179
|
+
return false;
|
180
|
+
}
|
126
181
|
|
127
182
|
return true;
|
128
183
|
},
|
@@ -162,8 +217,11 @@
|
|
162
217
|
// TODO: Break this up into smaller methods, getting hard to read.
|
163
218
|
check_validation_and_apply_styles : function (el_patterns) {
|
164
219
|
var i = el_patterns.length,
|
165
|
-
validations = []
|
166
|
-
|
220
|
+
validations = [];
|
221
|
+
if (i == 0) {
|
222
|
+
return validations;
|
223
|
+
}
|
224
|
+
var form = this.S(el_patterns[0][0]).closest('[data-' + this.attr_name(true) + ']'),
|
167
225
|
settings = form.data(this.attr_name(true) + '-init') || {};
|
168
226
|
while (i--) {
|
169
227
|
var el = el_patterns[i][0],
|
@@ -171,8 +229,8 @@
|
|
171
229
|
value = el.value.trim(),
|
172
230
|
direct_parent = this.S(el).parent(),
|
173
231
|
validator = el.getAttribute(this.add_namespace('data-abide-validator')),
|
174
|
-
is_radio = el.type ===
|
175
|
-
is_checkbox = el.type ===
|
232
|
+
is_radio = el.type === 'radio',
|
233
|
+
is_checkbox = el.type === 'checkbox',
|
176
234
|
label = this.S('label[for="' + el.getAttribute('id') + '"]'),
|
177
235
|
valid_length = (required) ? (el.value.length > 0) : true,
|
178
236
|
el_validations = [];
|
@@ -180,7 +238,7 @@
|
|
180
238
|
var parent, valid;
|
181
239
|
|
182
240
|
// support old way to do equalTo validations
|
183
|
-
if(el.getAttribute(this.add_namespace('data-equalto'))) { validator =
|
241
|
+
if (el.getAttribute(this.add_namespace('data-equalto'))) { validator = 'equalTo' }
|
184
242
|
|
185
243
|
if (!direct_parent.is('label')) {
|
186
244
|
parent = direct_parent;
|
@@ -188,15 +246,36 @@
|
|
188
246
|
parent = direct_parent.parent();
|
189
247
|
}
|
190
248
|
|
191
|
-
if (validator) {
|
192
|
-
valid = this.settings.validators[validator].apply(this, [el, required, parent]);
|
193
|
-
el_validations.push(valid);
|
194
|
-
}
|
195
|
-
|
196
249
|
if (is_radio && required) {
|
197
250
|
el_validations.push(this.valid_radio(el, required));
|
198
251
|
} else if (is_checkbox && required) {
|
199
252
|
el_validations.push(this.valid_checkbox(el, required));
|
253
|
+
|
254
|
+
} else if (validator) {
|
255
|
+
// Validate using each of the specified (space-delimited) validators.
|
256
|
+
var validators = validator.split(' ');
|
257
|
+
var last_valid = true, all_valid = true;
|
258
|
+
for (var iv = 0; iv < validators.length; iv++) {
|
259
|
+
valid = this.settings.validators[validators[iv]].apply(this, [el, required, parent])
|
260
|
+
el_validations.push(valid);
|
261
|
+
all_valid = valid && last_valid;
|
262
|
+
last_valid = valid;
|
263
|
+
}
|
264
|
+
if (all_valid) {
|
265
|
+
this.S(el).removeAttr(this.invalid_attr);
|
266
|
+
parent.removeClass('error');
|
267
|
+
if (label.length > 0 && this.settings.error_labels) {
|
268
|
+
label.removeClass(this.settings.error_class).removeAttr('role');
|
269
|
+
}
|
270
|
+
$(el).triggerHandler('valid');
|
271
|
+
} else {
|
272
|
+
this.S(el).attr(this.invalid_attr, '');
|
273
|
+
parent.addClass('error');
|
274
|
+
if (label.length > 0 && this.settings.error_labels) {
|
275
|
+
label.addClass(this.settings.error_class).attr('role', 'alert');
|
276
|
+
}
|
277
|
+
$(el).triggerHandler('invalid');
|
278
|
+
}
|
200
279
|
} else {
|
201
280
|
|
202
281
|
if (el_patterns[i][1].test(value) && valid_length ||
|
@@ -206,9 +285,8 @@
|
|
206
285
|
el_validations.push(false);
|
207
286
|
}
|
208
287
|
|
209
|
-
el_validations = [el_validations.every(function(valid){return valid;})];
|
210
|
-
|
211
|
-
if(el_validations[0]){
|
288
|
+
el_validations = [el_validations.every(function (valid) {return valid;})];
|
289
|
+
if (el_validations[0]) {
|
212
290
|
this.S(el).removeAttr(this.invalid_attr);
|
213
291
|
el.setAttribute('aria-invalid', 'false');
|
214
292
|
el.removeAttribute('aria-describedby');
|
@@ -222,9 +300,11 @@
|
|
222
300
|
el.setAttribute('aria-invalid', 'true');
|
223
301
|
|
224
302
|
// Try to find the error associated with the input
|
225
|
-
var errorElem = parent.find('small.'+this.settings.error_class, 'span.'+this.settings.error_class);
|
226
|
-
var errorID = errorElem.length > 0 ? errorElem[0].id :
|
227
|
-
if (errorID.length > 0)
|
303
|
+
var errorElem = parent.find('small.' + this.settings.error_class, 'span.' + this.settings.error_class);
|
304
|
+
var errorID = errorElem.length > 0 ? errorElem[0].id : '';
|
305
|
+
if (errorID.length > 0) {
|
306
|
+
el.setAttribute('aria-describedby', errorID);
|
307
|
+
}
|
228
308
|
|
229
309
|
// el.setAttribute('aria-describedby', $(el).find('.error')[0].id);
|
230
310
|
parent.addClass(this.settings.error_class);
|
@@ -234,20 +314,22 @@
|
|
234
314
|
$(el).triggerHandler('invalid');
|
235
315
|
}
|
236
316
|
}
|
237
|
-
validations.
|
317
|
+
validations = validations.concat(el_validations);
|
238
318
|
}
|
239
|
-
|
319
|
+
|
240
320
|
return validations;
|
241
321
|
},
|
242
322
|
|
243
|
-
valid_checkbox : function(el, required) {
|
323
|
+
valid_checkbox : function (el, required) {
|
244
324
|
var el = this.S(el),
|
245
325
|
valid = (el.is(':checked') || !required || el.get(0).getAttribute('disabled'));
|
246
326
|
|
247
327
|
if (valid) {
|
248
328
|
el.removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
|
329
|
+
$(el).triggerHandler('valid');
|
249
330
|
} else {
|
250
331
|
el.attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
|
332
|
+
$(el).triggerHandler('invalid');
|
251
333
|
}
|
252
334
|
|
253
335
|
return valid;
|
@@ -255,40 +337,42 @@
|
|
255
337
|
|
256
338
|
valid_radio : function (el, required) {
|
257
339
|
var name = el.getAttribute('name'),
|
258
|
-
group = this.S(el).closest('[data-' + this.attr_name(true) + ']').find("[name='"+name+"']"),
|
340
|
+
group = this.S(el).closest('[data-' + this.attr_name(true) + ']').find("[name='" + name + "']"),
|
259
341
|
count = group.length,
|
260
342
|
valid = false,
|
261
343
|
disabled = false;
|
262
344
|
|
263
345
|
// Has to count up to make sure the focus gets applied to the top error
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
}
|
275
|
-
}
|
346
|
+
for (var i=0; i < count; i++) {
|
347
|
+
if( group[i].getAttribute('disabled') ){
|
348
|
+
disabled=true;
|
349
|
+
valid=true;
|
350
|
+
} else {
|
351
|
+
if (group[i].checked){
|
352
|
+
valid = true;
|
353
|
+
} else {
|
354
|
+
if( disabled ){
|
355
|
+
valid = false;
|
276
356
|
}
|
357
|
+
}
|
277
358
|
}
|
359
|
+
}
|
278
360
|
|
279
361
|
// Has to count up to make sure the focus gets applied to the top error
|
280
|
-
for (var i=0; i < count; i++) {
|
362
|
+
for (var i = 0; i < count; i++) {
|
281
363
|
if (valid) {
|
282
364
|
this.S(group[i]).removeAttr(this.invalid_attr).parent().removeClass(this.settings.error_class);
|
365
|
+
$(group[i]).triggerHandler('valid');
|
283
366
|
} else {
|
284
367
|
this.S(group[i]).attr(this.invalid_attr, '').parent().addClass(this.settings.error_class);
|
368
|
+
$(group[i]).triggerHandler('invalid');
|
285
369
|
}
|
286
370
|
}
|
287
371
|
|
288
372
|
return valid;
|
289
373
|
},
|
290
374
|
|
291
|
-
valid_equal: function(el, required, parent) {
|
375
|
+
valid_equal : function (el, required, parent) {
|
292
376
|
var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value,
|
293
377
|
to = el.value,
|
294
378
|
valid = (from === to);
|
@@ -296,17 +380,21 @@
|
|
296
380
|
if (valid) {
|
297
381
|
this.S(el).removeAttr(this.invalid_attr);
|
298
382
|
parent.removeClass(this.settings.error_class);
|
299
|
-
if (label.length > 0 && settings.error_labels)
|
383
|
+
if (label.length > 0 && settings.error_labels) {
|
384
|
+
label.removeClass(this.settings.error_class);
|
385
|
+
}
|
300
386
|
} else {
|
301
387
|
this.S(el).attr(this.invalid_attr, '');
|
302
388
|
parent.addClass(this.settings.error_class);
|
303
|
-
if (label.length > 0 && settings.error_labels)
|
389
|
+
if (label.length > 0 && settings.error_labels) {
|
390
|
+
label.addClass(this.settings.error_class);
|
391
|
+
}
|
304
392
|
}
|
305
393
|
|
306
394
|
return valid;
|
307
395
|
},
|
308
396
|
|
309
|
-
valid_oneof: function(el, required, parent, doNotValidateOthers) {
|
397
|
+
valid_oneof : function (el, required, parent, doNotValidateOthers) {
|
310
398
|
var el = this.S(el),
|
311
399
|
others = this.S('[' + this.add_namespace('data-oneof') + ']'),
|
312
400
|
valid = others.filter(':checked').length > 0;
|
@@ -319,12 +407,20 @@
|
|
319
407
|
|
320
408
|
if (!doNotValidateOthers) {
|
321
409
|
var _this = this;
|
322
|
-
others.each(function() {
|
410
|
+
others.each(function () {
|
323
411
|
_this.valid_oneof.call(_this, this, null, null, true);
|
324
412
|
});
|
325
413
|
}
|
326
414
|
|
327
415
|
return valid;
|
416
|
+
},
|
417
|
+
|
418
|
+
reflow : function(scope, options) {
|
419
|
+
var self = this,
|
420
|
+
form = self.S('[' + this.attr_name() + ']').attr('novalidate', 'novalidate');
|
421
|
+
self.S(form).each(function (idx, el) {
|
422
|
+
self.events(el);
|
423
|
+
});
|
328
424
|
}
|
329
425
|
};
|
330
426
|
}(jQuery, window, window.document));
|
@@ -4,13 +4,13 @@
|
|
4
4
|
Foundation.libs.accordion = {
|
5
5
|
name : 'accordion',
|
6
6
|
|
7
|
-
version : '5.5.
|
7
|
+
version : '5.5.3',
|
8
8
|
|
9
9
|
settings : {
|
10
|
-
content_class: 'content',
|
11
|
-
active_class: 'active',
|
12
|
-
multi_expand: false,
|
13
|
-
toggleable: true,
|
10
|
+
content_class : 'content',
|
11
|
+
active_class : 'active',
|
12
|
+
multi_expand : false,
|
13
|
+
toggleable : true,
|
14
14
|
callback : function () {}
|
15
15
|
},
|
16
16
|
|
@@ -18,30 +18,35 @@
|
|
18
18
|
this.bindings(method, options);
|
19
19
|
},
|
20
20
|
|
21
|
-
events : function () {
|
21
|
+
events : function (instance) {
|
22
22
|
var self = this;
|
23
23
|
var S = this.S;
|
24
|
+
self.create(this.S(instance));
|
25
|
+
|
24
26
|
S(this.scope)
|
25
27
|
.off('.fndtn.accordion')
|
26
|
-
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > .
|
28
|
+
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a, [' + this.attr_name() + '] > li > a', function (e) {
|
27
29
|
var accordion = S(this).closest('[' + self.attr_name() + ']'),
|
28
30
|
groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
|
29
31
|
settings = accordion.data(self.attr_name(true) + '-init') || self.settings,
|
30
32
|
target = S('#' + this.href.split('#')[1]),
|
31
|
-
aunts = $('>
|
32
|
-
siblings = aunts.children('.'+settings.content_class),
|
33
|
+
aunts = $('> dd, > li', accordion),
|
34
|
+
siblings = aunts.children('.' + settings.content_class),
|
33
35
|
active_content = siblings.filter('.' + settings.active_class);
|
34
36
|
|
35
37
|
e.preventDefault();
|
36
38
|
|
37
39
|
if (accordion.attr(self.attr_name())) {
|
38
|
-
siblings = siblings.add('[' + groupSelector + '] dd > '+'.'+settings.content_class);
|
39
|
-
aunts = aunts.add('[' + groupSelector + ']
|
40
|
+
siblings = siblings.add('[' + groupSelector + '] dd > ' + '.' + settings.content_class + ', [' + groupSelector + '] li > ' + '.' + settings.content_class);
|
41
|
+
aunts = aunts.add('[' + groupSelector + '] dd, [' + groupSelector + '] li');
|
40
42
|
}
|
41
43
|
|
42
44
|
if (settings.toggleable && target.is(active_content)) {
|
43
|
-
target.parent('
|
45
|
+
target.parent('dd, li').toggleClass(settings.active_class, false);
|
44
46
|
target.toggleClass(settings.active_class, false);
|
47
|
+
S(this).attr('aria-expanded', function(i, attr){
|
48
|
+
return attr === 'true' ? 'false' : 'true';
|
49
|
+
});
|
45
50
|
settings.callback(target);
|
46
51
|
target.triggerHandler('toggled', [accordion]);
|
47
52
|
accordion.triggerHandler('toggled', [target]);
|
@@ -51,15 +56,68 @@
|
|
51
56
|
if (!settings.multi_expand) {
|
52
57
|
siblings.removeClass(settings.active_class);
|
53
58
|
aunts.removeClass(settings.active_class);
|
59
|
+
aunts.children('a').attr('aria-expanded','false');
|
54
60
|
}
|
55
61
|
|
56
62
|
target.addClass(settings.active_class).parent().addClass(settings.active_class);
|
57
63
|
settings.callback(target);
|
58
64
|
target.triggerHandler('toggled', [accordion]);
|
59
65
|
accordion.triggerHandler('toggled', [target]);
|
66
|
+
S(this).attr('aria-expanded','true');
|
60
67
|
});
|
61
68
|
},
|
62
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).addClass(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
|
+
toggle : function(options) {
|
85
|
+
var options = typeof options !== 'undefined' ? options : {};
|
86
|
+
var selector = typeof options.selector !== 'undefined' ? options.selector : '';
|
87
|
+
var toggle_state = typeof options.toggle_state !== 'undefined' ? options.toggle_state : '';
|
88
|
+
var $accordion = typeof options.$accordion !== 'undefined' ? options.$accordion : this.S(this.scope).closest('[' + this.attr_name() + ']');
|
89
|
+
|
90
|
+
var $items = $accordion.find('> dd' + selector + ', > li' + selector);
|
91
|
+
if ( $items.length < 1 ) {
|
92
|
+
if ( window.console ) {
|
93
|
+
console.error('Selection not found.', selector);
|
94
|
+
}
|
95
|
+
return false;
|
96
|
+
}
|
97
|
+
|
98
|
+
var S = this.S;
|
99
|
+
var active_class = this.settings.active_class;
|
100
|
+
$items.each(function() {
|
101
|
+
var $item = S(this);
|
102
|
+
var is_active = $item.hasClass(active_class);
|
103
|
+
if ( ( is_active && toggle_state === 'close' ) || ( !is_active && toggle_state === 'open' ) || toggle_state === '' ) {
|
104
|
+
$item.find('> a').trigger('click.fndtn.accordion');
|
105
|
+
}
|
106
|
+
});
|
107
|
+
},
|
108
|
+
|
109
|
+
open : function(options) {
|
110
|
+
var options = typeof options !== 'undefined' ? options : {};
|
111
|
+
options.toggle_state = 'open';
|
112
|
+
this.toggle(options);
|
113
|
+
},
|
114
|
+
|
115
|
+
close : function(options) {
|
116
|
+
var options = typeof options !== 'undefined' ? options : {};
|
117
|
+
options.toggle_state = 'close';
|
118
|
+
this.toggle(options);
|
119
|
+
},
|
120
|
+
|
63
121
|
off : function () {},
|
64
122
|
|
65
123
|
reflow : function () {}
|
@@ -4,10 +4,10 @@
|
|
4
4
|
Foundation.libs.alert = {
|
5
5
|
name : 'alert',
|
6
6
|
|
7
|
-
version : '5.5.
|
7
|
+
version : '5.5.3',
|
8
8
|
|
9
9
|
settings : {
|
10
|
-
callback: function (){}
|
10
|
+
callback : function () {}
|
11
11
|
},
|
12
12
|
|
13
13
|
init : function (scope, method, options) {
|
@@ -25,13 +25,13 @@
|
|
25
25
|
e.preventDefault();
|
26
26
|
if (Modernizr.csstransitions) {
|
27
27
|
alertBox.addClass('alert-close');
|
28
|
-
alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function(e) {
|
29
|
-
S(this).trigger('close
|
28
|
+
alertBox.on('transitionend webkitTransitionEnd oTransitionEnd', function (e) {
|
29
|
+
S(this).trigger('close.fndtn.alert').remove();
|
30
30
|
settings.callback();
|
31
31
|
});
|
32
32
|
} else {
|
33
33
|
alertBox.fadeOut(300, function () {
|
34
|
-
S(this).trigger('close
|
34
|
+
S(this).trigger('close.fndtn.alert').remove();
|
35
35
|
settings.callback();
|
36
36
|
});
|
37
37
|
}
|