Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
home
/
ophq1335
/
www
/
wp-content
/
plugins
/
divi-modules-pro
/
includes
/
modules
/
Popup
/
/home/ophq1335/www/wp-content/plugins/divi-modules-pro/includes/modules/Popup/custom.js
function dmproOnFullScreenChange() { document.fullscreenElement || document.msFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement ? jQuery("body").find(".dmpro_active_popup .dmpro_popup_inner_wrap").addClass("dmpro_popup_fullscreen") : jQuery("body").find(".dmpro_popup_module .dmpro_popup_inner_wrap").removeClass("dmpro_popup_fullscreen") } function dmpro_popup_stop_video(e) { if (void 0 === e || "" === e) return !1; if (e.find("iframe").length > 0) { let d = e.find("iframe").attr("src").replace("?autoplay=1", "").replace("&autoplay=1", "").replace("&mute=1&muted=1", ""); e.find("iframe").attr("src", d) } else e.find("video").length > 0 && (e.find("video").get(0).pause(), e.find("video").get(0).currentTime = 0) } function dmpro_popup_autoplay_video(e) { if (void 0 === e || "" === e) return !1; if ("on" === e.find(".dmpro_popup_wrapper").data("autoplay-video")) if (e.find("iframe").length > 0) { let d = "on_page_load" === e.find(".dmpro_popup_wrapper").data("trigger-type"), l = dmpro_popup_add_autoplay_to_url(e.find("iframe").attr("src"), d); e.find("iframe").attr("src", l) } else if (e.find("video").length > 0) { let d = e.find("video").get(0).play(); void 0 !== d && d.then(e => {}).catch(d => { e.find("video").prop("muted", !0), e.find("video").get(0).play() }) } } function dmpro_popup_add_autoplay_to_url(e, d) { let l = decodeURIComponent(e), o = l.split("&"); return 1 === o.length ? 1 !== (o = l.split("?")).length ? (l += "&autoplay=1", d && (l += "&mute=1&muted=1")) : (l += "?autoplay=1", d && (l += "&mute=1&muted=1")) : (l += "&autoplay=1", d && (l += "&mute=1&muted=1")), l } let diviModulesProPopupAddListeners = function () { document.addEventListener('focus', diviModulesProTrapFocus, true); }, diviModulesProPopupRemoveListeners = function () { document.removeEventListener('focus', diviModulesProTrapFocus, true); }, diviModulesProisFocusable = function (element) { if (element.tabIndex < 0) { return false; } if (element.disabled) { return false; } switch (element.nodeName) { case 'A': return !!element.href && element.rel != 'ignore'; case 'INPUT': return element.type != 'hidden'; case 'BUTTON': case 'SELECT': case 'TEXTAREA': return true; default: return false; } }, diviModulesProattemptFocus = function (element) { if ( !diviModulesProisFocusable(element) ) { return false; } try { element.focus(); } catch (e) { } return document.activeElement === element; }, diviModulesProFocusFirstDescendant = function (element) { for (var i = 0; i < element.childNodes.length; i++) { var child = element.childNodes[i]; if ( diviModulesProattemptFocus( child ) || diviModulesProFocusFirstDescendant( child ) ) { return true; } } return false; }, diviModulesProFocusLastDescendant = function (element) { for (var i = element.childNodes.length - 1; i >= 0; i--) { var child = element.childNodes[i]; if ( diviModulesProattemptFocus( child ) || diviModulesProFocusLastDescendant( child ) ) { return true; } } return false; }, diviModulesProTrapFocus = function ( event ) { let currentDialog = document.querySelector( '.dmpro_popup_opened .dmpro_popup_wrapper' ); if ( currentDialog.contains( event.target ) ) { currentDialog.lastFocus = event.target; } else { diviModulesProFocusFirstDescendant( currentDialog ); if ( currentDialog.lastFocus == document.activeElement ) { diviModulesProFocusLastDescendant( currentDialog ); } currentDialog.lastFocus = document.activeElement; } }; function dmpro_popup_get_module_classes() { return ["et_pb_sticky_module", "et_pb_sticky", "et_pb_sticky--top", "et_pb_sticky--bottom", "et_pb_sticky--top_bottom", "et_animated", "infinite", "et-waypoint", "et_had_animation", "fade", "fadeTop", "fadeRight", "fadeBottom", "fadeLeft", "slide", "slideTop", "slideRight", "slideBottom", "slideLeft", "bounce", "bounceTop", "bounceRight", "bounceBottom", "bounceLeft", "zoom", "zoomTop", "zoomRight", "zoomBottom", "zoomLeft", "flip", "flipTop", "flipRight", "flipBottom", "flipLeft", "fold", "foldTop", "foldRight", "foldBottom", "foldLeft", "roll", "rollTop", "rollRight", "rollBottom", "rollLeft", "transformAnim"] }! function(e) { let d = e(window).width(); e.fn.DiviModulesProPopupRemoveClasses = function(e) { let d = dmpro_popup_get_module_classes(); return d.push(e), this.removeClass(d.join(" ")), this.css({ "animation-delay": "", "animation-duration": "", "animation-timing-function": "", opacity: "", transform: "", filter: "" }), this }, e.fn.DiviModulesProPopup = function(l) { let o = this, a = 0, i = e.extend({}, { action: "", delay: "0" }, l) , popupId = o.prop("id") , wrapper = o.find(".dmpro_popup_wrapper") , createCookie = function( name, value, days ) { let expires = ''; if ( days ) { let date = new Date(); date.setTime(date.getTime() + ( days * 24 * 60 * 60 * 1000)); expires = '; expires=' + date.toUTCString(); } document.cookie = name + '=' + value + expires + '; path=/' + '; SameSite=Lax;'; } , readCookie = function( name ) { let nameEQ = name + "=" , ca = document.cookie.split(';'); for( var i=0; i < ca.length; i++ ) { let c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if ( c.indexOf(nameEQ) == 0 ) return c.substring(nameEQ.length,c.length); } return null; } , eraseCookie = function( name ) { createCookie( name, '', -1 ); } , cookieName = 'dmpro_popup' + popupId , cookieDays = wrapper.attr('data-dmpro-closecookie'); if ( "open" === i.action && readCookie( cookieName ) && cookieDays > 0 ) { return; } else if ( "open" === i.action && readCookie( cookieName ) && cookieDays == 0 ) { eraseCookie( cookieName ); } if (void 0 !== o.find(".dmpro_popup_wrapper").data("animation-duration") && (a = parseFloat(o.find(".dmpro_popup_wrapper").data("animation-duration")), d < 981 ? void 0 !== o.find(".dmpro_popup_wrapper").data("animation-duration-tablet") && "" !== o.find(".dmpro_popup_wrapper").data("animation-duration-tablet") && (a = parseFloat(o.find(".dmpro_popup_wrapper").data("animation-duration-tablet"))) : d < 768 && void 0 !== o.find(".dmpro_popup_wrapper").data("animation-duration-phone") && "" !== o.find(".dmpro_popup_wrapper").data("animation-duration-phone") && (a = parseFloat(o.find(".dmpro_popup_wrapper").data("animation-duration-phone")))), "open" === i.action) { let d = parseInt(i.delay); setTimeout(function() { let preDiv = e('<div/>', { "tabIndex": '0' }) , postDiv = e('<div/>', { "tabIndex": '0' }); o.prepend( preDiv ); o.append( postDiv ); let ctaCloseButton = o.find( '.dmpro_popup_close:last-child' ); if ( ctaCloseButton.length > 0 ) { ctaCloseButton.trigger( "focus" ); } a += 200, e("body").find(".dmpro_popup").removeClass("dmpro_active_popup"), e("body").addClass("dmpro_popup_active"), o.addClass("dmpro_active_popup"), setTimeout(function() { e("body").find(".dmpro_popup").removeClass("dmpro_popup_opened"), o.addClass("dmpro_popup_opened"), diviModulesProPopupAddListeners() }, a), setTimeout(function() { dmpro_popup_autoplay_video(o) }, .7 * a) }, d) } if ("close" === i.action) { let l = wrapper.data("trigger-type"), i = wrapper.data("re-render"); if ( cookieDays > 0 ) { createCookie( cookieName, 'true', cookieDays ); } diviModulesProPopupRemoveListeners(); if (0 !== a ? (o.removeClass("dmpro_active_popup"), o.find(".dmpro_animated").css("opacity", "1"), o.find(".dmpro_animated").css("transform", "none"), setTimeout(function() { o.find(".dmpro_animated").removeAttr("style"), o.addClass("dmpro_animate_reverse") }, 0), setTimeout(function() { o.removeClass("dmpro_animate_reverse"), o.removeClass("dmpro_popup_opened"), e("body").removeClass("dmpro_popup_active") }, a) ) : ( o.removeClass("dmpro_active_popup"), o.removeClass("dmpro_popup_opened"), e("body").removeClass("dmpro_popup_active") ), dmpro_popup_stop_video(o), -1 !== e.inArray(l, ["exit_intent", "on_page_load"])) { let e = popupId + "_" + l + "_hide"; ("on_page_load" === l && "off" === i || "exit_intent" === l) && localStorage.setItem(e, "true") } } return this } }(jQuery), jQuery(document).ready(function(e) { e("body").find(".dmpro_popup").length > 0 && (e("body").find(".dmpro_popup").each(function() { let d = e(this), l = d.prop("class"), o = d.prop("class").match(/dmpro_popup_\d+/)[0], a = d.find(".dmpro_popup_wrapper").data("id"), i = a + "_" + d.find(".dmpro_popup_wrapper").data("trigger-type") + "_hide", t = e('<div class="dmpro_popup_section et_pb_section entry-content et-l"></div>'), n = e("<div></div>"); if (n.prop("id", a), n.prop("class", l), n.DiviModulesProPopupRemoveClasses(o).addClass("dmpro_popup_module"), d.hasClass(o + "_tb_header") ? n.addClass(o + "_tb_header_module") : d.hasClass(o + "_tb_body") ? n.addClass(o + "_tb_body_module") : d.hasClass(o + "_tb_footer") ? n.addClass(o + "_tb_footer_module") : n.addClass(o + "_module"), n.html(e(this).find(".dmpro_popup_wrapper").detach()), t.html(n), e("body").find("#page-container").find("#et-boc").length > 0 ? e("body").find("#page-container").find("#et-boc").append(t) : e("body").find("#page-container").length > 0 ? e("body").find("#page-container").append(t) : e("body").find("#et_builder_outer_content").length > 0 ? e("body").find("#et_builder_outer_content").append(t) : e("body").find("#et-boc").length > 0 ? e("body").find("#et-boc").append(t) : e("body").append(t), "none" !== d.css("display")) if ("element" === n.find(".dmpro_popup_wrapper").data("trigger-type")) if (void 0 !== n.find(".dmpro_popup_wrapper").data("trigger-element-id") && "" !== n.find(".dmpro_popup_wrapper").data("trigger-element-id")) { let d = "#" + n.find(".dmpro_popup_wrapper").data("trigger-element-id"); e("body").find(d).on("click", function(e) { e.preventDefault(), n.DiviModulesProPopup({ action: "open" }) }) } else if (void 0 !== n.find(".dmpro_popup_wrapper").data("trigger-element-class") && "" !== n.find(".dmpro_popup_wrapper").data("trigger-element-class")) { let d = "." + n.find(".dmpro_popup_wrapper").data("trigger-element-class"); e("body").find(d).on("click", function(e) { e.preventDefault(), n.DiviModulesProPopup({ action: "open" }) }) } else d.find(".dmpro_popup_trigger_element").length > 0 && d.find(".dmpro_popup_trigger_element").on("click", function(e) { e.preventDefault(), n.DiviModulesProPopup({ action: "open" }) }); else if ("on_page_load" === n.find(".dmpro_popup_wrapper").data("trigger-type")) { let e = parseFloat(n.find(".dmpro_popup_wrapper").data("trigger-delay")), d = n.find(".dmpro_popup_wrapper").data("re-render"); ("off" === d && "true" !== localStorage.getItem(i) || "on" === d) && n.DiviModulesProPopup({ action: "open", delay: e }) } else "exit_intent" === n.find(".dmpro_popup_wrapper").data("trigger-type") && e(document).on("mouseout", function(e) { n.hasClass("dmpro_popup_opened") || null == e.toElement && null == e.relatedTarget && "true" !== localStorage.getItem(i) && n.DiviModulesProPopup({ action: "open" }) }) }), e("body").on("click", ".dmpro_popup_close", function(e) { e.preventDefault() }), e("body").on("click", ".dmpro_popup_opened .dmpro_popup_wrapper", function(d) { if (e(d.target).is(e(this))) { e(this).parents(".dmpro_popup").DiviModulesProPopup({ action: "close" }) } }), e("body").on("click", ".dmpro_popup_opened .dmpro_popup_close", function(d) { d.preventDefault(), e(this).parents(".dmpro_popup").DiviModulesProPopup({ action: "close" }) }), e(document).on("keyup", function(d) { if (27 === d.keyCode && e("body").hasClass("dmpro_popup_active") && e("body").find(".dmpro_popup_opened .dmpro_popup_wrapper").hasClass("dmpro_popup_close_on_esc") && e("body").find(".dmpro_popup_opened .dmpro_popup_wrapper").length > 0) { e("body").find(".dmpro_popup_opened").DiviModulesProPopup({ action: "close" }) } }), null === document.onfullscreenchange ? document.onfullscreenchange = dmproOnFullScreenChange : null === document.onmsfullscreenchange ? document.onmsfullscreenchange = dmproOnFullScreenChange : null === document.onmozfullscreenchange ? document.onmozfullscreenchange = dmproOnFullScreenChange : null === document.onwebkitfullscreenchange && (document.onwebkitfullscreenchange = dmproOnFullScreenChange)) });