Version Description
RTL menu fix
Download this release
Release Info
Developer | premiocommit |
Plugin | Floating Chat Widget: Contact Chat Icons, Telegram Chat, Line, WeChat, Email, SMS, Call Button – Chaty |
Version | 3.0.1 |
Comparing to | |
See all releases |
Code changes from version 3.0 to 3.0.1
- admin/assets/js/app.js +1 -1
- cht-icons.php +2 -2
- readme.txt +6 -3
- src/hoc/with-layout-change.js +20 -18
- views/admin/chaty-popup.php +2 -2
admin/assets/js/app.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{var e,t={304:(e,t,n)=>{"use strict";n(972);var o=window.jQuery,i=o("#adminmenuwrap").outerWidth(),a=o("#wpadminbar").outerHeight(),r=o(".chaty-header").outerHeight(),c=function(){return innerWidth<600?(scrollY<=a?a-scrollY:0)+"px":a+"px"},s=function(){return innerWidth>=783?i+"px":0},l=function(){return innerWidth<640?(r||0)+20:(r||0)+a};var d=window.jQuery;function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=window.jQuery;const v=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t.reduceRight((function(e,t){return u(u({},e),t)}),{});return function(e){return function(t){return e(u(u({},t),o))}}}({onLayoutChange:function(e){e({top:c(),left:s(),width:"calc(100% - ".concat(s(),")"),content:l()}),onscroll=function(){e({top:c(),left:s(),width:"calc(100% - ".concat(s(),")"),content:l()})},o(document).on("wp-menu-state-set wp-collapse-menu",(function(t,n){i=o("#adminmenuwrap").outerWidth(),a=o("#wpadminbar").outerHeight(),r=o(".chaty-header").outerHeight(),e({top:c(),left:s(),width:"calc(100% - ".concat(s(),")"),content:l()})}))}},{route:new URLSearchParams(window.location.search)})((function(e){var t=f(".chaty-header"),n=f("#chaty-widget-body-tab"),o=f("#chaty-social-channel"),i=f(".back-button"),a=f(".next-button"),r=["chaty-tab-social-channel","chaty-tab-customize-widget","chaty-tab-triger-targeting"],c=Number(e.route.get("step")||0);if(0!==t.length&&0!==o.length){e.onLayoutChange((function(e){t.css(e),n.css("margin-top","".concat(e.content,"px"))}));var s=function(e){if(e<r.length&&e>=0){c=e,f(".social-channel-tabs").removeClass("active"),f("#".concat(r[e])).addClass("active"),f(".chaty-tab").removeClass("active completed").each((function(){if(f(this).addClass("completed"),this.dataset.tabId===r[e])return f(this).addClass("active"),!1})),i.removeClass("cht-disable"),a.removeClass("cht-disable"),e<=0&&i.addClass("cht-disable"),e>=r.length-1&&a.addClass("cht-disable");var t=new URL(window.location.href),n=t.searchParams;n.set("step",e),t.search=n.toString();var o=t.toString();window.history.replaceState({page_id:e},"",o)}};s(c),t.find(".chaty-tab").on("click",(function(){s(r.indexOf(this.dataset.tabId)),"fixed"===t.css("position")&&window.scrollTo({top:(innerWidth>768?t.outerHeight():0)+32+"px",left:0,behavior:"smooth"})})),a.on("click",(function(){s(c+1)})),i.on("click",(function(){s(c-1)})),d(".save-button-container .arrow-btn").on("click",(function(){var e=d(".save-dashboard-button"),t=d(".footer-buttons").offset(),n=d(this).offset(),o=n.top-t.top+45,i=n.left-t.left+40;return 1==d(this).attr("data-click-state")?(d(this).attr("data-click-state",0).removeClass("active"),e.css({display:"none"})):(d(this).attr("data-click-state",1).addClass("active"),e.css({position:"absolute",left:i+"px",top:o+"px",display:"inline-block",transform:"translateX(-100%)"})),!1})),d(window).on("click",(function(e){d(".arrow-btn.active")&&(d(".save-dashboard-button").css({display:"none"}),d(".arrow-btn.active").attr("data-click-state",0).removeClass("active"))}))}}));var g=window.jQuery;var w=window.jQuery;var m=window.jQuery;function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(m("#active_widget").length){var t=m(".trigger-block-wrapper"),n=m(".widget-disable-alert"),o=m("#active_widget");null===e&&(e=o[0]),e.checked?(t.show(),n.hide()):(t.hide(),n.show()),m("#active_widget").on("change",(function(){y(this)}))}}var b=window.jQuery;var C=window.jQuery;var k=window.jQuery;var j=window.jQuery;var _=window.jQuery;var x=window.jQuery;function P(){wp.hooks.addAction("chaty.channel_update","channelUpdateHandler",(function(e){var t=e.action,n=e.target,o=e.channel,i=e.isExceeded;!function(e){var t=x(".popover-upgrade-pro");e?(t.addClass("flex shake-it").removeClass("hidden"),t.isInViewport()||t[0].scrollIntoView({behavior:"smooth",block:"center"}),setTimeout((function(){return t.removeClass("shake-it")}),1e3)):t.removeClass("flex shake-it").addClass("hidden")}(i),"added"===t&&!i&&n&&function(e){x("#chaty-social-".concat(e))[0].scrollIntoView({behavior:"smooth",block:"center"})}(n);var a=o.length<=1;x(".chaty-widget-color, .chaty-widget-icon, .chaty-default-state, .chaty-icon-view").toggleClass("hidden",a)}))}var $=window.jQuery;jQuery((function(){var e;v(),{init:function(){this.$previewBtn=g(".preview-help-btn"),this.$asidePreview=g(".preview-section-chaty"),this.resizeHandler(),this.$previewBtn.on("click",this.showPreview.bind(this)),this.$asidePreview.on("click",this.removePreview.bind(this)),g(window).resize(this.resizeHandler.bind(this))},showPreview:function(e){e.preventDefault(),e.stopPropagation(),this.$asidePreview.removeClass("pb-20 hidden").addClass("fixed top-0 left-0 flex items-center justify-center w-full h-screen bg-black/70").css("z-index",9999999).attr("data-show",1),this.$asidePreview.find(".preview").removeClass("sticky").css("max-width","350px")},removeHandler:function(){this.$asidePreview.addClass("pb-20 hidden").removeClass("fixed top-0 left-0 flex items-center justify-center w-full h-screen bg-black/70").removeAttr("style").attr("data-show",0),this.$asidePreview.find(".preview").addClass("sticky").removeAttr("style")},removePreview:function(e){e&&!e.target.closest(".preview")&&1==this.$asidePreview.attr("data-show")&&this.removeHandler()},position:function(){var e=g("#chaty-widget-body-tab");if(0!==e.length){var t=e.offset(),n=jQuery(document).width();return{centerY:window.innerHeight/2,left:t.left,right:n-(t.left+e.outerWidth()),width:n,containerWidth:e.outerWidth()}}},resizeHandler:function(){if(this.position()){var e=this.position(),t=e.centerY;e.right,e.width<=1024?(this.$previewBtn.css({top:t+"px",right:0,transform:"rotate(-90deg) translateX(137%)",opacity:1,zIndex:999999}),this.$asidePreview.addClass("hidden")):(this.removeHandler(),this.$asidePreview.removeClass("hidden"),this.$previewBtn.css({opacity:0}))}}}.init(),e={init:function(){this.extendJquery(),this.trigger(!1,{$scope:w(document),element:".chaty-color-field"}),w(document).on("chatyColorPicker/trigger",this.trigger.bind(this))},STATE:{current:null,set add(e){!e.is(this.current)&&this.current&&this.current.parent().next().slideUp(),this.current=e,this.closeAll},get closeAll(){var e=this;w("html, .preview-section-chaty").on("click",(function(t){t.target.closest(".cht-colorpicker__dropdown")||e.current.parent().next().slideUp()}))}},trigger:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0;t&&this.eventUtils(t);var o=["#202020","#86cd91","#1E88E5","#ff6060","#49E670","#ffdb5e","#ff95ee"];n.$scope.find(n.element).each((function(t,i){var a=n.$scope.find(i);if(!a.data("chaty-color-picker")){var r=a.val()||"#202020",c=AColorPicker.parseColor(r,"hex");Object.assign({$scope:n.$scope,$input:a,defaultColor:r,colors:o,defaultColorDarker:e.colorLuminance(c,-.1)},e).addReplacer(),a.attr("data-chaty-color-picker",!0)}}))},eventUtils:function(e){e.preventDefault(),e.stopPropagation()},addReplacer:function(){var e=this;e.$input.css("display","none"),e.$input.after('\n <div class="cht-colorpicker replacer">\n <div class="cht-colorpicker__preview">\n <span class="cht-colorpicker__preview--inner" style="background-color: '.concat(e.defaultColor,"; border-color: ").concat(e.defaultColorDarker,'"></span>\n </div>\n <div class="cht-colorpicker__dropdown">\n ').concat(e.colorTemplate(),"\n </div>\n </div>\n "));var t=e.$input.parent().find(".cht-colorpicker"),n=t.find(".cht-colorpicker__dropdown"),o=AColorPicker.createPicker(n,{attachTo:t,color:this.defaultColor,showAlpha:!0,showHSL:!1});e.initalize(t),o.on("change",(function(n,o){e.onChange.call(e,o,t,!0)}))},colorTemplate:function(){var e=this;return'\n <ul class="palate">\n '.concat(this.colors.map((function(t,n){return'<li data-color="'.concat(t,'" ').concat(t===e.defaultColor?'class="active"':"",'>\n <span class="template-color" style="background-color: ').concat(t,'"></span>\n </li>')})).join(""),'\n <li class="custom-color ').concat(this.colors.includes(this.defaultColor)?"":"active",'">\n <div>\n <svg class="pointer-events-none" width="16" height="16" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" svg-inline="" focusable="false" tabindex="-1"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 1a1 1 0 00-2 0v4H1a1 1 0 000 2h4v4a1 1 0 102 0V7h4a1 1 0 100-2H7V1z" fill="currentColor"></path></svg>\n </div>\n </li>\n </ul>\n ')},extendJquery:function(){w.fn.extend({premioFixHorizontalPosition:function(){var e=this.parent().offset().left,t=innerWidth-e;return this.outerWidth()+40>t&&this.css("right","0"),this}})},initalize:function(e){var t=this,n=e.find(".cht-colorpicker__preview--inner"),o=e.find(".cht-colorpicker__dropdown"),i=e.find(".custom-color"),a=e.find(".template-color"),r=e.find(".palate"),c=e.find(".a-color-picker");n.on("click",(function(e){t.eventUtils(e),o.premioFixHorizontalPosition().slideToggle(),c.hide(),setTimeout((function(){r.show()}),500),t.STATE.add=n})),a.on("click",(function(n){t.eventUtils(n),e.find("li").removeClass("active");var o=jQuery(this).parent();o.addClass("active"),t.onChange.call(t,o.data("color"),e,!1)})),i.on("click",(function(){e.find("li").removeClass("active"),jQuery(this).parent().addClass("active"),r.hide(),c.show()}))},colorLuminance:function(e,t){(e=String(e).replace(/[^0-9a-f]/gi,"")).length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;var n,o,i="#";for(o=0;o<3;o++)n=parseInt(e.substr(2*o,2),16),i+=("00"+(n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16))).substr(n.length);return i},updatePreviewColor:function(e,t,n){e.find(".cht-colorpicker__preview--inner").css({backgroundColor:t,borderColor:n})},updateCustomPreviewColor:function(e,t){e.find(".custom-color").css({borderColor:t})},updateChannelIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel);jQuery("#chaty_image_"+n+" .custom-chaty-image").css("background-color",t),jQuery("#chaty_image_"+n+" .facustom-icon").css("background-color",t),jQuery("#chaty_image_"+n+" .color-element").css("fill",t)},updateAgentIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel);console.log("color: "+t),console.log("channel: "+n),jQuery("#image_agent_data_agent-"+n+" .custom-agent-image").css("background-color",t),jQuery("#image_agent_data_agent-"+n+" .facustom-icon").css("background-color",t),jQuery("#image_agent_data_agent-"+n+" .color-element").css("fill",t)},updateAgentUserIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel),o=e.agentIndex;jQuery("#image_agent_data_"+n+"-"+o+" .custom-agent-image").css("background-color",t),jQuery("#image_agent_data_"+n+"-"+o+" .facustom-icon").css("background-color",t),jQuery("#image_agent_data_"+n+"-"+o+" .color-element").css("fill",t)},onChange:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=AColorPicker.parseColor(e,"hex"),i=n?this.colorLuminance(o,-.1):o,a=t.parents(".chaty-channel").data("channel");if(this.$input.val(e).attr("value",e),this.updatePreviewColor(t,e,i),n&&this.updateCustomPreviewColor(t,i),this.$input.hasClass("chaty-bg-color")&&(console.log("color: "+e),console.log("channel: "+a),this.updateChannelIconColor({type:"chaty-bg-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a})),this.$input.hasClass("agent-bg-color")&&this.updateAgentIconColor({type:"agent-bg-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a}),this.$input.hasClass("agent-icon-color")){var r=t.parents(".agent-channel-setting").data("item");this.updateAgentUserIconColor({type:"agent-icon-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a,agentIndex:r})}change_custom_preview()}},e.init(),y(),b(document).on("click",".customize-agent-button",(function(){var e=b(this).parents(".chaty-channel");e.find(".customize-agent-button, .agent-button-action").toggleClass("enable"),e.find(".chaty-channel-main-settings").slideToggle(200)})),b(document).on("click",".agent-channel-setting-button",(function(){b(this).parents(".agent-channel-setting").find(".agent-channel-setting-advance").slideToggle(200),b(this).toggleClass("enable")})),C(".close-chaty-popup-btn").on("click",(function(e){e.stopPropagation(),C(".chaty-popup").hide(),C(this).hasClass("channel-setting-btn")&&(C("#chaty-social-channel").trigger("click"),C(window).scrollTop(C("#channels-selected-list").offset().top-120))})),k(".chaty-settings").on("click",(function(e){e.preventDefault(),e.stopPropagation(),k(this).toggleClass("enable");var t=k(this).parents(".chaty-channel"),n=k(window).scrollTop(),o=t.offset().top-n-130;window.scrollBy({top:o,left:0,behavior:"smooth"})})),j(".widget-size-control").on("change",(function(){"radio"===this.type&&(j("#custom-widget-size").css({display:"size-custom"===this.id?"block":"none"}),j(".widget-size-control").prop("checked",!1),j(this).prop("checked",!0)),j("#custom-widget-size-input").val(this.value),change_custom_preview()})),_(".chaty-targeted-collapse").on("click",(function(e){e.preventDefault();var t=this.dataset.target,n=_("#".concat(t)),o=_(this);n.slideToggle(300,(function(){n.is(":hidden")?o.find("svg").css("transform","rotate(0deg)"):o.find("svg").css("transform","rotate(90deg)")}))})),P(),$(".create-rule").on("click",(function(){$(this).parents(".chaty-option-box").addClass("show-remove-rule-button")})),$(".remove-rules").on("click",(function(){$(this).parents(".chaty-option-box").removeClass("show-remove-rule-button")}))}))},972:()=>{var e=window.jQuery;e.fn.isInViewport=function(){var t=e(this).offset().top,n=t+e(this).outerHeight(),o=e(window).scrollTop(),i=o+e(window).height();return n>o&&t<i}},303:()=>{}},n={};function o(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,n,i,a)=>{if(!n){var r=1/0;for(d=0;d<e.length;d++){for(var[n,i,a]=e[d],c=!0,s=0;s<n.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](n[s])))?n.splice(s--,1):(c=!1,a<r&&(r=a));if(c){e.splice(d--,1);var l=i();void 0!==l&&(t=l)}}return t}a=a||0;for(var d=e.length;d>0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[n,i,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={561:0,782:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var i,a,[r,c,s]=n,l=0;if(r.some((t=>0!==e[t]))){for(i in c)o.o(c,i)&&(o.m[i]=c[i]);if(s)var d=s(o)}for(t&&t(n);l<r.length;l++)a=r[l],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(d)},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),o.O(void 0,[782],(()=>o(304)));var i=o.O(void 0,[782],(()=>o(303)));i=o.O(i)})();
|
1 |
+
(()=>{var e,t={304:(e,t,n)=>{"use strict";n(972);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=window.jQuery,a=i("#adminmenuwrap").outerWidth(),r=i("#wpadminbar").outerHeight(),c=i(".chaty-header").outerHeight(),s=Boolean(window.isRtl)?"right":"left",l=function(){return innerWidth<600?(scrollY<=r?r-scrollY:0)+"px":r+"px"},d=function(){return innerWidth>=783?a+"px":0},h=function(){return innerWidth<640?(c||0)+20:(c||0)+r};var u=window.jQuery;function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=window.jQuery;const w=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t.reduceRight((function(e,t){return f(f({},e),t)}),{});return function(e){return function(t){return e(f(f({},t),o))}}}({onLayoutChange:function(e){var t;e((o(t={top:l()},s,d()),o(t,"width","calc(100% - ".concat(d(),")")),o(t,"content",h()),t)),onscroll=function(){var t;e((o(t={top:l()},s,d()),o(t,"width","calc(100% - ".concat(d(),")")),o(t,"content",h()),t))},i(document).on("wp-menu-state-set wp-collapse-menu",(function(t,n){var u;a=i("#adminmenuwrap").outerWidth(),r=i("#wpadminbar").outerHeight(),c=i(".chaty-header").outerHeight(),e((o(u={top:l()},s,d()),o(u,"width","calc(100% - ".concat(d(),")")),o(u,"content",h()),u))}))}},{route:new URLSearchParams(window.location.search)})((function(e){var t=g(".chaty-header"),n=g("#chaty-widget-body-tab"),o=g("#chaty-social-channel"),i=g(".back-button"),a=g(".next-button"),r=["chaty-tab-social-channel","chaty-tab-customize-widget","chaty-tab-triger-targeting"],c=Number(e.route.get("step")||0);if(0!==t.length&&0!==o.length){e.onLayoutChange((function(e){t.css(e),n.css("margin-top","".concat(e.content,"px"))}));var s=function(e){if(e<r.length&&e>=0){c=e,g(".social-channel-tabs").removeClass("active"),g("#".concat(r[e])).addClass("active"),g(".chaty-tab").removeClass("active completed").each((function(){if(g(this).addClass("completed"),this.dataset.tabId===r[e])return g(this).addClass("active"),!1})),i.removeClass("cht-disable"),a.removeClass("cht-disable"),e<=0&&i.addClass("cht-disable"),e>=r.length-1&&a.addClass("cht-disable");var t=new URL(window.location.href),n=t.searchParams;n.set("step",e),t.search=n.toString();var o=t.toString();window.history.replaceState({page_id:e},"",o)}};s(c),t.find(".chaty-tab").on("click",(function(){s(r.indexOf(this.dataset.tabId)),"fixed"===t.css("position")&&window.scrollTo({top:(innerWidth>768?t.outerHeight():0)+32+"px",left:0,behavior:"smooth"})})),a.on("click",(function(){s(c+1)})),i.on("click",(function(){s(c-1)})),u(".save-button-container .arrow-btn").on("click",(function(){var e=u(".save-dashboard-button"),t=u(".footer-buttons").offset(),n=u(this).offset(),o=n.top-t.top+45,i=n.left-t.left+40;return 1==u(this).attr("data-click-state")?(u(this).attr("data-click-state",0).removeClass("active"),e.css({display:"none"})):(u(this).attr("data-click-state",1).addClass("active"),e.css({position:"absolute",left:i+"px",top:o+"px",display:"inline-block",transform:"translateX(-100%)"})),!1})),u(window).on("click",(function(e){u(".arrow-btn.active")&&(u(".save-dashboard-button").css({display:"none"}),u(".arrow-btn.active").attr("data-click-state",0).removeClass("active"))}))}}));var m=window.jQuery;var y=window.jQuery;var b=window.jQuery;function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(b("#active_widget").length){var t=b(".trigger-block-wrapper"),n=b(".widget-disable-alert"),o=b("#active_widget");null===e&&(e=o[0]),e.checked?(t.show(),n.hide()):(t.hide(),n.show()),b("#active_widget").on("change",(function(){C(this)}))}}var k=window.jQuery;var j=window.jQuery;var _=window.jQuery;var x=window.jQuery;var P=window.jQuery;var O=window.jQuery;function $(){wp.hooks.addAction("chaty.channel_update","channelUpdateHandler",(function(e){var t=e.action,n=e.target,o=e.channel,i=e.isExceeded;!function(e){var t=O(".popover-upgrade-pro");e?(t.addClass("flex shake-it").removeClass("hidden"),t.isInViewport()||t[0].scrollIntoView({behavior:"smooth",block:"center"}),setTimeout((function(){return t.removeClass("shake-it")}),1e3)):t.removeClass("flex shake-it").addClass("hidden")}(i),"added"===t&&!i&&n&&function(e){O("#chaty-social-".concat(e))[0].scrollIntoView({behavior:"smooth",block:"center"})}(n);var a=o.length<=1;O(".chaty-widget-color, .chaty-widget-icon, .chaty-default-state, .chaty-icon-view").toggleClass("hidden",a)}))}var Q=window.jQuery;jQuery((function(){var e;w(),{init:function(){this.$previewBtn=m(".preview-help-btn"),this.$asidePreview=m(".preview-section-chaty"),this.resizeHandler(),this.$previewBtn.on("click",this.showPreview.bind(this)),this.$asidePreview.on("click",this.removePreview.bind(this)),m(window).resize(this.resizeHandler.bind(this))},showPreview:function(e){e.preventDefault(),e.stopPropagation(),this.$asidePreview.removeClass("pb-20 hidden").addClass("fixed top-0 left-0 flex items-center justify-center w-full h-screen bg-black/70").css("z-index",9999999).attr("data-show",1),this.$asidePreview.find(".preview").removeClass("sticky").css("max-width","350px")},removeHandler:function(){this.$asidePreview.addClass("pb-20 hidden").removeClass("fixed top-0 left-0 flex items-center justify-center w-full h-screen bg-black/70").removeAttr("style").attr("data-show",0),this.$asidePreview.find(".preview").addClass("sticky").removeAttr("style")},removePreview:function(e){e&&!e.target.closest(".preview")&&1==this.$asidePreview.attr("data-show")&&this.removeHandler()},position:function(){var e=m("#chaty-widget-body-tab");if(0!==e.length){var t=e.offset(),n=jQuery(document).width();return{centerY:window.innerHeight/2,left:t.left,right:n-(t.left+e.outerWidth()),width:n,containerWidth:e.outerWidth()}}},resizeHandler:function(){if(this.position()){var e=this.position(),t=e.centerY;e.right,e.width<=1024?(this.$previewBtn.css({top:t+"px",right:0,transform:"rotate(-90deg) translateX(137%)",opacity:1,zIndex:999999}),this.$asidePreview.addClass("hidden")):(this.removeHandler(),this.$asidePreview.removeClass("hidden"),this.$previewBtn.css({opacity:0}))}}}.init(),e={init:function(){this.extendJquery(),this.trigger(!1,{$scope:y(document),element:".chaty-color-field"}),y(document).on("chatyColorPicker/trigger",this.trigger.bind(this))},STATE:{current:null,set add(e){!e.is(this.current)&&this.current&&this.current.parent().next().slideUp(),this.current=e,this.closeAll},get closeAll(){var e=this;y("html, .preview-section-chaty").on("click",(function(t){t.target.closest(".cht-colorpicker__dropdown")||e.current.parent().next().slideUp()}))}},trigger:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0;t&&this.eventUtils(t);var o=["#202020","#86cd91","#1E88E5","#ff6060","#49E670","#ffdb5e","#ff95ee"];n.$scope.find(n.element).each((function(t,i){var a=n.$scope.find(i);if(!a.data("chaty-color-picker")){var r=a.val()||"#202020",c=AColorPicker.parseColor(r,"hex");Object.assign({$scope:n.$scope,$input:a,defaultColor:r,colors:o,defaultColorDarker:e.colorLuminance(c,-.1)},e).addReplacer(),a.attr("data-chaty-color-picker",!0)}}))},eventUtils:function(e){e.preventDefault(),e.stopPropagation()},addReplacer:function(){var e=this;e.$input.css("display","none"),e.$input.after('\n <div class="cht-colorpicker replacer">\n <div class="cht-colorpicker__preview">\n <span class="cht-colorpicker__preview--inner" style="background-color: '.concat(e.defaultColor,"; border-color: ").concat(e.defaultColorDarker,'"></span>\n </div>\n <div class="cht-colorpicker__dropdown">\n ').concat(e.colorTemplate(),"\n </div>\n </div>\n "));var t=e.$input.parent().find(".cht-colorpicker"),n=t.find(".cht-colorpicker__dropdown"),o=AColorPicker.createPicker(n,{attachTo:t,color:this.defaultColor,showAlpha:!0,showHSL:!1});e.initalize(t),o.on("change",(function(n,o){e.onChange.call(e,o,t,!0)}))},colorTemplate:function(){var e=this;return'\n <ul class="palate">\n '.concat(this.colors.map((function(t,n){return'<li data-color="'.concat(t,'" ').concat(t===e.defaultColor?'class="active"':"",'>\n <span class="template-color" style="background-color: ').concat(t,'"></span>\n </li>')})).join(""),'\n <li class="custom-color ').concat(this.colors.includes(this.defaultColor)?"":"active",'">\n <div>\n <svg class="pointer-events-none" width="16" height="16" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" svg-inline="" focusable="false" tabindex="-1"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 1a1 1 0 00-2 0v4H1a1 1 0 000 2h4v4a1 1 0 102 0V7h4a1 1 0 100-2H7V1z" fill="currentColor"></path></svg>\n </div>\n </li>\n </ul>\n ')},extendJquery:function(){y.fn.extend({premioFixHorizontalPosition:function(){var e=this.parent().offset().left,t=innerWidth-e;return this.outerWidth()+40>t&&this.css("right","0"),this}})},initalize:function(e){var t=this,n=e.find(".cht-colorpicker__preview--inner"),o=e.find(".cht-colorpicker__dropdown"),i=e.find(".custom-color"),a=e.find(".template-color"),r=e.find(".palate"),c=e.find(".a-color-picker");n.on("click",(function(e){t.eventUtils(e),o.premioFixHorizontalPosition().slideToggle(),c.hide(),setTimeout((function(){r.show()}),500),t.STATE.add=n})),a.on("click",(function(n){t.eventUtils(n),e.find("li").removeClass("active");var o=jQuery(this).parent();o.addClass("active"),t.onChange.call(t,o.data("color"),e,!1)})),i.on("click",(function(){e.find("li").removeClass("active"),jQuery(this).parent().addClass("active"),r.hide(),c.show()}))},colorLuminance:function(e,t){(e=String(e).replace(/[^0-9a-f]/gi,"")).length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;var n,o,i="#";for(o=0;o<3;o++)n=parseInt(e.substr(2*o,2),16),i+=("00"+(n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16))).substr(n.length);return i},updatePreviewColor:function(e,t,n){e.find(".cht-colorpicker__preview--inner").css({backgroundColor:t,borderColor:n})},updateCustomPreviewColor:function(e,t){e.find(".custom-color").css({borderColor:t})},updateChannelIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel);jQuery("#chaty_image_"+n+" .custom-chaty-image").css("background-color",t),jQuery("#chaty_image_"+n+" .facustom-icon").css("background-color",t),jQuery("#chaty_image_"+n+" .color-element").css("fill",t)},updateAgentIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel);console.log("color: "+t),console.log("channel: "+n),jQuery("#image_agent_data_agent-"+n+" .custom-agent-image").css("background-color",t),jQuery("#image_agent_data_agent-"+n+" .facustom-icon").css("background-color",t),jQuery("#image_agent_data_agent-"+n+" .color-element").css("fill",t)},updateAgentUserIconColor:function(e){e.$scope;var t=e.color,n=(e.type,e.channel),o=e.agentIndex;jQuery("#image_agent_data_"+n+"-"+o+" .custom-agent-image").css("background-color",t),jQuery("#image_agent_data_"+n+"-"+o+" .facustom-icon").css("background-color",t),jQuery("#image_agent_data_"+n+"-"+o+" .color-element").css("fill",t)},onChange:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=AColorPicker.parseColor(e,"hex"),i=n?this.colorLuminance(o,-.1):o,a=t.parents(".chaty-channel").data("channel");if(this.$input.val(e).attr("value",e),this.updatePreviewColor(t,e,i),n&&this.updateCustomPreviewColor(t,i),this.$input.hasClass("chaty-bg-color")&&(console.log("color: "+e),console.log("channel: "+a),this.updateChannelIconColor({type:"chaty-bg-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a})),this.$input.hasClass("agent-bg-color")&&this.updateAgentIconColor({type:"agent-bg-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a}),this.$input.hasClass("agent-icon-color")){var r=t.parents(".agent-channel-setting").data("item");this.updateAgentUserIconColor({type:"agent-icon-color",$scope:jQuery(".custom-image-".concat(a)).parent(),color:e,channel:a,agentIndex:r})}change_custom_preview()}},e.init(),C(),k(document).on("click",".customize-agent-button",(function(){var e=k(this).parents(".chaty-channel");e.find(".customize-agent-button, .agent-button-action").toggleClass("enable"),e.find(".chaty-channel-main-settings").slideToggle(200)})),k(document).on("click",".agent-channel-setting-button",(function(){k(this).parents(".agent-channel-setting").find(".agent-channel-setting-advance").slideToggle(200),k(this).toggleClass("enable")})),j(".close-chaty-popup-btn").on("click",(function(e){e.stopPropagation(),j(".chaty-popup").hide(),j(this).hasClass("channel-setting-btn")&&(j("#chaty-social-channel").trigger("click"),j(window).scrollTop(j("#channels-selected-list").offset().top-120))})),_(".chaty-settings").on("click",(function(e){e.preventDefault(),e.stopPropagation(),_(this).toggleClass("enable");var t=_(this).parents(".chaty-channel"),n=_(window).scrollTop(),o=t.offset().top-n-130;window.scrollBy({top:o,left:0,behavior:"smooth"})})),x(".widget-size-control").on("change",(function(){"radio"===this.type&&(x("#custom-widget-size").css({display:"size-custom"===this.id?"block":"none"}),x(".widget-size-control").prop("checked",!1),x(this).prop("checked",!0)),x("#custom-widget-size-input").val(this.value),change_custom_preview()})),P(".chaty-targeted-collapse").on("click",(function(e){e.preventDefault();var t=this.dataset.target,n=P("#".concat(t)),o=P(this);n.slideToggle(300,(function(){n.is(":hidden")?o.find("svg").css("transform","rotate(0deg)"):o.find("svg").css("transform","rotate(90deg)")}))})),$(),Q(".create-rule").on("click",(function(){Q(this).parents(".chaty-option-box").addClass("show-remove-rule-button")})),Q(".remove-rules").on("click",(function(){Q(this).parents(".chaty-option-box").removeClass("show-remove-rule-button")}))}))},972:()=>{var e=window.jQuery;e.fn.isInViewport=function(){var t=e(this).offset().top,n=t+e(this).outerHeight(),o=e(window).scrollTop(),i=o+e(window).height();return n>o&&t<i}},303:()=>{}},n={};function o(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,n,i,a)=>{if(!n){var r=1/0;for(d=0;d<e.length;d++){for(var[n,i,a]=e[d],c=!0,s=0;s<n.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](n[s])))?n.splice(s--,1):(c=!1,a<r&&(r=a));if(c){e.splice(d--,1);var l=i();void 0!==l&&(t=l)}}return t}a=a||0;for(var d=e.length;d>0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[n,i,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={561:0,782:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var i,a,[r,c,s]=n,l=0;if(r.some((t=>0!==e[t]))){for(i in c)o.o(c,i)&&(o.m[i]=c[i]);if(s)var d=s(o)}for(t&&t(n);l<r.length;l++)a=r[l],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(d)},n=self.webpackChunk=self.webpackChunk||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),o.O(void 0,[782],(()=>o(304)));var i=o.O(void 0,[782],(()=>o(303)));i=o.O(i)})();
|
cht-icons.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
Author URI: https://premio.io/downloads/chaty/
|
8 |
Text Domain: chaty
|
9 |
Domain Path: /languages
|
10 |
-
Version: 3.0
|
11 |
License: GPL2
|
12 |
*/
|
13 |
|
@@ -27,7 +27,7 @@ define('CHT_INC', CHT_DIR . '/includes');
|
|
27 |
define('CHT_PRO_URL', admin_url("admin.php?page=chaty-app-upgrade"));
|
28 |
define('CHT_PLUGIN_URL', plugin_dir_url(__FILE__));
|
29 |
define('CHT_PLUGIN_BASE', plugin_basename(CHT_FILE));
|
30 |
-
define('CHT_VERSION', "3.0");
|
31 |
|
32 |
if (!function_exists('wp_doing_ajax')) {
|
33 |
function wp_doing_ajax()
|
7 |
Author URI: https://premio.io/downloads/chaty/
|
8 |
Text Domain: chaty
|
9 |
Domain Path: /languages
|
10 |
+
Version: 3.0.1
|
11 |
License: GPL2
|
12 |
*/
|
13 |
|
27 |
define('CHT_PRO_URL', admin_url("admin.php?page=chaty-app-upgrade"));
|
28 |
define('CHT_PLUGIN_URL', plugin_dir_url(__FILE__));
|
29 |
define('CHT_PLUGIN_BASE', plugin_basename(CHT_FILE));
|
30 |
+
define('CHT_VERSION', "3.0.1");
|
31 |
|
32 |
if (!function_exists('wp_doing_ajax')) {
|
33 |
function wp_doing_ajax()
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: galdub, tomeraharon, premio
|
3 |
Tags: whatsapp, whatsapp chat, facebook messenger, click to chat, chat, chat button, call now button, messenger, whatsapp button, chat icon, contact button, click to call
|
4 |
Requires at least: 3.1
|
5 |
-
Tested up to: 6.
|
6 |
-
Stable tag: 3.0
|
7 |
Plugin URI: https://premio.io/downloads/chaty/
|
8 |
|
9 |
WhatsApp chat, Facebook Messenger, Telegram, TikTok, Viber, Email, Line, WeChat Phone call, SMS, and more with customizable WhatsApp chat widget & call buttons. Chat with your visitors on WhatsApp, Facebook Messenger, and other chat channels!
|
@@ -18,7 +18,7 @@ Show a chat button on the bottom of your site and communicate with your customer
|
|
18 |
* Improve your customer support
|
19 |
* Direct customers to your store's location
|
20 |
|
21 |
-
[youtube https://www.youtube.com/watch?v=
|
22 |
|
23 |
= 💬 Connect with your website visitors on WhatsApp and 20+ chat channels =
|
24 |
Chaty is designed to help you connect with your visitors on WhatsApp or WhatsApp Business with ease. All you have to do is to enter your WhatsApp number, and you’re all set. We also have some advanced WhatsApp features like the WhatsApp popup that emulates a WhatsApp Chat window, WhatsApp Merge tags, WhatsApp agents, and many other features that’ll help you better communicate with your visitors on WhatsApp.
|
@@ -283,6 +283,9 @@ Yes! You can even decide what chat buttons will show up on each device (desktop/
|
|
283 |
|
284 |
== Changelog ==
|
285 |
|
|
|
|
|
|
|
286 |
= 3.0 =
|
287 |
We've improved the design of Chaty - it's more user-friendly. We've also added new chat channels including Discord and Microsoft Teams to the chat channel list. We've also added support for the HTML <br> tag in the call-to-action section. Also adding custom chat channels is easier than before.
|
288 |
|
2 |
Contributors: galdub, tomeraharon, premio
|
3 |
Tags: whatsapp, whatsapp chat, facebook messenger, click to chat, chat, chat button, call now button, messenger, whatsapp button, chat icon, contact button, click to call
|
4 |
Requires at least: 3.1
|
5 |
+
Tested up to: 6.1
|
6 |
+
Stable tag: 3.0.1
|
7 |
Plugin URI: https://premio.io/downloads/chaty/
|
8 |
|
9 |
WhatsApp chat, Facebook Messenger, Telegram, TikTok, Viber, Email, Line, WeChat Phone call, SMS, and more with customizable WhatsApp chat widget & call buttons. Chat with your visitors on WhatsApp, Facebook Messenger, and other chat channels!
|
18 |
* Improve your customer support
|
19 |
* Direct customers to your store's location
|
20 |
|
21 |
+
[youtube https://www.youtube.com/watch?v=nYCIoOxuU1E]
|
22 |
|
23 |
= 💬 Connect with your website visitors on WhatsApp and 20+ chat channels =
|
24 |
Chaty is designed to help you connect with your visitors on WhatsApp or WhatsApp Business with ease. All you have to do is to enter your WhatsApp number, and you’re all set. We also have some advanced WhatsApp features like the WhatsApp popup that emulates a WhatsApp Chat window, WhatsApp Merge tags, WhatsApp agents, and many other features that’ll help you better communicate with your visitors on WhatsApp.
|
283 |
|
284 |
== Changelog ==
|
285 |
|
286 |
+
= 3.0.1 =
|
287 |
+
RTL menu fix
|
288 |
+
|
289 |
= 3.0 =
|
290 |
We've improved the design of Chaty - it's more user-friendly. We've also added new chat channels including Discord and Microsoft Teams to the chat channel list. We've also added support for the HTML <br> tag in the call-to-action section. Also adding custom chat channels is easier than before.
|
291 |
|
src/hoc/with-layout-change.js
CHANGED
@@ -6,6 +6,7 @@
|
|
6 |
let sidebarWidth = $('#adminmenuwrap').outerWidth();
|
7 |
let adminBarHeight = $('#wpadminbar').outerHeight();
|
8 |
let headerEnd = $('.chaty-header').outerHeight();
|
|
|
9 |
|
10 |
const calculateTop = function() {
|
11 |
if( innerWidth < 600 )
|
@@ -13,7 +14,7 @@
|
|
13 |
return adminBarHeight + 'px';
|
14 |
}
|
15 |
|
16 |
-
const
|
17 |
if( innerWidth >= 783 )
|
18 |
return sidebarWidth + 'px';
|
19 |
return 0;
|
@@ -33,20 +34,20 @@
|
|
33 |
* calcualte postion on initial page relad
|
34 |
*/
|
35 |
callback({
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
});
|
41 |
/**
|
42 |
* calcualte postion on scroll
|
43 |
*/
|
44 |
onscroll = function() {
|
45 |
callback({
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
});
|
51 |
}
|
52 |
|
@@ -54,16 +55,17 @@
|
|
54 |
* @param eventData contains the sidebar position like "folded, responsive"
|
55 |
*/
|
56 |
$(document).on( 'wp-menu-state-set wp-collapse-menu', function( event, eventData ) {
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
67 |
});
|
68 |
}
|
69 |
}
|
6 |
let sidebarWidth = $('#adminmenuwrap').outerWidth();
|
7 |
let adminBarHeight = $('#wpadminbar').outerHeight();
|
8 |
let headerEnd = $('.chaty-header').outerHeight();
|
9 |
+
const position = Boolean(window.isRtl) ? 'right' : 'left';
|
10 |
|
11 |
const calculateTop = function() {
|
12 |
if( innerWidth < 600 )
|
14 |
return adminBarHeight + 'px';
|
15 |
}
|
16 |
|
17 |
+
const calculateHorizontalGap = function() {
|
18 |
if( innerWidth >= 783 )
|
19 |
return sidebarWidth + 'px';
|
20 |
return 0;
|
34 |
* calcualte postion on initial page relad
|
35 |
*/
|
36 |
callback({
|
37 |
+
top : calculateTop(),
|
38 |
+
[position]: calculateHorizontalGap(),
|
39 |
+
width : `calc(100% - ${calculateHorizontalGap()})`,
|
40 |
+
content : calcualteContent()
|
41 |
});
|
42 |
/**
|
43 |
* calcualte postion on scroll
|
44 |
*/
|
45 |
onscroll = function() {
|
46 |
callback({
|
47 |
+
top : calculateTop(),
|
48 |
+
[position]: calculateHorizontalGap(),
|
49 |
+
width : `calc(100% - ${calculateHorizontalGap()})`,
|
50 |
+
content : calcualteContent()
|
51 |
});
|
52 |
}
|
53 |
|
55 |
* @param eventData contains the sidebar position like "folded, responsive"
|
56 |
*/
|
57 |
$(document).on( 'wp-menu-state-set wp-collapse-menu', function( event, eventData ) {
|
58 |
+
sidebarWidth = $('#adminmenuwrap').outerWidth();
|
59 |
+
adminBarHeight = $('#wpadminbar').outerHeight();
|
60 |
+
headerEnd = $('.chaty-header').outerHeight();
|
61 |
|
62 |
+
callback({
|
63 |
+
top : calculateTop(),
|
64 |
+
[position]: calculateHorizontalGap(),
|
65 |
+
width : `calc(100% - ${calculateHorizontalGap()})`,
|
66 |
+
content : calcualteContent()
|
67 |
+
})
|
68 |
+
|
69 |
});
|
70 |
}
|
71 |
}
|
views/admin/chaty-popup.php
CHANGED
@@ -27,7 +27,7 @@ if (defined('ABSPATH') === false) {
|
|
27 |
Select chat channels that you'd like to add to your store, and fill out your info. For more info visit our <a class="text-primary hover:unde" target="_blank" href="https://premio.io/help/chaty/?utm_soruce=wordpresschaty">Help Center</a> and check the video.
|
28 |
</p>
|
29 |
|
30 |
-
<iframe class="font-primary text-sm text-cht-gray-150 mb-8 w-[530px] mx-auto bg-cht-primary/40 rounded-xl" height="300" src="https://www.youtube.com/embed/
|
31 |
|
32 |
<button class="btn rounded-md text-base shadow-lg inline-flex items-center space-x-2 shadow-cht-primary/60 font-normal font-primary" type="button">
|
33 |
<span>Go to Chaty</span>
|
@@ -37,4 +37,4 @@ if (defined('ABSPATH') === false) {
|
|
37 |
</button>
|
38 |
<input type="hidden" id="chaty_update_popup_status" value="<?php echo wp_create_nonce("chaty_update_popup_status") ?>">
|
39 |
</div>
|
40 |
-
</div>
|
27 |
Select chat channels that you'd like to add to your store, and fill out your info. For more info visit our <a class="text-primary hover:unde" target="_blank" href="https://premio.io/help/chaty/?utm_soruce=wordpresschaty">Help Center</a> and check the video.
|
28 |
</p>
|
29 |
|
30 |
+
<iframe class="font-primary text-sm text-cht-gray-150 mb-8 w-[530px] mx-auto bg-cht-primary/40 rounded-xl" height="300" src="https://www.youtube.com/embed/nYCIoOxuU1E?rel=0&start=18"></iframe>
|
31 |
|
32 |
<button class="btn rounded-md text-base shadow-lg inline-flex items-center space-x-2 shadow-cht-primary/60 font-normal font-primary" type="button">
|
33 |
<span>Go to Chaty</span>
|
37 |
</button>
|
38 |
<input type="hidden" id="chaty_update_popup_status" value="<?php echo wp_create_nonce("chaty_update_popup_status") ?>">
|
39 |
</div>
|
40 |
+
</div>
|