Guest User

Untitled

a guest
Dec 6th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. "use strict";
  2.  
  3. (function e(t, n, r) {
  4. function s(o, u) {
  5. if (!n[o]) {
  6. if (!t[o]) {
  7. var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);throw new Error("Cannot find module '" + o + "'");
  8. }var f = n[o] = { exports: {} };t[o][0].call(f.exports, function (e) {
  9. var n = t[o][1][e];return s(n ? n : e);
  10. }, f, f.exports, e, t, n, r);
  11. }return n[o].exports;
  12. }var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
  13. s(r[o]);
  14. }return s;
  15. })({ 1: [function (require, module, exports) {
  16. (function ($) {
  17.  
  18. "use strict";
  19.  
  20. var $document = $(document),
  21. $window = $(window),
  22. forms = {
  23. contactForm: $('#contactForm'),
  24. bookingForm: $('#bookingForm')
  25. };
  26.  
  27. $document.ready(function () {
  28.  
  29. // booking form
  30. if (forms.bookingForm.length) {
  31. var $bookingForm = forms.bookingForm;
  32. $bookingForm.validate({
  33. rules: {
  34. name: {
  35. required: true,
  36. minlength: 2
  37. },
  38. message: {
  39. required: true,
  40. minlength: 20
  41. },
  42. email: {
  43. required: true,
  44. email: true
  45. }
  46.  
  47. },
  48. messages: {
  49. name: {
  50. required: "Uzupełnij swoje imię",
  51. minlength: "Twoje imię musi zawierać co najmniej 2 znaki"
  52. },
  53. message: {
  54. required: "Wpisz swoją wiadomość",
  55. minlength: "Twoja wiadomość musi mieć co najmniej 20 znaków"
  56. },
  57. email: {
  58. required: "Uzupełnij swój adres e-mail"
  59. }
  60. },
  61. submitHandler: function submitHandler(form) {
  62. $(form).ajaxSubmit({
  63. type: "POST",
  64. data: $(form).serialize(),
  65. url: "form/process-booking.php",
  66. success: function success() {
  67. $('.successform', $bookingForm).fadeIn();
  68. $bookingForm.get(0).reset();
  69. },
  70. error: function error() {
  71. $('.errorform', $bookingForm).fadeIn();
  72. }
  73. });
  74. }
  75. });
  76. }
  77.  
  78. // contact page form
  79. if (forms.contactForm.length) {
  80. var $contactform = forms.contactForm;
  81. $contactform.validate({
  82. rules: {
  83. name: {
  84. required: true,
  85. minlength: 2
  86. },
  87. message: {
  88. required: true,
  89. minlength: 20
  90. },
  91. email: {
  92. required: true,
  93. email: true
  94. }
  95.  
  96. },
  97. messages: {
  98. name: {
  99. required: "Uzupełnij swoje imię",
  100. minlength: "Twoje imię musi zawierać co najmniej 2 znaki"
  101. },
  102. message: {
  103. required: "Wpisz swoją wiadomość",
  104. minlength: "Twoja wiadomość musi mieć co najmniej 20 znaków"
  105. },
  106. email: {
  107. required: "Uzupełnij swój adres e-mail"
  108. }
  109. },
  110. submitHandler: function submitHandler(form) {
  111. $(form).ajaxSubmit({
  112. type: "POST",
  113. data: $(form).serialize(),
  114. url: "form/process-contact.php",
  115. success: function success() {
  116. $('.successform', $contactform).fadeIn();
  117. $contactform.get(0).reset();
  118. },
  119. error: function error() {
  120. $('.errorform', $contactform).fadeIn();
  121. }
  122. });
  123. }
  124. });
  125. }
  126.  
  127. // datepicker
  128. if ($('.datetimepicker').length) {
  129. $('.datetimepicker').datetimepicker({
  130. format: 'DD/MM/YYYY',
  131. icons: {
  132. time: 'icon icon-clock',
  133. date: 'icon icon-calendar',
  134. up: 'icon icon-arrow_up',
  135. down: 'icon icon-arrow_down',
  136. previous: 'icon icon-arrow-left',
  137. next: 'icon icon-arrow-right',
  138. today: 'icon icon-today',
  139. clear: 'icon icon-trash',
  140. close: 'icon icon-cancel-music'
  141. }
  142. });
  143. }
  144. if ($('.timepicker').length) {
  145. $('.timepicker').datetimepicker({
  146. format: 'LT',
  147. icons: {
  148. time: 'icon icon-clock',
  149. up: 'icon icon-arrow_up',
  150. down: 'icon icon-arrow_down',
  151. previous: 'icon icon-arrow-left',
  152. next: 'icon icon-arrow-right'
  153. }
  154. });
  155. }
  156. });
  157. })(jQuery);
  158. }, {}] }, {}, [1]);
Advertisement
Add Comment
Please, Sign In to add comment