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:
@@ -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
Reference in New Issue
Block a user