Files
roi-theme/wp-content/plugins/thrive-ultimatum/tcb/editor/js/dist/gutenberg.min.js
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 21:04:30 -06:00

1 line
3.8 KiB
JavaScript
Executable File

!function(t){const e=".editor-block-list__layout,.block-editor-block-list__layout",i={isGutenbergActive:()=>"undefined"!=typeof wp&&void 0!==wp.blocks,init(){this.coreEditor=wp.data.select("core/editor"),this.$gutenberg=t("#editor"),this.$architectNotificationContent=t("#thrive-gutenberg-switch").html(),this.$architectDisplay=t('<div id="tar-display">').append(this.$architectNotificationContent),this.$architectLauncher=this.$architectDisplay.find("#thrive_preview_button"),this.isPostBox=-1!==this.$architectNotificationContent.indexOf("postbox"),t(window).on("storage.tcb",(t=>{if(this.coreEditor){const e=this.coreEditor.getCurrentPost();let i;try{i=JSON.parse(t.originalEvent.newValue)}catch(t){}i&&i.ID&&"tve_post_options_change"===t.originalEvent.key&&i.ID===Number(e.id)&&window.location.reload()}})),wp.data.subscribe((()=>{if(this.coreEditor){const t=this.coreEditor.isSavingPost(),e=this.coreEditor.isAutosavingPost();if(t&&!e){const t=JSON.stringify(this.coreEditor.getCurrentPost());window.localStorage.setItem("tve_post_options_change",t)}}setTimeout((()=>{this.render()}),1)}))},render(){const i=this.$gutenberg.find(".editor-post-title"),o=this.$gutenberg.find(e).not(i.closest(e));let n=!1;this.isPostBox?t("#tar-display").length||(i.length&&("DIV"===i[0].tagName?i.append(this.$architectDisplay):i.after(this.$architectDisplay)),o.hide(),this.$gutenberg.find(".editor-post-title__block").css("margin-bottom","0"),this.$gutenberg.find(".editor-writing-flow__click-redirect,.block-editor-writing-flow__click-redirect").hide(),this.$gutenberg.find(".edit-post-header-toolbar").css("visibility","hidden"),n=!0):t("#thrive_preview_button").length||(this.$gutenberg.find(".edit-post-header-toolbar").append(this.$architectLauncher),this.$architectLauncher.on("click",(function(){o.hide()})),this.$gutenberg.find(".edit-post-header-toolbar").css("visibility","visible"),n=!0),t(".editor-block-list__layout,.block-editor-block-list__layout").addClass("tcb-style-wrap"),n&&this.bindEvents()},bindEvents(){const e=this;t("#tcb2-show-wp-editor").on("click",(function(){const i=e.$gutenberg.find(".tcb-enable-editor").closest(".postbox");t.ajax({type:"post",url:ajaxurl,dataType:"json",data:{_nonce:TCB_Post_Edit_Data.admin_nonce,post_id:this.getAttribute("data-id"),action:"tcb_admin_ajax_controller",route:"disable_tcb"}}),i.next(".tcb-flags").find("input").prop("disabled",!1),i.remove(),e.$gutenberg.find(".editor-block-list__layout,.block-editor-block-list__layout").show(),e.isPostBox=!1,e.render(),e.fixBlocksPreview()})),this.$architectLauncher.on("click",(function(){t.ajax({type:"post",url:ajaxurl,dataType:"json",data:{_nonce:TCB_Post_Edit_Data.admin_nonce,post_id:this.getAttribute("data-id"),action:"tcb_admin_ajax_controller",route:"change_post_status_gutenberg"}})}))},fixBlocksPreview(){const t=document.querySelectorAll('[data-type*="thrive"] iframe');Array.prototype.forEach.call(t,(function(t){const e=t.contentDocument;t.style.setProperty("height",""),t.parentNode.style.setProperty("height",""),Array.prototype.forEach.call(e.body.querySelectorAll(".tve-countdown"),(function(t){t.style.setProperty("--tve-countdown-size","")}));const i=function(t){if(!t)return 0;let e=t.offsetHeight;const i=getComputedStyle(t);return e+=parseInt(i.marginTop)+parseInt(i.marginBottom),e}(e.body);t.style.setProperty("height",i+"px"),t.parentNode.style.setProperty("height",i+"px")}))}};t((function(){i.isGutenbergActive()&&i.init(),window.addEventListener("load",(function(){t(".tcb-revert").on("click",(function(){confirm("Are you sure you want to DELETE all of the content that was created in this landing page and revert to the theme page? \n If you click OK, any custom content you added to the landing page will be deleted.")&&(location.href=location.href+"&tve_revert_theme=1&nonce="+this.dataset.nonce,t("#editor").find(".edit-post-header-toolbar").css("visibility","visible"))}))}))}))}(jQuery);