Fix autosave and word count for DFW HTML editor, always update word count on autosave, see #17136

git-svn-id: http://svn.automattic.com/wordpress/trunk@17936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz
2011-05-16 06:17:44 +00:00
parent 3a9f1dcc5c
commit 3bb59dbc9c
16 changed files with 86 additions and 55 deletions

View File

@@ -195,12 +195,18 @@
});
});
// Word count if script is loaded
if ( 'undefined' != typeof wpWordCount ) {
// Word count
if ( 'undefined' != typeof(jQuery) ) {
ed.onKeyUp.add(function(ed, e) {
if ( e.keyCode == last ) return;
if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) );
last = e.keyCode;
var k = e.keyCode || e.charCode;
if ( k == last )
return;
if ( 13 == k || 8 == last || 46 == last )
jQuery(document).triggerHandler('wpcountwords', [ ed.getContent({format : 'raw'}) ]);
last = k;
});
};

File diff suppressed because one or more lines are too long