Sha256: f012a6160f62d8db45d8c47f4f52f027048d7f17275fccfe8003133ae03c53e4

Contents?: true

Size: 1.48 KB

Versions: 45

Compression:

Stored size: 1.48 KB

Contents

(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/\S\s+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$¿'"_+=\\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'<span id="'+c.id+'">0</span>')}}else{tinymce.DOM.add(h,"span",{},'<span id="'+c.id+'">0</span>')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_count:function(b){var c=this,a=0;if(c.block){return}c.block=1;setTimeout(function(){var d=b.getContent({format:"raw"});if(d){d=d.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ");d=d.replace(c.cleanre,"");d.replace(c.countre,function(){a++})}tinymce.DOM.setHTML(c.id,a.toString());setTimeout(function(){c.block=0},2000)},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();

Version data entries

45 entries across 45 versions & 6 rubygems

Version Path
tinymce_rails-3.4.6 vendor/assets/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js
skylinecms-3.1.0 public/skyline/javascripts/src/skyline.editor/vendor/tinymce/jscripts/tiny_mce/plugins/wordcount/editor_plugin.js
spree_editor-0.50.0 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.15 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.14 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.13 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.12 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.11 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.10 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.9 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.8 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.6 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.5 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
spree_editor-0.40.0 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.4 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.3 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.1 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.9.0 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.8.6 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js
cable-0.8.5 public/javascripts/tinymce/plugins/wordcount/editor_plugin.js