PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/files/validation.engine/2.5.2/languages/jquery.validationEngine-sv.js

https://gitlab.com/Mirros/jsdelivr
JavaScript | 147 lines | 132 code | 1 blank | 14 comment | 0 complexity | a9feeea3bad64d907b0857333872db81 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": "* Det här fältet krävs",
  10. "alertTextCheckboxMultiple": "* Var god välj ett alternativ",
  11. "alertTextCheckboxe": "* Den här kryssrutan måste anges"
  12. },
  13. "minSize": {
  14. "regex": "none",
  15. "alertText": "* Minimum ",
  16. "alertText2": " tecken"
  17. },
  18. "maxSize": {
  19. "regex": "none",
  20. "alertText": "* Maximalt ",
  21. "alertText2": " antal tecken"
  22. },
  23. "groupRequired": {
  24. "regex": "none",
  25. "alertText": "* You must fill one of the following fields"
  26. },
  27. "min": {
  28. "regex": "none",
  29. "alertText": "* Minsta möjliga värde är "
  30. },
  31. "max": {
  32. "regex": "none",
  33. "alertText": "* Maxvärdet är "
  34. },
  35. "past": {
  36. "regex": "none",
  37. "alertText": "* Datum måste vara före "
  38. },
  39. "future": {
  40. "regex": "none",
  41. "alertText": "* Datum efter "
  42. },
  43. "maxCheckbox": {
  44. "regex": "none",
  45. "alertText": "* Maximalt ",
  46. "alertText2": " alternativ får väljas"
  47. },
  48. "minCheckbox": {
  49. "regex": "none",
  50. "alertText": "* Var god välj ",
  51. "alertText2": " alternativ"
  52. },
  53. "equals": {
  54. "regex": "none",
  55. "alertText": "* Fält överensstämmer inte"
  56. },
  57. "creditCard": {
  58. "regex": "none",
  59. "alertText": "* Ogiltigt kreditkortsnummer"
  60. },
  61. "phone": {
  62. // credit: jquery.h5validate.js / orefalo
  63. "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
  64. "alertText": "* Ogiltigt telefonnummer"
  65. },
  66. "email": {
  67. // Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
  68. "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,
  69. "alertText": "* Ogiltig e-postadress"
  70. },
  71. "integer": {
  72. "regex": /^[\-\+]?\d+$/,
  73. "alertText": "* Inte korrekt numeriskt värde"
  74. },
  75. "number": {
  76. // Number, including positive, negative, and floating decimal. credit: orefalo
  77. "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,
  78. "alertText": "* Inte korrekt decimalvärde"
  79. },
  80. "date": {
  81. "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
  82. "alertText": "* Ogiltigt datum, måste vara i YYYY-MM-DD -format"
  83. },
  84. "ipv4": {
  85. "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]))$/,
  86. "alertText": "* Ogiltig IP-adress"
  87. },
  88. "url": {
  89. "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,
  90. "alertText": "* Ogiltig URL"
  91. },
  92. "onlyNumberSp": {
  93. "regex": /^[0-9\ ]+$/,
  94. "alertText": "* Enbart siffror"
  95. },
  96. "onlyLetterSp": {
  97. "regex": /^[a-zA-Z\ \']+$/,
  98. "alertText": "* Enbart bokstäver"
  99. },
  100. "onlyLetterNumber": {
  101. "regex": /^[0-9a-zA-Z]+$/,
  102. "alertText": "* Inga specialtecken"
  103. },
  104. // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
  105. "ajaxUserCall": {
  106. "url": "ajaxValidateFieldUser",
  107. // you may want to pass extra data on the ajax call
  108. "extraData": "name=eric",
  109. "alertText": "* Användarnamnet är upptaget",
  110. "alertTextLoad": "* Validerar, var god vänta"
  111. },
  112. "ajaxUserCallPhp": {
  113. "url": "phpajax/ajaxValidateFieldUser.php",
  114. // you may want to pass extra data on the ajax call
  115. "extraData": "name=eric",
  116. // if you provide an "alertTextOk", it will show as a green prompt when the field validates
  117. "alertTextOk": "* Användarnamnet är tillgängligt",
  118. "alertText": "* Användarnamnet är upptaget",
  119. "alertTextLoad": "* Validerar, var god vänta"
  120. },
  121. "ajaxNameCall": {
  122. // remote json service location
  123. "url": "ajaxValidateFieldName",
  124. // error
  125. "alertText": "* Användarnamnet är upptaget",
  126. // if you provide an "alertTextOk", it will show as a green prompt when the field validates
  127. "alertTextOk": "* Användarnamnet är tillgängligt",
  128. // speaks by itself
  129. "alertTextLoad": "* Validerar, var god vänta"
  130. },
  131. "ajaxNameCallPhp": {
  132. // remote json service location
  133. "url": "phpajax/ajaxValidateFieldName.php",
  134. // error
  135. "alertText": "* Användarnamnet är upptaget",
  136. // speaks by itself
  137. "alertTextLoad": "* Validerar, var god vänta"
  138. },
  139. "validate2fields": {
  140. "alertText": "* Ange text HELLO"
  141. }
  142. };
  143. }
  144. };
  145. $.validationEngineLanguage.newLang();
  146. })(jQuery);