Viewing File: /home/fshjisk/myqueen/wp-content/plugins/fusion-builder/assets/js/min/general/awb-off-canvas.js

!function(e){"use strict";window.awbOffCanvas={capitalize:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},set:function(e,n,a){e=e?"_"+e:"_data";let t=localStorage.getItem("off_canvas"+e);(t=t?JSON.parse(t):{})[n]=a,localStorage.setItem("off_canvas"+e,JSON.stringify(t))},get:function(e,n){e=e?"_"+e:"_data";let a=localStorage.getItem("off_canvas"+e);return(a=a?JSON.parse(a):{})[n]||""},animationsWithoutDirection:["flash","rubberBand","shake","flipinx","flipiny","lightspeedin","flipOutX","flipOutY","lightSpeedOut"],open_off_canvas:function(n,a=!0,t=!1){const s=e('.awb-off-canvas-wrap[data-id="'+n+'"]'),o=s.find(".awb-off-canvas"),i=window["off_canvas_"+n];if(!s.length)return;if(s.hasClass("awb-show")&&t)return void this.close_off_canvas(n);if(this.set(n,"last_open_date",new Date),s.hasClass("awb-show")&&!t)return;let c=i.enter_animation;const f=i.enter_animation_direction&&"static"!==i.enter_animation_direction?this.capitalize(i.enter_animation_direction):"",r=i.enter_animation_speed||1;if(("off"===i.status_css_animations||"desktop"===i.status_css_animations&&i.is_mobile)&&(c=!1),c){if(this.animationsWithoutDirection.includes(c)||(c=c+"In"+f),o.addClass("fusion-animated "+c),o.attr("data-animation-type",c),o.css({visibility:"visible","animation-duration":r+"s"}),"sliding-bar"===i.type&&"push"===i.transition&&("left"===i.position||"right"===i.position)){const n={transition:"margin-left "+i.enter_animation_speed+"s"};n.marginLeft=o.outerWidth()+"px","right"===i.position&&(n.marginLeft="-"+o.outerWidth()+"px");let a="#wrapper";s.hasClass("init-for-studio")&&(a=".post-preview"),e(a).css(n),e('#sliders-container .tfs-slider[data-parallax="1"]').length&&e('#sliders-container .tfs-slider[data-parallax="1"]').css(n)}}else this.enableTrapFocus(s);if("no"===i.overlay_page_scrollbar&&e("html").css("overflow","hidden"),s.addClass("awb-show"),e('a[href^="#awb-oc__'+n+'"]').addClass("awb-oc-active"),a){const e=this.get(n,"open_count")||0;this.set(n,"open_count",e+1)}s.trigger(e.Event("awb-oc-opened"),[n])},close_off_canvas:function(n,a=!0){const t=e('.awb-off-canvas-wrap[data-id="'+n+'"]'),s=t.find(".awb-off-canvas"),o=window["off_canvas_"+n];if(0===t.length||void 0===o)return;let i=o.exit_animation;const c=o.exit_animation_direction&&"static"!==o.exit_animation_direction?this.capitalize(o.exit_animation_direction):"",f=o.exit_animation_speed||1;if(("off"===o.status_css_animations||"desktop"===o.status_css_animations&&o.is_mobile)&&(i=!1),i){if(this.animationsWithoutDirection.includes(i)||(i=i+"Out"+c),s.addClass("fusion-animated "+i),s.attr("data-animation-type",i),s.addClass("is-closing"),s.css("animation-duration",f+"s"),"sliding-bar"===o.type&&"push"===o.transition&&("left"===o.position||"right"===o.position)){const n={transition:"margin-left "+o.exit_animation_speed+"s",marginLeft:0};let a="#wrapper";t.hasClass("init-for-studio")&&(a=".post-preview"),e(a).css(n),e('#sliders-container .tfs-slider[data-parallax="1"]').length&&e('#sliders-container .tfs-slider[data-parallax="1"]').css(n)}}else"yes"===o.overlay&&t.hasClass("init-for-studio")&&s.addClass("is-closing"),"no"===o.overlay&&t.hasClass("init-for-studio")&&e("#icon-bar .go-back").click(),t.removeClass("awb-show");if(e('a[href^="#awb-oc__'+n+'"]').removeClass("awb-oc-active"),"no"===o.overlay_page_scrollbar&&e("html").css("overflow",""),setTimeout(()=>{this.removeHash()},10),a){const e=this.get(n,"close_count")||0;this.set(n,"close_count",e+1)}this.set(n,"closed",!0),t.trigger(e.Event("awb-oc-closed"),[n])},removeHash(){const e=window.location.href.split("#")[0];history.replaceState({},"",e)},enableTrapFocus(e){if(!e.hasClass("type-popup"))return;const n=e.find(".awb-off-canvas"),a=n.find('a[href]:not([disabled]):visible, button:not([disabled]):visible, textarea:not([disabled]):visible, input[type="text"]:not([disabled]):visible, input[type="radio"]:not([disabled]):visible, input[type="checkbox"]:not([disabled]):visible, select:not([disabled]):visible'),t=a[0],s=a[a.length-1];setTimeout(()=>{n[0].focus()},100),n[0].addEventListener("keydown",function(e){("Tab"===e.key||9===e.keyCode)&&(e.shiftKey?document.activeElement===t&&(s.focus(),e.preventDefault()):document.activeElement===s&&(t.focus(),e.preventDefault()))})}},e(".awb-off-canvas").on("animationend",function(n){const a=e(this),t=a.parent();a.attr("data-animation-type")&&a.removeClass("fusion-animated").removeClass(a.attr("data-animation-type")).removeAttr("data-animation-type"),a.hasClass("is-closing")?(a.removeClass("is-closing"),a.addClass("oc-waiting-for-close"),t.removeClass("awb-show"),t.hasClass("init-for-studio")&&e("#icon-bar .go-back").click()):window.awbOffCanvas.enableTrapFocus(t)}),e(".awb-off-canvas-wrap").on("transitionend",function(n){const a=e(this).find(".awb-off-canvas");a.hasClass("is-closing")&&e(this).hasClass("init-for-studio")&&(e("#icon-bar .go-back").click(),a.removeClass("is-closing")),a.removeClass("oc-waiting-for-close")}),e(window).on("load",function(){if(location.hash&&location.hash.startsWith("#awb-oc__")||location.hash&&location.hash.startsWith("#awb-open-oc__")){const e=location.hash.split("__")[1];window.awbOffCanvas.open_off_canvas(e,!1,!1)}e(".awb-off-canvas-wrap.init-for-studio").each(function(n,a){const t=e(a).data("id");window.awbOffCanvas.open_off_canvas(t,!1,!1)}),e(".awb-off-canvas-wrap").each(function(){e(this).on("awb-oc-closed",function(){e(this).find(".fusion-youtube iframe").each(function(){this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),e(this).find(".fusion-vimeo iframe").each(function(){new Vimeo.Player(this).pause()}),e(this).find(".mejs-audio").each(function(){e(this).find(".mejs-playpause-button.mejs-pause button").trigger("click")})})})}),e('a[href^="#awb-oc__"]').on("click",function(n){n.preventDefault();const a=(e(this).attr("href")||"").split("__")[1];window.awbOffCanvas.open_off_canvas(a,!1,!0)}),e('a[href^="#awb-open-oc__"]').on("click",function(n){n.preventDefault();const a=(e(this).attr("href")||"").split("__")[1];window.awbOffCanvas.open_off_canvas(a,!1,!1)}),e('a[href^="#awb-close-oc__"]').on("click",function(n){n.preventDefault();const a=(e(this).attr("href")||"").split("__")[1];a?window.awbOffCanvas.close_off_canvas(a):e(".awb-off-canvas-wrap.awb-show").each(function(){const n=e(this).data("id");window.awbOffCanvas.close_off_canvas(n)}),window.awbOffCanvas.removeHash()}),e(".awb-off-canvas-wrap:not(.overlay-disable-close)").on("click",function(n){if(n.target===this){const n=e(this).data("id");window.awbOffCanvas.close_off_canvas(n)}}),e(".off-canvas-close").on("click",function(n){n.preventDefault();const a=e(this).closest(".awb-off-canvas-wrap").data("id");window.awbOffCanvas.close_off_canvas(a)}),e(document).on("keydown",function(n){if(27!==n.keyCode)return;e(".awb-off-canvas-wrap.awb-show:not(.disable-close-on-esc)").each(function(n,a){const t=e(a).data("id");window.awbOffCanvas.close_off_canvas(t)})}),e("body").on("goback",function(n){e(".post-preview").css({"margin-right":0,"margin-left":0})}),e(".awb-off-canvas-wrap").each(function(n,a){const t=e(a).data("id"),s=window["off_canvas_"+t],o=e("#wpadminbar"),i=o.outerHeight();if("full"===s.height&&o.length&&e(a).find(".awb-off-canvas").css("height",`calc(100vh - ${i}px)`),"sliding-bar"===s.type&&"top"===s.position&&o.length&&e(a).find(".awb-off-canvas").css("margin-top",`${i}px`),"yes"===s.on_click){const n=s.on_click_element?e(s.on_click_element):null;n&&n.length&&(n.attr("data-off-canvas",s.on_click_element),e(document).on("click",s.on_click_element,function(e){e.preventDefault(),window.awbOffCanvas.open_off_canvas(t,!1)}))}let c=!1;if(s.frequency){if("close"===s.frequency){!0===window.awbOffCanvas.get(t,"closed")&&(c=!0)}if("once"===s.frequency){0<window.awbOffCanvas.get(t,"open_count")&&(c=!0)}if("xtimes"===s.frequency&&s.frequency_xtimes){const e=window.awbOffCanvas.get(t,"open_count");parseInt(s.frequency_xtimes)<=e&&(c=!0)}if("session"===s.frequency){sessionStorage.getItem("off_canvas_"+t+"_opened")?c=!0:sessionStorage.setItem("off_canvas_"+t+"_opened",!0)}let e=window.awbOffCanvas.get(t,"last_open_date");const n=new Date;if("day"===s.frequency&&e){n<(e=new Date(e)).getTime()+864e5&&(c=!0)}if("week"===s.frequency&&e){n<(e=new Date(e)).getTime()+6048e5&&(c=!0)}if("month"===s.frequency&&e){e=new Date(e),n<new Date(e).setMonth(e.getMonth()+1)&&(c=!0)}if("xdays"===s.frequency&&s.frequency_xdays&&e){e=new Date(e);const a=parseInt(s.frequency_xdays);n<e.getTime()+24*a*60*60*1e3&&(c=!0)}}if("yes"===s.after_x_page_views){const e=window.awbOffCanvas.get(t,"page_views")||0;e<parseInt(s.number_of_page_views)&&(c=!0),window.awbOffCanvas.set(t,"page_views",e+1)}if("yes"===s.after_x_sessions){let e;sessionStorage.getItem("off_canvas_"+t)||(sessionStorage.setItem("off_canvas_"+t,!0),e=window.awbOffCanvas.get(t,"sessions")||0,window.awbOffCanvas.set(t,"sessions",e+1)),(e=window.awbOffCanvas.get(t,"sessions"))<=parseInt(s.number_of_sessions)&&(c=!0)}if(s.when_arriving_from){const e=document.referrer,n=window.location.host,a=s.when_arriving_from;let t;!e||e.includes(n)?t="internal":(t="external",/\.?(google|bing|yahoo|duckduckbot|yandex|baidu|msn|teoma|slurp)\./.test(e)&&(t="search")),c=!a.includes(t)}if("opened"===s.off_canvas_state&&"sliding-bar"===s.type&&s.has_js_rules&&!c&&(e(window).on("load",function(){window.awbOffCanvas.open_off_canvas(t)}),c=!0),!0===s.isOpened&&(c=!0),!c){if("yes"===s.on_page_load&&setTimeout(()=>{window.awbOffCanvas.open_off_canvas(t),s.isOpened=!0},100),"yes"===s.time_on_page&&s.time_on_page_duration&&setTimeout(()=>{window.awbOffCanvas.open_off_canvas(t),s.isOpened=!0},1e3*s.time_on_page_duration),"yes"===s.on_scroll){const n=s.scroll_direction,a=s.scroll_to,o=document.documentElement.scrollHeight;let i=s.scroll_position;if(i&&isNaN(i)&&(i=i.includes("%")?o/100*parseInt(i):parseInt(i)),"down"===n&&"element"===a){const e=s.scroll_element?document.querySelector(s.scroll_element):null;if(e){const n=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(window.awbOffCanvas.open_off_canvas(t),s.isOpened=!0,n.unobserve(e.target))})});n.observe(e)}}else e(window).on("scroll",function(e){"up"===s.scroll_direction&&this.oldScroll>this.scrollY&&(s.isOpened||window.awbOffCanvas.open_off_canvas(t),s.isOpened=!0),"down"===s.scroll_direction&&this.oldScroll<this.scrollY&&this.scrollY>=i&&(s.isOpened||window.awbOffCanvas.open_off_canvas(t),s.isOpened=!0),this.oldScroll=this.scrollY})}if("yes"===s.exit_intent){const e=function(n){null==n.relatedTarget&&"select"!==n.target.nodeName.toLowerCase()&&(window.awbOffCanvas.open_off_canvas(t),document.removeEventListener("mouseout",e),s.isOpened=!0)};document.addEventListener("mouseout",e)}if("yes"===s.after_inactivity&&s.inactivity_duration){const e=s.inactivity_duration;let n;const a=function(){n=window.setTimeout(o,1e3*e)},o=function(){s.isOpened||window.awbOffCanvas.open_off_canvas(t),s.isOpened=!0},i=function(){document.addEventListener("mousemove",c,!1),document.addEventListener("mousedown",c,!1),document.addEventListener("keypress",c,!1),document.addEventListener("touchmove",c,!1),document.addEventListener("scroll",c,!1),a()},c=function(){window.clearTimeout(n),a()};i()}}})}(jQuery);
Back to Directory File Manager