// Toastr Settings toastr.options = { "closeButton": true, "debug": false, "newestOnTop": false, "progressBar": true, "positionClass": "toast-top-right", "preventDuplicates": true, "onclick": null, "showDuration": "1200", "hideDuration": "1000", "timeOut": "5000", "extendedTimeOut": "1000", "showEasing": "swing", "hideEasing": "linear", "showMethod": "fadeIn", "hideMethod": "fadeOut" } // Tawk Customer Support /* var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date(); (function(){ var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0]; s1.async=true; s1.src='https://embed.tawk.to/59f0a36ec28eca75e4628237/default'; s1.charset='UTF-8'; s1.setAttribute('crossorigin','*'); s0.parentNode.insertBefore(s1,s0); })(); */ // Hoteleia Form Validations function HoteleiaStop(e) { e.stopPropagation(); e.preventDefault(); e.stopImmediatePropagation() } function validateEmail(email) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } // Hoteleia Onboarding Step-One (/listing/step-one.en.html?plan=$plan) $(function(){ if($('body').is('.hoteleia_onboarding_step_one')){ let HoteleiaError = false; $(".submit").click(function(e) { var firstname = $(".firstname").val(); var lastname = $(".lastname").val(); var email = $(".email").val(); var password = $(".password").val(); // First Name Validations if (firstname.length > 254) { $(".firstname").addClass('form-error'); toastr.error('The first name can not be longer than 255 characters!') HoteleiaError = true; } if (firstname.length < 2) { $(".firstname").addClass('form-error'); toastr.error('The first name can not be shorter than 2 characters!') HoteleiaError = true; } // Last Name Validations if (lastname.length > 254) { $(".lastname").addClass('form-error'); toastr.error('The last name can not be longer than 255 characters!') HoteleiaError = true; } if (lastname.length < 2) { $(".lastname").addClass('form-error'); toastr.error('The last name can not be shorter than 2 characters!') HoteleiaError = true; } // Password Validations if (password.length > 254) { $(".password").addClass('form-error'); toastr.error('The password can not be longer than 255 characters!') HoteleiaError = true; } if (password.length < 8) { $(".password").addClass('form-error'); toastr.error('The password can not be shorter than 8 characters!') HoteleiaError = true; } // Email Validations if (!validateEmail(email)) { $(".email").addClass('form-error'); toastr.error('The email is not valid!') HoteleiaError = true; } if (HoteleiaError == true) { HoteleiaError = false; HoteleiaStop(e); } }); } }); // Hoteleia Onboarding Step-Two (/listing/step-two.en.html) $(function(){ if($('body').is('.hoteleia_onboarding_step_two')){ let HoteleiaError = false; $(".submit").click(function(e) { var property = $(".property").val(); // Property Validations if (property.length < 5) { $(".password").addClass('form-error'); toastr.error('The property name can not be shorter than 5 characters!') HoteleiaError = true; } if (property.length > 254) { $(".password").addClass('form-error'); toastr.error('The property name can not be longer than 255 characters!') HoteleiaError = true; } if (HoteleiaError == true) { HoteleiaError = false; HoteleiaStop(e); } }); } });