1 line
218 KiB
JavaScript
1 line
218 KiB
JavaScript
|
|
var FusionPageBuilder=FusionPageBuilder||{};jQuery,FusionPageBuilder.template=_.memoize(function(e){var i,t={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g};return function(n){return(i=i||_.template(e,null,t))(n)}}),function(e,i){"undefined"!=typeof module&&module.exports?module.exports=i():"function"==typeof define?define(i):this.fusionBuilderStickyHeader=i()}(0,function(){return function(e,i){var t,n,o,a=document.getElementById("fusion_builder_container"),s=i||0,l=22,r=m(e),u=document.getElementById("fusion_builder_main_container"),d={position:"fixed",top:s+"px",left:r.left+"px",width:r.width+"px","border-top":l+"px solid #ffffff","z-index":999},c={};function f(){var i,n,o,f=jQuery("#fusion_builder_controls").height();if(t=m(u),i="fixed"===jQuery("#fusion_builder_controls").css("position")?t.height+r.height-f:t.height,jQuery(".fusion-builder-history-list").css("max-height",jQuery(window).height()-100),p().top>r.top-s-l&&p().top+s+l+r.height<t.top+i){for(o in n=a.left+"px",d.left=n,d.width=jQuery("#fusion_builder_container").outerWidth()+"px",d)e.style[o]=d[o];jQuery(".fusion-builder-update-buttons").stop().animate({bottom:0},100)}else{for(o in c)e.style[o]=c[o];p().top+s+l+r.height<t.top&&jQuery(".fusion-builder-update-buttons").stop().animate({bottom:"-50px"},100)}}function m(e){var i,t,n=e.getBoundingClientRect(),o=p();return t=n.top+o.top,jQuery(e).parents("#fusion_builder_layout").hasClass("closed")&&(t=(i=jQuery(e).parents("#fusion_builder_layout").find(".ui-sortable-handle")[0].getBoundingClientRect()).top+i.height+o.top),{left:n.left+o.left,top:t,width:n.width,height:n.height}}function p(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}}["position","top","left","z-index","border-top"].forEach(function(i){c[i]=e.style[i],c.width="100%"}),jQuery(".fusion-builder-history-list").css("max-height",jQuery(window).height()-100),window.onscroll&&(n=window.onscroll),window.onresize&&(o=window.onresize),window.onscroll=function(e){f(),n&&n(e)},window.onresize=function(i){var n=jQuery("#fusion_builder_container").outerWidth()+"px",a=u.top;r=m(e),void 0!==t&&t.top!==a&&(e.style.position="absolute",r=m(e)),jQuery(".fusion-builder-history-list").css("max-height",jQuery(window).height()-100),p().top>r.top-s?e.style.width=n:e.style.width=c.width,f(),o&&o(i)}}});FusionPageBuilder=FusionPageBuilder||{};jQuery(document).ready(function(){FusionPageBuilder.Element=Backbone.Model.extend({defaults:{type:"element"}})});FusionPageBuilder=FusionPageBuilder||{};jQuery(document).ready(function(){var e,i=[],t=[],n=[],o=0;e=_.sortBy(fusionAllElements,function(e){return e.name.toLowerCase()}),_.each(e,function(e){var o,a=t;void 0===e.hide_from_builder&&(o={title:e.name,label:e.shortcode},void 0!==e.component&&e.component&&(a=n),void 0===e.generator_only&&i.push(o),a.push(Object.assign({},o,{generator_only:void 0!==e.generator_only||e.generator_only,templates:void 0!==e.templates&&e.templates,components_per_template:void 0!==e.components_per_template&&e.components_per_template})))}),n.forEach(function(e){"string"!=typeof fusionBuilderConfig.template_category||"object"==typeof e.templates&&!e.templates.includes(fusionBuilderConfig.template_category)||o++}),FusionPageBuilder.ViewManager=Backbone.Model.extend({defaults:{modules:i,generator_elements:t,components:n,componentsCounter:o,elementCount:0,views:{}},getView:function(e){return this.get("views")[e]},getChildViews:function(e){var i=this.get("views"),t={};return _.each(i,function(i,n){e===i.model.attributes.parent&&(t[n]=i)}),t},generateCid:function(){var e=this.get("elementCount")+1;return this.set({elementCount:e}),e},addView:function(e,i){var t=this.get("views");t[e]=i,this.set({views:t})},removeView:function(e){var i=this.get("views"),t={};_.each(i,function(i,n){n!=e&&(t[n]=i)}),this.set({views:t})},removeViews:function(){this.set({views:{}})},countElementsByType:function(e){var i=this.get("views"),t=0;return _.each(i,function(i){i.model.attributes.element_ty
|