/Web/wp-admin/js/word-count.js

https://bitbucket.org/jimjenkins5/blog · JavaScript · 1 lines · 1 code · 0 blank · 0 comment · 0 complexity · b7c10310e95835848bfff9c49c0ae5e5 MD5 · raw file

  1. (function(a,b){wpWordCount={settings:{strip:/<[a-zA-Z\/][^<>]*>/g,clean:/[0-9.(),;:!?%#$?'"_+=\\/-]+/g,w:/\S\s+/g,c:/\S/g},block:0,wc:function(e,g){var f=this,d=a(".word-count"),c=0;if(g===b){g=wordCountL10n.type}if(g!=="w"&&g!=="c"){g="w"}if(f.block){return}f.block=1;setTimeout(function(){if(e){e=e.replace(f.settings.strip," ").replace(/&nbsp;|&#160;/gi," ");e=e.replace(f.settings.clean,"");e.replace(f.settings[g],function(){c++})}d.html(c.toString());setTimeout(function(){f.block=0},2000)},1)}};a(document).bind("wpcountwords",function(d,c){wpWordCount.wc(c)})}(jQuery));