Sha256: b5c39f14f4125cd79e5d7369a90ba3166176cb043a8b84433643cb05bcdbad4b

Contents?: true

Size: 899 Bytes

Versions: 6

Compression:

Stored size: 899 Bytes

Contents

tinymce.PluginManager.add("wordcount",function(e){function t(){e.theme.panel.find("#wordcount").text(["Words: {0}",a.getCount()])}var n,o,a=this;n=e.getParam("wordcount_countregex",/[\w\u2019\x27\-\u0600-\u06FF]+/g),o=e.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),e.on("init",function(){var n=e.theme.panel&&e.theme.panel.find("#statusbar")[0];n&&window.setTimeout(function(){n.insert({type:"label",name:"wordcount",text:["Words: {0}",a.getCount()],classes:"wordcount",disabled:e.settings.readonly},0),e.on("setcontent beforeaddundo",t),e.on("keyup",function(e){32==e.keyCode&&t()})},0)}),a.getCount=function(){var t=e.getContent({format:"raw"}),a=0;if(t){t=t.replace(/\.\.\./g," "),t=t.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," "),t=t.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," "),t=t.replace(o,"");var r=t.match(n);r&&(a=r.length)}return a}});

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
tinymce-rails-4.0.16 vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js
tinymce-rails-4.0.12 vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js
tinymce-rails4-4.0.11 app/assets/javascripts/plugins/wordcount/plugin.min.js
tinymce-rails-4.0.11 vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js
tinymce-rails-4.0.10 vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js
tinymce-rails-4.0.8 vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js