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