var v = '6a14da4976f7e';var Widget_BusinessID = '3';var Widget_SiteCDN = 'https://app.maslero.com/';Widget_SiteCDN = 'https://cdn.maslero.com/';var Widget_SiteIMG = 'https://app.maslero.com/';var WhatsAppReply = 'Birkaç dakika içinde cevap veririz'; var WhatsAppButton = 'Sohbete Başla'; var WhatsAppUserID = '8'; var WhatsAppPhone = '905324179654'; var WhatsAppText = 'Türkiye\'de emlak satın almak istiyorum bana yardım eder misin?'; var WhatsAppYourInfo = 'Bilgileriniz'; var WhatsAppYourFormText= 'WhatsApp ile Sohbet etmek için aşağıdaki formu doldurabilirsiniz. 👇'; var WhatsAppYourName = '*Ad Soyad'; var WhatsAppYourEmail = '*E-posta'; var WhatsAppYourPhone = '*Telefon'; var WhatsAppLang = 'tr'; var WhatsAppUserName = 'Anıl Övençoğlu'; var WhatsAppUserProfile = 'https://app.maslero.com/uploads/3/users/8.jpg'; var WhatsAppUserText = 'WhatsApp aracılığıyla benimle sohbet edin 💬'; var WhatsAppUserMessage = 'Merhaba 👋<br>Size nasıl yardım edebilirim?';window.onload = function(){ var HOST = location.host; var URL = location.href; var WhatsAppURL = "https://wa.me/" + WhatsAppPhone + "?text=" + WhatsAppText + " " + URL; var d = new Date(); var h = d.getHours(); h = h < 10 ? "0" + h : h; if($(window).width() > 768){ setTimeout(function(){ if(!$(".msl_chat_box").hasClass("msl_chat_open")){ $(".msl_chat_box").toggleClass("msl_chat_open"); $(".msl_bubble").toggleClass("msl_chat_open"); setTimeout(function(){ if($(".msl_chat_box").hasClass("msl_chat_open")){ $(".msl_chat_box").toggleClass("msl_chat_open"); $(".msl_bubble").toggleClass("msl_chat_open"); } }, 5000); } }, 30000); } $(document).on("click", "#MASLERO-WhatsAppWidget .msl_bubble, #MASLERO-WhatsAppWidget .msl_whatsapp_close", function(){ $(".msl_chat_box").toggleClass("msl_chat_open"); $(".msl_bubble").toggleClass("msl_chat_open"); if($(window).width() < 768){ $(".msl_notification").hide(); } }); setInterval(function(){ if(URL != location.href){ URL = location.href; WhatsAppURL = "https://wa.me/" + WhatsAppPhone + "?text=" + WhatsAppText + " " + URL; $(".msl_whatsapp_open").attr({"href" : WhatsAppURL}); } }, 100); var msl_whatsapp_PhoneInputJS = false; setInterval(function(){ if($("#msl_whatsapp_Phone").length > 0 && !msl_whatsapp_PhoneInputJS){ msl_whatsapp_PhoneInputJS = true; var itiInput = document.querySelector("#msl_whatsapp_Phone"); var iti = window.intlTelInput(itiInput, { initialCountry: "auto", separateDialCode: false, autoHideDialCode: true, nationalMode: false, utilsScript: "//cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.15/js/utils.min.js", geoIpLookup: function(success, failure) { $.get("//api.ip.sb/geoip", function() {}, "jsonp").always(function(resp) { var countryCode = (resp && resp.country_code) ? resp.country_code : "tr"; success(countryCode); }); }, }); itiInput.addEventListener("focus", function() { if(!$("#msl_whatsapp_Phone").val()){ var dialcode = iti.getSelectedCountryData().dialCode; $("#msl_whatsapp_Phone").val("+" + dialcode); } }); } }, 1000); $(document).on("submit", "#MASLERO-WhatsAppWidget #msl_whatsapp_form", function(){ var formData = $(this).serialize(); $.ajax({ type: "POST", url: "//app.maslero.com/Widget/" + Widget_BusinessID + "/WhatsApp/index.js", data: formData, dataType: "json", success: function(response){ if(response.status == "success"){ $("#MASLERO-WhatsAppWidget .msl_chat_box").addClass("msl_top_0"); $("#MASLERO-WhatsAppWidget .msl_form").hide(); $("#MASLERO-WhatsAppWidget .msl_start_chat.msl_start_btn").show(); if($(window).width() < 768){ window.location = WhatsAppURL; } else { window.open(WhatsAppURL, '_blank'); } } } }); return false; }); $("head").append('<script src="//cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.15/js/intlTelInput.min.js" integrity="sha512-L3moecKIMM1UtlzYZdiGlge2+bugLObEFLOFscaltlJ82y0my6mTUugiz6fQiSc5MaS7Ce0idFJzabEAl43XHg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>'); $("head").append('<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.15/css/intlTelInput.css" integrity="sha512-gxWow8Mo6q6pLa1XH/CcH8JyiSDEtiwJV78E+D+QP0EVasFs8wKXq16G8CLD4CJ2SnonHr4Lm/yY2fSI2+cbmw==" crossorigin="anonymous" referrerpolicy="no-referrer" />'); $("head").append('<link rel="stylesheet" href="' + Widget_SiteCDN + 'Widget/WhatsApp/css/style.css?v=' + v + '" type="text/css"/>'); $("body").append('<div id="MASLERO-WhatsAppWidget">'+ '<div class="msl_chat_box msl_form_box">'+ '<div class="msl_header">'+ '<div class="msl_user_img">'+ '<img src="' + WhatsAppUserProfile + '" width="50" height="50">'+ '</div>'+ '<div class="msl_user_info">'+ '<strong>' + WhatsAppUserName + '</strong>'+ WhatsAppUserText + '</div>'+ '<div class="msl_whatsapp_close"></div>'+ '</div>'+ '<div class="msl_component">'+ '<div class="msl_component_element">'+ '<div class="msl_message_notify">'+ '<span>' + WhatsAppReply + '</span>'+ '</div>'+ '<div class="msl_message">'+ '<div class="msl_message_name">' + WhatsAppUserName + '</div>'+ '<div class="msl_message_text">' + WhatsAppUserMessage + '</div>'+ '<small>' + h + ':00</small>'+ '</div>'+ '<div class="msl_message msl_form">'+ '<div class="msl_message_name">' + WhatsAppYourInfo + '</div>'+ '<div class="msl_message_text">' + '<form id="msl_whatsapp_form">' + '<input type="hidden" id="msl_whatsapp_BusinessID" name="msl_whatsapp_BusinessID" value="' + Widget_BusinessID +'">' + '<input type="hidden" id="msl_whatsapp_FType" name="msl_whatsapp_FType" value="WhatsApp">' + '<input type="hidden" id="msl_whatsapp_UserID" name="msl_whatsapp_UserID" value="' + WhatsAppUserID + '">' + '<input type="hidden" id="msl_whatsapp_Lang" name="msl_whatsapp_Lang" value="' + WhatsAppLang + '">' + '<input type="hidden" id="msl_whatsapp_FURL" name="msl_whatsapp_FURL" value="' + URL + '">' + '<input type="hidden" id="msl_whatsapp_gclid" name="msl_whatsapp_GoogleClickID" value="">' + '<input type="hidden" id="msl_yandex_clientid" name="YandexClientID" value="">' + '<small>' + WhatsAppYourFormText + '</small>' + '<input type="text" id="msl_whatsapp_Name" name="msl_whatsapp_Name" placeholder="' + WhatsAppYourName + '" required>' + '<input type="email" id="msl_whatsapp_Email" name="msl_whatsapp_Email" placeholder="' + WhatsAppYourEmail + '" required>' + '<input type="text" id="msl_whatsapp_Phone" name="msl_whatsapp_Phone" placeholder="' + WhatsAppYourPhone + '" required>' + '<div class="msl_start_chat">'+ '<button type="submit" class="msl_whatsapp_open">' + WhatsAppButton + '</button>'+ '</div>'+ '</form>'+ '</div>'+ '</div>'+ '</div>'+ '</div>'+ '<div class="msl_start_chat msl_start_btn" style="display:none;">'+ '<a href="' + WhatsAppURL + '" target="_blank" rel="nofollow" class="msl_whatsapp_open">' + WhatsAppButton + '</a>'+ '</div>'+ '<a href="https://maslero.com/?utm_source=' + HOST + '&utm_medium=Link&utm_campaign=WhatsAppWidget&utm_content=PoweredBy" target="_blank" rel="nofollow" class="msl_powered_by">'+ 'Powered by <img src="https://cdn.maslero.com/lib/img/logo.svg" width="50" height="9" alt="MASLERO: Real Estate CRM & Marketing Platform">'+ '</a>'+ '</div>'+ '<div id="msl_whatsapp_button" class="msl_bubble" role="button">'+ '<i class="msl_notification">1</i>'+ '<span class="msl_button_svg"></span>'+ '</div>'+ '</div>');}