Edit File: themify-builder-backend.min.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var f=a.length,d=0;d<f;d++){var e=a[d];if(b.call(c,e,d,a))return{i:d,v:e}}return{i:-1,v:void 0}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a}; $jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,b,c,f){if(b){c=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var d=a[f];d in c||(c[d]={});c=c[d]}a=a[a.length-1];f=c[a];b=b(f);b!=f&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6-impl","es3"); (function(a,b){var c=a("body");if(0<a("#page-builder.themify_write_panel").length)themifyBuilder.is_gutenberg_editor=!1,c[0].classList.remove("themify-gutenberg-editor");else if(!themifyBuilder.is_gutenberg_editor)return;var f=b.redirectFrontend=!1,d=function(){var e=b.toolbar.$el,c=function(){var b,c=a("#page-builder"),f=a("#tb_row_wrapper"),d,g=a("#wpadminbar"),k,h=function(){var a=window.pageYOffset;b=a>=k&&a<d+f.height();!0===b?e[0].classList.add("tb_toolbar_fixed"):e[0].classList.remove("tb_toolbar_fixed")}, l=function(){var a=g.outerHeight(!0);d=Math.round(e.offset().top);k=d-a;e.css({width:c.width()+"px",left:c.offset().left,top:a})};l();window.addEventListener("scroll",h,{passive:!0});a(window).on("tfsmartresize.tfsticky",function(){l();h()});h()};if(e.is(":visible"))c();else a(".themify-meta-box-tabs a").on("click",function m(){"page-buildert"===this.id&&(c(),a(".themify-meta-box-tabs a").off("click",m))})};b.toolbarCallback=function(){b.undoManager.btnUndo=b.toolbar.el.getElementsByClassName("tb_undo_btn")[0]; b.undoManager.btnRedo=b.toolbar.el.getElementsByClassName("tb_redo_btn")[0];b.undoManager.compactBtn=b.toolbar.el.getElementsByClassName("tb_compact_undo")[0]};b.render=function(){if(!themifyBuilder.is_gutenberg_editor||document.getElementById("tb_canvas_block")){c[0].insertAdjacentHTML("afterbegin",'<div class="tb_fixed_scroll" id="tb_fixed_bottom_scroll"></div>');c.append(a("<div/>",{id:"tb_alert"}));0===themifyBuilder.builder_data.length&&(themifyBuilder.builder_data={});if(themifyBuilder.is_gutenberg_editor){var e= wp.template("builder_admin_canvas_block");document.getElementById("tb_canvas_block").innerHTML=e()}ThemifyBuilderCommon.setToolbar();b.toolbar=new b.Views.Toolbar({el:"#tb_toolbar"});b.toolbar.render();b.toolbarCallback();b.Instances.Builder[0]=new b.Views.Builder({el:"#tb_row_wrapper",collection:new b.Collections.Rows(themifyBuilder.builder_data)});b.Instances.Builder[0].render();b.toolbar.pageBreakModule.countModules();a("input#publish,input#save-post").one("click",function(c){a(".themify_builder").find("input[required]").removeAttr("required"); if(!f){var e=a(this);e.addClass("disabled");b.Utils.saveBuilder(function(){b.undoManager.reset();e.removeClass("disabled").trigger("click")});c.preventDefault()}});var e=a('<a href="#" id="tb_switch_frontend_button" class="button tb_switch_frontend">'+themifyBuilder.i18n.switchToFrontendLabel+"</a>"),g=a(".themify-wp-editor-holder");g.length?e=g.find("a"):e.appendTo("#postdivrich #wp-content-media-buttons");e.on("click",function(b){b.preventDefault();a("#tb_switch_frontend").trigger("click")});a('input[name*="builder_switch_frontend"]').closest(".themify_field_row").remove(); b.Instances.Builder[b.builderIndex].$el.triggerHandler("tb_init");sessionStorage.getItem("focusBackendEditor")&&(b._backendBuilderFocus(),sessionStorage.removeItem("focusBackendEditor"));ThemifyStyles.init(ThemifyConstructor.data,ThemifyConstructor.breakpointsReverse,themifyBuilder.post_ID);themifyBuilder.is_gutenberg_editor||d()}};b._backendSwitchFrontend=function(c){a("#builder_switch_frontend_noncename").val("ok");f=!0;"publish"===a("#original_post_status").val()?themifyBuilder.is_gutenberg_editor? (a(".editor-post-publish-button").length?a(".editor-post-publish-button").trigger("click"):a(".editor-post-publish-panel__toggle").trigger("click"),b.redirectFrontend=c,a("#tb_switch_frontend").trigger("click.frontend-btn")):a("#publish").trigger("click"):themifyBuilder.is_gutenberg_editor?(a(".editor-post-save-draft").trigger("click"),b.redirectFrontend=c):a("#save-post").trigger("click")};b._backendBuilderFocus=function(){a("#page-buildert").trigger("click");themifyBuilder.is_gutenberg_editor?b.Utils.scrollToDropped(b.toolbar.el): b.Utils.scrollTo(b.toolbar.$el.offset().top-a("#wpadminbar").height())};a(function(){if(c[0].classList.contains("post-php")){var b=document.getElementById("post-lock-dialog");null===b||b.classList.contains("hidden")||Themify.LoadAsync(themifyBuilder.builder_url+"/js/themify-ticks.js",function(){c[0].classList.contains("tb_restriction")?TB_Ticks.init(themifyBuilder.ticks,window).show():TB_Ticks.init(themifyBuilder.ticks,window).ticks()},null,null,function(){return"undefined"!==typeof TB_Ticks})}if("function"=== typeof window.icl_copy_from_original){var d=window.icl_copy_from_original;window.icl_copy_from_original=function(b,c){d(b,c);a.ajax({url:ajaxurl,type:"POST",data:{action:"themify_builder_icl_copy_from_original",source_page_id:c,source_page_lang:b},success:function(b){"-1"!=b&&a("#page-builder .themify_builder.themify_builder_admin").empty().append(b).contents().unwrap()}})}}});a(window).on("load",function(){Themify.LoadAsync(themifyBuilder.builder_url+"/js/themify-constructor.js",function(){ThemifyConstructor.getForms(b.render)}, null,null,function(){return"undefined"!==typeof ThemifyConstructor})})})(jQuery,tb_app);
Back to File Manager