formvalidation-rails 0.7.1 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/formvalidation-rails/version.rb +2 -2
- data/vendor/assets/javascripts/{formvalidation.js → formValidation.js} +148 -30
- data/vendor/assets/javascripts/formValidation.min.js +13 -0
- data/vendor/assets/javascripts/formvalidation/framework/bootstrap.js +2 -7
- data/vendor/assets/javascripts/formvalidation/framework/bootstrap.min.js +2 -2
- data/vendor/assets/javascripts/formvalidation/framework/bootstrap4.js +215 -0
- data/vendor/assets/javascripts/formvalidation/framework/bootstrap4.min.js +10 -0
- data/vendor/assets/javascripts/formvalidation/framework/foundation.js +36 -50
- data/vendor/assets/javascripts/formvalidation/framework/foundation.min.js +2 -2
- data/vendor/assets/javascripts/formvalidation/framework/foundation5.js +161 -0
- data/vendor/assets/javascripts/formvalidation/framework/foundation5.min.js +10 -0
- data/vendor/assets/javascripts/formvalidation/framework/pure.js +7 -6
- data/vendor/assets/javascripts/formvalidation/framework/pure.min.js +2 -2
- data/vendor/assets/javascripts/formvalidation/framework/semantic.js +4 -4
- data/vendor/assets/javascripts/formvalidation/framework/semantic.min.js +2 -2
- data/vendor/assets/javascripts/formvalidation/framework/uikit.js +2 -8
- data/vendor/assets/javascripts/formvalidation/framework/uikit.min.js +2 -2
- data/vendor/assets/javascripts/formvalidation/language/ar_MA.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/bg_BG.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/ca_ES.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/cs_CZ.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/da_DK.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/de_DE.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/el_GR.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/en_US.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/es_CL.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/es_ES.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/eu_ES.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/fa_IR.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/fi_FI.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/fr_BE.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/fr_FR.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/he_IL.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/hi_IN.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/hu_HU.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/id_ID.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/it_IT.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/ja_JP.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/nl_BE.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/nl_NL.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/no_NO.js +3 -3
- data/vendor/assets/javascripts/formvalidation/language/pl_PL.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/pt_BR.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/pt_PT.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/ro_RO.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/ru_RU.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/sk_SK.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/sq_AL.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/sr_RS.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/sv_SE.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/th_TH.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/tr_TR.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/ua_UA.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/vi_VN.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/zh_CN.js +0 -0
- data/vendor/assets/javascripts/formvalidation/language/zh_TW.js +0 -0
- data/vendor/assets/stylesheets/formValidation.css +299 -0
- data/vendor/assets/stylesheets/formValidation.min.css +9 -0
- metadata +10 -6
- data/vendor/assets/javascripts/formvalidation.min.js +0 -13
- data/vendor/assets/stylesheets/formvalidation.css +0 -169
- data/vendor/assets/stylesheets/formvalidation.min.css +0 -1
@@ -0,0 +1,10 @@
|
|
1
|
+
/*!
|
2
|
+
* FormValidation (http://formvalidation.io)
|
3
|
+
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
|
+
*
|
5
|
+
* @version v0.8.1, built on 2016-07-29 1:10:56 AM
|
6
|
+
* @author https://twitter.com/formvalidation
|
7
|
+
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
8
|
+
* @license http://formvalidation.io/license/
|
9
|
+
*/
|
10
|
+
!function(a){FormValidation.Framework.Bootstrap4=function(b,c,d){c=a.extend(!0,{button:{selector:'[type="submit"]:not([formnovalidate])',disabled:"disabled"},err:{clazz:"form-control-feedback",parent:"^(.*)(col|offset)-(xs|sm|md|lg)-[0-9]+(.*)$"},icon:{valid:null,invalid:null,validating:null,feedback:"fv-control-feedback"},row:{selector:".form-group",valid:"has-success",invalid:"has-warning",feedback:"fv-has-feedback"}},c),FormValidation.Base.apply(this,[b,c,d])},FormValidation.Framework.Bootstrap4.prototype=a.extend({},FormValidation.Base.prototype,{_fixIcon:function(a,b){var c=this._namespace,d=a.attr("type"),e=a.attr("data-"+c+"-field"),f=this.options.fields[e].row||this.options.row.selector,g=a.closest(f);if("checkbox"===d||"radio"===d){var h=a.parent();h.hasClass("form-check")?b.insertAfter(h):h.parent().hasClass("form-check")&&b.insertAfter(h.parent())}0!==g.find(".input-group").length&&b.addClass("fv-bootstrap-icon-input-group").insertAfter(g.find(".input-group").eq(0))},_createTooltip:function(a,b,c){var d=this._namespace,e=a.data(d+".icon");if(e)switch(c){case"popover":e.css({cursor:"pointer","pointer-events":"auto"}).popover("destroy").popover({container:"body",content:b,html:!0,placement:"top",trigger:"hover click"});break;case"tooltip":default:e.css({cursor:"pointer","pointer-events":"auto"}).tooltip("dispose").tooltip({container:"body",html:!0,placement:"top",title:b})}},_destroyTooltip:function(a,b){var c=this._namespace,d=a.data(c+".icon");if(d)switch(b){case"popover":d.css({cursor:"","pointer-events":"none"}).popover("destroy");break;case"tooltip":default:d.css({cursor:"","pointer-events":"none"}).tooltip("dispose")}},_hideTooltip:function(a,b){var c=this._namespace,d=a.data(c+".icon");if(d)switch(b){case"popover":d.popover("hide");break;case"tooltip":default:d.tooltip("hide")}},_showTooltip:function(a,b){var c=this._namespace,d=a.data(c+".icon");if(d)switch(b){case"popover":d.popover("show");break;case"tooltip":default:d.tooltip("show")}}})}(jQuery);
|
@@ -1,14 +1,14 @@
|
|
1
|
-
|
1
|
+
/**
|
2
2
|
* FormValidation (http://formvalidation.io)
|
3
3
|
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
4
|
*
|
5
|
-
* @version v0.7.1, built on 2016-02-01 12:00:57 AM
|
6
5
|
* @author https://twitter.com/formvalidation
|
7
6
|
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
8
7
|
* @license http://formvalidation.io/license/
|
9
8
|
*/
|
9
|
+
|
10
10
|
/**
|
11
|
-
* This class supports validating Foundation form (http://foundation.zurb.com/)
|
11
|
+
* This class supports validating Foundation v6+ form (http://foundation.zurb.com/)
|
12
12
|
*/
|
13
13
|
/* global Foundation: false */
|
14
14
|
(function($) {
|
@@ -21,8 +21,8 @@
|
|
21
21
|
disabled: 'disabled'
|
22
22
|
},
|
23
23
|
err: {
|
24
|
-
// http://foundation.zurb.com/docs/
|
25
|
-
clazz: 'error',
|
24
|
+
// http://foundation.zurb.com/sites/docs/abide.html
|
25
|
+
clazz: 'form-error',
|
26
26
|
parent: '^.*((small|medium|large)-[0-9]+)\\s.*(columns).*$'
|
27
27
|
},
|
28
28
|
// Foundation doesn't support feedback icon
|
@@ -33,10 +33,9 @@
|
|
33
33
|
feedback: 'fv-control-feedback'
|
34
34
|
},
|
35
35
|
row: {
|
36
|
-
// http://foundation.zurb.com/docs/components/forms.html
|
37
36
|
selector: '.row',
|
38
37
|
valid: 'fv-has-success',
|
39
|
-
invalid: 'error',
|
38
|
+
invalid: 'fv-has-error',
|
40
39
|
feedback: 'fv-has-feedback'
|
41
40
|
}
|
42
41
|
}, options);
|
@@ -55,8 +54,7 @@
|
|
55
54
|
var ns = this._namespace,
|
56
55
|
type = $field.attr('type'),
|
57
56
|
field = $field.attr('data-' + ns + '-field'),
|
58
|
-
row = this.options.fields[field].row || this.options.row.selector
|
59
|
-
$parent = $field.closest(row);
|
57
|
+
row = this.options.fields[field].row || this.options.row.selector;
|
60
58
|
|
61
59
|
if ('checkbox' === type || 'radio' === type) {
|
62
60
|
var $next = $icon.next();
|
@@ -64,39 +62,31 @@
|
|
64
62
|
$icon.insertAfter($next);
|
65
63
|
}
|
66
64
|
}
|
67
|
-
|
68
|
-
if ($parent.find('label').length === 0) {
|
69
|
-
$icon.addClass('fv-icon-no-label');
|
70
|
-
}
|
71
65
|
},
|
72
66
|
|
73
67
|
/**
|
74
68
|
* Create a tooltip or popover
|
75
69
|
* It will be shown when focusing on the field
|
76
70
|
*
|
71
|
+
* @see http://foundation.zurb.com/sites/docs/tooltip.html
|
77
72
|
* @param {jQuery} $field The field element
|
78
73
|
* @param {String} message The message
|
79
74
|
* @param {String} type Can be 'tooltip' or 'popover'
|
80
75
|
*/
|
81
76
|
_createTooltip: function($field, message, type) {
|
82
|
-
var
|
83
|
-
$icon = $field.data('fv.icon');
|
77
|
+
var $icon = $field.data('fv.icon');
|
84
78
|
if ($icon) {
|
85
|
-
$icon
|
86
|
-
|
87
|
-
.
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
that._hideTooltip($field, type);
|
97
|
-
});
|
98
|
-
Foundation.libs.tooltip.create($icon);
|
99
|
-
$icon.data('fv.foundation.tooltip', $icon);
|
79
|
+
var tooltip = $icon.data('fv.foundation.tooltip');
|
80
|
+
if (tooltip) {
|
81
|
+
tooltip.destroy();
|
82
|
+
}
|
83
|
+
|
84
|
+
$icon.css('cursor', 'pointer')
|
85
|
+
.off('.zf.tooltip')
|
86
|
+
.data('fv.foundation.tooltip', new Foundation.Tooltip($icon, {
|
87
|
+
templateClasses: 'fv-foundation-tooltip',
|
88
|
+
tipText: message
|
89
|
+
}));
|
100
90
|
}
|
101
91
|
},
|
102
92
|
|
@@ -109,14 +99,14 @@
|
|
109
99
|
_destroyTooltip: function($field, type) {
|
110
100
|
var $icon = $field.data('fv.icon');
|
111
101
|
if ($icon) {
|
112
|
-
$icon.
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
102
|
+
$icon.removeAttr('title')
|
103
|
+
.removeAttr('data-tooltip')
|
104
|
+
.css('cursor', '')
|
105
|
+
.off('.zf.tooltip');
|
106
|
+
|
107
|
+
var tooltip = $icon.data('fv.foundation.tooltip');
|
108
|
+
if (tooltip) {
|
109
|
+
tooltip.destroy();
|
120
110
|
$icon.removeData('fv.foundation.tooltip');
|
121
111
|
}
|
122
112
|
}
|
@@ -131,12 +121,10 @@
|
|
131
121
|
_hideTooltip: function($field, type) {
|
132
122
|
var $icon = $field.data('fv.icon');
|
133
123
|
if ($icon) {
|
134
|
-
$icon.css(
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
if ($tooltip) {
|
139
|
-
Foundation.libs.tooltip.hide($tooltip);
|
124
|
+
$icon.css('cursor', '');
|
125
|
+
var tooltip = $icon.data('fv.foundation.tooltip');
|
126
|
+
if (tooltip) {
|
127
|
+
tooltip.hide();
|
140
128
|
}
|
141
129
|
}
|
142
130
|
},
|
@@ -150,12 +138,10 @@
|
|
150
138
|
_showTooltip: function($field, type) {
|
151
139
|
var $icon = $field.data('fv.icon');
|
152
140
|
if ($icon) {
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
});
|
158
|
-
Foundation.libs.tooltip.show($tooltip);
|
141
|
+
$icon.css('cursor', 'pointer');
|
142
|
+
var tooltip = $icon.data('fv.foundation.tooltip');
|
143
|
+
if (tooltip) {
|
144
|
+
tooltip.show();
|
159
145
|
}
|
160
146
|
}
|
161
147
|
}
|
@@ -2,9 +2,9 @@
|
|
2
2
|
* FormValidation (http://formvalidation.io)
|
3
3
|
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
4
|
*
|
5
|
-
* @version v0.
|
5
|
+
* @version v0.8.1, built on 2016-07-29 1:10:56 AM
|
6
6
|
* @author https://twitter.com/formvalidation
|
7
7
|
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
8
8
|
* @license http://formvalidation.io/license/
|
9
9
|
*/
|
10
|
-
!function(a){FormValidation.Framework.Foundation=function(b,c){c=a.extend(!0,{button:{selector:'[type="submit"]:not([formnovalidate])',disabled:"disabled"},err:{clazz:"error",parent:"^.*((small|medium|large)-[0-9]+)\\s.*(columns).*$"},icon:{valid:null,invalid:null,validating:null,feedback:"fv-control-feedback"},row:{selector:".row",valid:"fv-has-success",invalid:"error",feedback:"fv-has-feedback"}},c),FormValidation.Base.apply(this,[b,c])},FormValidation.Framework.Foundation.prototype=a.extend({},FormValidation.Base.prototype,{_fixIcon:function(a,b){var c=this._namespace,d=a.attr("type"),e=a.attr("data-"+c+"-field")
|
10
|
+
!function(a){FormValidation.Framework.Foundation=function(b,c){c=a.extend(!0,{button:{selector:'[type="submit"]:not([formnovalidate])',disabled:"disabled"},err:{clazz:"form-error",parent:"^.*((small|medium|large)-[0-9]+)\\s.*(columns).*$"},icon:{valid:null,invalid:null,validating:null,feedback:"fv-control-feedback"},row:{selector:".row",valid:"fv-has-success",invalid:"fv-has-error",feedback:"fv-has-feedback"}},c),FormValidation.Base.apply(this,[b,c])},FormValidation.Framework.Foundation.prototype=a.extend({},FormValidation.Base.prototype,{_fixIcon:function(a,b){var c=this._namespace,d=a.attr("type"),e=a.attr("data-"+c+"-field");this.options.fields[e].row||this.options.row.selector;if("checkbox"===d||"radio"===d){var f=b.next();f.is("label")&&b.insertAfter(f)}},_createTooltip:function(a,b,c){var d=a.data("fv.icon");if(d){var e=d.data("fv.foundation.tooltip");e&&e.destroy(),d.css("cursor","pointer").off(".zf.tooltip").data("fv.foundation.tooltip",new Foundation.Tooltip(d,{templateClasses:"fv-foundation-tooltip",tipText:b}))}},_destroyTooltip:function(a,b){var c=a.data("fv.icon");if(c){c.removeAttr("title").removeAttr("data-tooltip").css("cursor","").off(".zf.tooltip");var d=c.data("fv.foundation.tooltip");d&&(d.destroy(),c.removeData("fv.foundation.tooltip"))}},_hideTooltip:function(a,b){var c=a.data("fv.icon");if(c){c.css("cursor","");var d=c.data("fv.foundation.tooltip");d&&d.hide()}},_showTooltip:function(a,b){var c=a.data("fv.icon");if(c){c.css("cursor","pointer");var d=c.data("fv.foundation.tooltip");d&&d.show()}}})}(jQuery);
|
@@ -0,0 +1,161 @@
|
|
1
|
+
/**
|
2
|
+
* FormValidation (http://formvalidation.io)
|
3
|
+
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
|
+
*
|
5
|
+
* @author https://twitter.com/formvalidation
|
6
|
+
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
7
|
+
* @license http://formvalidation.io/license/
|
8
|
+
*/
|
9
|
+
|
10
|
+
/**
|
11
|
+
* This class supports validating Foundation v5 form
|
12
|
+
* The latest supported version is Foundation v5.3.3
|
13
|
+
* @see http://foundation.zurb.com/sites/docs/v/5.5.3/
|
14
|
+
*/
|
15
|
+
/* global Foundation: false */
|
16
|
+
(function($) {
|
17
|
+
FormValidation.Framework.Foundation5 = function(element, options) {
|
18
|
+
options = $.extend(true, {
|
19
|
+
button: {
|
20
|
+
selector: '[type="submit"]:not([formnovalidate])',
|
21
|
+
// The class for disabled button
|
22
|
+
// http://foundation.zurb.com/sites/docs/v/5.5.3/components/buttons.html
|
23
|
+
disabled: 'disabled'
|
24
|
+
},
|
25
|
+
err: {
|
26
|
+
// http://foundation.zurb.com/sites/docs/v/5.5.3/components/forms.html
|
27
|
+
clazz: 'error',
|
28
|
+
parent: '^.*((small|medium|large)-[0-9]+)\\s.*(columns).*$'
|
29
|
+
},
|
30
|
+
// Foundation doesn't support feedback icon
|
31
|
+
icon: {
|
32
|
+
valid: null,
|
33
|
+
invalid: null,
|
34
|
+
validating: null,
|
35
|
+
feedback: 'fv-control-feedback'
|
36
|
+
},
|
37
|
+
row: {
|
38
|
+
// http://foundation.zurb.com/sites/docs/v/5.5.3/components/forms.html
|
39
|
+
selector: '.row',
|
40
|
+
valid: 'fv-has-success',
|
41
|
+
invalid: 'error',
|
42
|
+
feedback: 'fv-has-feedback'
|
43
|
+
}
|
44
|
+
}, options);
|
45
|
+
|
46
|
+
FormValidation.Base.apply(this, [element, options]);
|
47
|
+
};
|
48
|
+
|
49
|
+
FormValidation.Framework.Foundation5.prototype = $.extend({}, FormValidation.Base.prototype, {
|
50
|
+
/**
|
51
|
+
* Specific framework might need to adjust the icon position
|
52
|
+
*
|
53
|
+
* @param {jQuery} $field The field element
|
54
|
+
* @param {jQuery} $icon The icon element
|
55
|
+
*/
|
56
|
+
_fixIcon: function($field, $icon) {
|
57
|
+
var ns = this._namespace,
|
58
|
+
type = $field.attr('type'),
|
59
|
+
field = $field.attr('data-' + ns + '-field'),
|
60
|
+
row = this.options.fields[field].row || this.options.row.selector,
|
61
|
+
$parent = $field.closest(row);
|
62
|
+
|
63
|
+
if ('checkbox' === type || 'radio' === type) {
|
64
|
+
var $next = $icon.next();
|
65
|
+
if ($next.is('label')) {
|
66
|
+
$icon.insertAfter($next);
|
67
|
+
}
|
68
|
+
}
|
69
|
+
},
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Create a tooltip or popover
|
73
|
+
* It will be shown when focusing on the field
|
74
|
+
*
|
75
|
+
* @param {jQuery} $field The field element
|
76
|
+
* @param {String} message The message
|
77
|
+
* @param {String} type Can be 'tooltip' or 'popover'
|
78
|
+
*/
|
79
|
+
_createTooltip: function($field, message, type) {
|
80
|
+
var that = this,
|
81
|
+
$icon = $field.data('fv.icon');
|
82
|
+
if ($icon) {
|
83
|
+
$icon
|
84
|
+
.attr('title', message)
|
85
|
+
.css({
|
86
|
+
'cursor': 'pointer'
|
87
|
+
})
|
88
|
+
.off('mouseenter.container.fv focusin.container.fv')
|
89
|
+
.on('mouseenter.container.fv', function() {
|
90
|
+
that._showTooltip($field, type);
|
91
|
+
})
|
92
|
+
.off('mouseleave.container.fv focusout.container.fv')
|
93
|
+
.on('mouseleave.container.fv focusout.container.fv', function() {
|
94
|
+
that._hideTooltip($field, type);
|
95
|
+
});
|
96
|
+
Foundation.libs.tooltip.create($icon);
|
97
|
+
$icon.data('fv.foundation.tooltip', $icon);
|
98
|
+
}
|
99
|
+
},
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Destroy the tooltip or popover
|
103
|
+
*
|
104
|
+
* @param {jQuery} $field The field element
|
105
|
+
* @param {String} type Can be 'tooltip' or 'popover'
|
106
|
+
*/
|
107
|
+
_destroyTooltip: function($field, type) {
|
108
|
+
var $icon = $field.data('fv.icon');
|
109
|
+
if ($icon) {
|
110
|
+
$icon.css({
|
111
|
+
'cursor': ''
|
112
|
+
});
|
113
|
+
var $tooltip = $icon.data('fv.foundation.tooltip');
|
114
|
+
if ($tooltip) {
|
115
|
+
// Foundation doesn't provide method to destroy particular tooltip instance
|
116
|
+
$tooltip.off('.fndtn.tooltip');
|
117
|
+
Foundation.libs.tooltip.hide($tooltip);
|
118
|
+
$icon.removeData('fv.foundation.tooltip');
|
119
|
+
}
|
120
|
+
}
|
121
|
+
},
|
122
|
+
|
123
|
+
/**
|
124
|
+
* Hide a tooltip or popover
|
125
|
+
*
|
126
|
+
* @param {jQuery} $field The field element
|
127
|
+
* @param {String} type Can be 'tooltip' or 'popover'
|
128
|
+
*/
|
129
|
+
_hideTooltip: function($field, type) {
|
130
|
+
var $icon = $field.data('fv.icon');
|
131
|
+
if ($icon) {
|
132
|
+
$icon.css({
|
133
|
+
'cursor': ''
|
134
|
+
});
|
135
|
+
var $tooltip = $icon.data('fv.foundation.tooltip');
|
136
|
+
if ($tooltip) {
|
137
|
+
Foundation.libs.tooltip.hide($tooltip);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
},
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Show a tooltip or popover
|
144
|
+
*
|
145
|
+
* @param {jQuery} $field The field element
|
146
|
+
* @param {String} type Can be 'tooltip' or 'popover'
|
147
|
+
*/
|
148
|
+
_showTooltip: function($field, type) {
|
149
|
+
var $icon = $field.data('fv.icon');
|
150
|
+
if ($icon) {
|
151
|
+
var $tooltip = $icon.data('fv.foundation.tooltip');
|
152
|
+
if ($tooltip) {
|
153
|
+
$icon.css({
|
154
|
+
'cursor': 'pointer'
|
155
|
+
});
|
156
|
+
Foundation.libs.tooltip.show($tooltip);
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
160
|
+
});
|
161
|
+
}(jQuery));
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/*!
|
2
|
+
* FormValidation (http://formvalidation.io)
|
3
|
+
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
|
+
*
|
5
|
+
* @version v0.8.1, built on 2016-07-29 1:10:56 AM
|
6
|
+
* @author https://twitter.com/formvalidation
|
7
|
+
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
8
|
+
* @license http://formvalidation.io/license/
|
9
|
+
*/
|
10
|
+
!function(a){FormValidation.Framework.Foundation5=function(b,c){c=a.extend(!0,{button:{selector:'[type="submit"]:not([formnovalidate])',disabled:"disabled"},err:{clazz:"error",parent:"^.*((small|medium|large)-[0-9]+)\\s.*(columns).*$"},icon:{valid:null,invalid:null,validating:null,feedback:"fv-control-feedback"},row:{selector:".row",valid:"fv-has-success",invalid:"error",feedback:"fv-has-feedback"}},c),FormValidation.Base.apply(this,[b,c])},FormValidation.Framework.Foundation5.prototype=a.extend({},FormValidation.Base.prototype,{_fixIcon:function(a,b){var c=this._namespace,d=a.attr("type"),e=a.attr("data-"+c+"-field"),f=this.options.fields[e].row||this.options.row.selector;a.closest(f);if("checkbox"===d||"radio"===d){var g=b.next();g.is("label")&&b.insertAfter(g)}},_createTooltip:function(a,b,c){var d=this,e=a.data("fv.icon");e&&(e.attr("title",b).css({cursor:"pointer"}).off("mouseenter.container.fv focusin.container.fv").on("mouseenter.container.fv",function(){d._showTooltip(a,c)}).off("mouseleave.container.fv focusout.container.fv").on("mouseleave.container.fv focusout.container.fv",function(){d._hideTooltip(a,c)}),Foundation.libs.tooltip.create(e),e.data("fv.foundation.tooltip",e))},_destroyTooltip:function(a,b){var c=a.data("fv.icon");if(c){c.css({cursor:""});var d=c.data("fv.foundation.tooltip");d&&(d.off(".fndtn.tooltip"),Foundation.libs.tooltip.hide(d),c.removeData("fv.foundation.tooltip"))}},_hideTooltip:function(a,b){var c=a.data("fv.icon");if(c){c.css({cursor:""});var d=c.data("fv.foundation.tooltip");d&&Foundation.libs.tooltip.hide(d)}},_showTooltip:function(a,b){var c=a.data("fv.icon");if(c){var d=c.data("fv.foundation.tooltip");d&&(c.css({cursor:"pointer"}),Foundation.libs.tooltip.show(d))}}})}(jQuery);
|
@@ -1,12 +1,12 @@
|
|
1
|
-
|
1
|
+
/**
|
2
2
|
* FormValidation (http://formvalidation.io)
|
3
3
|
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
4
|
*
|
5
|
-
* @version v0.7.1, built on 2016-02-01 12:00:57 AM
|
6
5
|
* @author https://twitter.com/formvalidation
|
7
6
|
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
8
7
|
* @license http://formvalidation.io/license/
|
9
8
|
*/
|
9
|
+
|
10
10
|
/**
|
11
11
|
* This class supports validating Pure framework (http://purecss.io/)
|
12
12
|
*/
|
@@ -53,11 +53,12 @@
|
|
53
53
|
var ns = this._namespace,
|
54
54
|
type = $field.attr('type'),
|
55
55
|
field = $field.attr('data-' + ns + '-field'),
|
56
|
-
|
57
|
-
$parent = $field.closest(row);
|
56
|
+
$parent = $field.parent();
|
58
57
|
|
59
|
-
if (
|
60
|
-
$
|
58
|
+
if ('checkbox' === type || 'radio' === type) {
|
59
|
+
if ($parent.is('label')) {
|
60
|
+
$icon.insertAfter($parent);
|
61
|
+
}
|
61
62
|
}
|
62
63
|
}
|
63
64
|
});
|
@@ -2,9 +2,9 @@
|
|
2
2
|
* FormValidation (http://formvalidation.io)
|
3
3
|
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
4
|
*
|
5
|
-
* @version v0.
|
5
|
+
* @version v0.8.1, built on 2016-07-29 1:10:56 AM
|
6
6
|
* @author https://twitter.com/formvalidation
|
7
7
|
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
8
8
|
* @license http://formvalidation.io/license/
|
9
9
|
*/
|
10
|
-
!function(a){FormValidation.Framework.Pure=function(b,c){c=a.extend(!0,{button:{selector:'[type="submit"]:not([formnovalidate])',disabled:"pure-button-disabled"},err:{clazz:"fv-help-block",parent:"^.*pure-control-group.*$"},icon:{valid:null,invalid:null,validating:null,feedback:"fv-control-feedback"},row:{selector:".pure-control-group",valid:"fv-has-success",invalid:"fv-has-error",feedback:"fv-has-feedback"}},c),FormValidation.Base.apply(this,[b,c])},FormValidation.Framework.Pure.prototype=a.extend({},FormValidation.Base.prototype,{_fixIcon:function(a,b){var c=this._namespace,d=
|
10
|
+
!function(a){FormValidation.Framework.Pure=function(b,c){c=a.extend(!0,{button:{selector:'[type="submit"]:not([formnovalidate])',disabled:"pure-button-disabled"},err:{clazz:"fv-help-block",parent:"^.*pure-control-group.*$"},icon:{valid:null,invalid:null,validating:null,feedback:"fv-control-feedback"},row:{selector:".pure-control-group",valid:"fv-has-success",invalid:"fv-has-error",feedback:"fv-has-feedback"}},c),FormValidation.Base.apply(this,[b,c])},FormValidation.Framework.Pure.prototype=a.extend({},FormValidation.Base.prototype,{_fixIcon:function(a,b){var c=this._namespace,d=a.attr("type"),e=(a.attr("data-"+c+"-field"),a.parent());("checkbox"===d||"radio"===d)&&e.is("label")&&b.insertAfter(e)}})}(jQuery);
|
@@ -1,12 +1,12 @@
|
|
1
|
-
|
1
|
+
/**
|
2
2
|
* FormValidation (http://formvalidation.io)
|
3
3
|
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
4
|
*
|
5
|
-
* @version v0.7.1, built on 2016-02-01 12:00:57 AM
|
6
5
|
* @author https://twitter.com/formvalidation
|
7
6
|
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
8
7
|
* @license http://formvalidation.io/license/
|
9
8
|
*/
|
9
|
+
|
10
10
|
/**
|
11
11
|
* This class supports validating SemanticUI form (http://semantic-ui.com/)
|
12
12
|
*/
|
@@ -25,7 +25,7 @@
|
|
25
25
|
},
|
26
26
|
err: {
|
27
27
|
// http://semantic-ui.com/elements/label.html#pointing
|
28
|
-
clazz: 'ui red pointing label
|
28
|
+
clazz: 'ui red pointing label',
|
29
29
|
parent: '^.*(field|column).*$'
|
30
30
|
},
|
31
31
|
// When using feedback icon, the input must place inside 'ui input icon' element
|
@@ -42,7 +42,7 @@
|
|
42
42
|
},
|
43
43
|
row: {
|
44
44
|
// http://semantic-ui.com/collections/form.html
|
45
|
-
selector: '.
|
45
|
+
selector: '.fields',
|
46
46
|
valid: 'fv-has-success',
|
47
47
|
invalid: 'error',
|
48
48
|
feedback: 'fv-has-feedback'
|
@@ -2,9 +2,9 @@
|
|
2
2
|
* FormValidation (http://formvalidation.io)
|
3
3
|
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
4
|
*
|
5
|
-
* @version v0.
|
5
|
+
* @version v0.8.1, built on 2016-07-29 1:10:56 AM
|
6
6
|
* @author https://twitter.com/formvalidation
|
7
7
|
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
8
8
|
* @license http://formvalidation.io/license/
|
9
9
|
*/
|
10
|
-
!function(a){FormValidation.Framework.Semantic=function(b,c){c=a.extend(!0,{button:{selector:'[type="submit"]:not([formnovalidate])',disabled:"disabled"},control:{valid:"",invalid:""},err:{clazz:"ui red pointing label
|
10
|
+
!function(a){FormValidation.Framework.Semantic=function(b,c){c=a.extend(!0,{button:{selector:'[type="submit"]:not([formnovalidate])',disabled:"disabled"},control:{valid:"",invalid:""},err:{clazz:"ui red pointing label",parent:"^.*(field|column).*$"},icon:{valid:null,invalid:null,validating:null,feedback:"fv-control-feedback"},row:{selector:".fields",valid:"fv-has-success",invalid:"error",feedback:"fv-has-feedback"}},c),FormValidation.Base.apply(this,[b,c])},FormValidation.Framework.Semantic.prototype=a.extend({},FormValidation.Base.prototype,{_fixIcon:function(a,b){var c=a.attr("type");if("checkbox"===c||"radio"===c){var d=a.parent();d.hasClass(c)&&b.insertAfter(d)}},_createTooltip:function(a,b,c){var d=a.data("fv.icon");if(d)switch(d.popup("exists")&&d.popup("remove popup").popup("destroy"),c){case"popover":d.css({cursor:"pointer"}).popup({content:b,position:"top center"});break;case"tooltip":default:d.css({cursor:"pointer"}).popup({content:b,position:"top center",variation:"inverted"})}},_destroyTooltip:function(a,b){var c=a.data("fv.icon");c&&c.popup("exists")&&c.css({cursor:""}).popup("remove popup").popup("destroy")},_hideTooltip:function(a,b){var c=a.data("fv.icon");c&&c.popup("hide")},_showTooltip:function(a,b){var c=a.data("fv.icon");c&&c.popup("show")}})}(jQuery);
|
@@ -1,12 +1,12 @@
|
|
1
|
-
|
1
|
+
/**
|
2
2
|
* FormValidation (http://formvalidation.io)
|
3
3
|
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
|
4
4
|
*
|
5
|
-
* @version v0.7.1, built on 2016-02-01 12:00:57 AM
|
6
5
|
* @author https://twitter.com/formvalidation
|
7
6
|
* @copyright (c) 2013 - 2016 Nguyen Huu Phuoc
|
8
7
|
* @license http://formvalidation.io/license/
|
9
8
|
*/
|
9
|
+
|
10
10
|
/**
|
11
11
|
* This class supports validating UIKit form (http://getuikit.com/)
|
12
12
|
*/
|
@@ -58,8 +58,6 @@
|
|
58
58
|
var ns = this._namespace,
|
59
59
|
type = $field.attr('type'),
|
60
60
|
field = $field.attr('data-' + ns + '-field'),
|
61
|
-
row = this.options.fields[field].row || this.options.row.selector,
|
62
|
-
$row = $field.closest(row),
|
63
61
|
$parent = $field.parent();
|
64
62
|
|
65
63
|
if ('checkbox' === type || 'radio' === type) {
|
@@ -68,10 +66,6 @@
|
|
68
66
|
}
|
69
67
|
}
|
70
68
|
|
71
|
-
if ($row.find('label').length === 0) {
|
72
|
-
$icon.addClass('fv-icon-no-label');
|
73
|
-
}
|
74
|
-
|
75
69
|
// Support UIKit form-password component
|
76
70
|
// http://getuikit.com/docs/form-password.html
|
77
71
|
if ($parent.hasClass('uk-form-password')) {
|