diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-17 17:07:50 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-17 17:08:17 +0200 |
| commit | c40c7f5621c9083cc274e3735b3c2e0000e8db38 (patch) | |
| tree | efc18ae23a7dbcab8405c7bc5c9542b90dd01138 /chimere/static/tinymce/plugins/wordcount/plugin.min.js | |
| parent | 6d4a13d05bf5e834fd6887e663d0203a09ecd496 (diff) | |
| download | Chimère-c40c7f5621c9083cc274e3735b3c2e0000e8db38.tar.bz2 Chimère-c40c7f5621c9083cc274e3735b3c2e0000e8db38.zip | |
Add tinymce files
Diffstat (limited to 'chimere/static/tinymce/plugins/wordcount/plugin.min.js')
| -rw-r--r-- | chimere/static/tinymce/plugins/wordcount/plugin.min.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/chimere/static/tinymce/plugins/wordcount/plugin.min.js b/chimere/static/tinymce/plugins/wordcount/plugin.min.js new file mode 100644 index 0000000..f20e765 --- /dev/null +++ b/chimere/static/tinymce/plugins/wordcount/plugin.min.js @@ -0,0 +1 @@ +tinymce.PluginManager.add("wordcount",function(a){function b(){a.theme.panel.find("#wordcount").text(["Words: {0}",e.getCount()])}var c,d,e=this;c=a.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),d=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),a.on("init",function(){var c=a.theme.panel&&a.theme.panel.find("#statusbar")[0];c&&tinymce.util.Delay.setEditorTimeout(a,function(){c.insert({type:"label",name:"wordcount",text:["Words: {0}",e.getCount()],classes:"wordcount",disabled:a.settings.readonly},0),a.on("setcontent beforeaddundo",b),a.on("keyup",function(a){32==a.keyCode&&b()})},0)}),e.getCount=function(){var b=a.getContent({format:"raw"}),e=0;if(b){b=b.replace(/\.\.\./g," "),b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),b=b.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),b=b.replace(d,"");var f=b.match(c);f&&(e=f.length)}return e}});
\ No newline at end of file |
