-
+ 6FFE1FC9F49159B3271AC674E38CA44B853F0949991C396A362C74E72BE3985E49D63A006E0DB651F7A7827AFBCB601001C74A6EBB897216D4C147E036B7EF05
mp-wp/wp-admin/js/word-count.js
(0 . 0)(1 . 39)
51740 // Word count
51741 (function(JQ) {
51742 wpWordCount = {
51743
51744 init : function() {
51745 var t = this, last = 0, co = JQ('#content');
51746
51747 JQ('#wp-word-count').html( wordCountL10n.count.replace( /%d/, '<span id="word-count">0</span>' ) );
51748 t.block = 0;
51749 t.wc(co.val());
51750 co.keyup( function(e) {
51751 if ( e.keyCode == last ) return true;
51752 if ( 13 == e.keyCode || 8 == last || 46 == last ) t.wc(co.val());
51753 last = e.keyCode;
51754 return true;
51755 });
51756 },
51757
51758 wc : function(tx) {
51759 var t = this, w = JQ('#word-count'), tc = 0;
51760
51761 if ( t.block ) return;
51762 t.block = 1;
51763
51764 setTimeout( function() {
51765 if ( tx ) {
51766 tx = tx.replace( /<.[^<>]*?>/g, ' ' ).replace( / /gi, ' ' );
51767 tx = tx.replace( /[0-9.(),;:!?%#$'"_+=\\/-]*/g, '' );
51768 tx.replace( /\S\s+/g, function(){tc++;} );
51769 }
51770 w.html(tc.toString());
51771
51772 setTimeout( function() { t.block = 0; }, 2000 );
51773 }, 1 );
51774 }
51775 }
51776 }(jQuery));
51777
51778 jQuery(document).ready( function(){ wpWordCount.init(); } );