PageSourceSearch

https://www.bestiepaws.com/wp-content/themes/superb-pixels/js/script.js?ver=20160720

js bestiepaws.com collected 2026-10-08 07:29:32 UTC 5,192 bytes, 177 lines download raw bytes

1"use strict";
2jQuery.fn.exists = function (callback) {
3  var args = [].slice.call(arguments, 1);
4  if (this.length) {
5    callback.call(this, args);
6  }
7  return this;
8};
9
10(function ($) {
11  "use strict";
12  var khmerScript = {
13    initAll: function () {
14      this.menuShowHide();
15      this.searchOpen();
16    },
17
18    menuShowHide: function () {
19      var $primary_menu = $("#primary-site-navigation");
20      var $secondary_menu = $("#secondary-site-navigation");
21
22      var $first_menu = "";
23      var $second_menu = "";
24
25      if ($primary_menu.length == 0 && $secondary_menu.length == 0) {
26        return;
27      } else {
28        if ($primary_menu.length) {
29          $first_menu = $primary_menu;
30        }
31      }
32
33      var menu_wrapper = $first_menu.clone().appendTo("#smobile-menu");
34
35      if ($secondary_menu.length) {
36        if ($("ul.smenu").length) {
37          var $second_menu = $secondary_menu
38            .find("ul.smenu")
39            .clone()
40            .insertAfter("#smobile-menu .primary-menu .pmenu");
41        } else {
42          var $second_menu1 = $secondary_menu
43            .find(".smenu > ul")
44            .clone()
45            .insertAfter("#smobile-menu .primary-menu .pmenu");
46        }
47      }
48
49      $(
50        "#smobile-menu .header-content-container.navigation-layout-large"
51      ).remove();
52
53      $(".toggle-mobile-menu").click(function (e) {
54        e.preventDefault();
55        e.stopPropagation();
56
57        if (!$("body").hasClass("mobile-menu-active")) {
58          $("#smobile-menu").show().addClass("show");
59          $("body").toggleClass("mobile-menu-active");
60        } else {
61          khmerScript.callFunctionHideMenu();
62        }
63      });
64
65      $(
66        '<span class="sub-arrow"><i class="fa fa-angle-down"></i></span>'
67      ).insertAfter(
68        $(".menu-item-has-children > a, .page_item_has_children > a")
69      );
70
71      $(
72        ".menu-item-has-children .sub-arrow, .page_item_has_children .sub-arrow"
73      ).click(function (e) {
74        e.preventDefault();
75        e.stopPropagation();
76
77        var subMenuOpen = $(this).hasClass("sub-menu-open");
78
79        if (subMenuOpen) {
80          $(this).removeClass("sub-menu-open");
81          $(this)
82            .find("i")
83            .removeClass("fa-angle-up")
84            .addClass("fa-angle-down");
85          $(this)
86            .next("ul.children, ul.sub-menu")
87            .removeClass("active")
88            .slideUp();
89        } else {
90          $(this).addClass("sub-menu-open");
91          $(this)
92            .find("i")
93            .removeClass("fa-angle-down")
94            .addClass("fa-angle-up");
95          $(this)
96            .next("ul.children, ul.sub-menu")
97            .addClass("active")
98            .slideDown();
99        }
100      });
101
102      if ($("#wpadminbar").length) {
103        $("#smobile-menu").addClass("wpadminbar-active");
104      }
105    },
106
107    searchOpen: function () {
108      $(".btn-search").on("click", function (e) {
109        e.preventDefault();
110        e.stopPropagation();
111        $(".search-style-one").addClass("open");
112        $(".overlay").find("input").focus();
113      });
114
115      $(".overlay-close").on("click", function (e) {
116        e.preventDefault();
117        e.stopPropagation();
118        $(".search-style-one").removeClass("open");
119      });
120
121      $(document).on("click", function (e) {
122        $(".search-style-one").removeClass("open");
123      });
124
125      $(".search-style-one").click(function (e) {
126        e.preventDefault();
127        e.stopPropagation();
128      });
129    },
130    callFunctionHideMenu: function () {
131      $("#smobile-menu").removeClass("show");
132      jQuery("body").removeClass("mobile-menu-active");
133      jQuery("html").removeClass("noscroll");
134      jQuery("#mobile-menu-overlay").fadeOut();
135    },
136  };
137
138  $(document)
139    .ready(function (e) {
140      khmerScript.initAll();
141    })
142    .on("click", function (event) {
143      khmerScript.callFunctionHideMenu();
144    });
145
146  // Initialize gototop for carousel
147  if ($("#goTop").length > 0) {
148    // Hide the toTop button when the page loads.
149    $("#goTop").css("display", "none");
150
151    // This function runs every time the user scrolls the page.
152    $(window).scroll(function () {
153      // Check weather the user has scrolled down (if "scrollTop()"" is more than 0)
154      if ($(window).scrollTop() > 0) {
155        // If it's more than or equal to 0, show the toTop button.
156        $("#goTop").fadeIn("slow");
157      } else {
158        // If it's less than 0 (at the top), hide the toTop button.
159        $("#goTop").fadeOut("slow");
160      }
161    });
162
163    // When the user clicks the toTop button, we want the page to scroll to the top.
164    jQuery("#goTop").click(function (event) {
165      // Disable the default behaviour when a user clicks an empty anchor link.
166      // (The page jumps to the top instead of // animating)
167      event.preventDefault();
168      // Animate the scrolling motion.
169      jQuery("html, body").animate(
170        {
171          scrollTop: 0,
172        },
173        "slow"
174      );
175    });
176  }
177})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.