Edit File: plugin.min.js
tinymce.PluginManager.add("themifyMenu",function(d,m){function l(){var c=d.settings.color_picker_callback;if(c)return function(){var a=this;c.call(d,function(c){a.value(c).fire("change")},a.value())}}function h(c){return{text:c.label,body:{type:c.id},onclick:function(){if(jQuery.isEmptyObject(c.fields)){var a={};a.selectedContent=d.selection.getContent();var f=wp.template("themify-shortcode-"+c.id);d.insertContent(f(a))}else{var e=[];jQuery.each(c.fields,function(a,b){"colorbox"===b.type?b.onaction= l():"image"===b.type?b={type:"container",label:b.label,layout:"flex",direction:"row",items:[{type:"textbox",name:b.name},{type:"button",text:b.text,onclick:function(){var b=jQuery(this.$el),a=wp.media.frames.file_frame=wp.media({multiple:!1});a.on("select",function(){var c=a.state().get("selection").first().toJSON();b.prev().val(c.url)});a.open()}}]}:"iconpicker"===b.type&&(b={type:"container",label:b.label,layout:"flex",direction:"row",items:[{type:"textbox",name:b.name},{type:"button",text:b.text, onclick:function(){var a=jQuery(this.$el);if(Themify.is_builder_active)var b=Themify.iframe.contentWindow.Themify_Icons;b.target=a.prev();b.showLightbox(b.target.val())}}]});e.push(b)});d.windowManager.open({title:c.label,body:e,onSubmit:function(a){a=this.toJSON();a.selectedContent=d.selection.getContent();var b=wp.template("themify-shortcode-"+c.id);d.insertContent(b(a))}})}}}}var e=[],g;for(g in themifyEditor.shortcodes){var a=themifyEditor.shortcodes[g];a.id=g;if("object"===typeof a.menu){var k= [],f;for(f in a.menu)a.menu[f].id=f,k.push(h(a.menu[f]));e.push({text:a.label,menu:k})}else e.push(h(a))}d.addButton("btnthemifyMenu",{type:"menubutton",text:"",image:themifyEditor.editor.icon,tooltip:themifyEditor.editor.menuTooltip,menu:e})});
Back to File Manager