(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(e,d){var f=this;f.editor=e;e.addCommand("mceVisualChars",f._toggleVisualChars,f);e.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});e.onBeforeGetContent.add(function(b,a){if(f.state){f.state=true;f._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 d=this,p=d.editor,t,r,q,i=p.getDoc(),h=p.getBody(),o,b=p.selection,s;d.state=!d.state;p.controlManager.setActive("visualchars",d.state);if(d.state){t=[];tinymce.walk(h,function(a){if(a.nodeType==3&&a.nodeValue&&a.nodeValue.indexOf("\u00a0")!=-1){t.push(a)}},"childNodes");for(r=0;r<t.length;r++){o=t[r].nodeValue;o=o.replace(/(\u00a0+)/g,'<span class="mceItemHidden mceVisualNbsp">$1</span>');o=o.replace(/\u00a0/g,"\u00b7");p.dom.setOuterHTML(t[r],o,i)}}else{t=tinymce.grep(p.dom.select("span",h),function(a){return p.dom.hasClass(a,"mceVisualNbsp")});for(r=0;r<t.length;r++){p.dom.setOuterHTML(t[r],t[r].innerHTML.replace(/(&middot;|\u00b7)/g,"&nbsp;"),i)}}}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})();