PageRenderTime 55ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/files/validation.engine/2.2.4/languages/jquery.validationEngine-hr.js

https://gitlab.com/Mirros/jsdelivr
JavaScript | 167 lines | 150 code | 1 blank | 16 comment | 0 complexity | c39c0123f86941066933d3c62b650497 MD5 | raw file
  1. (function($){
  2. $.fn.validationEngineLanguage = function(){
  3. };
  4. $.validationEngineLanguage = {
  5. newLang: function(){
  6. $.validationEngineLanguage.allRules = {
  7. "required": { // Add your regex rules here, you can take telephone as an example
  8. "regex": "none",
  9. "alertText": "* Ovo polje je obavezno",
  10. "alertTextCheckboxMultiple": "* Molimo odaberite opciju",
  11. "alertTextCheckboxe": "* Ovaj odabir je obavezan",
  12. "alertTextDateRange": "* Oba datuma su obavezna"
  13. },
  14. "dateRange": {
  15. "regex": "none",
  16. "alertText": "* Greška ",
  17. "alertText2": "Raspon datuma"
  18. },
  19. "dateTimeRange": {
  20. "regex": "none",
  21. "alertText": "* Greška ",
  22. "alertText2": "Raspon vremena i datuma"
  23. },
  24. "minSize": {
  25. "regex": "none",
  26. "alertText": "* Minimalno ",
  27. "alertText2": " dozvoljenih znakova"
  28. },
  29. "maxSize": {
  30. "regex": "none",
  31. "alertText": "* Maksimalno ",
  32. "alertText2": " dozvoljenih znakova"
  33. },
  34. "groupRequired": {
  35. "regex": "none",
  36. "alertText": "* Morate popuniti jedno od obaveznih polja"
  37. },
  38. "min": {
  39. "regex": "none",
  40. "alertText": "* Minimalna vrijednost je "
  41. },
  42. "max": {
  43. "regex": "none",
  44. "alertText": "* Maksimalna vrijednost je "
  45. },
  46. "past": {
  47. "regex": "none",
  48. "alertText": "* Datum raniji od "
  49. },
  50. "future": {
  51. "regex": "none",
  52. "alertText": "* Datum nakon "
  53. },
  54. "maxCheckbox": {
  55. "regex": "none",
  56. "alertText": "* Maksimalno ",
  57. "alertText2": " dozvoljenih opcija"
  58. },
  59. "minCheckbox": {
  60. "regex": "none",
  61. "alertText": "* Molimo odaberite ",
  62. "alertText2": " opcija"
  63. },
  64. "equals": {
  65. "regex": "none",
  66. "alertText": "* Polja se ne podudaraju"
  67. },
  68. "phone": {
  69. // credit: jquery.h5validate.js / orefalo
  70. "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
  71. "alertText": "* Pogrešan unos telefonskog broja"
  72. },
  73. "email": {
  74. // Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
  75. "regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
  76. "alertText": "* Neispravna email adresa"
  77. },
  78. "integer": {
  79. "regex": /^[\-\+]?\d+$/,
  80. "alertText": "* Neispravno unesen broj"
  81. },
  82. "number": {
  83. // Number, including positive, negative, and floating decimal. credit: orefalo
  84. "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,
  85. "alertText": "* Neispravan broj sa pomičnim zarezom"
  86. },
  87. "date": {
  88. "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
  89. "alertText": "* Neispravan unos datuma, ispravan format je GGGG-MM-DD"
  90. },
  91. "ipv4": {
  92. "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
  93. "alertText": "* neispravna IP adresa"
  94. },
  95. "url": {
  96. "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,
  97. "alertText": "* Neispravan URL"
  98. },
  99. "onlyNumberSp": {
  100. "regex": /^[0-9\ ]+$/,
  101. "alertText": "* Dozvoljeni su samo brojevi"
  102. },
  103. "onlyLetterSp": {
  104. "regex": /^[a-zA-Z\ \']+$/,
  105. "alertText": "* Dozvoljena su samo slova"
  106. },
  107. "onlyLetterNumber": {
  108. "regex": /^[0-9a-zA-Z]+$/,
  109. "alertText": "* Nisu dozvoljeni specijalni znakovi"
  110. },
  111. // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
  112. "ajaxUserCall": {
  113. "url": "ajaxValidateFieldUser",
  114. // you may want to pass extra data on the ajax call
  115. "extraData": "name=eric",
  116. "alertText": "* This user is already taken",
  117. "alertTextLoad": "* Validating, please wait"
  118. },
  119. "ajaxUserCallPhp": {
  120. "url": "phpajax/ajaxValidateFieldUser.php",
  121. // you may want to pass extra data on the ajax call
  122. "extraData": "name=eric",
  123. // if you provide an "alertTextOk", it will show as a green prompt when the field validates
  124. "alertTextOk": "* This username is available",
  125. "alertText": "* This user is already taken",
  126. "alertTextLoad": "* Validating, please wait"
  127. },
  128. "ajaxNameCall": {
  129. // remote json service location
  130. "url": "ajaxValidateFieldName",
  131. // error
  132. "alertText": "* This name is already taken",
  133. // if you provide an "alertTextOk", it will show as a green prompt when the field validates
  134. "alertTextOk": "* This name is available",
  135. // speaks by itself
  136. "alertTextLoad": "* Validating, please wait"
  137. },
  138. "ajaxNameCallPhp": {
  139. // remote json service location
  140. "url": "phpajax/ajaxValidateFieldName.php",
  141. // error
  142. "alertText": "* This name is already taken",
  143. // speaks by itself
  144. "alertTextLoad": "* Validating, please wait"
  145. },
  146. "validate2fields": {
  147. "alertText": "* Please input HELLO"
  148. },
  149. //tls warning:homegrown not fielded
  150. "dateFormat":{
  151. "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,
  152. "alertText": "* Neispravan datum"
  153. },
  154. //tls warning:homegrown not fielded
  155. "dateTimeFormat": {
  156. "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,
  157. "alertText": "* Neispravan format datuma",
  158. "alertText2": "Očekivani format: ",
  159. "alertText3": "mm/dd/gggg hh:mm:ss ili ",
  160. "alertText4": "gggg-mm-dd hh:mm:ss "
  161. }
  162. };
  163. }
  164. };
  165. $.validationEngineLanguage.newLang();
  166. })(jQuery);