Uname: Linux p3plzcpnl499967.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Software: Apache
PHP version: 8.2.30 [ PHP INFO ] PHP os: Linux
Server Ip: 208.109.40.231
Your Ip: 216.73.216.26
User: nayff91c5tsx (10005085) | Group: nayff91c5tsx (10005085)
Safe Mode: OFF
Disable Function:
NONE

name : site.js
/**
 * Custom polyfill NodeList.prototype.forEach
 *
 * @see https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach
 */
if (window.NodeList && !NodeList.prototype.forEach) {
	NodeList.prototype.forEach = Array.prototype.forEach;
}

var WpbfPremium = {};

/**
 * This module is intended to handle the site wide JS functionality.
 * Except for the desktop menu and mobile menu.
 *
 * Along with the desktop-menu.js and mobile-menu.js, this file will be combined to site-min.js file.
 *
 * @param {Object} $ jQuery object.
 * @return {Object}
 */
WpbfPremium.site = (function ($) {
	/**
	 * Whether we're inside customizer or not.
	 *
	 * @var bool
	 */
	var isInsideCustomizer = window.wp && wp.customize ? true : false;

	/**
	 * Pre-defined breakpoints.
	 *
	 * @var Object
	 */
	var breakpoints = {
		desktop: 1024,
		tablet: 768,
		mobile: 480,
	};

	// Run the module.
	init();

	/**
	 * Initialize the module, call the main functions.
	 *
	 * This function is the only function that should be called on top level scope.
	 * Other functions are called / hooked from this function.
	 */
	function init() {
		setupBreakpoints();
		setupResponsiveVideoOptIn();
		setupPostGridMasonry();
	}

	/**
	 * Setup breakpoints for desktop, tablet, and mobile.
	 */
	function setupBreakpoints() {
		setupBreakpoint("desktop");
		setupBreakpoint("tablet");
		setupBreakpoint("mobile");
	}

	/**
	 * Setup breakpoint by device type.
	 *
	 * Retrieve breakpoint based on body class,
	 * then set it as the value of top level `breakpoints` variable.
	 *
	 * @param {string} device The device type. Accepts 'desktop', 'tablet', or 'mobile'.
	 */
	function setupBreakpoint(device) {
		var matchRule = "wpbf-" + device + "-breakpoint-[\\w-]*\\b";
		var breakpointClass = $("body").attr("class").match(matchRule);

		if (null != breakpointClass) {
			breakpoints[device] = breakpointClass.toString().match(/\d+/);
			breakpoints[device] = Array.isArray(breakpoints[device])
				? breakpoints[device][0]
				: breakpoints[device];
		}
	}

	/**
	 * Setup responsive video opt-in.
	 */
	function setupResponsiveVideoOptIn() {
		$(document).on(
			"click",
			".wpbf-video-opt-in-button, .wpbf-video-opt-in-image",
			function (e) {
				e.preventDefault();

				var $parentNext = $(this).parent().next();
				var url = $parentNext.attr("data-wpbf-video");

				$parentNext.attr("data-wpbf-video");
				$parentNext.children().attr("src", url);
				$parentNext.removeClass("opt-in");
				this.parentNode.remove(this);
			},
		);
	}

	/**
	 * Setup post grid masonry.
	 */
	function setupPostGridMasonry() {
		window.addEventListener("load", function (e) {
			var $grid = $(".wpbf-post-grid-masonry");
			if (!$grid.length) return;

			$grid.isotope({
				itemSelector: ".wpbf-article-wrapper",
				transitionDuration: 0,
			});
		});
	}

	init();

	return {
		isInsideCustomizer: isInsideCustomizer,
		breakpoints: breakpoints,
	};
})(jQuery);
© 2026 GrazzMean