parsley-rails 1.1.15.0 → 1.1.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Parsley
2
2
  module Rails
3
- VERSION = "1.1.15.0"
3
+ VERSION = "1.1.16.0"
4
4
  end
5
5
  end
@@ -78,6 +78,24 @@ window.ParsleyConfig = window.ParsleyConfig || {};
78
78
  }
79
79
  return sum % 10 === 0;
80
80
  }
81
+
82
+ , americandate: function ( val, elem, self) {
83
+ if(!/^([01]?[1-9])[\.\/-]([0-3]?[0-9])[\.\/-]([0-9]{4}|[0-9]{2})$/.test(val)) {
84
+ return false;
85
+ }
86
+ var parts = val.split(/[.\/-]+/);
87
+ var day = parseInt(parts[1], 10);
88
+ var month = parseInt(parts[0], 10);
89
+ var year = parseInt(parts[2], 10);
90
+ if(year == 0 || month == 0 || month > 12) {
91
+ return false;
92
+ }
93
+ var monthLength = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
94
+ if(year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)) {
95
+ monthLength[1] = 29;
96
+ }
97
+ return day > 0 && day <= monthLength[month - 1];
98
+ }
81
99
  }
82
100
  , messages: {
83
101
  minwords: "This value should have %s words at least."
@@ -88,6 +106,7 @@ window.ParsleyConfig = window.ParsleyConfig || {};
88
106
  , beforedate: "This date should be before %s."
89
107
  , afterdate: "This date should be after %s."
90
108
  , luhn: "This value should pass the luhn test."
109
+ , americandate: "This value should be a valid date (MM/DD/YYYY)."
91
110
  }
92
111
  });
93
112
  }(window.jQuery || window.Zepto));
@@ -23,8 +23,8 @@ window.ParsleyConfig = window.ParsleyConfig || {};
23
23
  , notblank: "This value should not be blank."
24
24
  , required: "This value is required."
25
25
  , regexp: "This value seems to be invalid."
26
- , min: "This value should be greater than %s."
27
- , max: "This value should be lower than %s."
26
+ , min: "This value should be greater than or equal to %s."
27
+ , max: "This value should be lower than or equal to %s."
28
28
  , range: "This value should be between %s and %s."
29
29
  , minlength: "This value is too short. It should have %s characters or more."
30
30
  , maxlength: "This value is too long. It should have %s characters or less."
@@ -42,6 +42,7 @@ window.ParsleyConfig = window.ParsleyConfig || {};
42
42
  , lessthan: "This value should be less than %s."
43
43
  , beforedate: "This date should be before %s."
44
44
  , afterdate: "This date should be after %s."
45
+ , americandate: "This value should be a valid date (MM/DD/YYYY)."
45
46
  }
46
47
  });
47
48
  }(window.jQuery || window.Zepto));
@@ -0,0 +1,48 @@
1
+ /**
2
+ * /!\ This file is in Croatian /!\
3
+ */
4
+
5
+ window.ParsleyConfig = window.ParsleyConfig || {};
6
+
7
+ (function ($) {
8
+ window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, {
9
+ messages: {
10
+ // parsley //////////////////////////////////////
11
+ defaultMessage: "Pogrešan unos"
12
+ , type: {
13
+ email: "Potrebno je unijeti ispravnu e-mail adresu"
14
+ , url: "Potrebno je unijeti ispravan link"
15
+ , urlstrict: "Potrebno je unijeti ispravan link."
16
+ , number: "Potrebno je unijeti ispravan broj"
17
+ , digits: "U ovom polju je isključivo dopušteno unošenje brojeva."
18
+ , dateIso: "Potrebno je unijeti ispravan datum (GGGG-MM-DD)."
19
+ , alphanum: "U ovom polju je isključivo dopušteno unošenje brojeva i slova."
20
+ , phone: "Unesite ispravan broj telefona"
21
+ }
22
+ , notnull: "Potrebno je unijeti ispravan podatak."
23
+ , notblank: "Potrebno je unijeti ispravan podatak."
24
+ , required: "Ovo je obavezno polje."
25
+ , regexp: "Čini se da ste unijeli krivi izraz"
26
+ , min: "Ova vrijednost mora biti veća ili jednaka %s."
27
+ , max: "Ova vrijednost mora biti manja ili jednaka %s."
28
+ , range: "Ova vrijednost mora biti između %s i %s."
29
+ , minlength: "Uneseni podatak je prekratak. Potrebno je %s ili više znakova."
30
+ , maxlength: "Uneseni podatak je predug. Potrebno je %s ili manje znakova."
31
+ , rangelength: "Raspon nije u dopuštenim granicama. Potrebno je da bude između %s i %s znakova."
32
+ , mincheck: "Potrebno je odabrati %s opcije."
33
+ , maxcheck: "Potrebno je odabrati %s ili manje opcija."
34
+ , rangecheck: "Potrebno je odabrati između %s i %s opcija."
35
+ , equalto: "Unesena vrijednost mora odgovarati prethodnoj."
36
+
37
+ // parsley.extend ///////////////////////////////
38
+ , minwords: "Unos mora sadržavati minimalno %s riječi."
39
+ , maxwords: "Unos mora sadržavati maksimalno %s riječi."
40
+ , rangewords: "Unos mora sadržavati %s do %s riječi."
41
+ , greaterthan: "Unos mora biti veći od %s."
42
+ , lessthan: "Unos mora biti manji od %s."
43
+ , beforedate: "Odabrani datum bi trebao biti prije %s."
44
+ , afterdate: "Odabrani datum bi trebao biti poslije %s."
45
+ , americandate: "Uneseni datum mora biti u zadanom obliku (MM/DD/GGGG)."
46
+ }
47
+ });
48
+ }(window.jQuery || window.Zepto));
@@ -0,0 +1,43 @@
1
+ window.ParsleyConfig = window.ParsleyConfig || {};
2
+
3
+ (function ($) {
4
+ window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, {
5
+ messages: {
6
+ // parsley //////////////////////////////////////
7
+ defaultMessage: "正しい値を入力してください。"
8
+ , type: {
9
+ email: "正しいメールアドレスを入力してください。"
10
+ , url: "正しい URL を入力してください。"
11
+ , urlstrict: "完全な URL を入力してください。"
12
+ , number: "正しい数値を入力してください。"
13
+ , digits: "整数を入力してください。"
14
+ , dateIso: "正しい形式 (YYYY-MM-DD) の日付を入力してください。"
15
+ , alphanum: "半角英数字で入力してください。"
16
+ , phone: "正しい電話番号を入力してください。"
17
+ }
18
+ , notnull: "値を入力してください。"
19
+ , notblank: "空白以外の値を入力してください。"
20
+ , required: "このフィールドを入力してください。"
21
+ , regexp: "正しい値を入力してください。"
22
+ , min: "%s 以上の数値を入力してください。"
23
+ , max: "%s 以下の数値を入力してください。"
24
+ , range: "%s 以上 %s 以下の数値を入力してください。"
25
+ , minlength: "値が短すぎます。%s 文字以上で入力してください。"
26
+ , maxlength: "値が長すぎます。%s 文字以下で入力してください。"
27
+ , rangelength: "値の長さが正しくありません。%s 文字以上 %s 文字以下で入力してください。"
28
+ , mincheck: "%s 個以上を選択してください。"
29
+ , maxcheck: "%s 個以下を選択してください。"
30
+ , rangecheck: "%s 個以上 %s 個以下を選択してください。"
31
+ , equalto: "同じ値を入力してください。"
32
+
33
+ // parsley.extend ///////////////////////////////
34
+ , minwords: "%s 語以上で入力してください。"
35
+ , maxwords: "%s 語以下で入力してください。"
36
+ , rangewords: "%s 語以上 %s 語以下で入力してください。"
37
+ , greaterthan: "%s より大きい数値を入力してください。"
38
+ , lessthan: "%s より小さい数値を入力してください。"
39
+ , beforedate: "%s より前の日付を入力してください。"
40
+ , afterdate: "%s より後の日付を入力してください。"
41
+ }
42
+ });
43
+ }(window.jQuery || window.Zepto));
@@ -0,0 +1,43 @@
1
+ window.ParsleyConfig = window.ParsleyConfig || {};
2
+
3
+ (function ($) {
4
+ window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, {
5
+ messages: {
6
+ // parsley //////////////////////////////////////
7
+ defaultMessage: "Алдаатай утга оруулсан байна."
8
+ , type: {
9
+ email: "Зөв и-мэйл хаяг оруулна уу."
10
+ , url: "Зөв холбоос оруулна уу."
11
+ , urlstrict: "Зөв холбоос оруулна уу."
12
+ , number: "Тоо оруулна уу."
13
+ , digits: "Зөвхөн тоо оруулна уу."
14
+ , dateIso: "Зөв огноо оруулна уу (ОООО-СС-ӨӨ)."
15
+ , alphanum: "Тоо болон үсэг оруулна уу."
16
+ , phone: "Зөв утасны дугаар оруулна уу."
17
+ }
18
+ , notnull: "Энэ талбарыг хоосон орхих боломжгүй."
19
+ , notblank: "Энэ талбарыг хоосон орхих боломжгүй."
20
+ , required: "Энэ талбарыг бөглөнө үү."
21
+ , regexp: "Алдаатай утга оруулсан байна."
22
+ , min: "%s - с их утга оруулна уу."
23
+ , max: "%s - с бага утга оруулна уу."
24
+ , range: "%s - %s хооронд утга оруулна уу."
25
+ , minlength: "Хэт богино утга оруулсан байна. %s эсвэл түүнээс их тэмдэгт оруулна уу."
26
+ , maxlength: "Хэт урт утга оруулсан байна. %s эсвэл түүнээс бага тэмдэгт оруулна уу."
27
+ , rangelength: "Алдаатай утга оруулсан байна. %s - %s хооронд тэмдэгт оруулна."
28
+ , mincheck: "Хамгийн багадаа %s - г сонгоно уу."
29
+ , maxcheck: "Та хамгийн ихдээ %s - г сонгох боломжтой."
30
+ , rangecheck: "Та %s - %s хооронд сонголт хийх боломжтой."
31
+ , equalto: "Ижил утга оруулна уу."
32
+
33
+ // parsley.extend ///////////////////////////////
34
+ , minwords: "Хамгийн багадаа %s үг оруулна уу."
35
+ , maxwords: "Хамгийн ихдээ %s үг оруулна уу."
36
+ , rangewords: "%s - %s хооронд үг оруулна уу."
37
+ , greaterthan: "%s - с их утга оруулна уу."
38
+ , lessthan: "%s - с бага утга оруулна уу."
39
+ , beforedate: "%s - с өмнөх огноо оруулна уу."
40
+ , afterdate: "%s - с дараах огноо оруулна уу."
41
+ }
42
+ });
43
+ }(window.jQuery || window.Zepto));
@@ -1,40 +1,40 @@
1
- window.ParsleyConfig = window.ParsleyConfig || {};
2
-
3
- (function ($) {
4
- window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, {
5
- messages: {
6
- // parsley ////////PL/by/Tymek///////////////////
7
- defaultMessage: "Wartość wygląda na nieprawidłową"
8
- , type: {
9
- email: "Wpisz poprawny adres e-mail"
10
- , url: "Wpisz poprawny adres URL"
11
- , urlstrict: "Wpisz poprawny adres URL"
12
- , number: "Wpisz poprawną liczbę"
13
- , digits: "Dozwolone jedynie cyfry"
14
- , dateIso: "Wpisz poprawny format daty (RRRR-MM-DD)"
15
- , alphanum: "Dozwolone jedynie znaki alfanumeryczne"
16
- }
17
- , notnull: "Wartość musi być różna od zera"
18
- , notblank: "Pole nie może pozostać puste"
19
- , required: "Pole wymagane"
20
- , regexp: "Wartość wygląda na nieprawidłową"
21
- , min: "Wartość powinna być większa od %s"
22
- , max: "Wartość powinna być mniejsza od %s"
23
- , range: "Wartość powinna być większa od %s i mniejsza od %s"
24
- , minlength: "Ilość znaków powinna wynosić %s lub więcej"
25
- , maxlength: "Ilość znaków powinna wynosić %s lub mniej"
26
- , rangelength: "Ilość znaków powinna wynosić od %s do %s"
27
- , mincheck: "Wybierz %s lub więcej opcji"
28
- , maxcheck: "Wybierz %s lub mniej opcji"
29
- , rangecheck: "Wybierz od %s do %s opcji"
30
- , equalto: "Wartość musi być identyczna"
31
-
32
- // parsley.extend ///////////////////////////////
33
- , minwords: "Wpisz więcej niż %s wyrazów"
34
- , maxwords: "Wartość nie może przekraczać %s wyrazów"
35
- , rangewords: "Wartość musi zawierać od %s do %s wyrazów"
36
- , greaterthan: "Wartość musi być większa niż %s"
37
- , lessthan: "Wartość musi być mniejsza niż %s"
38
- }
39
- });
40
- }(window.jQuery || window.Zepto));
1
+ window.ParsleyConfig = window.ParsleyConfig || {};
2
+
3
+ (function ($) {
4
+ window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, {
5
+ messages: {
6
+ // parsley ////////PL/by/Tymek.Cz////////////////
7
+ defaultMessage: "Wartość nieprawidłowa"
8
+ , type: {
9
+ email: "Niepoprawny adres e-mail"
10
+ , url: "Niepoprawny adres URL"
11
+ , urlstrict: "Niepoprawny format adresu adres URL"
12
+ , number: "Wpisz poprawną liczbę"
13
+ , digits: "Dozwolone tylko cyfry"
14
+ , dateIso: "Niepoprawny format (użyj RRRR-MM-DD)"
15
+ , alphanum: "Dozwolone tylko znaki alfanumeryczne"
16
+ }
17
+ , notnull: "Wartość nie może być równa zero"
18
+ , notblank: "Pole nie może pozostać puste"
19
+ , required: "Pole wymagane"
20
+ , regexp: "Niepoprawna wartość"
21
+ , min: "Wpisz wartość większą od %s"
22
+ , max: "Wpisz wartość mniejszą od %s"
23
+ , range: "Wpisz wartość pomiędzy %s i %s"
24
+ , minlength: "Wpisz %s lub więcej znaków"
25
+ , maxlength: "Wpisz %s lub mniej znaków"
26
+ , rangelength: "Wpisz od %s do %s znaków"
27
+ , mincheck: "Wybierz %s lub więcej opcji"
28
+ , maxcheck: "Wybierz %s lub mniej opcji"
29
+ , rangecheck: "Wybierz od %s do %s opcji"
30
+ , equalto: "Wartość nie jest identyczna"
31
+
32
+ // parsley.extend /PL/by/Tymek.Cz////////////////
33
+ , minwords: "Wpisz więcej niż %s wyrazów"
34
+ , maxwords: "Wpisz co najwyżej %s wyrazów"
35
+ , rangewords: "Wpisz od %s do %s wyrazów"
36
+ , greaterthan: "Podaj wartość większą od %s"
37
+ , lessthan: "Podaj wartość mniejszą od %s"
38
+ }
39
+ });
40
+ }(window.jQuery || window.Zepto));
@@ -3,16 +3,18 @@ window.ParsleyConfig = window.ParsleyConfig || {};
3
3
  (function ($) {
4
4
  window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, {
5
5
  messages: {
6
+ // parsley //////////////////////////////////////
6
7
  defaultMessage: "Este valor parece estar inválido."
7
8
  , type: {
8
- email: "Este valor deve ser um e-mail válido."
9
- , url: "Este valor deve ser uma URL válida."
10
- , urlstrict: "Este valor deve ser uma URL válida."
11
- , number: "Este valor deve ser um número válido."
12
- , digits: "Este valor deve ser um dígito válido."
13
- , dateIso: "Este valor deve ser uma data válida (YYYY-MM-DD)."
14
- , alphanum: "Este valor deve ser alfanumérico."
15
- }
9
+ email: "Este valor deve ser um e-mail válido."
10
+ , url: "Este valor deve ser uma URL válida."
11
+ , urlstrict: "Este valor deve ser uma URL válida."
12
+ , number: "Este valor deve ser um número válido."
13
+ , digits: "Este valor deve ser um dígito válido."
14
+ , dateIso: "Este valor deve ser uma data válida (YYYY-MM-DD)."
15
+ , alphanum: "Este valor deve ser alfanumérico."
16
+ , phone: "Este valor deve ser um número telefone válido."
17
+ }
16
18
  , notnull: "Este valor não deve ser nulo."
17
19
  , notblank: "Este valor não deve ser branco."
18
20
  , required: "Este valor é obrigatório."
@@ -23,10 +25,18 @@ window.ParsleyConfig = window.ParsleyConfig || {};
23
25
  , minlength: "Este valor é muito pequeno. Ele deve ter %s caracteres ou mais."
24
26
  , maxlength: "Este valor é muito grande. Ele deve ter %s caracteres ou menos."
25
27
  , rangelength: "O tamanho deste valor é inválido. Ele deve possuir entre %s e %s caracteres."
28
+ , mincheck: "Você deve selecionar pelo menos %s opções."
29
+ , maxcheck: "Você deve selecionar %s opções ou menos."
30
+ , rangecheck: "Você deve selecionar entre %s e %s opções."
26
31
  , equalto: "Este valor deve ser o mesmo."
32
+ // parsley.extend ///////////////////////////////
27
33
  , minwords: "Este valor deve possuir no mínimo %s palavras."
28
34
  , maxwords: "Este valor deve possuir no máximo %s palavras."
29
35
  , rangewords: "Este valor deve possuir entre %s e %s palavras."
36
+ , greaterthan: "Este valor deve ser maior que %s."
37
+ , lessthan: "Este valor deve ser menor que %s."
38
+ , beforedate: "Esta data deve ser anterior a %s."
39
+ , afterdate: "Esta data deve ser posterior a %s."
30
40
  }
31
41
  });
32
42
  }(window.jQuery || window.Zepto));
@@ -0,0 +1,44 @@
1
+ window.ParsleyConfig = window.ParsleyConfig || {};
2
+
3
+ (function ($) {
4
+ window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, {
5
+ messages: {
6
+ // parsley //////////////////////////////////////
7
+ defaultMessage: "Această valoare nu pare validă."
8
+ , type: {
9
+ email: "Această valoare ar trebui să fie un email valid."
10
+ , url: "Această valoare ar trebui să fie un url valid."
11
+ , urlstrict: "Această valoare ar trebui să fie un url valid."
12
+ , number: "Această valoare ar trebui să fie un număr valid."
13
+ , digits: "Această valoare ar trebui să fie compusă doar din cifre."
14
+ , dateIso: "Această valoare ar trebui să fie o dată validă (YYYY-MM-DD)."
15
+ , alphanum: "Această valoare ar trebui să fie alfanumerică."
16
+ , phone: "Această valoare ar trebui să fie un număr de telefon valid."
17
+ }
18
+ , notnull: "Această valoare nu ar trebui să fie null."
19
+ , notblank: "Această valoare nu ar trebui să fie necompletată."
20
+ , required: "Această valoare este obligatorie."
21
+ , regexp: "Această valoare nu pare validă."
22
+ , min: "Această valoare ar trebui să fie mai mare sau egală cu %s."
23
+ , max: "Această valoare ar trebui să fie mai mică sau egală cu %s."
24
+ , range: "Această valoare trebuie să fie între %s şi %s."
25
+ , minlength: "Această valoare este prea scurtă. Ar trebui să aibă %s caractere sau mai mult."
26
+ , maxlength: "Această valoare este prea lungă. Ar trebui să aibă %s caractere sau mai puţin."
27
+ , rangelength: "Lungimea acestei valori nu este validă. Ar trebui să aibă între %s şi %s caractere."
28
+ , mincheck: "Trebuie să selectaţi cel puţin %s opţiuni."
29
+ , maxcheck: "Trebuie să selectaţi %s opţiuni sau mai puţin."
30
+ , rangecheck: "Trebuie să selectaţi între %s şi %s opţiuni."
31
+ , equalto: "Aceste valori ar trebui să fie identice."
32
+
33
+ // parsley.extend ///////////////////////////////
34
+ , minwords: "Această valoare ar trebui să aibă cel puţin %s cuvinte."
35
+ , maxwords: "Această valoare ar trebui să aibă cel mult %s cuvinte."
36
+ , rangewords: "Această valoare ar trebui să aibă între %s şi %s cuvinte."
37
+ , greaterthan: "Această valoare ar trebui să fie mai mare decât %s."
38
+ , lessthan: "Această valoare ar trebui să fie mai mică decât %s."
39
+ , beforedate: "Această valoare ar trebui să fie înainte de %s."
40
+ , afterdate: "Această valoare ar trebui să fie după %s."
41
+ , americandate: "Această valoare ar trebui să fie o dată validă (MM/DD/YYYY)."
42
+ }
43
+ });
44
+ }(window.jQuery || window.Zepto));
@@ -12,7 +12,7 @@ window.ParsleyConfig = window.ParsleyConfig || {};
12
12
  , number: "Поле должно быть числом."
13
13
  , digits: "Поле должно содержать только цифры."
14
14
  , dateIso: "Поле должно быть датой в формате (ГГГГ-ММ-ДД)."
15
- , alphanum: "Поле должно содержать только цифры и буквы"
15
+ , alphanum: "Поле должно содержать только цифры и буквы."
16
16
  }
17
17
  , notnull: "Поле должно быть не нулевым."
18
18
  , notblank: "Поле не должно быть пустым."
@@ -0,0 +1,48 @@
1
+ /**
2
+ * /!\ Created by Murat Akdeniz: www.webfikirleri.com /!\
3
+ */
4
+
5
+ window.ParsleyConfig = window.ParsleyConfig || {};
6
+
7
+ (function ($) {
8
+ window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, {
9
+ messages: {
10
+ // parsley //////////////////////////////////////
11
+ defaultMessage: "Bu değer geçersiz görünüyor."
12
+ , type: {
13
+ email: "Geçerli bir e-posta adresi girmelisiniz."
14
+ , url: "Geçerli bir URL girmelisiniz."
15
+ , urlstrict: "Geçerli bir URL girmelisiniz."
16
+ , number: "Bu bölüme geçerli bir numara girmelisiniz."
17
+ , digits: "Bu bölüm basamaklardan oluşmalıdır."
18
+ , dateIso: "Bu alan geçerli bir tarih olmalıdır (YYYY-MM-DD)."
19
+ , alphanum: "Bu alan alfa sayısal karakterlerden oluşmalıdır."
20
+ , phone: "Bu alan geçerli bir telefon numarası olmalıdır."
21
+ }
22
+ , notnull: "Bu alan boş olmamalıdır."
23
+ , notblank: "Bu alanı boş bırakamazsınız."
24
+ , required: "Bu alan gereklidir."
25
+ , regexp: "Değer geçersiz görünüyor ."
26
+ , min: "Bu alan %s değerine eşit ya da küçük olmalıdır."
27
+ , max: "Bu alan %s değerine eşit ya da büyük olmalıdır."
28
+ , range: "Bu alanın değeri %s ile %s arasında olmalıdır."
29
+ , minlength: "Bu alan çok kısa. %s karaktere eşit ya da fazla olmalıdır."
30
+ , maxlength: "Bu alan çok uzun. %s karaktere eşit ya da küçük olmalıdır."
31
+ , rangelength: "Bu alanın uzunluğu %s ile %s arasında olmalıdır."
32
+ , mincheck: "En az %s seçenek seçmelisiniz."
33
+ , maxcheck: "En fazla %s seçenek seçebilirsiniz."
34
+ , rangecheck: "En az %s en fazla %s seçenek seçebilirsiniz."
35
+ , equalto: "Bu değer eşit olmalıdır."
36
+
37
+ // parsley.extend ///////////////////////////////
38
+ , minwords: "Bu alan en az %s kelime içermelidir."
39
+ , maxwords: "Bu alan en fazla %s kelime içermelidir."
40
+ , rangewords: "Bu alan %s ile %s kelime arasında olmalıdır."
41
+ , greaterthan: "Bu bölüm %s karakterden büyük olmalıdır."
42
+ , lessthan: "Bu alan %s değerinden küçük olmalıdır."
43
+ , beforedate: "Bu alan %s tarihinden önce olmalıdır."
44
+ , afterdate: "Bu alan %s tarihinden sonra olmalıdır."
45
+ , americandate: "Bu alan geçerli bir tarih olmalıdır (MM/DD/YYYY)."
46
+ }
47
+ });
48
+ }(window.jQuery || window.Zepto));
@@ -0,0 +1,35 @@
1
+ window.ParsleyConfig = window.ParsleyConfig || {};
2
+
3
+ (function ($) {
4
+ window.ParsleyConfig = $.extend( true, {}, window.ParsleyConfig, {
5
+ messages: {
6
+ // parsley //////////////////////////////////////
7
+ defaultMessage: "Поле заповнене некорректно."
8
+ , type: {
9
+ email: "Поле повинно бути адресою електронної пошти."
10
+ , url: "Поле повинно бути посиланням на сайт."
11
+ , urlstrict: "Поле повинно бути посиланням на сайт."
12
+ , number: "Поле повинно бути числом."
13
+ , digits: "Поле повинно містити тільки цифри."
14
+ , dateIso: "Поле повинно бути датою у форматі (РРРР-ММ-ДД)."
15
+ , alphanum: "Поле повинно містити тільки цифри і літери."
16
+ }
17
+ , notnull: "Поле повинно бути не нульовим."
18
+ , notblank: "Поле не повинно бути порожнім."
19
+ , required: "Поле обов'язкове для заповнення."
20
+ , regexp: "Поле заповнено некорректно."
21
+ , min: "Значення поля повинно бути більше, ніж %s."
22
+ , max: "Значення поля повинно бути меньше, ніж %s."
23
+ , range: "Значення поля повинно бути між %s та %s."
24
+ , minlength: "Довжина поля повинна бути щонайменьше %s символів(а)."
25
+ , maxlength: "Довжина поля повинна бути щонайбільше %s символів(а)."
26
+ , rangelength: "Довжина поля повинна бути від %s і до %s символів(а)."
27
+ , mincheck: "Необхідно вибрати неменьше, ніж %s пункт(ів)."
28
+ , maxcheck: "Необхідно вибрати небільше, ніж %s пункт(ів)."
29
+ , rangecheck: "Необхідно вибрати від %s і до %s пунктів."
30
+ , equalto: "Значення полів повинно бути однаковим."
31
+
32
+ // parsley.extend ///////////////////////////////
33
+ }
34
+ });
35
+ }(window.jQuery || window.Zepto));
@@ -18,7 +18,7 @@
18
18
  var Validator = function ( options ) {
19
19
  /**
20
20
  * Error messages
21
- *
21
+ *
22
22
  * @property messages
23
23
  * @type {Object}
24
24
  */
@@ -38,8 +38,8 @@
38
38
  , notblank: "This value should not be blank."
39
39
  , required: "This value is required."
40
40
  , regexp: "This value seems to be invalid."
41
- , min: "This value should be greater than %s."
42
- , max: "This value should be lower than %s."
41
+ , min: "This value should be greater than or equal to %s."
42
+ , max: "This value should be lower than or equal to %s."
43
43
  , range: "This value should be between %s and %s."
44
44
  , minlength: "This value is too short. It should have %s characters or more."
45
45
  , maxlength: "This value is too long. It should have %s characters or less."
@@ -59,7 +59,7 @@
59
59
 
60
60
  /**
61
61
  * Validator list. Built-in validators functions
62
- *
62
+ *
63
63
  * @property validators
64
64
  * @type {Object}
65
65
  */
@@ -69,7 +69,7 @@
69
69
  }
70
70
 
71
71
  , notblank: function ( val ) {
72
- return null !== val && '' !== val.replace( /^\s+/g, '' ).replace( /\s+$/g, '' );
72
+ return 'string' === typeof val && '' !== val.replace( /^\s+/g, '' ).replace( /\s+$/g, '' );
73
73
  }
74
74
 
75
75
  // Works on all inputs. val is object for checkboxes
@@ -386,7 +386,7 @@
386
386
  */
387
387
  , bindHtml5Constraints: function () {
388
388
  // add html5 required support + class required support
389
- if ( this.$element.hasClass( 'required' ) || this.$element.attr( 'required' ) ) {
389
+ if ( this.$element.hasClass( 'required' ) || this.$element.prop( 'required' ) ) {
390
390
  this.options.required = true;
391
391
  }
392
392
 
@@ -601,7 +601,7 @@
601
601
  * @returns {String} val
602
602
  */
603
603
  , getVal: function () {
604
- return this.$element.val();
604
+ return this.$element.data('value') || this.$element.val();
605
605
  }
606
606
 
607
607
  /**
@@ -629,7 +629,7 @@
629
629
  return true;
630
630
  }
631
631
 
632
- this.validate( true );
632
+ this.validate();
633
633
  }
634
634
 
635
635
  /**
@@ -683,11 +683,9 @@
683
683
  return this.valid;
684
684
  }
685
685
 
686
- this.errorBubbling = 'undefined' !== typeof errorBubbling ? errorBubbling : true;
687
-
688
686
  valid = this.applyValidators();
689
687
 
690
- if ( this.errorBubbling ) {
688
+ if ( 'undefined' !== typeof errorBubbling ? errorBubbling : this.options.showErrors ) {
691
689
  this.manageValidationResult();
692
690
  }
693
691
 
@@ -726,9 +724,11 @@
726
724
  if ( false === result ) {
727
725
  valid = false;
728
726
  this.constraints[ constraint ].valid = valid;
727
+ this.options.listeners.onFieldError( this.element, this.constraints, this );
729
728
  } else if ( true === result ) {
730
729
  this.constraints[ constraint ].valid = true;
731
730
  valid = false !== valid;
731
+ this.options.listeners.onFieldSuccess( this.element, this.constraints, this );
732
732
  }
733
733
  }
734
734
 
@@ -738,7 +738,7 @@
738
738
  /**
739
739
  * Fired when all validators have be executed
740
740
  * Returns true or false if field is valid or not
741
- * Display errors messages below faild fields
741
+ * Display errors messages below failed fields
742
742
  * Adds parsley-success or parsley-error class on fields
743
743
  *
744
744
  * @method manageValidationResult
@@ -762,11 +762,9 @@
762
762
  if ( true === this.valid ) {
763
763
  this.removeErrors();
764
764
  this.errorClassHandler.removeClass( this.options.errorClass ).addClass( this.options.successClass );
765
- this.options.listeners.onFieldSuccess( this.element, this.constraints, this );
766
765
  return true;
767
766
  } else if ( false === this.valid ) {
768
767
  this.errorClassHandler.removeClass( this.options.successClass ).addClass( this.options.errorClass );
769
- this.options.listeners.onFieldError( this.element, this.constraints, this );
770
768
  return false;
771
769
  }
772
770
 
@@ -791,9 +789,15 @@
791
789
  * @param {String} constraintName Method Name
792
790
  */
793
791
  , removeError: function ( constraintName ) {
794
- var liError = this.ulError + ' .' + constraintName;
792
+ var liError = this.ulError + ' .' + constraintName
793
+ , that = this;
795
794
 
796
- this.options.animate ? $( liError ).fadeOut( this.options.animateDuration, function () { $( this ).remove() } ) : $( liError ).remove();
795
+ this.options.animate ? $( liError ).fadeOut( this.options.animateDuration, function () {
796
+ $( this ).remove();
797
+
798
+ if ( that.ulError && $( that.ulError ).children().length === 0 ) {
799
+ that.removeErrors();
800
+ } } ) : $( liError ).remove();
797
801
 
798
802
  // remove li error, and ul error if no more li inside
799
803
  if ( this.ulError && $( this.ulError ).children().length === 0 ) {
@@ -811,7 +815,7 @@
811
815
  for ( var constraint in error ) {
812
816
  var liTemplate = $( this.options.errors.errorElem ).addClass( constraint );
813
817
 
814
- $( this.ulError ).append( this.options.animate ? $( liTemplate ).text( error[ constraint ] ).hide().fadeIn( this.options.animateDuration ) : $( liTemplate ).text( error[ constraint ] ) );
818
+ $( this.ulError ).append( this.options.animate ? $( liTemplate ).html( error[ constraint ] ).hide().fadeIn( this.options.animateDuration ) : $( liTemplate ).html( error[ constraint ] ) );
815
819
  }
816
820
  }
817
821
 
@@ -884,7 +888,7 @@
884
888
  * @method manageErrorContainer
885
889
  */
886
890
  , manageErrorContainer: function () {
887
- var errorContainer = this.options.errorContainer || this.options.errors.container( this.element, this.isRadioOrCheckbox )
891
+ var errorContainer = this.options.errorContainer || this.options.errors.container( this.element, this.isRadioOrCheckbox )
888
892
  , ulTemplate = this.options.animate ? this.ulTemplate.show() : this.ulTemplate;
889
893
 
890
894
  if ( 'undefined' !== typeof errorContainer ) {
@@ -1196,7 +1200,7 @@
1196
1200
 
1197
1201
  this.$element.off( '.' + this.type ).removeData( this.type );
1198
1202
  }
1199
-
1203
+
1200
1204
  /**
1201
1205
  * reset Parsley binded on the form and its fields
1202
1206
  *
@@ -1272,7 +1276,7 @@
1272
1276
 
1273
1277
  /**
1274
1278
  * Parsley plugin configuration
1275
- *
1279
+ *
1276
1280
  * @property $.fn.parsley.defaults
1277
1281
  * @type {Object}
1278
1282
  */
@@ -1289,6 +1293,7 @@
1289
1293
  , errorClass: 'parsley-error' // Class name on each invalid input
1290
1294
  , errorMessage: false // Customize an unique error message showed if one constraint fails
1291
1295
  , validators: {} // Add your custom validators functions
1296
+ , showErrors: true // Set to false if you don't want Parsley to display error messages
1292
1297
  , messages: {} // Add your own error messages here
1293
1298
 
1294
1299
  //some quite advanced configuration here..
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parsley-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.15.0
4
+ version: 1.1.16.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-23 00:00:00.000000000 Z
12
+ date: 2013-05-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Parsley.js bundled for Rails Asset Pipeline
15
15
  email:
@@ -38,16 +38,22 @@ files:
38
38
  - vendor/assets/javascripts/parsley.i18n.fa.js
39
39
  - vendor/assets/javascripts/parsley.i18n.fi.js
40
40
  - vendor/assets/javascripts/parsley.i18n.fr.js
41
+ - vendor/assets/javascripts/parsley.i18n.hr.js
41
42
  - vendor/assets/javascripts/parsley.i18n.id.js
42
43
  - vendor/assets/javascripts/parsley.i18n.is.js
43
44
  - vendor/assets/javascripts/parsley.i18n.it.js
45
+ - vendor/assets/javascripts/parsley.i18n.ja.js
44
46
  - vendor/assets/javascripts/parsley.i18n.lt.js
47
+ - vendor/assets/javascripts/parsley.i18n.mn.js
45
48
  - vendor/assets/javascripts/parsley.i18n.nl.js
46
49
  - vendor/assets/javascripts/parsley.i18n.no.js
47
50
  - vendor/assets/javascripts/parsley.i18n.pl.js
48
51
  - vendor/assets/javascripts/parsley.i18n.pt_br.js
52
+ - vendor/assets/javascripts/parsley.i18n.ro.js
49
53
  - vendor/assets/javascripts/parsley.i18n.ru.js
50
54
  - vendor/assets/javascripts/parsley.i18n.sv.js
55
+ - vendor/assets/javascripts/parsley.i18n.tr.js
56
+ - vendor/assets/javascripts/parsley.i18n.ua.js
51
57
  - vendor/assets/javascripts/parsley.i18n.vn.js
52
58
  - vendor/assets/javascripts/parsley.i18n.zh_cn.js
53
59
  - vendor/assets/javascripts/parsley.js