]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/word-count.min.js
WordPress 4.3
[autoinstalls/wordpress.git] / wp-admin / js / word-count.min.js
index cfe5c702c1e78ed97f25392536773d1d963ea634..296ef2578f8742bea68e6157a1d5c4f3b11da80b 100644 (file)
@@ -1 +1 @@
-var wpWordCount;!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(c,d){var e=this,f=a(".word-count"),g=0;d===b&&(d=wordCountL10n.type),"w"!==d&&"c"!==d&&(d="w"),e.block||(e.block=1,setTimeout(function(){c&&(c=c.replace(e.settings.strip," ").replace(/&nbsp;|&#160;/gi," "),c=c.replace(e.settings.clean,""),c.replace(e.settings[d],function(){g++})),f.html(g.toString()),setTimeout(function(){e.block=0},2e3)},1))}},a(document).bind("wpcountwords",function(a,b){wpWordCount.wc(b)})}(jQuery);
\ No newline at end of file
+!function(){function a(a){var b,c;if(a)for(b in a)a.hasOwnProperty(b)&&(this.settings[b]=a[b]);c=this.settings.l10n.shortcodes,c&&c.length&&(this.settings.shortcodesRegExp=new RegExp("\\[\\/?(?:"+c.join("|")+")[^\\]]*?\\]","g"))}a.prototype.settings={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/&nbsp;|&#160;/gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-@[-`{-~","\x80-\xbf\xd7\xf7","\u2000-\u2bff","\u2e00-\u2e7f","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:window.wordCountL10n||{}},a.prototype.count=function(a,b){var c=0;return b=b||this.settings.l10n.type,"characters_excluding_spaces"!==b&&"characters_including_spaces"!==b&&(b="words"),a&&(a+="\n",a=a.replace(this.settings.HTMLRegExp,"\n"),a=a.replace(this.settings.HTMLcommentRegExp,""),this.settings.shortcodesRegExp&&(a=a.replace(this.settings.shortcodesRegExp,"\n")),a=a.replace(this.settings.spaceRegExp," "),"words"===b?(a=a.replace(this.settings.HTMLEntityRegExp,""),a=a.replace(this.settings.connectorRegExp," "),a=a.replace(this.settings.removeRegExp,"")):(a=a.replace(this.settings.HTMLEntityRegExp,"a"),a=a.replace(this.settings.astralRegExp,"a")),a=a.match(this.settings[b+"RegExp"]),a&&(c=a.length)),c},window.wp=window.wp||{},window.wp.utils=window.wp.utils||{},window.wp.utils.WordCounter=a}();
\ No newline at end of file