Sha256: 443d8cdf4ab051855ca7716796e14add355dec422773e178329e35fbafa71396

Contents?: true

Size: 928 Bytes

Versions: 14

Compression:

Stored size: 928 Bytes

Contents

tinymce.PluginManager.add("wordcount",function(e){function t(){e.theme.panel.find("#wordcount").text(["Words: {0}",i.getCount()])}var n,r,i=this;n=e.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),r=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&&tinymce.util.Delay.setEditorTimeout(e,function(){n.insert({type:"label",name:"wordcount",text:["Words: {0}",i.getCount()],classes:"wordcount",disabled:e.settings.readonly},0),e.on("setcontent beforeaddundo",t),e.on("keyup",function(e){32==e.keyCode&&t()})},0)}),i.getCount=function(){var t=e.getContent({format:"raw"}),i=0;if(t){t=t.replace(/\.\.\./g," "),t=t.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," "),t=t.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),t=t.replace(r,"");var o=t.match(n);o&&(i=o.length)}return i}});

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
mosaico-2.0.0 vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js
mosaico-1.1.1 vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js
mosaico-1.1.0 vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js
mosaico-1.0.2 vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js
mosaico-1.0.1 vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js
mosaico-1.0.0 vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js
guts-1.1.1 app/assets/javascripts/guts/vendor/tinymce/plugins/wordcount/plugin.min.js
guts-1.1.0 app/assets/javascripts/guts/vendor/tinymce/plugins/wordcount/plugin.min.js
guts-1.0.8 app/assets/javascripts/guts/vendor/tinymce/plugins/wordcount/plugin.min.js
guts-1.0.7 app/assets/javascripts/guts/vendor/tinymce/plugins/wordcount/plugin.min.js
guts-1.0.5 app/assets/javascripts/guts/vendor/tinymce/plugins/wordcount/plugin.min.js
guts-1.0.3 app/assets/javascripts/guts/vendor/tinymce/plugins/wordcount/plugin.min.js
tinymce-rails-4.3.3 vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js
tinymce-rails-4.3.2 vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js