geno/wp-content/plugins/mailpoet/assets/dist/js/newsletter_editor.js

2 lines
1.4 MiB
JavaScript
Raw Permalink Normal View History

2024-02-01 17:24:18 +05:30
/*! For license information please see newsletter_editor.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([[883],{92140:function(){(function(){var e,t;e=this.jQuery||window.jQuery,t=e(window),e.fn.stick_in_parent=function(o){var n,r,i,s,a,l,c,d,u,h,m,p,g;for(null==o&&(o={}),g=o.sticky_class,l=o.inner_scrolling,p=o.recalc_every,m=o.parent,u=o.offset_top,d=o.spacer,i=o.bottoming,null==u&&(u=0),null==m&&(m=void 0),null==l&&(l=!0),null==g&&(g="is_stuck"),n=e(document),null==i&&(i=!0),h=function(e){var t,o;return window.getComputedStyle?(e[0],t=window.getComputedStyle(e[0]),o=parseFloat(t.getPropertyValue("width"))+parseFloat(t.getPropertyValue("margin-left"))+parseFloat(t.getPropertyValue("margin-right")),"border-box"!==t.getPropertyValue("box-sizing")&&(o+=parseFloat(t.getPropertyValue("border-left-width"))+parseFloat(t.getPropertyValue("border-right-width"))+parseFloat(t.getPropertyValue("padding-left"))+parseFloat(t.getPropertyValue("padding-right"))),o):e.outerWidth(!0)},s=function(o,r,s,a,c,f,v,b){var y,w,_,x,C,k,S,T,E,O,M,A;if(!o.data("sticky_kit")){if(o.data("sticky_kit",!0),C=n.height(),S=o.parent(),null!=m&&(S=S.closest(m)),!S.length)throw"failed to find stick parent";return _=!1,y=!1,(M=null!=d?d&&o.closest(d):e("<div />"))&&M.css("position",o.css("position")),(T=function(){var e,t,i;if(!b)return C=n.height(),e=parseInt(S.css("border-top-width"),10),t=parseInt(S.css("padding-top"),10),r=parseInt(S.css("padding-bottom"),10),s=S.offset().top+e+t,a=S.height(),_&&(_=!1,y=!1,null==d&&(o.insertAfter(M),M.detach()),o.css({position:"",top:"",width:"",bottom:""}).removeClass(g),i=!0),c=o.offset().top-(parseInt(o.css("margin-top"),10)||0)-u,f=o.outerHeight(!0),v=o.css("float"),M&&M.css({width:h(o),height:f,display:o.css("display"),"vertical-align":o.css("vertical-align"),float:v}),i?A():void 0})(),x=void 0,k=u,O=p,A=function(){var e,h,m,w,E,A;if(!b)return m=!1,null!=O&&(O-=1)<=0&&(O=p,T(),m=!0),m||n.height()===C||(T(),m=!0),w=t.scrollTop(),null!=x&&(h=w-x),x=w,_?(i&&(E=w+f+k>a+s,y&&!E&&(y=!1,o.css({position:"fixed",bottom:"",top:k}).trigger("sticky_kit:unbottom"))),w<c&&(_=!1,k=u,null==d&&("left"!==v&&"right"!==v||o.insertAfter(M),M.detach()),e={position:"",width:"",top:""},o.css(e).removeClass(g).trigger("sticky_kit:unstick")),l&&(A=t.height(),f+u>A&&(y||(k-=h,k=Math.max(A-f,k),k=Math.min(u,k),_&&o.css({top:k+"px"}))))):w>c&&(_=!0,(e={position:"fixed",top:k}).width="border-box"===o.css("box-sizing")?o.outerWidth()+"px":o.width()+"px",o.css(e).addClass(g),null==d&&(o.after(M),"left"!==v&&"right"!==v||M.append(o)),o.trigger("sticky_kit:stick")),_&&i&&(null==E&&(E=w+f+k>a+s),!y&&E)?(y=!0,"static"===S.css("position")&&S.css({position:"relative"}),o.css({position:"absolute",bottom:r,top:"auto"}).trigger("sticky_kit:bottom")):void 0},E=function(){return T(),A()},w=function(){if(b=!0,t.off("touchmove",A),t.off("scroll",A),t.off("resize",E),e(document.body).off("sticky_kit:recalc",E),o.off("sticky_kit:detach",w),o.removeData("sticky_kit"),o.css({position:"",bottom:"",top:"",width:""}),S.position("position",""),_)return null==d&&("left"!==v&&"right"!==v||o.insertAfter(M),M.remove()),o.removeClass(g)},t.on("touchmove",A),t.on("scroll",A),t.on("resize",E),e(document.body).on("sticky_kit:recalc",E),o.on("sticky_kit:detach",w),setTimeout(A,0)}},a=0,c=this.length;a<c;a++)r=this[a],s(e(r));return this}}).call(this)},46708:function(e,t,o){"use strict";o(92140),o(67694);var n=o(84209),r=o(69177),i=o(7936),s=o(2226),a=o(11103),l=o(83665),c=o(43869),d=o(89912),u=o(47571),h=o(35250);n.Hooks.addAction("mailpoet_newsletters_editor_initialize","mailpoet",(e=>{const t=document.getElementById("mailpoet_editor"),o=e=>(document.location.search.split(`${e}=`)[1]||"").split("&")[0];t&&window.EditorApplication&&(r.MailPoet.Modal.loading(!0),r.MailPoet.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:o("id")}}).always((()=>r.MailPoet.Modal.loading(!1))).always((()=>(0,u.Z)())).done((t=>{const n=t.data;if("sending"===n.status&&n.queue&&null===n.queue.status){let e="yes"===o("pauseConfirmed");if(e||(e=window.confirm((0,i.__)("Sending is in progress. Do you want to pa