tinymce.PluginManager.add("visualchars",function(e){function t(t){var n,i,o,a,s,l,c=e.getBody(),d=e.selection;if(r=!r,e.fire("VisualChars",{state:r}),t&&(l=d.getBookmark()),r)for(i=[],tinymce.walk(c,function(e){3==e.nodeType&&e.nodeValue&&-1!=e.nodeValue.indexOf(" ")&&i.push(e)},"childNodes"),o=0;o$1'),s=e.dom.create("div",null,a);n=s.lastChild;)e.dom.insertAfter(n,i[o]);e.dom.remove(i[o])}else for(i=e.dom.select("span.mce-nbsp",c),o=i.length-1;o>=0;o--)e.dom.remove(i[o],1);d.moveToBookmark(l)}function n(){var t=this;e.on("VisualChars",function(e){t.active(e.state)})}var r;e.addCommand("mceVisualChars",t),e.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:n}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:n,selectable:!0,context:"view",prependToContext:!0}),e.on("beforegetcontent",function(e){r&&"raw"!=e.format&&!e.draft&&(r=!0,t(!1))})});