. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.216.168   [ Reverse IP ]
Web Server : Apache
System : Linux webm002.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : eticmes ( 123698)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/eticmes/www/wp-content/themes/oceanwp/assets/src/js/theme/search/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/eticmes/www/wp-content/themes/oceanwp/assets/src/js/theme/search/mobile-search-icon.js
import { options } from "../../constants";
import { fadeIn, fadeOut } from "../../lib/utils";
import SearchBase from "./base";

class MobileSearchIcon extends SearchBase {
  #elements;

  constructor() {
    super();

    if (options.mobileMenuSearchStyle === "disabled") {
      return;
    }

    this.#setElements();
    this.#setupEventListeners();
  }

  #setElements = () => {
    this.#elements = {
      dropdownSearchIcon: document.querySelector(".search-icon-dropdown"),
      dropdownSearchForm: document.querySelector(".search-style-dropdown"),
      overlaySearch: document.querySelector(".search-style-overlay"),
      overlaySearchIcon: document.querySelector(".search-icon-overlay"),
      overlaySearchCloseIcon: document.querySelector(
        ".search-style-overlay .search-overlay-close"
      ),
      html: document.querySelector("html"),
    };
  };

  #setupEventListeners = () => {

    if ( ! this.#elements ) {
      return;
    }

    if (options.mobileMenuSearchStyle === "drop_down") {
      this.#elements.dropdownSearchIcon?.addEventListener(
        "click",
        this.#toggleDropdownSearch
      );
      document.addEventListener("click", this.#onClickDocument);
    } else if (options.mobileMenuSearchStyle === "overlay") {
      this.#elements.overlaySearchIcon?.addEventListener(
        "click",
        this.#openOverlaySearch
      );
      this.#elements.overlaySearchCloseIcon?.addEventListener(
        "click",
        this.#closeOverlaySearch
      );
      this.#elements.overlaySearch?.addEventListener(
        "click",
        this.#onClickOverlaySearch
      );
    }
  };

  #toggleDropdownSearch = (event) => {
    event.preventDefault();
    event.stopPropagation();

    this.#elements.dropdownSearchForm.classList.toggle("show");
    this.#elements.dropdownSearchIcon.classList.toggle("active");

    this.focus(
      this.#elements.dropdownSearchForm.querySelector("form"),
      "input.field"
    );
  };

  #openOverlaySearch = (event) => {
    event.preventDefault();

    this.#elements.overlaySearch.classList.add("active");
    fadeIn(this.#elements.overlaySearch);

    this.focus(
      this.#elements.overlaySearch.querySelector("form"),
      "input.mobile-search-overlay-input"
    );

    setTimeout(() => {
      this.#elements.html.style.overflow = "hidden";
    }, 400);
  };

  #closeOverlaySearch = (event) => {
    event.preventDefault();

    this.#elements.overlaySearch.classList.remove("active");
    fadeOut(this.#elements.overlaySearch);

    setTimeout(() => {
      this.#elements.html.style.overflow = "visible";
    }, 400);
  };

  #onClickOverlaySearch = (event) => {
    this.#elements.overlaySearch.querySelector("input").focus();
  };

  #onClickDocument = (event) => {
    if (!event.target.closest("#icon-searchform-dropdown.show")) {
      this.#elements.dropdownSearchIcon.classList.remove("active");
      this.#elements.dropdownSearchForm.classList.remove("show");
    }
  };
}

("use script");
window.oceanwp = window.oceanwp || {};
oceanwp.mobileSearchIcon = new MobileSearchIcon();

Anon7 - 2022
AnonSec Team