| 1 |
- tinymce.PluginManager.add("visualblocks",function(e,s){var o,l,t;if(!window.NodeList){return}function a(){var s=this;s.active(t);e.on("VisualBlocks",function(){s.active(e.dom.hasClass(e.getBody(),"mce-visualblocks"))})}e.addCommand("mceVisualBlocks",function(){var a=e.dom,i;if(!o){o=a.uniqueId();i=a.create("link",{id:o,rel:"stylesheet",href:s+"/css/visualblocks.css"});e.getDoc().getElementsByTagName("head")[0].appendChild(i)}e.on("PreviewFormats AfterPreviewFormats",function(s){if(t){a.toggleClass(e.getBody(),"mce-visualblocks",s.type=="afterpreviewformats")}});a.toggleClass(e.getBody(),"mce-visualblocks");t=e.dom.hasClass(e.getBody(),"mce-visualblocks");if(l){l.active(a.hasClass(e.getBody(),"mce-visualblocks"))}e.fire("VisualBlocks")});e.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:a});e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:a,selectable:true,context:"view",prependToContext:true});e.on("init",function(){if(e.settings.visualblocks_default_state){e.execCommand("mceVisualBlocks",false,null,{skip_focus:true})}});e.on("remove",function(){e.dom.removeClass(e.getBody(),"mce-visualblocks")})});
|