Plugin Directory

Changeset 3106461


Ignore:
Timestamp:
06/24/2024 07:20:58 AM (21 months ago)
Author:
biggidroid
Message:

Added update

Location:
customize-tawk-to-widget/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • customize-tawk-to-widget/trunk/README.md

    r3001040 r3106461  
    44Tags: tawk.to, tawkto, customize, chat, chatbot
    55Requires at least: 3.0.0
    6 Tested up to: 6.4
    7 Stable tag: 1.3.4
     6Tested up to: 6.5
     7Stable tag: 1.3.6
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    1717
    1818== Changelog ==
     19
     20= 1.3.6 =
     21Added update
     22
     23= 1.3.5 =
     24Added update
    1925
    2026= 1.3.4 =
  • customize-tawk-to-widget/trunk/assets/js/main.js

    r2983150 r3106461  
    1414      ) {
    1515        //set left style 20px
    16         element.style.left = "20px";
     16        element.style.setProperty("left", "20px", "important");
    1717        //set right style auto
    18         element.style.right = "auto";
     18        element.style.setProperty("right", "auto", "important");
    1919      } else {
    2020        //set right style 20px
    21         element.style.right = "20px";
     21        element.style.setProperty("right", "20px", "important");
    2222        //set left style auto
    23         element.style.left = "auto";
     23        element.style.setProperty("left", "auto", "important");
    2424      }
    2525    });
     
    3131  () => {
    3232    window.Tawk_API = window.Tawk_API || {};
     33
     34    // Set interval to check for .widget-visible or .widget-hidden class
     35    window.widgetVisibilityCheck = setInterval(() => {
     36      //check if .widget-visible exists
     37      if (document.querySelector(".widget-visible")) {
     38        //set advancetawktocustomise to display none to important
     39        document
     40          .querySelector(".widget-visible")
     41          .style.setProperty("display", "none", "important");
     42
     43        //confirm .widget-visible is hidden then clear interval
     44        if (
     45          document.querySelector(".widget-visible").style.display === "none"
     46        ) {
     47          clearInterval(widgetVisibilityCheck);
     48        }
     49      }
     50    }, 50);
     51
    3352    window.Tawk_API.onLoad = function () {
    3453      //display advancetawktocustomise
     
    4160      .querySelector(".advancetawktocustomise-new-design")
    4261      .addEventListener("click", () => {
     62        //then toggle widget
    4363        window.$_Tawk.toggle();
    4464      });
     
    4767      //fade in advancetawktocustomisebtn
    4868      document.querySelector(".advancetawktocustomise").style.display = "block";
     69      //hide widget
     70      window.$_Tawk.hideWidget();
    4971    };
    5072
     
    5274      document.querySelector(".advancetawktocustomise").style.display = "none";
    5375    };
     76
     77    //customise init
     78    let initcustomise = () => {
     79      //init
     80      document.querySelector(".advancetawktocustomise").style.display = "block";
     81      //hideWidget
     82      window.$_Tawk.hideWidget();
     83      //check element exist and set widget-hidden to block
     84      if (document.querySelector(".widget-hidden")) {
     85        document.querySelector(".widget-hidden").style.display = "block";
     86      }
     87      //check element exist and set widget-visible to none
     88      if (document.querySelector(".widget-visible")) {
     89        document.querySelector(".widget-visible").style.display = "block";
     90      }
     91    };
     92
     93    //set interval to check if api has onBeforeLoaded hasOwnProperty and is true
     94    let tawkApiCheck = setInterval(() => {
     95      if (
     96        window.Tawk_API.hasOwnProperty("onBeforeLoaded") &&
     97        window.Tawk_API.onBeforeLoaded
     98      ) {
     99        initcustomise();
     100        clearInterval(tawkApiCheck);
     101      }
     102    }, 500);
    54103  },
    55104  false
    56105);
     106
     107//set interval to check if api has onBeforeLoaded hasOwnProperty and is true
     108setInterval(() => {
     109  customiseTawkToWidget();
     110}, 50);
  • customize-tawk-to-widget/trunk/customize-tawk-to-widget.php

    r3001040 r3106461  
    77 * Author URI: https://adeleyeayodeji.com
    88 * Description: This plugin allows you to customize the Tawk.to widget.
    9  * Version: 1.3.4
    10  * License: 1.3.4
     9 * Version: 1.3.5
     10 * License: 1.3.5
    1111 * License URL: http://www.gnu.org/licenses/gpl-2.0.txt
    1212 * text-domain: customize-tawk-to-widget
Note: See TracChangeset for help on using the changeset viewer.