Edit File: themify-builder-static-badge.min.js
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(a,d,b){if(null==a)throw new TypeError("The 'this' value for String.prototype."+b+" must not be null or undefined");if(d instanceof RegExp)throw new TypeError("First argument to String.prototype."+b+" must not be a regular expression");return a+""};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,d,b){a!=Array.prototype&&a!=Object.prototype&&(a[d]=b.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,d,b,c){if(d){b=$jscomp.global;a=a.split(".");for(c=0;c<a.length-1;c++){var e=a[c];e in b||(b[e]={});b=b[e]}a=a[a.length-1];c=b[a];d=d(c);d!=c&&null!=d&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:d})}}; $jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(a){var b=$jscomp.checkStringArgs(this,null,"repeat");if(0>a||1342177279<a)throw new RangeError("Invalid count value");a|=0;for(var c="";a;)if(a&1&&(c+=b),a>>>=1)b+=b;return c}},"es6-impl","es3"); (function(a,d,b){b=wp.media;var c="",e=[/\x3c!--themify_builder_static--\x3e([\s\S]*?)\x3c!--\/themify_builder_static--\x3e/gi,/<!--themify_builder_static-->([\s\S]*?)<!--\/themify_builder_static-->/gi,/&lt;!--themify_builder_static--&gt;([\s\S]*?)&lt;!--\/themify_builder_static--&gt;/gi];wp.mce.views.register("tb_static_badge",{template:b.template("tb-static-badge"),bindNode:function(g,b){a(b).on("click",".tb_mce_view_frontend_btn",this.goToFront).on("click",".tb_mce_view_backend_btn", this.goToBack)},getContent:function(){return this.template({})},match:function(a){if(a=wp.mce.views._tb_static_content.isMatch(a))return{index:a.index,content:a[0],options:{}}},View:{className:"tb_static_badge",template:b.template("tb-static-badge"),getHtml:function(){return this.template({})}},edit:function(a){this.goToFront()},goToFront:function(){a("#tb_switch_frontend").trigger("click")},goToBack:function(){tb_app._backendBuilderFocus()},contentPlaceholder:function(a){c=c||a;return"\x3c!--themify_builder_static--\x3e\x3c!--/themify_builder_static--\x3e"+ (59<a.length?" ".repeat(a.length-59):"")}});wp.mce.views._tb_static_content={setContent:function(b,c){tinyMCE&&tinyMCE.activeEditor?tinyMCE.activeEditor.hidden?a("#content").val(c):b.setContent(c):b.val(c)},isMatch:function(a){return e[0].exec(a)||e[1].exec(a)||e[2].exec(a)}};a(document).on("tinymce-editor-init",function(a,b){var c;b.wp&&b.wp._createToolbar&&(c=b.wp._createToolbar(["wp_view_edit"]));if(c)b.on("wptoolbar",function(a){b.dom.hasClass(a.element,"wpview")&&"tb_static_badge"===b.dom.getAttrib(a.element, "data-wpview-type")&&(a.toolbar=c)});b.setContent(wp.mce.views.setMarkers(b.getContent()));b.on("beforesetcontent",function(a){a.content=wp.mce.views.setMarkers(a.content)})});a("body").on("themify_builder_save_data",function(b,c,e){if(themifyBuilder.is_gutenberg_editor||d.isEmpty(c.data.static_content))return!0;if(tinyMCE&&tinyMCE.activeEditor){var f=tinyMCE.activeEditor;e=!1===tinyMCE.activeEditor.hidden?tinyMCE.activeEditor.getContent():tinymce.DOM.get("content").value}else f=a("#content"),e=f.val(); b=wp.mce.views._tb_static_content.isMatch(e);d.isNull(b)?wp.mce.views._tb_static_content.setContent(f,e+c.data.static_content):wp.mce.views._tb_static_content.setContent(f,e.replace(b[0],c.data.static_content))});var f={timeout:void 0,init:function(){a(window).on("YoastSEO:ready",function(){f.load()})},load:function(){themifyBuilder.is_gutenberg_editor&&(c=wp.data.select("core/editor").getCurrentPost().builder_content);YoastSEO.app.registerPlugin("TBuilderReader",{status:"loading"});YoastSEO.app.pluginReady("TBuilderReader"); YoastSEO.app.registerModification("content",f.readContent,"TBuilderReader",5);f.update()},readContent:function(a){c&&(a=themifyBuilder.is_gutenberg_editor?a+" "+c:a.replace("\x3c!--themify_builder_static--\x3e\x3c!--/themify_builder_static--\x3e",c).replace(/(\r\n|\n|\r)/gm,""));return a},update:function(){clearTimeout(f.timeout);f.timeout=setTimeout(function(){YoastSEO.app.refresh()},250)}};f.init()})(jQuery,_,Backbone);
Back to File Manager