Plugin Directory

Changeset 3394807


Ignore:
Timestamp:
11/13/2025 07:12:12 AM (5 months ago)
Author:
bhvreddy
Message:

v4.31 fix icon not added for shortcode style-1

Location:
click-to-chat-for-whatsapp
Files:
266 added
15 edited

Legend:

Unmodified
Added
Removed
  • click-to-chat-for-whatsapp/trunk/click-to-chat.php

    r3386465 r3394807  
    88 * Plugin URI:  https://wordpress.org/plugins/click-to-chat-for-whatsapp/
    99 * Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
    10  * Version:     4.30
     10 * Version:     4.31
    1111 * Author:      HoliThemes
    1212 * Author URI:  https://holithemes.com/plugins/click-to-chat/
     
    2222// ctc - Version - update version at readme 'Stable tag'.
    2323if ( ! defined( 'HT_CTC_VERSION' ) ) {
    24     define( 'HT_CTC_VERSION', '4.30' );
     24    define( 'HT_CTC_VERSION', '4.31' );
    2525}
    2626
  • click-to-chat-for-whatsapp/trunk/common/class-ht-ctc-switch.php

    r3369409 r3394807  
    6767        public function to_switch() {
    6868
    69             // new interface  yes/no
     69            // New interface yes/no.
    7070            $is_new = '';
    7171
    72             // user new/prev
     72            // User new/prev.
    7373            $user = '';
    7474
     
    9090            }
    9191
    92             // prev user and if switched
     92            // Previous user and if switched.
    9393            if ( 'prev' === $user ) {
    9494
     
    103103            // $is_new = 'yes';
    104104
    105             // define HT_CTC_IS_NEW
     105            // Define HT_CTC_IS_NEW.
    106106            if ( ! defined( 'HT_CTC_IS_NEW' ) ) {
    107107                define( 'HT_CTC_IS_NEW', $is_new );
    108108            }
    109109
    110             // include related files ..
     110            // Include related files.
    111111            if ( 'yes' === HT_CTC_IS_NEW ) {
    112                 // new interface
     112                // New interface.
    113113
    114                 // register hooks
     114                // Register hooks.
    115115                include_once HT_CTC_PLUGIN_DIR . 'new/inc/class-ht-ctc-register.php';
    116116                register_activation_hook( HT_CTC_PLUGIN_FILE, array( 'HT_CTC_Register', 'activate' ) );
     
    118118                register_uninstall_hook( HT_CTC_PLUGIN_FILE, array( 'HT_CTC_Register', 'uninstall' ) );
    119119
    120                 // include main file - prev
     120                // Include main file - new.
    121121                include_once HT_CTC_PLUGIN_DIR . 'new/class-ht-ctc.php';
    122122
     
    133133
    134134            } else {
    135                 // prev interface
     135                // Previous interface.
    136136
    137                 // include main file - prev
     137                // Include main file - previous.
    138138                include_once HT_CTC_PLUGIN_DIR . 'prev/inc/class-ht-ccw.php';
    139139
  • click-to-chat-for-whatsapp/trunk/new/admin/admin_assets/js/admin.js

    r3332166 r3394807  
    1 (()=>{var t;document.addEventListener("DOMContentLoaded",function(){try{var t=document.querySelectorAll("select");M.FormSelect.init(t,{});t=document.querySelectorAll(".collapsible");M.Collapsible.init(t,{});t=document.querySelectorAll(".modal");M.Modal.init(t,{});t=document.querySelectorAll(".tooltipped");M.Tooltip.init(t,{})}catch(t){}}),(t=jQuery)(function(){try{document.dispatchEvent(new CustomEvent("ht_ctc_fn_all",{detail:{admin_ctc:{},ctc_getItem:o,ctc_setItem:c,intl_init:h,intl_onchange:r}}))}catch(t){}var e={},_=window.ht_ctc_admin_var?window.ht_ctc_admin_var:{};function o(t){return!!e[t]&&e[t]}function c(t,_){e[t]=_;var o=JSON.stringify(e);localStorage.setItem("ht_ctc_admin",o)}localStorage.getItem("ht_ctc_admin")&&(e=localStorage.getItem("ht_ctc_admin"),e=JSON.parse(e));var a={};localStorage.getItem("ht_ctc_storage")&&(a=localStorage.getItem("ht_ctc_storage"),a=JSON.parse(a));try{t("select").formSelect(),t(".collapsible").collapsible(),t(".modal").modal(),t(".tooltipped").tooltip()}catch(t){}try{if(t(document).on("click",".open_tab",function(){var e=t(this).attr("data-tab");t(".tabs").tabs("select",e),c("woo_tab","#"+e)}),t(document).on("click",".md_tab_li",function(){var e=t(this).children("a").attr("href");window.location.hash=e,c("woo_tab",e)}),t(".tabs").tabs(),document.querySelector(".ctc-admin-woo-page")&&o("woo_tab")){var n=o("woo_tab");n=n.replace("#",""),setTimeout(function(){t("[data-tab="+n+"]").trigger("click")},1200)}}catch(t){}try{!function(e){if(document.querySelector("."+e)){if("undefined"==typeof intlTelInput)throw new Error("intlTelInput not loaded..");t("."+e).each(function(){h(this)}),r()}}("intl_number"),t(".intl_error").remove()}catch(e){t(".greetings_links").hide(),t(".intl_error").show()}var s,i,l,d={palettes:["#000000","#FFFFFF","#075e54","#128C7E","#25d366","#DCF8C6","#34B7F1","#ECE5DD","#00a884"],change:function(e,_){try{var o=e.target,c=_.color.toString(),a=t(o).attr("data-update-type"),n=t(o).attr("data-update-selector");a&&n&&(t(n).css(a,c),".template-greetings-1 .ctc_g_message_box"===n&&document.documentElement.style.setProperty("--ctc_g_message_box_bg_color",c),t(o).attr("data-update-2-type")&&t(o).attr("data-update-2-selector")&&t(t(o).attr("data-update-2-selector")).css(t(o).attr("data-update-2-type"),c))}catch(t){}}};try{t(".ht-ctc-color").wpColorPicker(d)}catch(e){t(".ht-ctc-color").wpColorPicker()}"show"==(l=t(".global_display:checked").val())?(t(".global_show_or_hide_icon").addClass("dashicons dashicons-visibility"),t(".hide_settings").show(),t(".show_hide_types .show_btn").attr("disabled","disabled"),t(".show_hide_types .show_box").hide()):"hide"==l&&(t(".global_show_or_hide_icon").addClass("dashicons dashicons-hidden"),t(".show_settings").show(),t(".show_hide_types .hide_btn").attr("disabled","disabled"),t(".show_hide_types .hide_box").hide()),t(".global_show_or_hide_label").html("("+l+")"),t(".global_display").on("change",function(e){var _=e.target.value,o="",c="";t(".hide_settings").hide(),t(".show_settings").hide(),t(".show_hide_types .show_btn").removeAttr("disabled"),t(".show_hide_types .hide_btn").removeAttr("disabled"),t(".show_hide_types .show_box").hide(),t(".show_hide_types .hide_box").hide(),"show"==_?(o="dashicons dashicons-visibility",c="dashicons-hidden",t(".hide_settings").show(500),t(".show_hide_types .show_btn").attr("disabled","disabled"),t(".show_hide_types .hide_box").show()):"hide"==_&&(o="dashicons dashicons-hidden",c="dashicons-visibility",t(".show_settings").show(500),t(".show_hide_types .hide_btn").attr("disabled","disabled"),t(".show_hide_types .show_box").show()),t(".global_show_or_hide_label").html("("+_+")"),t(".global_show_or_hide_icon").removeClass(c),t(".global_show_or_hide_icon").addClass(o)}),(i=t(".select_style_container").attr("data-style"))&&t('.select_style_item[data-style="'+i+'"]').addClass("select_style_selected"),t(".select_style_item").on("click",function(e){t(".select_style_item").removeClass("select_style_selected"),t(this).addClass("select_style_selected");var _=t(this).attr("data-style");t(".select_style_desktop").val(_),t(".customize_styles_link").fadeOut(100).fadeIn(100)}),(i=t(".m_select_style_container").attr("data-style"))&&t('.m_select_style_item[data-style="'+i+'"]').addClass("select_style_selected"),t(".m_select_style_item").on("click",function(e){t(".m_select_style_item").removeClass("select_style_selected"),t(this).addClass("select_style_selected");var _=t(this).attr("data-style");t(".select_style_mobile").val(_)}),t("#select_styles_issue").is(":checked")&&!t(".same_settings").is(":checked")&&t(".select_styles_issue_checkbox").show(),t(".select_styles_issue_description").on("click",function(e){t(".select_styles_issue_checkbox").toggle(500)}),t("#display_allstyles").on("change",function(e){t(".display_allstyles_description").show(200)}),t(".s1_add_icon").is(":checked")?t(".s1_icon_settings").show():t(".s1_icon_settings").hide(),t(".s1_add_icon").on("change",function(e){t(".s1_add_icon").is(":checked")?t(".s1_icon_settings").show(200):t(".s1_icon_settings").hide(200)}),t(".cs_m_fullwidth input").on("change",function(e){var _=t(this).closest(".cs_m_fullwidth").find(".m_fullwidth_description");t(this).is(":checked")?t(_).show(200):t(_).hide(200)}),[".ht_ctc_s2",".ht_ctc_s3",".ht_ctc_s3_1",".ht_ctc_s7"].forEach(function(e){"hide"==t(e+" .select_cta_type").find(":selected").val()&&t(e+" .cta_stick").hide(),t(e+" .select_cta_type").on("change",function(_){"hide"==_.target.value?t(e+" .cta_stick").hide(100):t(e+" .cta_stick").show(200)})}),"no-animation"==t(".select_an_type").find(":selected").val()&&(t(".an_delay").hide(),t(".an_itr").hide()),t(".select_an_type").on("change",function(e){"no-animation"==e.target.value?(t(".an_delay").hide(),t(".an_itr").hide()):(t(".an_delay").show(500),t(".an_itr").show(500))}),t(".same_settings").is(":checked")?t(".not_samesettings").hide():t(".not_samesettings").show(),t(".same_settings").on("change",function(e){t(".same_settings").is(":checked")?(t(".not_samesettings").hide(900),t(".select_styles_issue_checkbox").hide()):t(".not_samesettings").show(900)}),t("#notification_badge").is(":checked")?t(".notification_settings ").show():t(".notification_settings ").hide(),t("#notification_badge").on("change",function(e){t("#notification_badge").is(":checked")?t(".notification_settings ").show(400):t(".notification_settings ").hide(400)}),function(){var e=t("#whatsapp_cc").val(),_=t("#whatsapp_number").val();function o(){t(".ht_ctc_wn").html(e+""+_),t("#ctc_whatsapp_number").val(e+""+_)}t("#whatsapp_cc").on("change paste keyup",function(_){e=t("#whatsapp_cc").val(),o()}),t("#whatsapp_number").on("change paste keyup",function(e){_=t("#whatsapp_number").val(),o(),_&&0==_.charAt(0)?t(".ctc_wn_initial_zero").show(500):t(".ctc_wn_initial_zero").hide(500)})}(),s=t(".add_hook_value").attr("data-html"),t(document).on("click",".add_hook_value",function(){t(".ctc_hook_value").append(s)}),t(".ctc_hook_value").on("click",".hook_remove_value",function(e){e.preventDefault(),t(this).closest(".additional-value").remove()}),"yes"==(void 0!==screen.width&&screen.width>1024?"no":"yes")&&(t("#whatsapp_cc").attr("data-position","bottom"),t("#whatsapp_number").attr("data-position","bottom")),function(){t(".ga_ads_display").on("click",function(e){t(".ga_ads_checkbox").toggle(500)});var e=t("#ctc_save_changes_hover_text").text();t("#submit").attr("title",e),t("#s3_box_shadow").is(":checked")||t(".s3_box_shadow_hover").show(),t("#s3_box_shadow").on("change",function(e){t("#s3_box_shadow").is(":checked")?t(".s3_box_shadow_hover").hide(400):t(".s3_box_shadow_hover").show(500)})}();try{!function(){var e=t(".woo_single_position_select").find(":selected").val(),_=t(".woo_single_style_select").find(":selected").val();if(e&&""!==e&&"select"!==e&&t(".woo_single_position_settings").show(),e&&"select"==e?a():(_&&"1"==_||"8"==_)&&c(),t(".woo_single_position_select").on("change",function(e){var _=e.target.value,o=t(".woo_single_style_select").find(":selected").val();"select"==_?(t(".woo_single_position_settings").hide(200),a()):(t(".woo_single_position_settings").show(200),"1"!=o&&"8"!=o||c())}),t(".woo_single_style_select").on("change",function(t){var e=t.target.value;"1"==e||"8"==e?c():a()}),t("#woo_single_position_center").is(":checked")&&t(".woo_single_position_center_checked_content").show(),t("#woo_single_position_center").on("change",function(e){t("#woo_single_position_center").is(":checked")?t(".woo_single_position_center_checked_content").show(200):t(".woo_single_position_center_checked_content").hide(100)}),t("#woo_shop_add_whatsapp").is(":checked")){t(".woo_shop_add_whatsapp_settings").show();var o=t(".woo_shop_style").find(":selected").val();"1"!=o&&"8"!=o||n()}function c(){t(".woo_single_position_settings_cart_layout").show(200)}function a(){t(".woo_single_position_settings_cart_layout").hide(200)}function n(){t(".woo_shop_cart_layout").show(200)}function s(){t(".woo_shop_cart_layout").hide(200)}t("#woo_shop_add_whatsapp").on("change",function(e){if(t("#woo_shop_add_whatsapp").is(":checked")){t(".woo_shop_add_whatsapp_settings").show(200);var _=t(".woo_shop_style").find(":selected").val();"1"!=_&&"8"!=_||n()}else t(".woo_shop_add_whatsapp_settings").hide(100),s(100)}),t(".woo_shop_style").on("change",function(t){var e=t.target.value;"1"==e||"8"==e?n():s()})}(),function(){var e=["ht_ctc_s1","ht_ctc_s2","ht_ctc_s3","ht_ctc_s3_1","ht_ctc_s4","ht_ctc_s5","ht_ctc_s6","ht_ctc_s7","ht_ctc_s7_1","ht_ctc_s8","ht_ctc_s99","ht_ctc_webhooks","ht_ctc_animations","ht_ctc_notification","ht_ctc_other_settings","ht_ctc_enable_share_group","ht_ctc_debug","ht_ctc_device_settings","ht_ctc_show_hide_settings","ht_ctc_woo_1","ht_ctc_woo_shop","ctc_g_opt_in","g_content_collapsible","url_structure","ht_ctc_custom_css"];document.querySelector(".coll_active")&&t(".coll_active").each(function(){e.push(t(this).attr("data-coll_active"))});var _=["ht_ctc_device_settings","ht_ctc_show_hide_settings","ht_ctc_woo_1","ht_ctc_webhooks","ht_ctc_animations","ht_ctc_notification","g_content_collapsible","url_structure"];e.forEach(function(e){var a=o("col_"+e)?o("col_"+e):"";"open"==a?t("."+e+" li").addClass("active"):"close"==a?t("."+e+" li").removeClass("active"):_.includes(e)&&t("."+e+" li").addClass("active"),t("."+e).collapsible({onOpenEnd:function(){c("col_"+e,"open")},onCloseEnd:function(){c("col_"+e,"close")}})})}(),t(".notification_field").on("change",function(t){!function(t,e){a[t]=e;var _=JSON.stringify(a);localStorage.setItem("ht_ctc_storage",_)}("n_badge","admin_start")}),function(){t("#google_analytics").is(":checked")&&t(".ctc_ga_values").show(),t("#google_analytics").on("change",function(e){t("#google_analytics").is(":checked")?t(".ctc_ga_values").show(400):t(".ctc_ga_values").hide(200)});var e=t(".ctc_g_an_param_snippets .ht_ctc_g_an_add_param");t(document).on("click",".ctc_add_g_an_param_button",function(){var _=t(".g_an_param_order").val();_=parseInt(_);var o=e.clone();t(o).find(".g_an_param_order_ref_number").attr("name","ht_ctc_othersettings[g_an_params][]"),t(o).find(".g_an_param_order_ref_number").val("g_an_param_"+_),t(o).find(".ht_ctc_g_an_add_param_key").attr("name","ht_ctc_othersettings[g_an_param_".concat(_,"][key]")),t(o).find(".ht_ctc_g_an_add_param_value").attr("name","ht_ctc_othersettings[g_an_param_".concat(_,"][value]")),t(".ctc_new_g_an_param").append(o),_++,t(".g_an_param_order").val(_)}),t("#fb_pixel").is(":checked")&&t(".ctc_pixel_values").show(),t("#fb_pixel").on("change",function(e){t("#fb_pixel").is(":checked")?t(".ctc_pixel_values").show(400):t(".ctc_pixel_values").hide(200)});var _=t(".pixel_event_type").find(":selected").val();"trackCustom"==_?t(".pixel_custom_event").show(100):"track"==_&&t(".pixel_standard_event").show(100),t(".pixel_event_type").on("change",function(e){var _=e.target.value;"trackCustom"==_?(t(".pixel_custom_event").show(200),t(".pixel_standard_event").hide(100)):"track"==_&&(t(".pixel_standard_event").show(200),t(".pixel_custom_event").hide(100))});var o=t(".ctc_pixel_param_snippets .ht_ctc_pixel_add_param");t(document).on("click",".ctc_add_pixel_param_button",function(){var e=t(".pixel_param_order").val();e=parseInt(e);var _=o.clone();t(_).find(".pixel_param_order_ref_number").attr("name","ht_ctc_othersettings[pixel_params][]"),t(_).find(".pixel_param_order_ref_number").val("pixel_param_"+e),t(_).find(".ht_ctc_pixel_add_param_key").attr("name","ht_ctc_othersettings[pixel_param_".concat(e,"][key]")),t(_).find(".ht_ctc_pixel_add_param_value").attr("name","ht_ctc_othersettings[pixel_param_".concat(e,"][value]")),t(".ctc_new_pixel_param").append(_),e++,t(".pixel_param_order").val(e)}),t(".ctc_an_params").on("click",".an_param_remove",function(e){e.preventDefault(),t(this).closest(".ctc_an_param").remove()}),t(".analytics_count_message").on("click",function(e){t(".analytics_count_select").toggle(200)}),t(".select_analytics").on("change",function(e){var _=e.target.value;t(".analytics_count_message span").html(_)})}()}catch(t){}try{t(".ctc_sortable").sortable({cursor:"move",handle:".handle"})}catch(t){}function h(e){var a=t(e).attr("value"),n=t(e).attr("data-name")?t(e).attr("data-name"):"ht_ctc_chat_options[number]";t(e).removeAttr("name");var s=[],i=(new Date).toDateString(),l=o("country_code_date")==i?o("country_code"):"";""==l?(l="us",t.get("https://ipinfo.io",function(){},"jsonp").always(function(t){c("country_code",l=t&&t.country?t.country:"us"),c("country_code_date",i),u(l),h()})):h();var d="";function h(){s=o("pre_countries")?o("pre_countries"):[];var t={autoHideDialCode:!1,initialCountry:"auto",geoIpLookup:function(t,e){t(l)},dropdownContainer:document.body,hiddenInput:function(){return{phone:n,country:"ht_ctc_chat_options[intl_country]"}},nationalMode:!1,countryOrder:s,separateDialCode:!0,containerClass:"intl_tel_input_container",utilsScript:_.utils};d=intlTelInput(e,t),a&&a.length>8&&d.setNumber(a)}return d}function r(){t(".intl_number").on("input countrychange",function(e){var _=intlTelInput.getInstance(this);if(t(this).next('input[type="hidden"]').val(_.getNumber()),window.ht_ctc_admin_demo_var&&(window.ht_ctc_admin_demo_var.number=_.getNumber()),_.isValidNumber()){var o={number:_.getNumber()};document.dispatchEvent(new CustomEvent("ht_ctc_admin_event_valid_number",{detail:{d:o}}))}}),t(".intl_number").on("countrychange",function(t){u(intlTelInput.getInstance(this).getSelectedCountryData().iso2)})}function u(t){t=t&&""!==t?t.toUpperCase():"US";var e=o("pre_countries")?o("pre_countries"):[];e.includes(t)||(e.unshift(t),c("pre_countries",e))}!function(){function e(e,_){var o=t(e),c=t(_);function a(){"custom_url"===o.find(":selected").val()?c.show(500):c.hide(500)}a(),o.on("change",a)}e(".url_structure_d",".custom_url_desktop"),e(".url_structure_m",".custom_url_mobile")}()})})();
     1(()=>{"use strict";var t;document.addEventListener("DOMContentLoaded",function(){try{var t=document.querySelectorAll("select");M.FormSelect.init(t,{});t=document.querySelectorAll(".collapsible");M.Collapsible.init(t,{});t=document.querySelectorAll(".modal");M.Modal.init(t,{});t=document.querySelectorAll(".tooltipped");M.Tooltip.init(t,{})}catch(t){}}),(t=jQuery)(function(){try{document.dispatchEvent(new CustomEvent("ht_ctc_fn_all",{detail:{admin_ctc:{},ctc_getItem:o,ctc_setItem:c,intl_init:h,intl_onchange:r}}))}catch(t){}var e={},_=window.ht_ctc_admin_var?window.ht_ctc_admin_var:{};function o(t){return!!e[t]&&e[t]}function c(t,_){e[t]=_;var o=JSON.stringify(e);localStorage.setItem("ht_ctc_admin",o)}localStorage.getItem("ht_ctc_admin")&&(e=localStorage.getItem("ht_ctc_admin"),e=JSON.parse(e));var a={};localStorage.getItem("ht_ctc_storage")&&(a=localStorage.getItem("ht_ctc_storage"),a=JSON.parse(a));try{t("select").formSelect(),t(".collapsible").collapsible(),t(".modal").modal(),t(".tooltipped").tooltip()}catch(t){}try{if(t(document).on("click",".open_tab",function(){var e=t(this).attr("data-tab");t(".tabs").tabs("select",e),c("woo_tab","#"+e)}),t(document).on("click",".md_tab_li",function(){var e=t(this).children("a").attr("href");window.location.hash=e,c("woo_tab",e)}),t(".tabs").tabs(),document.querySelector(".ctc-admin-woo-page")&&o("woo_tab")){var n=o("woo_tab");n=n.replace("#",""),setTimeout(function(){t("[data-tab="+n+"]").trigger("click")},1200)}}catch(t){}try{!function(e){if(document.querySelector("."+e)){if("undefined"==typeof intlTelInput)throw new Error("intlTelInput not loaded..");t("."+e).each(function(){h(this)}),r()}}("intl_number"),t(".intl_error").remove()}catch(e){t(".greetings_links").hide(),t(".intl_error").show()}var s,i,l,d={palettes:["#000000","#FFFFFF","#075e54","#128C7E","#25d366","#DCF8C6","#34B7F1","#ECE5DD","#00a884"],change:function(e,_){try{var o=e.target,c=_.color.toString(),a=t(o).attr("data-update-type"),n=t(o).attr("data-update-selector");a&&n&&(t(n).css(a,c),".template-greetings-1 .ctc_g_message_box"===n&&document.documentElement.style.setProperty("--ctc_g_message_box_bg_color",c),t(o).attr("data-update-2-type")&&t(o).attr("data-update-2-selector")&&t(t(o).attr("data-update-2-selector")).css(t(o).attr("data-update-2-type"),c))}catch(t){}}};try{t(".ht-ctc-color").wpColorPicker(d)}catch(e){t(".ht-ctc-color").wpColorPicker()}"show"==(l=t(".global_display:checked").val())?(t(".global_show_or_hide_icon").addClass("dashicons dashicons-visibility"),t(".hide_settings").show(),t(".show_hide_types .show_btn").attr("disabled","disabled"),t(".show_hide_types .show_box").hide()):"hide"==l&&(t(".global_show_or_hide_icon").addClass("dashicons dashicons-hidden"),t(".show_settings").show(),t(".show_hide_types .hide_btn").attr("disabled","disabled"),t(".show_hide_types .hide_box").hide()),t(".global_show_or_hide_label").html("("+l+")"),t(".global_display").on("change",function(e){var _=e.target.value,o="",c="";t(".hide_settings").hide(),t(".show_settings").hide(),t(".show_hide_types .show_btn").removeAttr("disabled"),t(".show_hide_types .hide_btn").removeAttr("disabled"),t(".show_hide_types .show_box").hide(),t(".show_hide_types .hide_box").hide(),"show"==_?(o="dashicons dashicons-visibility",c="dashicons-hidden",t(".hide_settings").show(500),t(".show_hide_types .show_btn").attr("disabled","disabled"),t(".show_hide_types .hide_box").show()):"hide"==_&&(o="dashicons dashicons-hidden",c="dashicons-visibility",t(".show_settings").show(500),t(".show_hide_types .hide_btn").attr("disabled","disabled"),t(".show_hide_types .show_box").show()),t(".global_show_or_hide_label").html("("+_+")"),t(".global_show_or_hide_icon").removeClass(c),t(".global_show_or_hide_icon").addClass(o)}),(i=t(".select_style_container").attr("data-style"))&&t('.select_style_item[data-style="'+i+'"]').addClass("select_style_selected"),t(".select_style_item").on("click",function(e){t(".select_style_item").removeClass("select_style_selected"),t(this).addClass("select_style_selected");var _=t(this).attr("data-style");t(".select_style_desktop").val(_),t(".customize_styles_link").fadeOut(100).fadeIn(100)}),(i=t(".m_select_style_container").attr("data-style"))&&t('.m_select_style_item[data-style="'+i+'"]').addClass("select_style_selected"),t(".m_select_style_item").on("click",function(e){t(".m_select_style_item").removeClass("select_style_selected"),t(this).addClass("select_style_selected");var _=t(this).attr("data-style");t(".select_style_mobile").val(_)}),t("#select_styles_issue").is(":checked")&&!t(".same_settings").is(":checked")&&t(".select_styles_issue_checkbox").show(),t(".select_styles_issue_description").on("click",function(e){t(".select_styles_issue_checkbox").toggle(500)}),t("#display_allstyles").on("change",function(e){t(".display_allstyles_description").show(200)}),t(".s1_add_icon").is(":checked")?t(".s1_icon_settings").show():t(".s1_icon_settings").hide(),t(".s1_add_icon").on("change",function(e){t(".s1_add_icon").is(":checked")?t(".s1_icon_settings").show(200):t(".s1_icon_settings").hide(200)}),t(".cs_m_fullwidth input").on("change",function(e){var _=t(this).closest(".cs_m_fullwidth").find(".m_fullwidth_description");t(this).is(":checked")?t(_).show(200):t(_).hide(200)}),[".ht_ctc_s2",".ht_ctc_s3",".ht_ctc_s3_1",".ht_ctc_s7"].forEach(function(e){"hide"==t(e+" .select_cta_type").find(":selected").val()&&t(e+" .cta_stick").hide(),t(e+" .select_cta_type").on("change",function(_){"hide"==_.target.value?t(e+" .cta_stick").hide(100):t(e+" .cta_stick").show(200)})}),"no-animation"==t(".select_an_type").find(":selected").val()&&(t(".an_delay").hide(),t(".an_itr").hide()),t(".select_an_type").on("change",function(e){"no-animation"==e.target.value?(t(".an_delay").hide(),t(".an_itr").hide()):(t(".an_delay").show(500),t(".an_itr").show(500))}),t(".same_settings").is(":checked")?t(".not_samesettings").hide():t(".not_samesettings").show(),t(".same_settings").on("change",function(e){t(".same_settings").is(":checked")?(t(".not_samesettings").hide(900),t(".select_styles_issue_checkbox").hide()):t(".not_samesettings").show(900)}),t("#notification_badge").is(":checked")?t(".notification_settings ").show():t(".notification_settings ").hide(),t("#notification_badge").on("change",function(e){t("#notification_badge").is(":checked")?t(".notification_settings ").show(400):t(".notification_settings ").hide(400)}),function(){var e=t("#whatsapp_cc").val(),_=t("#whatsapp_number").val();function o(){t(".ht_ctc_wn").html(e+""+_),t("#ctc_whatsapp_number").val(e+""+_)}t("#whatsapp_cc").on("change paste keyup",function(_){e=t("#whatsapp_cc").val(),o()}),t("#whatsapp_number").on("change paste keyup",function(e){_=t("#whatsapp_number").val(),o(),_&&0==_.charAt(0)?t(".ctc_wn_initial_zero").show(500):t(".ctc_wn_initial_zero").hide(500)})}(),s=t(".add_hook_value").attr("data-html"),t(document).on("click",".add_hook_value",function(){t(".ctc_hook_value").append(s)}),t(".ctc_hook_value").on("click",".hook_remove_value",function(e){e.preventDefault(),t(this).closest(".additional-value").remove()}),"yes"==(void 0!==screen.width&&screen.width>1024?"no":"yes")&&(t("#whatsapp_cc").attr("data-position","bottom"),t("#whatsapp_number").attr("data-position","bottom")),function(){t(".ga_ads_display").on("click",function(e){t(".ga_ads_checkbox").toggle(500)});var e=t("#ctc_save_changes_hover_text").text();t("#submit").attr("title",e),t("#s3_box_shadow").is(":checked")||t(".s3_box_shadow_hover").show(),t("#s3_box_shadow").on("change",function(e){t("#s3_box_shadow").is(":checked")?t(".s3_box_shadow_hover").hide(400):t(".s3_box_shadow_hover").show(500)})}();try{!function(){var e=t(".woo_single_position_select").find(":selected").val(),_=t(".woo_single_style_select").find(":selected").val();if(e&&""!==e&&"select"!==e&&t(".woo_single_position_settings").show(),e&&"select"==e?a():(_&&"1"==_||"8"==_)&&c(),t(".woo_single_position_select").on("change",function(e){var _=e.target.value,o=t(".woo_single_style_select").find(":selected").val();"select"==_?(t(".woo_single_position_settings").hide(200),a()):(t(".woo_single_position_settings").show(200),"1"!=o&&"8"!=o||c())}),t(".woo_single_style_select").on("change",function(t){var e=t.target.value;"1"==e||"8"==e?c():a()}),t("#woo_single_position_center").is(":checked")&&t(".woo_single_position_center_checked_content").show(),t("#woo_single_position_center").on("change",function(e){t("#woo_single_position_center").is(":checked")?t(".woo_single_position_center_checked_content").show(200):t(".woo_single_position_center_checked_content").hide(100)}),t("#woo_shop_add_whatsapp").is(":checked")){t(".woo_shop_add_whatsapp_settings").show();var o=t(".woo_shop_style").find(":selected").val();"1"!=o&&"8"!=o||n()}function c(){t(".woo_single_position_settings_cart_layout").show(200)}function a(){t(".woo_single_position_settings_cart_layout").hide(200)}function n(){t(".woo_shop_cart_layout").show(200)}function s(){t(".woo_shop_cart_layout").hide(200)}t("#woo_shop_add_whatsapp").on("change",function(e){if(t("#woo_shop_add_whatsapp").is(":checked")){t(".woo_shop_add_whatsapp_settings").show(200);var _=t(".woo_shop_style").find(":selected").val();"1"!=_&&"8"!=_||n()}else t(".woo_shop_add_whatsapp_settings").hide(100),s(100)}),t(".woo_shop_style").on("change",function(t){var e=t.target.value;"1"==e||"8"==e?n():s()})}(),function(){var e=["ht_ctc_s1","ht_ctc_s2","ht_ctc_s3","ht_ctc_s3_1","ht_ctc_s4","ht_ctc_s5","ht_ctc_s6","ht_ctc_s7","ht_ctc_s7_1","ht_ctc_s8","ht_ctc_s99","ht_ctc_webhooks","ht_ctc_animations","ht_ctc_notification","ht_ctc_other_settings","ht_ctc_enable_share_group","ht_ctc_debug","ht_ctc_device_settings","ht_ctc_show_hide_settings","ht_ctc_woo_1","ht_ctc_woo_shop","ctc_g_opt_in","g_content_collapsible","url_structure","ht_ctc_custom_css"];document.querySelector(".coll_active")&&t(".coll_active").each(function(){e.push(t(this).attr("data-coll_active"))});var _=["ht_ctc_device_settings","ht_ctc_show_hide_settings","ht_ctc_woo_1","ht_ctc_webhooks","ht_ctc_animations","ht_ctc_notification","g_content_collapsible","url_structure"];e.forEach(function(e){var a=o("col_"+e)?o("col_"+e):"";"open"==a?t("."+e+" li").addClass("active"):"close"==a?t("."+e+" li").removeClass("active"):_.includes(e)&&t("."+e+" li").addClass("active"),t("."+e).collapsible({onOpenEnd:function(){c("col_"+e,"open")},onCloseEnd:function(){c("col_"+e,"close")}})})}(),t(".notification_field").on("change",function(t){!function(t,e){a[t]=e;var _=JSON.stringify(a);localStorage.setItem("ht_ctc_storage",_)}("n_badge","admin_start")}),function(){t("#google_analytics").is(":checked")&&t(".ctc_ga_values").show(),t("#google_analytics").on("change",function(e){t("#google_analytics").is(":checked")?t(".ctc_ga_values").show(400):t(".ctc_ga_values").hide(200)});var e=t(".ctc_g_an_param_snippets .ht_ctc_g_an_add_param");t(document).on("click",".ctc_add_g_an_param_button",function(){var _=t(".g_an_param_order").val();_=parseInt(_);var o=e.clone();t(o).find(".g_an_param_order_ref_number").attr("name","ht_ctc_othersettings[g_an_params][]"),t(o).find(".g_an_param_order_ref_number").val("g_an_param_"+_),t(o).find(".ht_ctc_g_an_add_param_key").attr("name","ht_ctc_othersettings[g_an_param_".concat(_,"][key]")),t(o).find(".ht_ctc_g_an_add_param_value").attr("name","ht_ctc_othersettings[g_an_param_".concat(_,"][value]")),t(".ctc_new_g_an_param").append(o),_++,t(".g_an_param_order").val(_)}),t("#fb_pixel").is(":checked")&&t(".ctc_pixel_values").show(),t("#fb_pixel").on("change",function(e){t("#fb_pixel").is(":checked")?t(".ctc_pixel_values").show(400):t(".ctc_pixel_values").hide(200)});var _=t(".pixel_event_type").find(":selected").val();"trackCustom"==_?t(".pixel_custom_event").show(100):"track"==_&&t(".pixel_standard_event").show(100),t(".pixel_event_type").on("change",function(e){var _=e.target.value;"trackCustom"==_?(t(".pixel_custom_event").show(200),t(".pixel_standard_event").hide(100)):"track"==_&&(t(".pixel_standard_event").show(200),t(".pixel_custom_event").hide(100))});var o=t(".ctc_pixel_param_snippets .ht_ctc_pixel_add_param");t(document).on("click",".ctc_add_pixel_param_button",function(){var e=t(".pixel_param_order").val();e=parseInt(e);var _=o.clone();t(_).find(".pixel_param_order_ref_number").attr("name","ht_ctc_othersettings[pixel_params][]"),t(_).find(".pixel_param_order_ref_number").val("pixel_param_"+e),t(_).find(".ht_ctc_pixel_add_param_key").attr("name","ht_ctc_othersettings[pixel_param_".concat(e,"][key]")),t(_).find(".ht_ctc_pixel_add_param_value").attr("name","ht_ctc_othersettings[pixel_param_".concat(e,"][value]")),t(".ctc_new_pixel_param").append(_),e++,t(".pixel_param_order").val(e)}),t(".ctc_an_params").on("click",".an_param_remove",function(e){e.preventDefault(),t(this).closest(".ctc_an_param").remove()}),t(".analytics_count_message").on("click",function(e){t(".analytics_count_select").toggle(200)}),t(".select_analytics").on("change",function(e){var _=e.target.value;t(".analytics_count_message span").html(_)})}()}catch(t){}try{t(".ctc_sortable").sortable({cursor:"move",handle:".handle"})}catch(t){}function h(e){var a=t(e).attr("value"),n=t(e).attr("data-name")?t(e).attr("data-name"):"ht_ctc_chat_options[number]";t(e).removeAttr("name");var s=[],i=(new Date).toDateString(),l=o("country_code_date")==i?o("country_code"):"";""==l?(l="us",t.get("https://ipinfo.io",function(){},"jsonp").always(function(t){c("country_code",l=t&&t.country?t.country:"us"),c("country_code_date",i),u(l),h()})):h();var d="";function h(){s=o("pre_countries")?o("pre_countries"):[];var t={autoHideDialCode:!1,initialCountry:"auto",geoIpLookup:function(t,e){t(l)},dropdownContainer:document.body,hiddenInput:function(){return{phone:n,country:"ht_ctc_chat_options[intl_country]"}},nationalMode:!1,countryOrder:s,separateDialCode:!0,containerClass:"intl_tel_input_container",utilsScript:_.utils};d=intlTelInput(e,t),a&&a.length>8&&d.setNumber(a)}return d}function r(){t(".intl_number").on("input countrychange",function(e){var _=intlTelInput.getInstance(this);if(t(this).next('input[type="hidden"]').val(_.getNumber()),window.ht_ctc_admin_demo_var&&(window.ht_ctc_admin_demo_var.number=_.getNumber()),_.isValidNumber()){var o={number:_.getNumber()};document.dispatchEvent(new CustomEvent("ht_ctc_admin_event_valid_number",{detail:{d:o}}))}}),t(".intl_number").on("countrychange",function(t){u(intlTelInput.getInstance(this).getSelectedCountryData().iso2)})}function u(t){t=t&&""!==t?t.toUpperCase():"US";var e=o("pre_countries")?o("pre_countries"):[];e.includes(t)||(e.unshift(t),c("pre_countries",e))}!function(){function e(e,_){var o=t(e),c=t(_);function a(){"custom_url"===o.find(":selected").val()?c.show(500):c.hide(500)}a(),o.on("change",a)}e(".url_structure_d",".custom_url_desktop"),e(".url_structure_m",".custom_url_mobile")}()})})();
  • click-to-chat-for-whatsapp/trunk/new/admin/admin_assets/js/greetings.js

    r3323453 r3394807  
    1 (()=>{var e;(e=jQuery)(function(){if(document.querySelector(".pr_greetings_template"))try{!function(){var t=e(".pr_greetings_template select").find(":selected").val();function _(){e(".is_opt_in").is(":checked")?e(".pr_opt_in ").show(200):e(".pr_opt_in ").hide(200)}"no"==t||""==t?e(".g_content_collapsible").hide():e(".g_content_collapsible").show(),"greetings-1"==t&&(e(".ctc_greetings_settings.ctc_g_1").show(),e(".pr_ht_ctc_greetings_1").show(),e(".pr_ht_ctc_greetings_settings").show(),e(".ctc_greetings_notes").show(),_()),"greetings-2"==t&&(e(".ctc_greetings_settings.ctc_g_2").show(),e(".pr_ht_ctc_greetings_2").show(),e(".pr_ht_ctc_greetings_settings").show(),e(".ctc_greetings_notes").show(),_()),e(".pr_greetings_template select").on("change",function(t){var n=t.target.value;"no"==n?(e(".g_content_collapsible").hide(100),e(" .ctc_greetings_settings").hide()):(e(".g_content_collapsible").show(),"greetings-2"!=n&&"greetings-1"!=n||e(" .ctc_greetings_settings").hide(),e(".ctc_greetings_notes").show(),"greetings-1"==n&&(e(".ctc_greetings_settings.ctc_g_1").show(100),e(".pr_ht_ctc_greetings_1").show(100),_()),"greetings-2"==n&&(e(".ctc_greetings_settings.ctc_g_2").show(100),e(".pr_ht_ctc_greetings_2").show(100),_()),e(".pr_ht_ctc_greetings_settings").show())}),e(".is_opt_in").on("change",function(e){_()})}()}catch(e){}if(document.querySelector(".ctc-admin-greetings-page")||document.querySelector(".ctc-admin-woo-page"))try{!function(){var e=1,t=1e3,_=28;function n(){if(document.getElementById("header_content_ifr"))try{i()}catch(e){}else++e<_&&setTimeout(n,t)}function i(){try{for(var e=0;e<tinyMCE.editors.length;e++){var t=tinyMCE.editors[e];t.dom.setStyle(t.getBody(),"backgroundColor","#26a69a")}}catch(e){}}n()}()}catch(e){}!function(){var t;function _(){""==e(".g_header_image").val()?(e(".row_g_header_online_status").hide(),e(".row_g_header_online_status_color").hide()):(e(".row_g_header_online_status").show(),e(".g_header_online_status").is(":checked")?e(".row_g_header_online_status_color").show():e(".row_g_header_online_status_color").hide())}e(".ctc_add_image_wp").on("click",function(n){n.preventDefault(),t||(t=wp.media.frames.file_frame=wp.media({title:"Select Header Image",button:{text:"Select"},multiple:!1})).on("select",function(){if(attachment=t.state().get("selection").first().toJSON(),"undefined"==typeof attachment)return!0;image_url=attachment.url,e(".g_header_image").val(image_url),e(".g_header_image_preview").attr("src",image_url),e(".g_header_image_preview").show(),e(".ctc_remove_image_wp").show(),_(),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings_header_image",{detail:image_url}))}),t.open()}),e(".ctc_remove_image_wp").on("click",function(t){t.preventDefault(),e(".g_header_image").val(""),e(".g_header_image_preview").hide(),e(".ctc_remove_image_wp").hide(),_()}),_(),e(".g_header_online_status").on("change",function(){e(".g_header_online_status").is(":checked")?e(".row_g_header_online_status_color").show():e(".row_g_header_online_status_color").hide()})}()})})();
     1(()=>{"use strict";var e;(e=jQuery)(function(){if(document.querySelector(".pr_greetings_template"))try{!function(){var t=e(".pr_greetings_template select").find(":selected").val();function _(){e(".is_opt_in").is(":checked")?e(".pr_opt_in ").show(200):e(".pr_opt_in ").hide(200)}"no"==t||""==t?e(".g_content_collapsible").hide():e(".g_content_collapsible").show(),"greetings-1"==t&&(e(".ctc_greetings_settings.ctc_g_1").show(),e(".pr_ht_ctc_greetings_1").show(),e(".pr_ht_ctc_greetings_settings").show(),e(".ctc_greetings_notes").show(),_()),"greetings-2"==t&&(e(".ctc_greetings_settings.ctc_g_2").show(),e(".pr_ht_ctc_greetings_2").show(),e(".pr_ht_ctc_greetings_settings").show(),e(".ctc_greetings_notes").show(),_()),e(".pr_greetings_template select").on("change",function(t){var n=t.target.value;"no"==n?(e(".g_content_collapsible").hide(100),e(" .ctc_greetings_settings").hide()):(e(".g_content_collapsible").show(),"greetings-2"!=n&&"greetings-1"!=n||e(" .ctc_greetings_settings").hide(),e(".ctc_greetings_notes").show(),"greetings-1"==n&&(e(".ctc_greetings_settings.ctc_g_1").show(100),e(".pr_ht_ctc_greetings_1").show(100),_()),"greetings-2"==n&&(e(".ctc_greetings_settings.ctc_g_2").show(100),e(".pr_ht_ctc_greetings_2").show(100),_()),e(".pr_ht_ctc_greetings_settings").show())}),e(".is_opt_in").on("change",function(e){_()})}()}catch(e){}if(document.querySelector(".ctc-admin-greetings-page")||document.querySelector(".ctc-admin-woo-page"))try{!function(){var e=1,t=1e3,_=28;function n(){if(document.getElementById("header_content_ifr"))try{i()}catch(e){}else++e<_&&setTimeout(n,t)}function i(){try{for(var e=0;e<tinyMCE.editors.length;e++){var t=tinyMCE.editors[e];t.dom.setStyle(t.getBody(),"backgroundColor","#26a69a")}}catch(e){}}n()}()}catch(e){}!function(){var t;function _(){""==e(".g_header_image").val()?(e(".row_g_header_online_status").hide(),e(".row_g_header_online_status_color").hide()):(e(".row_g_header_online_status").show(),e(".g_header_online_status").is(":checked")?e(".row_g_header_online_status_color").show():e(".row_g_header_online_status_color").hide())}e(".ctc_add_image_wp").on("click",function(n){n.preventDefault(),t||(t=wp.media.frames.file_frame=wp.media({title:"Select Header Image",button:{text:"Select"},multiple:!1})).on("select",function(){if(attachment=t.state().get("selection").first().toJSON(),"undefined"==typeof attachment)return!0;image_url=attachment.url,e(".g_header_image").val(image_url),e(".g_header_image_preview").attr("src",image_url),e(".g_header_image_preview").show(),e(".ctc_remove_image_wp").show(),_(),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings_header_image",{detail:image_url}))}),t.open()}),e(".ctc_remove_image_wp").on("click",function(t){t.preventDefault(),e(".g_header_image").val(""),e(".g_header_image_preview").hide(),e(".ctc_remove_image_wp").hide(),_()}),_(),e(".g_header_online_status").on("change",function(){e(".g_header_online_status").is(":checked")?e(".row_g_header_online_status_color").show():e(".row_g_header_online_status_color").hide()})}()})})();
  • click-to-chat-for-whatsapp/trunk/new/admin/admin_demo/admin-demo.js

    r3332166 r3394807  
    1 (()=>{function t(c){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(c)}function c(c,e,_){return(e=function(c){var e=function(c,e){if("object"!=t(c)||!c)return c;var _=c[Symbol.toPrimitive];if(void 0!==_){var o=_.call(c,e||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(c)}(c,"string");return"symbol"==t(e)?e:e+""}(e))in c?Object.defineProperty(c,e,{value:_,enumerable:!0,configurable:!0,writable:!0}):c[e]=_,c}var e;(e=jQuery)(function(){var t=window.location.href,_=void 0!==document.title?document.title:"",o=void 0!==screen.width&&screen.width>1024?"no":"yes",n=window.ht_ctc_admin_demo_var?window.ht_ctc_admin_demo_var:{},s="2";try{document.dispatchEvent(new CustomEvent("ht_ctc_demo_messages",{detail:{admin_demo:{},ctc_demo_messages:function(){var t,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";clearTimeout(t),e(".ctc_ad_links").hide(),e(".ctc_demo_messages").html(c),e(".ctc_demo_messages").hide().fadeIn(500),t=setTimeout(function(){e(".ctc_demo_messages").hide(120),e(".ctc_ad_links").show(120)},9e3)}}}))}catch(t){}!function(){function i(){var c=ht_ctc_admin_demo_var.number,e=ht_ctc_admin_demo_var.pre_filled;try{var s=n.site?n.site:"";e=(e=(e=(e=(e=e.replaceAll("%","%25")).replaceAll("{site}",s)).replaceAll("{url}",t)).replaceAll("{title}",_)).replace(/\[url]/gi,t),e=encodeURIComponent(decodeURI(e))}catch(t){}var i="https://wa.me/"+c+"?text="+e,a=n.url_target_d?n.url_target_d:"_blank",r=n.url_structure_d?n.url_structure_d:"",l=n.url_structure_m?n.url_structure_m:"",d=n.custom_url_d?n.custom_url_d:"",h=n.custom_url_m?n.custom_url_m:"",m="number";"yes"==o?("wa_colon"==l&&(i="whatsapp://send?phone="+c+"&text="+e,a="_self"),"custom_url"==l&&""!==h&&(i=h,m="custom_url")):("web"==r&&(i="https://web.whatsapp.com/send?phone="+c+"&text="+e),"custom_url"==r&&""!==d&&(i=d,m="custom_url"));var g="popup"==a?"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=788,height=514,left=100,top=100":"noopener";"number"==m&&""==c?F(n.m1):"_self"==a?F(n.m2):window.open(i,a,g)}if(e(".ctc_demo_style").on("click",function(){e(".ht_ctc_chat_greetings_box").length||i()}),e("body").hasClass("toplevel_page_click-to-chat")){var a=function(){var t=e(".call_to_action").val();if(e(".ctc_demo_style .ctc_cta").text(t),e(".ctc_demo_style").hide(),e(".ctc_demo_style_"+s).show(),"close"!==l)try{e(".ht-ctc-admin-sidebar .collapsible").collapsible("close"),l="close"}catch(t){}e(".ht-ctc-admin-sidebar .collapsible").on("click",function(){e(".ctc_demo_style").hide(),L(),l="open"}),L(),e(".ctc_ad_links").show()},r=function(){"left"==e(".position_right_left").val()?(e(".ctc_s_2 .ctc_cta").css("order","1"),e(".ctc_s_3 .ctc_cta").css("order","1"),e(".ctc_s_3_1 .ctc_cta").css("order","1"),e(".ctc_s_7 .ctc_cta").css("order","1"),e(".ctc_s_5 .s5_content ").css("order","1"),e(".ctc_s_5 .s5_content ").removeClass("right").addClass("left"),e(".ctc_s_7_1 .ctc_cta").css({order:"1","padding-left":"0px","padding-right":"21px"})):(e(".ctc_s_2 .ctc_cta").css("order","0"),e(".ctc_s_3 .ctc_cta").css("order","0"),e(".ctc_s_3_1 .ctc_cta").css("order","0"),e(".ctc_s_7 .ctc_cta").css("order","0"),e(".ctc_s_5 .s5_content").css("order","0"),e(".ctc_s_5 .s5_content ").removeClass("left").addClass("right"),e(".ctc_s_7_1 .ctc_cta").css({order:"0","padding-left":"21px","padding-right":"0px"}))},l="";e(".select_style_item").on("click",function(){s=e(".select_style_desktop").val(),a()}),e(".m_select_style_item").on("click",function(){s=e(".select_style_mobile").val(),a()}),e(".ctc_ad_main_page_on_change_input").on("change input paste",function(){a()}),e(".ctc_ad_main_page_on_change_input_update_var").on("change input paste",function(){n[e(this).attr("data-var")]=e(this).val(),a()}),document.addEventListener("ht_ctc_admin_event_valid_number",function(t){a()}),e(".ctc_demo_position").on("change input paste",function(){e(this).val(),function(){var t=e(".ctc_demo_position").val(),_="top"==t?"bottom":"top",o=e(".position_right_left").val(),n="left"==o?"right":"left",s=/^\d+$/,i=e(".position_right_left_value").val();""==i?i="0px":s.test(i)&&(i+="px");var l=e(".position_bottom_top_value").val();""==l?l="0px":s.test(l)&&(l+="px");var d=c(c(c(c({},t,l),o,i),_,"unset"),n,"unset");e(".ctc_demo_load").css(d),r(),a(),L(),e(".ctc_menu_at_demo .ctc_ad_page_link").remove()}()})}if(e("body").hasClass("click-to-chat_page_click-to-chat-other-settings")){var d=function(){e(".ctc_demo_style").removeClass(v);var t=e(".select_an_type").val();v="ht_ctc_an_"+t,e(".ctc_demo_style").addClass(v);var c=e("#an_delay").val(),_=e("#an_itr").val(),o={"animation-delay":c?c+"s":"0","animation-iteration-count":_||"1"};e(".ctc_demo_style.ht_ctc_animation").css(o),"no-animation"==t?e(".ctc_an_demo_btn").hide():e(".ctc_an_demo_btn").show()},h=function(){e(".ctc_demo_style").removeClass(v),e(".ctc_demo_style").removeClass(f),e(".ctc_demo_style.ht_ctc_animation").css({"animation-delay":"unset","animation-iteration-count":"unset"}),e(".ctc_demo_style").hide();var t=e(".show_effect").val();"From Center"==t?(f="ht_ctc_an_entry_center",e(".ctc_demo_style").addClass(f),e(".ctc_demo_style").show()):"From Corner"==t&&setTimeout(function(){e(".ctc_demo_style").show(180)},100),"no-show-effects"==t?(e(".ctc_demo_style").show(),e(".ctc_ee_demo_btn").hide()):e(".ctc_ee_demo_btn").show()},m=function(){if(e(".notification_badge").is(":checked")){b="yes",e(".ctc_ad_notification").show();var t=e(".field_notification_bg_color").val();e(".ctc_ad_badge").css("background-color",t);var c=e(".field_notification_text_color").val();e(".ctc_ad_badge").css("color",c)}else b="no",e(".ctc_ad_notification").hide()},g=function(){var t=e(".field_notification_border_color").val();border=""!==t?"2px solid "+t:"none",e(".ctc_ad_badge").css("border",border)},u=function(){if(document.querySelector(".ctc_nb")){var t=e(".ctc_ad_badge").closest(".ctc_demo_style");e(".ctc_ad_badge").css({top:e(t).find(".ctc_nb").attr("data-nb_top"),right:e(t).find(".ctc_nb").attr("data-nb_right")})}};e(".ctc_ad_page_link").remove(),e(".ctc_ad_links").css("margin","0 50px").show(),e(".ctc_demo_style").show();var v="";e(".select_an_type").val(),e(".select_an_type").on("change",function(t){d()}),e(".ctc_an_demo_btn").on("click",function(t){e(".ctc_demo_style").removeClass(v),setTimeout(function(){d()},100)});var f="";e(".select_an_type").val(),e(".show_effect").on("change",function(t){h()}),e(".ctc_ee_demo_btn").on("click",function(t){e(".ctc_demo_style").removeClass(f),setTimeout(function(){h()},100)});var p,b="";if(e(".notification_badge").is(":checked")){b="yes";var y=e(".field_notification_time").val();y=y&&""!=y?y:0,setTimeout(function(){m(),u()},1e3*y)}e(".notification_badge").on("change",function(t){m(),u(),g()}),e(".notification_border_color_field .wp-picker-container").on("click",function(t){g()}),e(document).on("change, input, keyup",".field_notification_bg_color, .field_notification_text_color, .field_notification_border_color",function(){m()}),e(".field_notification_count").on("input",function(){var t=e(this).val();e(".ctc_ad_badge").text(t)}),e(".field_notification_time").on("change",function(){e(".ctc_ad_notification").hide(),clearTimeout(p);var t=e(this).val();t=t&&""!=t?t:0,p=setTimeout(function(){"yes"==b&&e(".ctc_ad_notification").show()},1e3*t)})}if(e("body").hasClass("click-to-chat_page_click-to-chat-customize-styles")&&(e(".ctc_ad_page_link").remove(),e(".ctc_ad_links").css("margin","0 50px"),e(".ht_ctc_customize_style").on("click",function(){var t=e(this).attr("data-style");e(".ctc_demo_style_"+t).show(),e(".ctc_demo_style").not(".ctc_demo_style_"+t).hide(),e(".ctc_ad_links").show()}),e(".wp-picker-container").on("click",function(){var t=e(this).closest(".ht_ctc_customize_style"),c=e(t).attr("data-style");c&&(e(".ctc_demo_style_"+c).show(),e(".ctc_demo_style").not(".ctc_demo_style_"+c).hide())}),e(".ctc_s_3_1").hover(function(){e(".ctc_s_3_1 .ht_ctc_padding").css("background-color",e("#s3_1_bg_color_hover").val()),!e("#s3_box_shadow").is(":checked")&&e("#s3_box_shadow_hover").is(":checked")&&e(".ctc_s_3_1 .ht_ctc_padding").css("box-shadow","0px 0px 11px rgba(0,0,0,.5)")},function(){e(".ctc_s_3_1 .ht_ctc_padding").css("background-color",e("#s3_1_bg_color").val()),!e("#s3_box_shadow").is(":checked")&&e("#s3_box_shadow_hover").is(":checked")&&e(".ctc_s_3_1 .ht_ctc_padding").css("box-shadow","unset")}),e("#s3_box_shadow").on("change",function(t){e("#s3_box_shadow").is(":checked")?e(".ctc_s_3_1 .ht_ctc_padding").css("box-shadow","0px 0px 11px rgba(0,0,0,.5)"):e(".ctc_s_3_1 .ht_ctc_padding").css("box-shadow","unset")}),e(".s4_img_position").on("change",function(t){var c=e(this).val();"left"==c?(e(".ctc_s_4 .s4_img").css("margin","0 8px 0 -12px"),e(".ctc_s_4 .s4_img").css("order","0")):"right"==c&&(e(".ctc_s_4 .s4_img").css("margin","0 -12px 0 8px"),e(".ctc_s_4 .s4_img").css("order","1"))}),e(".ctc_s_6").hover(function(){e(".ctc_s_6").css({color:e("#s6_txt_color_on_hover").val(),"text-decoration":e("#s6_txt_decoration_on_hover").find(":selected").val()})},function(){e(".ctc_s_6").css({color:e("#s6_txt_color").val(),"text-decoration":e("#s6_txt_decoration").find(":selected").val()})}),e(".ctc_s_7").hover(function(){e(".ctc_s_7 svg path").css("fill",e("#s7_icon_color_hover").val()),e(".ctc_s_7 .ctc_s_7_icon_padding").css("background-color",e("#s7_border_color_hover").val())},function(){e(".ctc_s_7 svg path").css("fill",e("#s7_icon_color").val()),e(".ctc_s_7 .ctc_s_7_icon_padding").css("background-color",e("#s7_border_color").val())}),e(".ctc_s_7_1").hover(function(){e(".ctc_s_7_1 svg path").css("fill",e("#s7_1_icon_color_hover").val()),e(".ctc_s_7_1 .ctc_s_7_1_cta").css("color",e("#s7_1_icon_color_hover").val()),e(".ctc_s_7_1").css("background-color",e("#s7_1_bgcolor_hover").val()),e(".ctc_s_7_1 .ctc_s_7_icon_padding").css("background-color",e("#s7_1_bgcolor_hover").val())},function(){e(".ctc_s_7_1 svg path").css("fill",e("#s7_1_icon_color").val()),e(".ctc_s_7_1 .ctc_s_7_1_cta").css("color",e("#s7_1_icon_color").val()),e(".ctc_s_7_1").css("background-color",e("#s7_1_bgcolor").val()),e(".ctc_s_7_1 .ctc_s_7_icon_padding").css("background-color",e("#s7_1_bgcolor").val())}),e(".ctc_s_8").hover(function(){e(".ctc_s_8 .s_8").css({"background-color":e("#s8_bg_color_on_hover").val()}),e(".ctc_s_8 .s8_span").css("color",e("#s8_txt_color_on_hover").val()),e(".ctc_s_8 svg path").css("fill",e("#s8_icon_color_on_hover").val())},function(){e(".ctc_s_8 .s_8").css({"background-color":e("#s8_bg_color").val()}),e(".ctc_s_8 .s8_span").css("color",e("#s8_txt_color").val()),e(".ctc_s_8 svg path").css("fill",e("#s8_icon_color").val())}),e(".ctc_oninput").on("change paste keyup",function(t){var c=e(this).attr("data-update-type");L();var _=e(this).val(),o=e(this).attr("data-update-selector");if(c&&o)if("text"==c)e(o).text(_);else if("cta"==c){var n=e(o).closest(".ctc_demo_style");"show"==_?(e(o).show(),e(o).removeClass("ht-ctc-cta-hover"),e(n).removeAttr("title")):"hide"==_?(e(o).hide(),e(o).removeClass("ht-ctc-cta-hover"),e(n).attr("title","Call to action")):"hover"==_&&(e(o).hide(),e(o).addClass("ht-ctc-cta-hover"),e(n).removeAttr("title"))}else{e(o).css(c,_);var s=e(this).attr("data-update-type-2");s&&e(o).css(s,_)}})),e("body").hasClass("click-to-chat_page_click-to-chat-greetings")){var w=function(){try{var t=tinyMCE.get("header_content").getContent(),c=e(".greetings_header_image img").attr("src"),_=tinyMCE.get("main_content").getContent(),o=tinyMCE.get("bottom_content").getContent();t||c?(e(".ctc_g_heading").show(),c?e(".ctc_g_header_content_image").attr("src",c).show():e(".ctc_g_header_content_image").hide(),t?e(".ctc_g_header_content").html(t).show():e(".ctc_g_header_content").hide()):e(".ctc_g_heading").hide(),_?(e(".ctc_g_content").show(),e(".ctc_g_message_box").html(_).show()):(e(".ctc_g_message_box").hide(),e(".ctc_g_content").hide()),o?e(".ctc_g_bottom").html(o).show():e(".ctc_g_bottom").hide()}catch(t){}},k=function(){T=e(".pr_greetings_template select").find(":selected").val(),e(".ctc_demo_greetings").hide();var t="ctc_demo_greetings_"+T;e(".ctc_cta_stick").remove(),e("."+t).length&&e("."+t).show()},x=function(){e(".ht_ctc_chat_greetings_box").hide("slow")},C=function(){e(".g_header_online_status").is(":checked")?e(".for_greetings_header_image_badge").addClass("g_header_badge_online").show():e(".for_greetings_header_image_badge").removeClass("g_header_badge_online").hide()};if(e(".ctc_demo_style").show(),"undefined"==typeof tinyMCE)return;var T=e(".pr_greetings_template select").find(":selected").val();"no"==T?e(".ctc_demo_greetings").hide():k(),w();var E=0,S=setInterval(function(){(tinyMCE.get("header_content").getContent()||E>20)&&(w(),clearInterval(S)),E++},200);try{for(var I=0;I<tinyMCE.editors.length;I++)tinyMCE.editors[I].on("change paste keyup",function(t){w()})}catch(t){}e(".ctc_remove_image_wp").on("click",function(){var t=e(".greetings_header_image");t.is(":visible")&&(t.css("display","none"),e(".greetings_header_image img").attr("src",""),w())}),document.addEventListener("ht_ctc_event_greetings_header_image",function(t){var c,_;c=t.detail,_=e(".greetings_header_image"),e(".greetings_header_image img").attr("src",c),w(),_.show()}),e('input[name="ht_ctc_greetings_options[call_to_action]"]').on("input",function(){var t=e(this).val();e(".ctc_demo_style .ctc_g_sentbutton .ctc_cta").text(t)}),e(".pr_g_size select").on("change",function(){var t=e(".pr_g_size select").val(),c="330px";"s"==t?c="300px":"m"==t?c="330px":"l"==t&&(c="360px"),e(".ht_ctc_chat_greetings_box").css({"min-width":c}).show()}),e(".pr_greetings_template select").on("change",function(){k()}),e(".ctc_ad_page_link").remove(),e(".ctc_ad_links").css("margin","0 50px").show(),e(".ht_ctc_chat_greetings_box").length&&(e(document).on("click",".ht_ctc_chat_style ",function(){e(".ht_ctc_chat_greetings_box").is(":visible")?x():e(".ht_ctc_chat_greetings_box").show("slow")}),e(document).on("click",".ctc_greetings_close_btn",function(){x()})),C(),e(document).on("change",".g_header_online_status",function(){C()}),e(document).on("click",".ht_ctc_chat_greetings_box_link",function(t){t.preventDefault(),i(),setTimeout(function(){x()},500)}),e(document).on("change","#ctc_opt",function(){e(this).is(":checked")&&(i(),x())})}var M,z,A,j,P;function F(){var t,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";clearTimeout(t),e(".ctc_ad_links").hide(),e(".ctc_demo_messages").html(c),e(".ctc_demo_messages").hide().fadeIn(500),t=setTimeout(function(){e(".ctc_demo_messages").hide(120),e(".ctc_ad_links").show(120)},9e3)}function L(){e(".ctc_demo_messages").hide(),e(".ctc_ad_links").hide(),e(".ctc_no_demo_notice").hide()}e(".ctc_no_demo").on("change paste keyup",function(){L(),clearTimeout(M),e(".ctc_no_demo_notice").hide().fadeIn(500),M=setTimeout(function(){e(".ctc_no_demo_notice").hide(120),e(".ctc_ad_links").show(120)},5e3)}),e(".ctc_demo_style").hover(function(){e(this).find(".ht-ctc-cta-hover").show(120)},function(){e(".ctc_demo_style .ht-ctc-cta-hover").hide(100)}),z=e(".ctc_ad_show_demo"),A=e(".ctc_ad_hide_demo"),j=e(".ctc_demo_load"),P=e(".ctc_ad_page_link"),z.on("click",function(){j.show(),z.hide(),A.show(),P.show()}),A.on("click",function(){j.hide(),A.hide(),z.show(),P.hide()})}()})})();
     1(()=>{"use strict";function t(c){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(c)}function c(c,e,_){return(e=function(c){var e=function(c,e){if("object"!=t(c)||!c)return c;var _=c[Symbol.toPrimitive];if(void 0!==_){var o=_.call(c,e||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(c)}(c,"string");return"symbol"==t(e)?e:e+""}(e))in c?Object.defineProperty(c,e,{value:_,enumerable:!0,configurable:!0,writable:!0}):c[e]=_,c}var e;(e=jQuery)(function(){var t=window.location.href,_=void 0!==document.title?document.title:"",o=void 0!==screen.width&&screen.width>1024?"no":"yes",n=window.ht_ctc_admin_demo_var?window.ht_ctc_admin_demo_var:{},s="2";try{document.dispatchEvent(new CustomEvent("ht_ctc_demo_messages",{detail:{admin_demo:{},ctc_demo_messages:function(){var t,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";clearTimeout(t),e(".ctc_ad_links").hide(),e(".ctc_demo_messages").html(c),e(".ctc_demo_messages").hide().fadeIn(500),t=setTimeout(function(){e(".ctc_demo_messages").hide(120),e(".ctc_ad_links").show(120)},9e3)}}}))}catch(t){}!function(){function i(){var c=ht_ctc_admin_demo_var.number,e=ht_ctc_admin_demo_var.pre_filled;try{var s=n.site?n.site:"";e=(e=(e=(e=(e=e.replaceAll("%","%25")).replaceAll("{site}",s)).replaceAll("{url}",t)).replaceAll("{title}",_)).replace(/\[url]/gi,t),e=encodeURIComponent(decodeURI(e))}catch(t){}var i="https://wa.me/"+c+"?text="+e,a=n.url_target_d?n.url_target_d:"_blank",r=n.url_structure_d?n.url_structure_d:"",l=n.url_structure_m?n.url_structure_m:"",d=n.custom_url_d?n.custom_url_d:"",h=n.custom_url_m?n.custom_url_m:"",m="number";"yes"==o?("wa_colon"==l&&(i="whatsapp://send?phone="+c+"&text="+e,a="_self"),"custom_url"==l&&""!==h&&(i=h,m="custom_url")):("web"==r&&(i="https://web.whatsapp.com/send?phone="+c+"&text="+e),"custom_url"==r&&""!==d&&(i=d,m="custom_url"));var g="popup"==a?"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=788,height=514,left=100,top=100":"noopener";"number"==m&&""==c?F(n.m1):"_self"==a?F(n.m2):window.open(i,a,g)}if(e(".ctc_demo_style").on("click",function(){e(".ht_ctc_chat_greetings_box").length||i()}),e("body").hasClass("toplevel_page_click-to-chat")){var a=function(){var t=e(".call_to_action").val();if(e(".ctc_demo_style .ctc_cta").text(t),e(".ctc_demo_style").hide(),e(".ctc_demo_style_"+s).show(),"close"!==l)try{e(".ht-ctc-admin-sidebar .collapsible").collapsible("close"),l="close"}catch(t){}e(".ht-ctc-admin-sidebar .collapsible").on("click",function(){e(".ctc_demo_style").hide(),L(),l="open"}),L(),e(".ctc_ad_links").show()},r=function(){"left"==e(".position_right_left").val()?(e(".ctc_s_2 .ctc_cta").css("order","1"),e(".ctc_s_3 .ctc_cta").css("order","1"),e(".ctc_s_3_1 .ctc_cta").css("order","1"),e(".ctc_s_7 .ctc_cta").css("order","1"),e(".ctc_s_5 .s5_content ").css("order","1"),e(".ctc_s_5 .s5_content ").removeClass("right").addClass("left"),e(".ctc_s_7_1 .ctc_cta").css({order:"1","padding-left":"0px","padding-right":"21px"})):(e(".ctc_s_2 .ctc_cta").css("order","0"),e(".ctc_s_3 .ctc_cta").css("order","0"),e(".ctc_s_3_1 .ctc_cta").css("order","0"),e(".ctc_s_7 .ctc_cta").css("order","0"),e(".ctc_s_5 .s5_content").css("order","0"),e(".ctc_s_5 .s5_content ").removeClass("left").addClass("right"),e(".ctc_s_7_1 .ctc_cta").css({order:"0","padding-left":"21px","padding-right":"0px"}))},l="";e(".select_style_item").on("click",function(){s=e(".select_style_desktop").val(),a()}),e(".m_select_style_item").on("click",function(){s=e(".select_style_mobile").val(),a()}),e(".ctc_ad_main_page_on_change_input").on("change input paste",function(){a()}),e(".ctc_ad_main_page_on_change_input_update_var").on("change input paste",function(){n[e(this).attr("data-var")]=e(this).val(),a()}),document.addEventListener("ht_ctc_admin_event_valid_number",function(t){a()}),e(".ctc_demo_position").on("change input paste",function(){e(this).val(),function(){var t=e(".ctc_demo_position").val(),_="top"==t?"bottom":"top",o=e(".position_right_left").val(),n="left"==o?"right":"left",s=/^\d+$/,i=e(".position_right_left_value").val();""==i?i="0px":s.test(i)&&(i+="px");var l=e(".position_bottom_top_value").val();""==l?l="0px":s.test(l)&&(l+="px");var d=c(c(c(c({},t,l),o,i),_,"unset"),n,"unset");e(".ctc_demo_load").css(d),r(),a(),L(),e(".ctc_menu_at_demo .ctc_ad_page_link").remove()}()})}if(e("body").hasClass("click-to-chat_page_click-to-chat-other-settings")){var d=function(){e(".ctc_demo_style").removeClass(v);var t=e(".select_an_type").val();v="ht_ctc_an_"+t,e(".ctc_demo_style").addClass(v);var c=e("#an_delay").val(),_=e("#an_itr").val(),o={"animation-delay":c?c+"s":"0","animation-iteration-count":_||"1"};e(".ctc_demo_style.ht_ctc_animation").css(o),"no-animation"==t?e(".ctc_an_demo_btn").hide():e(".ctc_an_demo_btn").show()},h=function(){e(".ctc_demo_style").removeClass(v),e(".ctc_demo_style").removeClass(f),e(".ctc_demo_style.ht_ctc_animation").css({"animation-delay":"unset","animation-iteration-count":"unset"}),e(".ctc_demo_style").hide();var t=e(".show_effect").val();"From Center"==t?(f="ht_ctc_an_entry_center",e(".ctc_demo_style").addClass(f),e(".ctc_demo_style").show()):"From Corner"==t&&setTimeout(function(){e(".ctc_demo_style").show(180)},100),"no-show-effects"==t?(e(".ctc_demo_style").show(),e(".ctc_ee_demo_btn").hide()):e(".ctc_ee_demo_btn").show()},m=function(){if(e(".notification_badge").is(":checked")){b="yes",e(".ctc_ad_notification").show();var t=e(".field_notification_bg_color").val();e(".ctc_ad_badge").css("background-color",t);var c=e(".field_notification_text_color").val();e(".ctc_ad_badge").css("color",c)}else b="no",e(".ctc_ad_notification").hide()},g=function(){var t=e(".field_notification_border_color").val();border=""!==t?"2px solid "+t:"none",e(".ctc_ad_badge").css("border",border)},u=function(){if(document.querySelector(".ctc_nb")){var t=e(".ctc_ad_badge").closest(".ctc_demo_style");e(".ctc_ad_badge").css({top:e(t).find(".ctc_nb").attr("data-nb_top"),right:e(t).find(".ctc_nb").attr("data-nb_right")})}};e(".ctc_ad_page_link").remove(),e(".ctc_ad_links").css("margin","0 50px").show(),e(".ctc_demo_style").show();var v="";e(".select_an_type").val(),e(".select_an_type").on("change",function(t){d()}),e(".ctc_an_demo_btn").on("click",function(t){e(".ctc_demo_style").removeClass(v),setTimeout(function(){d()},100)});var f="";e(".select_an_type").val(),e(".show_effect").on("change",function(t){h()}),e(".ctc_ee_demo_btn").on("click",function(t){e(".ctc_demo_style").removeClass(f),setTimeout(function(){h()},100)});var p,b="";if(e(".notification_badge").is(":checked")){b="yes";var y=e(".field_notification_time").val();y=y&&""!=y?y:0,setTimeout(function(){m(),u()},1e3*y)}e(".notification_badge").on("change",function(t){m(),u(),g()}),e(".notification_border_color_field .wp-picker-container").on("click",function(t){g()}),e(document).on("change, input, keyup",".field_notification_bg_color, .field_notification_text_color, .field_notification_border_color",function(){m()}),e(".field_notification_count").on("input",function(){var t=e(this).val();e(".ctc_ad_badge").text(t)}),e(".field_notification_time").on("change",function(){e(".ctc_ad_notification").hide(),clearTimeout(p);var t=e(this).val();t=t&&""!=t?t:0,p=setTimeout(function(){"yes"==b&&e(".ctc_ad_notification").show()},1e3*t)})}if(e("body").hasClass("click-to-chat_page_click-to-chat-customize-styles")&&(e(".ctc_ad_page_link").remove(),e(".ctc_ad_links").css("margin","0 50px"),e(".ht_ctc_customize_style").on("click",function(){var t=e(this).attr("data-style");e(".ctc_demo_style_"+t).show(),e(".ctc_demo_style").not(".ctc_demo_style_"+t).hide(),e(".ctc_ad_links").show()}),e(".wp-picker-container").on("click",function(){var t=e(this).closest(".ht_ctc_customize_style"),c=e(t).attr("data-style");c&&(e(".ctc_demo_style_"+c).show(),e(".ctc_demo_style").not(".ctc_demo_style_"+c).hide())}),e(".ctc_s_3_1").hover(function(){e(".ctc_s_3_1 .ht_ctc_padding").css("background-color",e("#s3_1_bg_color_hover").val()),!e("#s3_box_shadow").is(":checked")&&e("#s3_box_shadow_hover").is(":checked")&&e(".ctc_s_3_1 .ht_ctc_padding").css("box-shadow","0px 0px 11px rgba(0,0,0,.5)")},function(){e(".ctc_s_3_1 .ht_ctc_padding").css("background-color",e("#s3_1_bg_color").val()),!e("#s3_box_shadow").is(":checked")&&e("#s3_box_shadow_hover").is(":checked")&&e(".ctc_s_3_1 .ht_ctc_padding").css("box-shadow","unset")}),e("#s3_box_shadow").on("change",function(t){e("#s3_box_shadow").is(":checked")?e(".ctc_s_3_1 .ht_ctc_padding").css("box-shadow","0px 0px 11px rgba(0,0,0,.5)"):e(".ctc_s_3_1 .ht_ctc_padding").css("box-shadow","unset")}),e(".s4_img_position").on("change",function(t){var c=e(this).val();"left"==c?(e(".ctc_s_4 .s4_img").css("margin","0 8px 0 -12px"),e(".ctc_s_4 .s4_img").css("order","0")):"right"==c&&(e(".ctc_s_4 .s4_img").css("margin","0 -12px 0 8px"),e(".ctc_s_4 .s4_img").css("order","1"))}),e(".ctc_s_6").hover(function(){e(".ctc_s_6").css({color:e("#s6_txt_color_on_hover").val(),"text-decoration":e("#s6_txt_decoration_on_hover").find(":selected").val()})},function(){e(".ctc_s_6").css({color:e("#s6_txt_color").val(),"text-decoration":e("#s6_txt_decoration").find(":selected").val()})}),e(".ctc_s_7").hover(function(){e(".ctc_s_7 svg path").css("fill",e("#s7_icon_color_hover").val()),e(".ctc_s_7 .ctc_s_7_icon_padding").css("background-color",e("#s7_border_color_hover").val())},function(){e(".ctc_s_7 svg path").css("fill",e("#s7_icon_color").val()),e(".ctc_s_7 .ctc_s_7_icon_padding").css("background-color",e("#s7_border_color").val())}),e(".ctc_s_7_1").hover(function(){e(".ctc_s_7_1 svg path").css("fill",e("#s7_1_icon_color_hover").val()),e(".ctc_s_7_1 .ctc_s_7_1_cta").css("color",e("#s7_1_icon_color_hover").val()),e(".ctc_s_7_1").css("background-color",e("#s7_1_bgcolor_hover").val()),e(".ctc_s_7_1 .ctc_s_7_icon_padding").css("background-color",e("#s7_1_bgcolor_hover").val())},function(){e(".ctc_s_7_1 svg path").css("fill",e("#s7_1_icon_color").val()),e(".ctc_s_7_1 .ctc_s_7_1_cta").css("color",e("#s7_1_icon_color").val()),e(".ctc_s_7_1").css("background-color",e("#s7_1_bgcolor").val()),e(".ctc_s_7_1 .ctc_s_7_icon_padding").css("background-color",e("#s7_1_bgcolor").val())}),e(".ctc_s_8").hover(function(){e(".ctc_s_8 .s_8").css({"background-color":e("#s8_bg_color_on_hover").val()}),e(".ctc_s_8 .s8_span").css("color",e("#s8_txt_color_on_hover").val()),e(".ctc_s_8 svg path").css("fill",e("#s8_icon_color_on_hover").val())},function(){e(".ctc_s_8 .s_8").css({"background-color":e("#s8_bg_color").val()}),e(".ctc_s_8 .s8_span").css("color",e("#s8_txt_color").val()),e(".ctc_s_8 svg path").css("fill",e("#s8_icon_color").val())}),e(".ctc_oninput").on("change paste keyup",function(t){var c=e(this).attr("data-update-type");L();var _=e(this).val(),o=e(this).attr("data-update-selector");if(c&&o)if("text"==c)e(o).text(_);else if("cta"==c){var n=e(o).closest(".ctc_demo_style");"show"==_?(e(o).show(),e(o).removeClass("ht-ctc-cta-hover"),e(n).removeAttr("title")):"hide"==_?(e(o).hide(),e(o).removeClass("ht-ctc-cta-hover"),e(n).attr("title","Call to action")):"hover"==_&&(e(o).hide(),e(o).addClass("ht-ctc-cta-hover"),e(n).removeAttr("title"))}else{e(o).css(c,_);var s=e(this).attr("data-update-type-2");s&&e(o).css(s,_)}})),e("body").hasClass("click-to-chat_page_click-to-chat-greetings")){var w=function(){try{var t=tinyMCE.get("header_content").getContent(),c=e(".greetings_header_image img").attr("src"),_=tinyMCE.get("main_content").getContent(),o=tinyMCE.get("bottom_content").getContent();t||c?(e(".ctc_g_heading").show(),c?e(".ctc_g_header_content_image").attr("src",c).show():e(".ctc_g_header_content_image").hide(),t?e(".ctc_g_header_content").html(t).show():e(".ctc_g_header_content").hide()):e(".ctc_g_heading").hide(),_?(e(".ctc_g_content").show(),e(".ctc_g_message_box").html(_).show()):(e(".ctc_g_message_box").hide(),e(".ctc_g_content").hide()),o?e(".ctc_g_bottom").html(o).show():e(".ctc_g_bottom").hide()}catch(t){}},k=function(){T=e(".pr_greetings_template select").find(":selected").val(),e(".ctc_demo_greetings").hide();var t="ctc_demo_greetings_"+T;e(".ctc_cta_stick").remove(),e("."+t).length&&e("."+t).show()},x=function(){e(".ht_ctc_chat_greetings_box").hide("slow")},C=function(){e(".g_header_online_status").is(":checked")?e(".for_greetings_header_image_badge").addClass("g_header_badge_online").show():e(".for_greetings_header_image_badge").removeClass("g_header_badge_online").hide()};if(e(".ctc_demo_style").show(),"undefined"==typeof tinyMCE)return;var T=e(".pr_greetings_template select").find(":selected").val();"no"==T?e(".ctc_demo_greetings").hide():k(),w();var E=0,S=setInterval(function(){(tinyMCE.get("header_content").getContent()||E>20)&&(w(),clearInterval(S)),E++},200);try{for(var I=0;I<tinyMCE.editors.length;I++)tinyMCE.editors[I].on("change paste keyup",function(t){w()})}catch(t){}e(".ctc_remove_image_wp").on("click",function(){var t=e(".greetings_header_image");t.is(":visible")&&(t.css("display","none"),e(".greetings_header_image img").attr("src",""),w())}),document.addEventListener("ht_ctc_event_greetings_header_image",function(t){var c,_;c=t.detail,_=e(".greetings_header_image"),e(".greetings_header_image img").attr("src",c),w(),_.show()}),e('input[name="ht_ctc_greetings_options[call_to_action]"]').on("input",function(){var t=e(this).val();e(".ctc_demo_style .ctc_g_sentbutton .ctc_cta").text(t)}),e(".pr_g_size select").on("change",function(){var t=e(".pr_g_size select").val(),c="330px";"s"==t?c="300px":"m"==t?c="330px":"l"==t&&(c="360px"),e(".ht_ctc_chat_greetings_box").css({"min-width":c}).show()}),e(".pr_greetings_template select").on("change",function(){k()}),e(".ctc_ad_page_link").remove(),e(".ctc_ad_links").css("margin","0 50px").show(),e(".ht_ctc_chat_greetings_box").length&&(e(document).on("click",".ht_ctc_chat_style ",function(){e(".ht_ctc_chat_greetings_box").is(":visible")?x():e(".ht_ctc_chat_greetings_box").show("slow")}),e(document).on("click",".ctc_greetings_close_btn",function(){x()})),C(),e(document).on("change",".g_header_online_status",function(){C()}),e(document).on("click",".ht_ctc_chat_greetings_box_link",function(t){t.preventDefault(),i(),setTimeout(function(){x()},500)}),e(document).on("change","#ctc_opt",function(){e(this).is(":checked")&&(i(),x())})}var M,z,A,j,P;function F(){var t,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";clearTimeout(t),e(".ctc_ad_links").hide(),e(".ctc_demo_messages").html(c),e(".ctc_demo_messages").hide().fadeIn(500),t=setTimeout(function(){e(".ctc_demo_messages").hide(120),e(".ctc_ad_links").show(120)},9e3)}function L(){e(".ctc_demo_messages").hide(),e(".ctc_ad_links").hide(),e(".ctc_no_demo_notice").hide()}e(".ctc_no_demo").on("change paste keyup",function(){L(),clearTimeout(M),e(".ctc_no_demo_notice").hide().fadeIn(500),M=setTimeout(function(){e(".ctc_no_demo_notice").hide(120),e(".ctc_ad_links").show(120)},5e3)}),e(".ctc_demo_style").hover(function(){e(this).find(".ht-ctc-cta-hover").show(120)},function(){e(".ctc_demo_style .ht-ctc-cta-hover").hide(100)}),z=e(".ctc_ad_show_demo"),A=e(".ctc_ad_hide_demo"),j=e(".ctc_demo_load"),P=e(".ctc_ad_page_link"),z.on("click",function(){j.show(),z.hide(),A.show(),P.show()}),A.on("click",function(){j.hide(),A.hide(),z.show(),P.hide()})}()})})();
  • click-to-chat-for-whatsapp/trunk/new/class-ht-ctc.php

    r3369409 r3394807  
    115115        private function hooks() {
    116116
    117             // init
     117            // Init.
    118118            add_action( 'init', array( $this, 'init' ), 0 );
    119119
    120             // enable shortcodes in widget area.
     120            // Enable shortcodes in widget area.
    121121            add_filter( 'widget_text', 'do_shortcode' );
    122122
    123             // add_filter( 'the_excerpt', 'do_shortcode');
    124 
    125             // settings page link
     123            // Settings page link.
    126124            add_filter( 'plugin_action_links_' . HT_CTC_PLUGIN_BASENAME, array( 'HT_CTC_Register', 'plugin_action_links' ) );
    127125
    128             // when plugin updated - check version diff
     126            // When plugin updated - check version diff.
    129127            add_action( 'plugins_loaded', array( 'HT_CTC_Register', 'version_check' ) );
    130128        }
     
    145143            $this->device_type = new HT_CTC_IsMobile();
    146144
    147             // stub
     145            // Stub
    148146            // Rest api - init
    149147            // include_once HT_CTC_PLUGIN_DIR .'new/inc/api/class-ht-ctc-rest-api.php';
     
    151149            // hooks
    152150            include_once HT_CTC_PLUGIN_DIR . 'new/inc/commons/class-ht-ctc-hooks.php';
    153             // woo init
     151            // WooCommerce init.
    154152            include_once HT_CTC_PLUGIN_DIR . 'new/tools/woo/ht-ctc-woo.php';
    155153
    156             // is_admin ? include file to admin area : include files to non-admin area
     154            // Is admin? Include file to admin area : include files to non-admin area.
    157155            if ( is_admin() ) {
    158                 // admin
    159                 // admin main file
     156                // Admin main file.
    160157                include_once HT_CTC_PLUGIN_DIR . 'new/admin/admin.php';
    161158            } else {
    162                 // front
    163                 // main file - Enable - Chat, Group, Share
     159                // Front - main file - Enable - Chat, Group, Share.
    164160                include_once HT_CTC_PLUGIN_DIR . 'new/inc/class-ht-ctc-main.php';
    165                 // scripts
     161                // Scripts.
    166162                include_once HT_CTC_PLUGIN_DIR . 'new/inc/commons/class-ht-ctc-scripts.php';
    167163            }
  • click-to-chat-for-whatsapp/trunk/new/inc/assets/js/app.js

    r3386465 r3394807  
    1 (()=>{function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);e&&(c=c.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,c)}return n}function e(e){for(var c=1;c<arguments.length;c++){var o=null!=arguments[c]?arguments[c]:{};c%2?t(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=c(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}var o;(o=jQuery)(function(){var t=window.location.href,n=void 0!==document.title?document.title:"",a="no",r=document.querySelector(".ht-ctc-chat");try{a=void 0!==navigator.userAgent&&navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i)?"yes":"no"}catch(t){}"no"==a&&(a=void 0!==screen.width&&screen.width>1025?"no":"yes");var i={};function _(){localStorage.getItem("ht_ctc_storage")&&(i=localStorage.getItem("ht_ctc_storage"),i=JSON.parse(i))}function s(t){return!!i[t]&&i[t]}function u(t,e){_(),i[t]=e;var n=JSON.stringify(i);localStorage.setItem("ht_ctc_storage",n)}_();var l={},d={};function h(){var t=document.querySelector(".ht_ctc_chat_data");t&&t.remove(),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:l}})),function(){if(r){document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){l.schedule&&"yes"==l.schedule?document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:l,display_chat:g,ht_ctc_chat:t,online_content:b}})):(g(t),b())}(r),r.addEventListener("click",function(){document.querySelector(".ht_ctc_chat_greetings_box")||S(r)}),function(){if(r){var t=document.querySelector(".ht_ctc_chat_greetings_box");t&&r.addEventListener("click",function(e){e.target.closest(".ht_ctc_chat_style")&&(t.classList.contains("ctc_greetings_opened")?p("user_closed"):v("user_opened"))}),r.addEventListener("click",function(t){t.target.closest(".ctc_greetings_close_btn")&&p("user_closed")})}}(),r&&r.addEventListener("click",function(t){if(t.target.closest(".ht_ctc_chat_greetings_box_link")){t.preventDefault();var e=document.querySelector("#ctc_opt");if(e)if(e.checked||s("g_optin"))S(r),m();else{var n=document.querySelector(".ctc_opt_in");n&&(n.style.display="block",n.style.opacity="0",setTimeout(function(){n.style.transition="opacity 0.4s",n.style.opacity="1"},10))}else S(r),m();document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))}});var t=document.querySelector("#ctc_opt");t&&t.addEventListener("change",function(){if(t.checked){var e=document.querySelector(".ctc_opt_in");e&&(e.style.transition="opacity 0.1s ease-out",e.style.opacity="0",setTimeout(function(){e.style.display="none"},100)),u("g_optin","y"),setTimeout(function(){S(r),m()},500)}})}}(),o(document).on("click",".ht-ctc-sc-chat",function(){S(this)}),document.addEventListener("click",function(t){var e=t.target.closest(".ctc_chat, #ctc_chat");e&&(S(e),e.classList.contains("ctc_woo_place")&&t.preventDefault());var n=t.target.closest('[href="#ctc_chat"]');n&&(t.preventDefault(),S(n))})}function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"open";w();var e=document.querySelector(".ht-ctc-chat .ctc_cta_stick");e&&e.remove();var n=document.querySelector(".ht_ctc_chat_greetings_box");n&&("init"==t?o(".ht_ctc_chat_greetings_box").show(70):o(".ht_ctc_chat_greetings_box").show(400),n.classList.add("ctc_greetings_opened"),n.classList.remove("ctc_greetings_closed")),u("g_action",t),"user_opened"==t&&u("g_user_action",t),function(){if(document.querySelector(".ctc_greetings_modal")&&!document.querySelector(".ht_ctc_modal_backdrop")){var t=function(e){"Escape"===e.key&&(p("user_closed"),document.removeEventListener("keydown",t))},e=document.createElement("div");e.className="ht_ctc_modal_backdrop",document.body.appendChild(e),e.addEventListener("click",function(){p("user_closed")}),document.addEventListener("keydown",t)}}()}function m(){f(),setTimeout(function(){p("chat_clicked")},500)}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"close";f(),"element"==t?o(".ht_ctc_chat_greetings_box").hide(70):o(".ht_ctc_chat_greetings_box").hide(400);var e=document.querySelector(".ht_ctc_chat_greetings_box");e&&(e.classList.add("ctc_greetings_closed"),e.classList.remove("ctc_greetings_opened")),u("g_action",t),"user_closed"==t&&u("g_user_action",t)}function f(){var t=document.querySelector(".ht_ctc_modal_backdrop");t&&t.remove()}function g(t){var e;"yes"==a?"show"==l.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=l.pos_m+l.css,y(t)):"show"==l.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=l.pos_d+l.css,y(t))}function y(t){try{o(t).show(parseInt(l.se))}catch(e){t.style.display="block"}!function(){var t=document.querySelector(".ht_ctc_chat_greetings_box");if(t){if(l.g_device){if("yes"!==a&&"mobile"===l.g_device)return void t.remove();if("yes"===a&&"desktop"===l.g_device)return void t.remove()}document.dispatchEvent(new CustomEvent("ht_ctc_event_after_chat_displayed",{detail:{ctc:l,greetings_open:v,greetings_close:p}})),l.g_init&&"user_closed"!==s("g_user_action")&&("default"===l.g_init?"yes"!==a&&v("init"):"open"===l.g_init&&v("init"));var e=document.querySelectorAll('.ctc_greetings, #ctc_greetings, .ctc_greetings_now, [href="#ctc_greetings"]');e.length>0&&e.forEach(function(t){t.addEventListener("click",function(t){t.preventDefault(),p("element"),v("element")})})}}(),function(){if(document.querySelector(".ht_ctc_notification")&&"stop"!==s("n_badge")){var t=document.querySelector(".ctc_nb");if(t){var e=t.closest(".ht_ctc_style"),n=document.querySelector(".ht_ctc_badge");if(e&&n){var c,a,r=null===(c=e.querySelector(".ctc_nb"))||void 0===c?void 0:c.getAttribute("data-nb_top"),i=null===(a=e.querySelector(".ctc_nb"))||void 0===a?void 0:a.getAttribute("data-nb_right");null!==r&&(n.style.top=r),null!==i&&(n.style.right=i)}}var _=l.n_time?1e3*l.n_time:150;setTimeout(function(){o(".ht_ctc_notification").show(400)},_)}}(),function(t){var e=t.classList.contains("ht_ctc_entry_animation")?1200:120;setTimeout(function(){t.classList.add("ht_ctc_animation",l.ani)},e),o(".ht-ctc-chat").hover(function(){o(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){o(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}(t)}function b(){document.querySelector(".for_greetings_header_image_badge")&&(document.querySelectorAll(".for_greetings_header_image_badge").forEach(function(t){t.classList.add("g_header_badge_online")}),o(".for_greetings_header_image_badge").show())}function w(){var t=document.querySelector(".ht_ctc_notification");t&&(u("n_badge","stop"),t.remove())}function k(o){if(l.analytics&&"session"==l.analytics){if(sessionStorage.getItem("ht_ctc_analytics"))return;sessionStorage.setItem("ht_ctc_analytics","done")}function a(e){var c=l.chat_number&&""!==l.chat_number?l.chat_number:l.number;try{document.dispatchEvent(new CustomEvent("ht_ctc_event_apply_variables",{detail:{v:e}})),e=(e=(e=(e=void 0!==window.apply_variables_value?window.apply_variables_value:e).replace("{number}",c)).replace("{title}",n)).replace("{url}",t)}catch(t){}return e}var r;r="event_"+Math.floor(1e4+9e4*Math.random()),l.ctc_pixel_event_id=r,document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var i=l.chat_number&&""!==l.chat_number?l.chat_number:l.number,_={},s="Click to Chat for WhatsApp",u="chat: "+i,h=n+", "+t;if(l.ga){var v=l.g_an_event_name&&""!==l.g_an_event_name?l.g_an_event_name:"click to chat";v=a(v),d.g_an_params&&d.g_an_params.forEach(function(t){if(d[t]){var e=d[t],n=e.key,c=e.value;n=a(n),c=a(c),_[n]=c}});var m=0,p="no",f=[];if("undefined"!=typeof dataLayer)try{var g=function(t,e){t&&"string"==typeof t&&""!==t.trim()&&(f.includes(t)||f.push(t))};"undefined"==typeof gtag&&(window.gtag=function(){dataLayer.push(arguments)},p="yes");var y=[];try{var b,w=null===(b=window.google_tag_data)||void 0===b?void 0:b.tidr;null!=w&&w.destination&&"object"===c(w.destination)&&Object.keys(w.destination).forEach(function(t){g(t)})}catch(t){}try{var k,S=null===(k=window.google_tag_data)||void 0===k||null===(k=k.tidr)||void 0===k?void 0:k.container;S&&"object"===c(S)&&Object.values(S).forEach(function(t){Array.isArray(t.destinations)&&t.destinations.forEach(function(t){"string"==typeof t&&t.startsWith("G-")&&g(t)})})}catch(t){}try{Array.isArray(window.dataLayer)&&window.dataLayer.forEach(function(t){Array.isArray(t)&&"config"===t[0]&&"string"==typeof t[1]?g(t[1]):null!=t&&t.send_to&&"string"==typeof t.send_to&&g(t.send_to)})}catch(t){}f.forEach(function(t){var e;e=(e=t).toUpperCase(),y.includes(e)||(y.push(e),(e.startsWith("G-")||e.startsWith("GT-"))&&(_.send_to=e,gtag("event",v,_),m++))})}catch(t){}0==m&&"no"==p&&("undefined"!=typeof gtag?gtag("event",v,_):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",s,u,h):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",s,u,h))}if("undefined"!=typeof dataLayer){dataLayer.push({event:"Click to Chat",type:"chat",number:i,title:n,url:t,event_category:s,event_label:h,event_action:u,ref:"dataLayer push"});var E=e(e({},null!=_?_:{}),{},{event:null!=v?v:"chat_click",ref:"dataLayer push ga admin values"});dataLayer.push(E)}if(l.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),l.fb&&"undefined"!=typeof fbq){var x=l.pixel_event_name&&""!==l.pixel_event_name?l.pixel_event_name:"Click to Chat by HoliThemes",q=d.pixel_event_type&&""!==d.pixel_event_type?d.pixel_event_type:"trackCustom",O={};d.pixel_params&&d.pixel_params.forEach(function(t){if(d[t]){var e=d[t],n=e.key,c=e.value;n=a(n),c=a(c),O[n]=c}}),l.ctc_pixel_event_id="",fbq(q,x,O,{eventID:r})}}function S(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:l}}));var e=l.number,n=l.pre_filled;if(t.hasAttribute("data-number")&&""!==t.getAttribute("data-number")&&(e=t.getAttribute("data-number")),t.hasAttribute("data-pre_filled")){var c=t.getAttribute("data-pre_filled")||"";n=(l.prefix_pre_filled?l.prefix_pre_filled:"")+c}try{n=n.replaceAll("%","%25");var r=window.location.href;n=n.replace(/\[url]/gi,r),n=encodeURIComponent(decodeURI(n))}catch(t){}if(""!=e||l.custom_url_m&&""!==l.custom_url_m||l.custom_url_d&&""!==l.custom_url_d){var i="https://wa.me/"+e+"?text="+n,_=l.url_target_d?l.url_target_d:"_blank";"yes"==a?(l.url_structure_m&&"wa_colon"==l.url_structure_m&&(i="whatsapp://send?phone="+e+"&text="+n,_="_self"),l.custom_url_m&&""!==l.custom_url_m&&(i=l.custom_url_m)):(l.url_structure_d&&"web"==l.url_structure_d&&(i="https://web.whatsapp.com/send?phone="+e+"&text="+n),l.custom_url_d&&""!==l.custom_url_d&&(i=l.custom_url_d));var s="popup"==_?"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=788,height=514,left=100,top=100":"noopener";window.open(i,_,s),l.chat_number=e,k(),function(t){if(l.hook_url){var e={};if(l.hook_v){e=void 0!==E?E:l.hook_v;var n={},c=1;e.forEach(function(t){n["value"+c]=t,c++}),l.hook_v=n}document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:l,number:t}}));var a=l.hook_url;if(e=l.hook_v,l.webhook_format&&"json"==l.webhook_format)var r=e;else r=JSON.stringify(e);o.ajax({url:a,type:"POST",mode:"no-cors",data:r,success:function(t){}})}}(e),w()}else if(l.no_number){var u=document.querySelector(".ctc-no-number-message");u&&(u.style.display="block")}}"undefined"!=typeof ht_ctc_chat_var&&(l=ht_ctc_chat_var),"undefined"!=typeof ht_ctc_variables&&(d=ht_ctc_variables),0===Object.keys(l).length||0===Object.keys(d).length?function(){if(0===Object.keys(l).length&&document.querySelector(".ht_ctc_chat_data"))try{var t,e=(null===(t=document.querySelector(".ht_ctc_chat_data"))||void 0===t?void 0:t.getAttribute("data-settings"))||"";l=JSON.parse(e),window.ht_ctc_chat_var=l}catch(t){}0===Object.keys(d).length&&(d={g_an_event_name:"click to chat",pixel_event_name:"Click to Chat by HoliThemes",pixel_event_type:"trackCustom",g_an_params:["g_an_param_1","g_an_param_2","g_an_param_3"],g_an_param_1:{key:"number",value:"{number}"},g_an_param_2:{key:"title",value:"{title}"},g_an_param_3:{key:"url",value:"{url}"},pixel_params:["pixel_param_1","pixel_param_2","pixel_param_3","pixel_param_4"],pixel_param_1:{key:"Category",value:"Click to Chat for WhatsApp"},pixel_param_2:{key:"return_type",value:"chat"},pixel_param_3:{key:"ID",value:"{number}"},pixel_param_4:{key:"Title",value:"{title}"}},window.ht_ctc_variables=d),h()}():h();var E=l.hook_v?l.hook_v:""})})();
     1(()=>{"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);e&&(c=c.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,c)}return n}function e(e){for(var c=1;c<arguments.length;c++){var o=null!=arguments[c]?arguments[c]:{};c%2?t(Object(o),!0).forEach(function(t){n(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=c(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}var o;(o=jQuery)(function(){var t=window.location.href,n=void 0!==document.title?document.title:"",a="no",r=document.querySelector(".ht-ctc-chat");try{a=void 0!==navigator.userAgent&&navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i)?"yes":"no"}catch(t){}"no"==a&&(a=void 0!==screen.width&&screen.width>1025?"no":"yes");var i={};function _(){localStorage.getItem("ht_ctc_storage")&&(i=localStorage.getItem("ht_ctc_storage"),i=JSON.parse(i))}function s(t){return!!i[t]&&i[t]}function u(t,e){_(),i[t]=e;var n=JSON.stringify(i);localStorage.setItem("ht_ctc_storage",n)}_();var l={},d={};function h(){var t=document.querySelector(".ht_ctc_chat_data");t&&t.remove(),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:l}})),function(){if(r){document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){l.schedule&&"yes"==l.schedule?document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:l,display_chat:g,ht_ctc_chat:t,online_content:b}})):(g(t),b())}(r),r.addEventListener("click",function(){document.querySelector(".ht_ctc_chat_greetings_box")||S(r)}),function(){if(r){var t=document.querySelector(".ht_ctc_chat_greetings_box");t&&r.addEventListener("click",function(e){e.target.closest(".ht_ctc_chat_style")&&(t.classList.contains("ctc_greetings_opened")?p("user_closed"):v("user_opened"))}),r.addEventListener("click",function(t){t.target.closest(".ctc_greetings_close_btn")&&p("user_closed")})}}(),r&&r.addEventListener("click",function(t){if(t.target.closest(".ht_ctc_chat_greetings_box_link")){t.preventDefault();var e=document.querySelector("#ctc_opt");if(e)if(e.checked||s("g_optin"))S(r),m();else{var n=document.querySelector(".ctc_opt_in");n&&(n.style.display="block",n.style.opacity="0",setTimeout(function(){n.style.transition="opacity 0.4s",n.style.opacity="1"},10))}else S(r),m();document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))}});var t=document.querySelector("#ctc_opt");t&&t.addEventListener("change",function(){if(t.checked){var e=document.querySelector(".ctc_opt_in");e&&(e.style.transition="opacity 0.1s ease-out",e.style.opacity="0",setTimeout(function(){e.style.display="none"},100)),u("g_optin","y"),setTimeout(function(){S(r),m()},500)}})}}(),o(document).on("click",".ht-ctc-sc-chat",function(){S(this)}),document.addEventListener("click",function(t){var e=t.target.closest(".ctc_chat, #ctc_chat");e&&(S(e),e.classList.contains("ctc_woo_place")&&t.preventDefault());var n=t.target.closest('[href="#ctc_chat"]');n&&(t.preventDefault(),S(n))})}function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"open";w();var e=document.querySelector(".ht-ctc-chat .ctc_cta_stick");e&&e.remove();var n=document.querySelector(".ht_ctc_chat_greetings_box");n&&("init"==t?o(".ht_ctc_chat_greetings_box").show(70):o(".ht_ctc_chat_greetings_box").show(400),n.classList.add("ctc_greetings_opened"),n.classList.remove("ctc_greetings_closed")),u("g_action",t),"user_opened"==t&&u("g_user_action",t),function(){if(document.querySelector(".ctc_greetings_modal")&&!document.querySelector(".ht_ctc_modal_backdrop")){var t=function(e){"Escape"===e.key&&(p("user_closed"),document.removeEventListener("keydown",t))},e=document.createElement("div");e.className="ht_ctc_modal_backdrop",document.body.appendChild(e),e.addEventListener("click",function(){p("user_closed")}),document.addEventListener("keydown",t)}}()}function m(){f(),setTimeout(function(){p("chat_clicked")},500)}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"close";f(),"element"==t?o(".ht_ctc_chat_greetings_box").hide(70):o(".ht_ctc_chat_greetings_box").hide(400);var e=document.querySelector(".ht_ctc_chat_greetings_box");e&&(e.classList.add("ctc_greetings_closed"),e.classList.remove("ctc_greetings_opened")),u("g_action",t),"user_closed"==t&&u("g_user_action",t)}function f(){var t=document.querySelector(".ht_ctc_modal_backdrop");t&&t.remove()}function g(t){var e;"yes"==a?"show"==l.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=l.pos_m+l.css,y(t)):"show"==l.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=l.pos_d+l.css,y(t))}function y(t){try{o(t).show(parseInt(l.se))}catch(e){t.style.display="block"}!function(){var t=document.querySelector(".ht_ctc_chat_greetings_box");if(t){if(l.g_device){if("yes"!==a&&"mobile"===l.g_device)return void t.remove();if("yes"===a&&"desktop"===l.g_device)return void t.remove()}document.dispatchEvent(new CustomEvent("ht_ctc_event_after_chat_displayed",{detail:{ctc:l,greetings_open:v,greetings_close:p}})),l.g_init&&"user_closed"!==s("g_user_action")&&("default"===l.g_init?"yes"!==a&&v("init"):"open"===l.g_init&&v("init"));var e=document.querySelectorAll('.ctc_greetings, #ctc_greetings, .ctc_greetings_now, [href="#ctc_greetings"]');e.length>0&&e.forEach(function(t){t.addEventListener("click",function(t){t.preventDefault(),p("element"),v("element")})})}}(),function(){if(document.querySelector(".ht_ctc_notification")&&"stop"!==s("n_badge")){var t=document.querySelector(".ctc_nb");if(t){var e=t.closest(".ht_ctc_style"),n=document.querySelector(".ht_ctc_badge");if(e&&n){var c,a,r=null===(c=e.querySelector(".ctc_nb"))||void 0===c?void 0:c.getAttribute("data-nb_top"),i=null===(a=e.querySelector(".ctc_nb"))||void 0===a?void 0:a.getAttribute("data-nb_right");null!==r&&(n.style.top=r),null!==i&&(n.style.right=i)}}var _=l.n_time?1e3*l.n_time:150;setTimeout(function(){o(".ht_ctc_notification").show(400)},_)}}(),function(t){var e=t.classList.contains("ht_ctc_entry_animation")?1200:120;setTimeout(function(){t.classList.add("ht_ctc_animation",l.ani)},e),o(".ht-ctc-chat").hover(function(){o(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){o(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}(t)}function b(){document.querySelector(".for_greetings_header_image_badge")&&(document.querySelectorAll(".for_greetings_header_image_badge").forEach(function(t){t.classList.add("g_header_badge_online")}),o(".for_greetings_header_image_badge").show())}function w(){var t=document.querySelector(".ht_ctc_notification");t&&(u("n_badge","stop"),t.remove())}function k(o){if(l.analytics&&"session"==l.analytics){if(sessionStorage.getItem("ht_ctc_analytics"))return;sessionStorage.setItem("ht_ctc_analytics","done")}function a(e){var c=l.chat_number&&""!==l.chat_number?l.chat_number:l.number;try{document.dispatchEvent(new CustomEvent("ht_ctc_event_apply_variables",{detail:{v:e}})),e=(e=(e=(e=void 0!==window.apply_variables_value?window.apply_variables_value:e).replace("{number}",c)).replace("{title}",n)).replace("{url}",t)}catch(t){}return e}var r;r="event_"+Math.floor(1e4+9e4*Math.random()),l.ctc_pixel_event_id=r,document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var i=l.chat_number&&""!==l.chat_number?l.chat_number:l.number,_={},s="Click to Chat for WhatsApp",u="chat: "+i,h=n+", "+t;if(l.ga){var v=l.g_an_event_name&&""!==l.g_an_event_name?l.g_an_event_name:"click to chat";v=a(v),d.g_an_params&&d.g_an_params.forEach(function(t){if(d[t]){var e=d[t],n=e.key,c=e.value;n=a(n),c=a(c),_[n]=c}});var m=0,p="no",f=[];if("undefined"!=typeof dataLayer)try{var g=function(t,e){t&&"string"==typeof t&&""!==t.trim()&&(f.includes(t)||f.push(t))};"undefined"==typeof gtag&&(window.gtag=function(){dataLayer.push(arguments)},p="yes");var y=[];try{var b,w=null===(b=window.google_tag_data)||void 0===b?void 0:b.tidr;null!=w&&w.destination&&"object"===c(w.destination)&&Object.keys(w.destination).forEach(function(t){g(t)})}catch(t){}try{var k,S=null===(k=window.google_tag_data)||void 0===k||null===(k=k.tidr)||void 0===k?void 0:k.container;S&&"object"===c(S)&&Object.values(S).forEach(function(t){Array.isArray(t.destinations)&&t.destinations.forEach(function(t){"string"==typeof t&&t.startsWith("G-")&&g(t)})})}catch(t){}try{Array.isArray(window.dataLayer)&&window.dataLayer.forEach(function(t){Array.isArray(t)&&"config"===t[0]&&"string"==typeof t[1]?g(t[1]):null!=t&&t.send_to&&"string"==typeof t.send_to&&g(t.send_to)})}catch(t){}f.forEach(function(t){var e;e=(e=t).toUpperCase(),y.includes(e)||(y.push(e),(e.startsWith("G-")||e.startsWith("GT-"))&&(_.send_to=e,gtag("event",v,_),m++))})}catch(t){}0==m&&"no"==p&&("undefined"!=typeof gtag?gtag("event",v,_):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",s,u,h):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",s,u,h))}if("undefined"!=typeof dataLayer){dataLayer.push({event:"Click to Chat",type:"chat",number:i,title:n,url:t,event_category:s,event_label:h,event_action:u,ref:"dataLayer push"});var E=e(e({},null!=_?_:{}),{},{event:null!=v?v:"chat_click",ref:"dataLayer push ga admin values"});dataLayer.push(E)}if(l.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),l.fb&&"undefined"!=typeof fbq){var x=l.pixel_event_name&&""!==l.pixel_event_name?l.pixel_event_name:"Click to Chat by HoliThemes",q=d.pixel_event_type&&""!==d.pixel_event_type?d.pixel_event_type:"trackCustom",O={};d.pixel_params&&d.pixel_params.forEach(function(t){if(d[t]){var e=d[t],n=e.key,c=e.value;n=a(n),c=a(c),O[n]=c}}),l.ctc_pixel_event_id="",fbq(q,x,O,{eventID:r})}}function S(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:l}}));var e=l.number,n=l.pre_filled;if(t.hasAttribute("data-number")&&""!==t.getAttribute("data-number")&&(e=t.getAttribute("data-number")),t.hasAttribute("data-pre_filled")){var c=t.getAttribute("data-pre_filled")||"";n=(l.prefix_pre_filled?l.prefix_pre_filled:"")+c}try{n=n.replaceAll("%","%25");var r=window.location.href;n=n.replace(/\[url]/gi,r),n=encodeURIComponent(decodeURI(n))}catch(t){}if(""!=e||l.custom_url_m&&""!==l.custom_url_m||l.custom_url_d&&""!==l.custom_url_d){var i="https://wa.me/"+e+"?text="+n,_=l.url_target_d?l.url_target_d:"_blank";"yes"==a?(l.url_structure_m&&"wa_colon"==l.url_structure_m&&(i="whatsapp://send?phone="+e+"&text="+n,_="_self"),l.custom_url_m&&""!==l.custom_url_m&&(i=l.custom_url_m)):(l.url_structure_d&&"web"==l.url_structure_d&&(i="https://web.whatsapp.com/send?phone="+e+"&text="+n),l.custom_url_d&&""!==l.custom_url_d&&(i=l.custom_url_d));var s="popup"==_?"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=788,height=514,left=100,top=100":"noopener";window.open(i,_,s),l.chat_number=e,k(),function(t){if(l.hook_url){var e={};if(l.hook_v){e=void 0!==E?E:l.hook_v;var n={},c=1;e.forEach(function(t){n["value"+c]=t,c++}),l.hook_v=n}document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:l,number:t}}));var a=l.hook_url;if(e=l.hook_v,l.webhook_format&&"json"==l.webhook_format)var r=e;else r=JSON.stringify(e);o.ajax({url:a,type:"POST",mode:"no-cors",data:r,success:function(t){}})}}(e),w()}else if(l.no_number){var u=document.querySelector(".ctc-no-number-message");u&&(u.style.display="block")}}"undefined"!=typeof ht_ctc_chat_var&&(l=ht_ctc_chat_var),"undefined"!=typeof ht_ctc_variables&&(d=ht_ctc_variables),0===Object.keys(l).length||0===Object.keys(d).length?function(){if(0===Object.keys(l).length&&document.querySelector(".ht_ctc_chat_data"))try{var t,e=(null===(t=document.querySelector(".ht_ctc_chat_data"))||void 0===t?void 0:t.getAttribute("data-settings"))||"";l=JSON.parse(e),window.ht_ctc_chat_var=l}catch(t){}0===Object.keys(d).length&&(d={g_an_event_name:"click to chat",pixel_event_name:"Click to Chat by HoliThemes",pixel_event_type:"trackCustom",g_an_params:["g_an_param_1","g_an_param_2","g_an_param_3"],g_an_param_1:{key:"number",value:"{number}"},g_an_param_2:{key:"title",value:"{title}"},g_an_param_3:{key:"url",value:"{url}"},pixel_params:["pixel_param_1","pixel_param_2","pixel_param_3","pixel_param_4"],pixel_param_1:{key:"Category",value:"Click to Chat for WhatsApp"},pixel_param_2:{key:"return_type",value:"chat"},pixel_param_3:{key:"ID",value:"{number}"},pixel_param_4:{key:"Title",value:"{title}"}},window.ht_ctc_variables=d),h()}():h();var E=l.hook_v?l.hook_v:""})})();
  • click-to-chat-for-whatsapp/trunk/new/inc/assets/js/group.js

    r3323453 r3394807  
    1 (()=>{var t;(t=jQuery)(function(){var e,a=window.location.href,o=void 0!==screen.width&&screen.width>1024?"no":"yes",n=void 0!==document.title?document.title:"";function i(e){try{var a=parseInt(e.getAttribute("data-show_effect"));t(e).show(a)}catch(t){e.style.display="block"}var o=e.getAttribute("data-an_type"),n=t(e).hasClass("ht_ctc_entry_animation")?1200:120;setTimeout(function(){e.classList.add("ht_ctc_animation",o)},n),t(".ht-ctc-group").hover(function(){t(".ht-ctc-group .ht-ctc-cta-hover").show(220)},function(){t(".ht-ctc-group .ht-ctc-cta-hover").hide(100)})}function c(t){var e=t.getAttribute("data-group_id"),o="Click to Chat for WhatsApp",i="group: "+e,c=n+", "+a;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",i,{event_category:o,event_label:c}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",o,i,c):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",o,i,c)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:o,event_label:c,event_action:i}),"yes"==t.getAttribute("data-ga_ads")&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"group",ID:e,Title:n,URL:a})}(e=document.querySelector(".ht-ctc-group"))&&(function(t){if("yes"==o){if("show"==t.getAttribute("data-display_mobile")){(n=document.querySelector(".ht_ctc_desktop_group"))&&n.remove();var e=t.getAttribute("data-css"),a=t.getAttribute("data-position_mobile");t.style.cssText=a+e,i(t)}}else if("show"==t.getAttribute("data-display_desktop")){var n;(n=document.querySelector(".ht_ctc_mobile_group"))&&n.remove(),e=t.getAttribute("data-css");var c=t.getAttribute("data-position");t.style.cssText=c+e,i(t)}}(e),e.addEventListener("click",function(){var t=e.getAttribute("data-group_id");window.open("https://chat.whatsapp.com/"+t,"_blank","noopener"),c(e)})),t(document).on("click",".ht-ctc-sc-group",function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),c(this)})})})();
     1(()=>{"use strict";var t;(t=jQuery)(function(){var e,a=window.location.href,o=void 0!==screen.width&&screen.width>1024?"no":"yes",n=void 0!==document.title?document.title:"";function i(e){try{var a=parseInt(e.getAttribute("data-show_effect"));t(e).show(a)}catch(t){e.style.display="block"}var o=e.getAttribute("data-an_type"),n=t(e).hasClass("ht_ctc_entry_animation")?1200:120;setTimeout(function(){e.classList.add("ht_ctc_animation",o)},n),t(".ht-ctc-group").hover(function(){t(".ht-ctc-group .ht-ctc-cta-hover").show(220)},function(){t(".ht-ctc-group .ht-ctc-cta-hover").hide(100)})}function c(t){var e=t.getAttribute("data-group_id"),o="Click to Chat for WhatsApp",i="group: "+e,c=n+", "+a;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",i,{event_category:o,event_label:c}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",o,i,c):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",o,i,c)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:o,event_label:c,event_action:i}),"yes"==t.getAttribute("data-ga_ads")&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"group",ID:e,Title:n,URL:a})}(e=document.querySelector(".ht-ctc-group"))&&(function(t){if("yes"==o){if("show"==t.getAttribute("data-display_mobile")){(n=document.querySelector(".ht_ctc_desktop_group"))&&n.remove();var e=t.getAttribute("data-css"),a=t.getAttribute("data-position_mobile");t.style.cssText=a+e,i(t)}}else if("show"==t.getAttribute("data-display_desktop")){var n;(n=document.querySelector(".ht_ctc_mobile_group"))&&n.remove(),e=t.getAttribute("data-css");var c=t.getAttribute("data-position");t.style.cssText=c+e,i(t)}}(e),e.addEventListener("click",function(){var t=e.getAttribute("data-group_id");window.open("https://chat.whatsapp.com/"+t,"_blank","noopener"),c(e)})),t(document).on("click",".ht-ctc-sc-group",function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),c(this)})})})();
  • click-to-chat-for-whatsapp/trunk/new/inc/assets/js/share.js

    r3323453 r3394807  
    1 (()=>{var t;(t=jQuery)(function(){var e=window.location.href,a="no",n="no";try{void 0!==navigator.userAgent&&navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i)&&(a="yes",navigator.userAgent.match(/iPhone/i)&&(n="yes"))}catch(t){}"no"==a&&(a=void 0!==screen.width&&screen.width>1025?"no":"yes");var i,o=void 0!==document.title?document.title:"";function r(e){try{var a=parseInt(e.getAttribute("data-show_effect"));t(e).show(a)}catch(t){e.style.display="block"}!function(e){var a=e.getAttribute("data-an_type"),n=t(e).hasClass("ht_ctc_entry_animation")?1200:120;setTimeout(function(){e.classList.add("ht_ctc_animation",a)},n),t(".ht-ctc-share").hover(function(){t(".ht-ctc-share .ht-ctc-cta-hover").show(220)},function(){t(".ht-ctc-share .ht-ctc-cta-hover").hide(100)})}(e)}function c(t){var a=t.getAttribute("data-share_text"),n="Click to Chat for WhatsApp",i="share: "+a,r=o+", "+e;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",i,{event_category:n,event_label:r}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",n,i,r):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",n,i,r)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:n,event_label:r,event_action:i}),"yes"==t.getAttribute("data-ga_ads")&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"share",ID:a,Title:o,URL:e})}"undefined"!=typeof ht_ctc_share_var&&ht_ctc_share_var,(i=document.querySelector(".ht-ctc-share"))&&(function(t){if("yes"==a){if("show"==t.getAttribute("data-display_mobile")){(i=document.querySelector(".ht_ctc_desktop_share"))&&i.remove();var e=t.getAttribute("data-css"),n=t.getAttribute("data-position_mobile");t.style.cssText=n+e,r(t)}}else if("show"==t.getAttribute("data-display_desktop")){var i;(i=document.querySelector(".ht_ctc_mobile_share"))&&i.remove(),e=t.getAttribute("data-css");var o=t.getAttribute("data-position");t.style.cssText=o+e,r(t)}}(i),i.addEventListener("click",function(){var t;(function(t){var e=t.getAttribute("data-share_text"),i=t.getAttribute("data-webandapi"),o="api";"webapi"==i&&(o="yes"==a?"api":"web");var r="https://"+o+".whatsapp.com/send",c="_blank";"yes"==n&&(c="_self"),window.open(r+"?text="+e,c,"noopener")})(t=i),c(t)})),t(document).on("click",".ht-ctc-sc-share",function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),c(this)})})})();
     1(()=>{"use strict";var t;(t=jQuery)(function(){var e=window.location.href,a="no",n="no";try{void 0!==navigator.userAgent&&navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i)&&(a="yes",navigator.userAgent.match(/iPhone/i)&&(n="yes"))}catch(t){}"no"==a&&(a=void 0!==screen.width&&screen.width>1025?"no":"yes");var i,o=void 0!==document.title?document.title:"";function r(e){try{var a=parseInt(e.getAttribute("data-show_effect"));t(e).show(a)}catch(t){e.style.display="block"}!function(e){var a=e.getAttribute("data-an_type"),n=t(e).hasClass("ht_ctc_entry_animation")?1200:120;setTimeout(function(){e.classList.add("ht_ctc_animation",a)},n),t(".ht-ctc-share").hover(function(){t(".ht-ctc-share .ht-ctc-cta-hover").show(220)},function(){t(".ht-ctc-share .ht-ctc-cta-hover").hide(100)})}(e)}function c(t){var a=t.getAttribute("data-share_text"),n="Click to Chat for WhatsApp",i="share: "+a,r=o+", "+e;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",i,{event_category:n,event_label:r}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",n,i,r):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",n,i,r)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:n,event_label:r,event_action:i}),"yes"==t.getAttribute("data-ga_ads")&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"share",ID:a,Title:o,URL:e})}"undefined"!=typeof ht_ctc_share_var&&ht_ctc_share_var,(i=document.querySelector(".ht-ctc-share"))&&(function(t){if("yes"==a){if("show"==t.getAttribute("data-display_mobile")){(i=document.querySelector(".ht_ctc_desktop_share"))&&i.remove();var e=t.getAttribute("data-css"),n=t.getAttribute("data-position_mobile");t.style.cssText=n+e,r(t)}}else if("show"==t.getAttribute("data-display_desktop")){var i;(i=document.querySelector(".ht_ctc_mobile_share"))&&i.remove(),e=t.getAttribute("data-css");var o=t.getAttribute("data-position");t.style.cssText=o+e,r(t)}}(i),i.addEventListener("click",function(){var t;(function(t){var e=t.getAttribute("data-share_text"),i=t.getAttribute("data-webandapi"),o="api";"webapi"==i&&(o="yes"==a?"api":"web");var r="https://"+o+".whatsapp.com/send",c="_blank";"yes"==n&&(c="_self"),window.open(r+"?text="+e,c,"noopener")})(t=i),c(t)})),t(document).on("click",".ht-ctc-sc-share",function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),c(this)})})})();
  • click-to-chat-for-whatsapp/trunk/new/inc/assets/js/woo.js

    r3323453 r3394807  
    1 (()=>{var t;(t=jQuery)(function(){try{document.querySelector(".single_add_to_cart_button")||document.querySelector(".add_to_cart_button")?(o=document.querySelector(".single_add_to_cart_button"),c=document.querySelector(".button.add_to_cart_button")||document.querySelector(".add_to_cart_button"),r(".ctc_woo_single_cart_layout .s1_btn",o),r(".ctc_woo_shop_cart_layout .s1_btn",c,!0),n(".ctc_woo_shop_cart_layout .s_8",c),n(".ctc_woo_single_cart_layout .s_8",o)):document.querySelector(".ctc_woo_place")&&e()}catch(t){}var o,c;function e(){document.querySelector(".ctc_woo_schedule")||(t(".ctc_woo_place").css({display:t(".ctc_woo_place").attr("data-dt")}),t(".ctc_woo_place").show())}function r(o,c){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?document.querySelectorAll(o):[document.querySelector(o)];c&&r.length&&r[0]&&(r.forEach(function(o){var e,r,n;e=c,r=o,n=window.getComputedStyle(e),Array.from(n).forEach(function(t){r.style.setProperty(t,n.getPropertyValue(t),n.getPropertyPriority(t))});var _=t(o).css("color"),a=t(o).css("background-color");t(o).css({display:"inline-flex",width:"fit-content","align-items":"center",color:_,"background-color":a})}),e())}function n(o,c){var r=document.querySelectorAll(o);r.length&&c&&(r.forEach(function(o){t(o).css({"min-height":t(c).css("min-height"),"font-size":t(c).css("font-size"),"font-weight":t(c).css("font-weight"),"letter-spacing":t(c).css("letter-spacing"),"border-radius":t(c).css("border-radius"),width:"fit-content"})}),e())}})})();
     1(()=>{"use strict";var t;(t=jQuery)(function(){try{document.querySelector(".single_add_to_cart_button")||document.querySelector(".add_to_cart_button")?(o=document.querySelector(".single_add_to_cart_button"),c=document.querySelector(".button.add_to_cart_button")||document.querySelector(".add_to_cart_button"),r(".ctc_woo_single_cart_layout .s1_btn",o),r(".ctc_woo_shop_cart_layout .s1_btn",c,!0),n(".ctc_woo_shop_cart_layout .s_8",c),n(".ctc_woo_single_cart_layout .s_8",o)):document.querySelector(".ctc_woo_place")&&e()}catch(t){}var o,c;function e(){document.querySelector(".ctc_woo_schedule")||(t(".ctc_woo_place").css({display:t(".ctc_woo_place").attr("data-dt")}),t(".ctc_woo_place").show())}function r(o,c){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?document.querySelectorAll(o):[document.querySelector(o)];c&&r.length&&r[0]&&(r.forEach(function(o){var e,r,n;e=c,r=o,n=window.getComputedStyle(e),["color","background-color","border-radius","border","padding","font-size","font-weight"].forEach(function(t){r.style.setProperty(t,n.getPropertyValue(t),n.getPropertyPriority(t))});var a=t(o).css("color"),u=t(o).css("background-color");t(o).css({display:"inline-flex",width:"fit-content","align-items":"center",color:a,"background-color":u})}),e())}function n(o,c){var r=document.querySelectorAll(o);r.length&&c&&(r.forEach(function(o){t(o).css({"min-height":t(c).css("min-height"),"font-size":t(c).css("font-size"),"font-weight":t(c).css("font-weight"),"letter-spacing":t(c).css("letter-spacing"),"border-radius":t(c).css("border-radius"),width:"fit-content"})}),e())}})})();
  • click-to-chat-for-whatsapp/trunk/new/inc/commons/class-ht-ctc-hooks.php

    r3369409 r3394807  
    181181            $ht_ctc_os['ga_ads']      = ( isset( $othersettings['ga_ads'] ) ) ? 'yes' : 'no';
    182182
     183            if ( ! isset( $ht_ctc_os['data-attributes'] ) ) {
     184                $ht_ctc_os['data-attributes'] = '';
     185            } else {
     186                $ht_ctc_os['data-attributes'] = (string) $ht_ctc_os['data-attributes'];
     187            }
     188
    183189            $ht_ctc_os['show_effect'] = ( isset( $othersettings['show_effect'] ) ) ? esc_attr( $othersettings['show_effect'] ) : '';
    184190
  • click-to-chat-for-whatsapp/trunk/new/inc/commons/position-to-place.php

    r3369409 r3394807  
    2323
    2424// desktop position
    25 $side_1       = esc_attr( $options['side_1'] );
    26 $side_1_value = esc_attr( $options['side_1_value'] );
    27 $side_2       = esc_attr( $options['side_2'] );
     25$side_1       = isset( $options['side_1'] ) ? esc_attr( $options['side_1'] ) : 'bottom';
     26$side_1_value = isset( $options['side_1_value'] ) ? esc_attr( $options['side_1_value'] ) : '15px';
     27$side_2       = isset( $options['side_2'] ) ? esc_attr( $options['side_2'] ) : 'right';
    2828// @uses position, call to action ..   (cta - desktop value only uses for both devices. )
    2929$side_2       = apply_filters( 'ht_ctc_fh_side_2', $side_2 );
    30 $side_2_value = esc_attr( $options['side_2_value'] );
     30$side_2_value = isset( $options['side_2_value'] ) ? esc_attr( $options['side_2_value'] ) : '15px';
    3131
    3232$position = "position: $position_type; $side_1: $side_1_value; $side_2: $side_2_value;";
     
    4040} else {
    4141    // Mobile position
    42     $mobile_side_1       = ( isset( $options['mobile_side_1'] ) ) ? esc_attr( $options['mobile_side_1'] ) : '';
    43     $mobile_side_1_value = ( isset( $options['mobile_side_1_value'] ) ) ? esc_attr( $options['mobile_side_1_value'] ) : '';
    44     $mobile_side_2       = ( isset( $options['mobile_side_2'] ) ) ? esc_attr( $options['mobile_side_2'] ) : '';
    45     $mobile_side_2       = apply_filters( 'ht_ctc_fh_mobile_side_2', $mobile_side_2 );
    46     $mobile_side_2_value = ( isset( $options['mobile_side_2_value'] ) ) ? esc_attr( $options['mobile_side_2_value'] ) : '';
     42        $mobile_side_1       = isset( $options['mobile_side_1'] ) ? esc_attr( $options['mobile_side_1'] ) : $side_1;
     43        $mobile_side_1_value = isset( $options['mobile_side_1_value'] ) ? esc_attr( $options['mobile_side_1_value'] ) : $side_1_value;
     44        $mobile_side_2       = isset( $options['mobile_side_2'] ) ? esc_attr( $options['mobile_side_2'] ) : $side_2;
     45        $mobile_side_2       = apply_filters( 'ht_ctc_fh_mobile_side_2', $mobile_side_2 );
     46        $mobile_side_2_value = isset( $options['mobile_side_2_value'] ) ? esc_attr( $options['mobile_side_2_value'] ) : $side_2_value;
    4747
    4848    $position_mobile = "position: $position_type_mobile; $mobile_side_1: $mobile_side_1_value; $mobile_side_2: $mobile_side_2_value;";
  • click-to-chat-for-whatsapp/trunk/new/inc/styles-shortcode/sc-style-1.php

    r3369409 r3394807  
    1717
    1818$s1_css        = '';
    19 $s1_text_color = ( isset( $s1_options['s1_text_color'] ) ) ? esc_attr( $s1_options['s1_text_color'] ) : '';
     19$s1_text_color = isset( $s1_options['s1_text_color'] ) ? esc_attr( $s1_options['s1_text_color'] ) : '';
    2020$s1_css       .= ( '' !== $s1_text_color ) ? "color:$s1_text_color;" : '';
    21 $s1_bg_color   = ( isset( $s1_options['s1_bg_color'] ) ) ? esc_attr( $s1_options['s1_bg_color'] ) : '';
     21$s1_bg_color   = isset( $s1_options['s1_bg_color'] ) ? esc_attr( $s1_options['s1_bg_color'] ) : '';
    2222$s1_css       .= ( '' !== $s1_bg_color ) ? "background-color:$s1_bg_color;" : '';
    2323
    2424$s1_style = ( '' !== $s1_css ) ? "style='$s1_css'" : '';
    2525
    26 $s1_fullwidth_css = '';
     26// ICON SETTINGS (Added)
     27$s1_add_icon   = isset( $s1_options['s1_add_icon'] ) ? esc_attr( $s1_options['s1_add_icon'] ) : '';
     28$s1_icon_color = isset( $s1_options['s1_icon_color'] ) ? esc_attr( $s1_options['s1_icon_color'] ) : '';
     29$s1_icon_size  = isset( $s1_options['s1_icon_size'] ) ? esc_attr( $s1_options['s1_icon_size'] ) : '';
     30
     31if ( '' === $s1_icon_size ) {
     32    $s1_icon_size = '15';
     33}
     34
     35if ( '' === $s1_icon_color ) {
     36    $s1_icon_color = '#ffffff';
     37}
    2738
    2839if ( '' === $call_to_action ) {
     
    3041}
    3142
     43$ctc_type = isset( $type ) ? $type : 'chat';
     44
     45$icon_html = '';
     46
     47/* Load Icon if enabled */
     48if ( '' !== $s1_add_icon ) {
     49
     50    $s1_svg_css = 'margin-right:6px;';
     51
     52    $s1_svg_attrs = array(
     53        'color'          => $s1_icon_color,
     54        'icon_size'      => $s1_icon_size,
     55        'type'           => $ctc_type,
     56        'ht_ctc_svg_css' => $s1_svg_css,
     57    );
     58
     59    // Load SVG functions
     60    include_once HT_CTC_PLUGIN_DIR . 'new/inc/assets/img/ht-ctc-svg-images.php';
     61
     62    // Generate the icon SVG
     63    // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - SVG is escaped in its function.
     64    $icon_html = ht_ctc_singlecolor( $s1_svg_attrs );
     65}
     66
     67
    3268
    3369$o .= '
    34     <button ' . $s1_style . ' class="ctc-analytics ctc_cta">' . $call_to_action . '</button>
     70    <button ' . $s1_style . ' class="ctc-analytics" style="display:flex; align-items:center;">
     71        ' . $icon_html . '
     72        <span class="ctc_cta">' . esc_html( $call_to_action ) . '</span>
     73    </button>
    3574';
  • click-to-chat-for-whatsapp/trunk/new/inc/styles/style-1.php

    r3369409 r3394807  
    5454}
    5555
     56
     57$ctc_type = isset( $type ) ? $type : 'chat';
     58
     59$icon_html = '';
     60/* Load Icon if enabled */
     61if ( '' !== $s1_add_icon ) {
     62
     63    $s1_svg_css = 'margin-right:6px;';
     64
     65    $s1_svg_attrs = array(
     66        'color'          => $s1_icon_color,
     67        'icon_size'      => $s1_icon_size,
     68        'type'           => $ctc_type,
     69        'ht_ctc_svg_css' => $s1_svg_css,
     70    );
     71
     72    // Load SVG functions
     73    include_once HT_CTC_PLUGIN_DIR . 'new/inc/assets/img/ht-ctc-svg-images.php';
     74
     75    $icon_html = ht_ctc_singlecolor( $s1_svg_attrs );
     76}
    5677?>
     78
    5779<button
    5880<?php
     
    6183?>
    6284class="ctc-analytics s1_btn ctc_s_1">
    63 <?php
    64 if ( '' !== $s1_add_icon ) {
     85    <?php
     86    // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- SVG is sanitized at source.
     87    echo $icon_html;
     88    ?>
     89    <span class="ctc_cta"><?php echo esc_html( $call_to_action ); ?></span>
     90</button>
    6591
    66     $s1_svg_css = 'margin-right:6px;';
    67 
    68     $s1_svg_attrs = array(
    69         'color'          => "$s1_icon_color",
    70         'icon_size'      => "$s1_icon_size",
    71         'type'           => "$type",
    72         'ht_ctc_svg_css' => "$s1_svg_css",
    73     );
    74     include_once HT_CTC_PLUGIN_DIR . 'new/inc/assets/img/ht-ctc-svg-images.php';
    75   // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- SVG markup is escaped in ht_ctc_singlecolor().
    76     echo ht_ctc_singlecolor( $s1_svg_attrs );
    77 }
    78 ?>
    79 <span class="ctc_cta"><?php echo esc_html( $call_to_action ); ?></span>
    80 </button>
    8192<?php
    8293// todo: instead of display message like this.. remove here and focus at customize styles settings.. and at select style..
  • click-to-chat-for-whatsapp/trunk/readme.txt

    r3386465 r3394807  
    11=== Click to Chat - HoliThemes ===
    22Requires at least: 4.7
    3 Tested up to: 6.8.2
     3Tested up to: 6.8.3
    44Requires PHP: 5.6
    55Contributors: HoliThemes
    6 Stable tag: 4.30
     6Stable tag: 4.31
    77Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, WooCommerce WhatsApp
    88License: GPLv2 or later
     
    542542== Changelog ==
    543543
     544= 4.31 =
     545* Fix: Shortcode style-1 icon not displaying correctly.
     546
    544547= 4.30 =
    545548* Enchancement: Google Analytics feature.
Note: See TracChangeset for help on using the changeset viewer.