$89 GRAYBYTE WORDPRESS FILE MANAGER $25

SERVER : premium246.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 199.188.201.56 | ADMIN IP 216.73.216.146
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/kjohakhy/https:/airworldmechanical.net/sms/whatsappchatpro/

HOME
Current File : /home/kjohakhy/https:/airworldmechanical.net/sms/whatsappchatpro//chatpro.js
(function($) {
  const widgetPosition = 'right';
  const enableGDPR = true;
  const buttonEffect = 'ripple';

  var wa_time_out, wa_time_in;
  
  function isMobile() {
    return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  }

  $(document).on('click', '.wa__popup_content_item a', function(e) {
    e.preventDefault();

    const phone = $(this).data('phone');
    const text = $(this).data('text');
    
    if (!phone) {
        console.error("WhatsApp phone number is not defined. Please check the 'data-phone' attribute.");
        return;
    }

    const encodedText = encodeURIComponent(text || '');
    const baseDomain = isMobile() ? 'api.whatsapp.com' : 'web.whatsapp.com';
    const fullUrl = `https://${baseDomain}/send?phone=${phone}&text=${encodedText}`;

    window.open(fullUrl, '_blank');
  });

   function enableButtonEffect() {
    const $icon = $('.wa__btn_popup_icon');
    
    // Clear any existing effects
    $icon.removeClass('pulse ripple'); 

    // Add the selected effect
    if (buttonEffect === 'pulse') {
      $icon.addClass('pulse');
    } else if (buttonEffect === 'ripple') {
      $icon.addClass('ripple');
    }
    // If buttonEffect is 'none', nothing is added
  }

  function disableButtonEffect() {
    // Clear all effects
    $('.wa__btn_popup_icon').removeClass('pulse ripple');
  }

  $(document).ready(function() {
    if (widgetPosition === 'left') {
        $('.wa__btn_popup, .wa__popup_chat_box').addClass('wa-widget-position--left');
    } else {
        $('.wa__btn_popup, .wa__popup_chat_box').addClass('wa-widget-position--right');
    }

    // --- Availability Check ---
    function updateAvailability() {
      let anyOnline = false;
      $('.wa__popup_content_item a').each(function() {
          const $link = $(this);
          const timezone = $link.data('timezone');
          const [workStart, workEnd] = $link.data('hours').split('-').map(Number);
          const [dayStart, dayEnd] = ($link.data('days') || '1-7').split('-').map(Number);
          
          const now = new Date();
          
          const hourOptions = { timeZone: timezone, hour12: false, hour: 'numeric' };
          const currentHour = parseInt(now.toLocaleString('en-US', hourOptions), 10);

          const dayOptions = { timeZone: timezone, weekday: 'long' };
          const currentDayName = now.toLocaleString('en-US', dayOptions);
          const dayMap = { "Monday": 1, "Tuesday": 2, "Wednesday": 3, "Thursday": 4, "Friday": 5, "Saturday": 6, "Sunday": 7 };
          const currentDay = dayMap[currentDayName];
          
          const isWithinHours = currentHour >= workStart && currentHour < workEnd;
          const isWithinDays = currentDay >= dayStart && currentDay <= dayEnd;
          const isAvailable = isWithinHours && isWithinDays;
  
          $link.toggleClass('wa__stt_online', isAvailable).toggleClass('wa__stt_offline', !isAvailable);
          $link.toggleClass('pointer-disable', !isAvailable);
          
          if(isAvailable) {
            anyOnline = true;
            $link.find('.wa__member_status').text('🟢 I am online now');
          } else {
            $link.find('.wa__member_status').text(`⏰ Available at ${workStart}:00`);
          }
      });

    anyOnline ? enableButtonEffect() : disableButtonEffect();
  }
  updateAvailability();
  setInterval(updateAvailability, 60000);

   $('.wa__popup_content_list').on('click', '.pointer-disable', function(e) {
    e.preventDefault();
    return false;
  });

    // --- Popup Toggle with original animation logic ---
    $(".wa__btn_popup").on("click", function() {
      if ($(".wa__popup_chat_box").hasClass("wa__active")) {
        $(".wa__popup_chat_box").removeClass("wa__active");
        $(".wa__btn_popup").removeClass("wa__active");
        clearTimeout(wa_time_in);
        if ($(".wa__popup_chat_box").hasClass("wa__lauch")) {
          wa_time_out = setTimeout(function() {
            $(".wa__popup_chat_box").removeClass("wa__pending");
            $(".wa__popup_chat_box").removeClass("wa__lauch");
          }, 400);
        }
      } else {
        $(".wa__popup_chat_box").addClass("wa__pending");
        $(".wa__popup_chat_box").addClass("wa__active");
        $(".wa__btn_popup").addClass("wa__active");
        clearTimeout(wa_time_out);
        if (!$(".wa__popup_chat_box").hasClass("wa__lauch")) {
          wa_time_in = setTimeout(function() {
            $(".wa__popup_chat_box").addClass("wa__lauch");
          }, 100);
        }
      }
    });

    // --- GDPR and Cookie Functions ---
    function setCookie(cname, cvalue, exdays) {
      var d = new Date();
      d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
      var expires = "expires="+d.toUTCString();
      document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
    }

    function getCookie(cname) {
      var name = cname + "=";
      var ca = document.cookie.split(';');
      for(var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') {
          c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
          return c.substring(name.length, c.length);
        }
      }
      return "";
    }

    function deleteCookie(cname) {
      document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
    }

    // GDPR Consent Handler
    function handleGDPRConsent() {
      const gdprCheckbox = $("#nta-wa-gdpr");
      const gdprContainer = $('.nta-wa-gdpr');

      if (!enableGDPR) {
        gdprContainer.hide(); // Hide the GDPR box
        $('.wa__popup_content_item').removeClass('pointer-disable'); // Ensure chat items are clickable
        $('.wa__popup_content_list').off('click.gdpr'); // Remove the click blocker
        return; // Stop processing the rest of the GDPR logic
      }
      
      // Handle checkbox change
      gdprCheckbox.on('change', function() {
        if (this.checked) {
          setCookie("nta-wa-gdpr", "accept", 30);
          $('.nta-wa-gdpr').slideUp(300, function() {
            $('.wa__popup_content_item').removeClass('pointer-disable');
            $('.wa__popup_content_list').off('click.gdpr');
          });
        } else {
          deleteCookie("nta-wa-gdpr");
          // You might want to re-add the 'pointer-disable' class if unchecked
          // $('.wa__popup_content_item').addClass('pointer-disable');
          // And re-attach the 'click.gdpr' handler
        }
      });

      // Check existing consent
      if (getCookie("nta-wa-gdpr") === "accept") {
        gdprContainer.hide();
        $('.wa__popup_content_item').removeClass('pointer-disable');
      } else {
        // Initially disable user items if GDPR is not accepted
        $('.wa__popup_content_item').addClass('pointer-disable');
        
        // Add visual feedback when trying to click disabled items
        $('.wa__popup_content_list').on('click.gdpr', '.pointer-disable', function(e){
          e.preventDefault();
          e.stopPropagation();
          
          // Add highlight effect to GDPR section
          gdprContainer.addClass('nta-wa-gdpr-highlight');
          setTimeout(function() {
            gdprContainer.removeClass('nta-wa-gdpr-highlight');
          }, 1000);
          
          return false;
        });
      }
    }

    // Initialize GDPR handling
    handleGDPRConsent();

  });
})(jQuery);


Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
17 Feb 2026 3.13 PM
kjohakhy / kjohakhy
0755
Company.png
7.822 KB
17 Feb 2026 3.14 PM
kjohakhy / kjohakhy
0644
Cross_icon_.svg.png
0.861 KB
17 Feb 2026 3.14 PM
kjohakhy / kjohakhy
0644
WhatsApp Image 2026-02-16 at 11.57.22 AM.jpeg
119.829 KB
17 Feb 2026 3.14 PM
kjohakhy / kjohakhy
0644
WhatsApp Image 2026-02-16 at 12.01.34 PM.jpeg
28.57 KB
17 Feb 2026 3.14 PM
kjohakhy / kjohakhy
0644
WhatsApp Image 2026-02-16 at 12.27.55 PM.jpeg
37.593 KB
17 Feb 2026 3.14 PM
kjohakhy / kjohakhy
0644
chatpro.css
11.9 KB
17 Feb 2026 3.14 PM
kjohakhy / kjohakhy
0644
chatpro.js
7.467 KB
17 Feb 2026 3.14 PM
kjohakhy / kjohakhy
0644
whatsapp-img1.jpg
10.225 KB
17 Feb 2026 3.14 PM
kjohakhy / kjohakhy
0644
whatsapp_logo_gray_sm.svg
1.81 KB
17 Feb 2026 3.14 PM
kjohakhy / kjohakhy
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF