(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(b,c){var a=this;a.editor=b;b.addCommand("mceVisualChars",a._toggleVisualChars,a);b.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});b.onBeforeGetContent.add(function(d,e){if(a.state){a.state=true;a._toggleVisualChars()}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(){var k=this,e=k.editor,m,a,c,g=e.getDoc(),j=e.getBody(),f,l=e.selection,n;k.state=!k.state;e.controlManager.setActive("visualchars",k.state);if(k.state){m=[];tinymce.walk(j,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){m.push(b)}},"childNodes");for(a=0;a<m.length;a++){f=m[a].nodeValue;f=f.replace(/(\u00a0+)/g,'<span class="mceItemHidden mceVisualNbsp">$1</span>');f=f.replace(/\u00a0/g,"\u00b7");e.dom.setOuterHTML(m[a],f,g)}}else{m=tinymce.grep(e.dom.select("span",j),function(b){return e.dom.hasClass(b,"mceVisualNbsp")});for(a=0;a<m.length;a++){e.dom.setOuterHTML(m[a],m[a].innerHTML.replace(/(&middot;|\u00b7)/g,"&nbsp;"),g)}}}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})();