summaryrefslogtreecommitdiff
path: root/program/js/tinymce/plugins/wordcount
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-01-20 18:46:28 +0100
committerAleksander Machniak <alec@alec.pl>2014-01-20 18:46:28 +0100
commit6fa5b437a48485927e5d90abe061ee723f3b45c2 (patch)
tree118a32ddde4af92c7def9838b10beddb9f0fe241 /program/js/tinymce/plugins/wordcount
parentfac59dc441d25f7204fb6013bf88db90c01ae34b (diff)
Update to TinyMCE 4.x
Diffstat (limited to 'program/js/tinymce/plugins/wordcount')
-rw-r--r--program/js/tinymce/plugins/wordcount/plugin.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/program/js/tinymce/plugins/wordcount/plugin.min.js b/program/js/tinymce/plugins/wordcount/plugin.min.js
new file mode 100644
index 000000000..acda5d044
--- /dev/null
+++ b/program/js/tinymce/plugins/wordcount/plugin.min.js
@@ -0,0 +1 @@
+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}}); \ No newline at end of file