PageRenderTime 57ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/public/admin/template/assets/js/validationEngine/languages/jquery.validationEngine-da.js

https://gitlab.com/fayimora/pp
JavaScript | 135 lines | 125 code | 1 blank | 9 comment | 1 complexity | 49d2ed968e325beb8f5b29b99bb7e075 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": "* Dette felt skal udfyldes",
  10. "alertTextCheckboxMultiple": "* Vælg venligst en af mulighederne",
  11. "alertTextCheckboxe": "* Dette felt er påkrævet"
  12. },
  13. "requiredInFunction": {
  14. "func": function (field, rules, i, options) {
  15. return (field.val() == "test") ? true : false;
  16. },
  17. "alertText": "* Indholdet af feltet skal være lig med test"
  18. },
  19. "minSize": {
  20. "regex": "none",
  21. "alertText": "* Minimum ",
  22. "alertText2": " tegn tilladt"
  23. },
  24. "maxSize": {
  25. "regex": "none",
  26. "alertText": "* Maksimum ",
  27. "alertText2": " tegn tilladt"
  28. },
  29. "groupRequired": {
  30. "regex": "none",
  31. "alertText": "* Du skal udfylde mindst et af følgende felter"
  32. },
  33. "min": {
  34. "regex": "none",
  35. "alertText": "* Den mindst tilladte værdi er "
  36. },
  37. "max": {
  38. "regex": "none",
  39. "alertText": "* Den maksimalt tilladte værdi er "
  40. },
  41. "past": {
  42. "regex": "none",
  43. "alertText": "* Datoen skal være før "
  44. },
  45. "future": {
  46. "regex": "none",
  47. "alertText": "* Datoen skal være efter "
  48. },
  49. "maxCheckbox": {
  50. "regex": "none",
  51. "alertText": "* Antallet af tilladte valg er overskredet"
  52. },
  53. "minCheckbox": {
  54. "regex": "none",
  55. "alertText": "* Vælg venligst ",
  56. "alertText2": " muligheder"
  57. },
  58. "equals": {
  59. "regex": "none",
  60. "alertText": "* Felterne er ikke ens"
  61. },
  62. "creditCard": {
  63. "regex": "none",
  64. "alertText": "* Ugyldigt kreditkortnummer"
  65. },
  66. "phone": {
  67. // credit: jquery.h5validate.js / orefalo
  68. "regex": /^([\+][0-9]{1,3}([ \.\-])?)?([\(][0-9]{1,6}[\)])?([0-9 \.\-]{1,32})(([A-Za-z \:]{1,11})?[0-9]{1,4}?)$/,
  69. "alertText": "* Ikke gyldigt telefonnummer"
  70. },
  71. "email": {
  72. // Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
  73. "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,
  74. "alertText": "* Ikke gyldig e-mail"
  75. },
  76. "integer": {
  77. "regex": /^[\-\+]?\d+$/,
  78. "alertText": "* Ikke et korrekt tal"
  79. },
  80. "number": {
  81. // Number, including positive, negative, and floating decimal. credit: orefalo
  82. "regex": /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/,
  83. "alertText": "* Ugyldig decimaltal"
  84. },
  85. "date": {
  86. "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
  87. "alertText": "* Ugyldig dato, skal være i formatet ÅÅÅÅ-MM-DD"
  88. },
  89. "ipv4": {
  90. "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]))$/,
  91. "alertText": "* Ugyldig IP adresse"
  92. },
  93. "url": {
  94. "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,
  95. "alertText": "* Ugyldig URL"
  96. },
  97. "onlyNumberSp": {
  98. "regex": /^[0-9\ ]+$/,
  99. "alertText": "* Kun tal"
  100. },
  101. "onlyLetterSp": {
  102. "regex": /^[a-zA-Z\ \']+$/,
  103. "alertText": "* Kun bogstaver"
  104. },
  105. "onlyLetterNumber": {
  106. "regex": /^[0-9a-zA-Z]+$/,
  107. "alertText": "* Ingen specialtegn tilladt"
  108. },
  109. // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
  110. "ajaxUserCall": {
  111. "url": "ajaxValidateFieldUser",
  112. // you may want to pass extra data on the ajax call
  113. "extraData": "name=eric",
  114. "alertText": "* Denne bruger er allerede taget",
  115. "alertTextLoad": "* Kontrollere, vent venligst"
  116. },
  117. "ajaxNameCall": {
  118. // remote json service location
  119. "url": "ajaxValidateFieldName",
  120. // error
  121. "alertText": "* Dette navn er allerede taget",
  122. // if you provide an "alertTextOk", it will show as a green prompt when the field validates
  123. "alertTextOk": "* Dette navn er ledig",
  124. // speaks by itself
  125. "alertTextLoad": "* Kontrollere, vent venligst"
  126. },
  127. "validate2fields": {
  128. "alertText": "* Indsæt venligst HELLO"
  129. }
  130. };
  131. }
  132. };
  133. $.validationEngineLanguage.newLang();
  134. })(jQuery);