PHP Classes

File: contents/apps/ledit/src/lib/tinymce/plugins/visualchars/plugin.min.js

Recommend this page to a friend!
  Classes of Subin Siby   Lobby   contents/apps/ledit/src/lib/tinymce/plugins/visualchars/plugin.min.js   Download  
File: contents/apps/ledit/src/lib/tinymce/plugins/visualchars/plugin.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Lobby
Web OS to install and run Web applications
Author: By
Last change:
Date: 8 years ago
Size: 1,259 bytes
 

Contents

Class file image Download
tinymce.PluginManager.add("visualchars",function(e){function t(t){function n(e){return'<span data-mce-bogus="1" class="mce-'+p[e]+'">'+e+"</span>"}function o(){var e,t="";for(e in p)t+=e;return new RegExp("["+t+"]","g")}function a(){var e,t="";for(e in p)t&&(t+=","),t+="span.mce-"+p[e];return t}var s,l,c,u,d,f,p,m,h=e.getBody(),g=e.selection;if(p={"\xa0":"nbsp","\xad":"shy"},r=!r,i.state=r,e.fire("VisualChars",{state:r}),m=o(),t&&(f=g.getBookmark()),r)for(l=[],tinymce.walk(h,function(e){3==e.nodeType&&e.nodeValue&&m.test(e.nodeValue)&&l.push(e)},"childNodes"),c=0;c<l.length;c++){for(u=l[c].nodeValue,u=u.replace(m,n),d=e.dom.create("div",null,u);s=d.lastChild;)e.dom.insertAfter(s,l[c]);e.dom.remove(l[c])}else for(l=e.dom.select(a(),h),c=l.length-1;c>=0;c--)e.dom.remove(l[c],1);g.moveToBookmark(f)}function n(){var t=this;e.on("VisualChars",function(e){t.active(e.state)})}var r,i=this;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))})});