public/js/ckeditor/plugins/charcount/plugin.js
/**
 * Attach the keyup event to the editor
 * @param {CKEDITOR} editor <p>The editor to attach the events to.</p>
 */
Attach the keyup event to the editor
@param {CKEDITOR} editor The editor to attach the events to.
Attach the keyup event to the editor @param { CKEDITOR } editor The editor to attach the events to .
function addEventOnkey(editor) {
	var initilised = false;
	editor.on('contentDom', function() {
		calculate(editor);
		var editable = editor.editable();
		editable.attachListener(editor.document, 'keyup', function() {
			calculate(editor);
		});
		if (!initilised)
			editor.on('paste', function() {
				calculate(editor);
			});
	var buttons = document.getElementsByClassName('cke_button__charcount');
	for (button in buttons) {
		if (!isNaN(button)) {
			var spans = buttons[button].getElementsByTagName('span');
			spans[0].style.display = 'none';
			spans[1].style.display = 'inline';
			spans[1].style['padding-left'] = '0px';
		}
	}
	});
}
function addEventOnkey ( editor ) { var initilised = false ; editor . on ( 'contentDom' , function ( ) { calculate ( editor ) ; var editable = editor . editable ( ) ; editable . attachListener ( editor . document , 'keyup' , function ( ) { calculate ( editor ) ; } ) ; if ( ! initilised ) editor . on ( 'paste' , function ( ) { calculate ( editor ) ; } ) ; var buttons = document . getElementsByClassName ( 'cke_button__charcount' ) ; for ( button in buttons ) { if ( ! isNaN ( button ) ) { var spans = buttons [ button ] . getElementsByTagName ( 'span' ) ; spans [ 0 ] . style . display = 'none' ; spans [ 1 ] . style . display = 'inline' ; spans [ 1 ] . style [ 'padding-left' ] = '0px' ; } } } ) ; }
Attach the keyup event to the editor
 @param {CKEDITOR} editor <p>The editor to attach the events to.</p>
Attach the keyup event to the editor @param { CKEDITOR } editor <p > The editor to attach the events to . < / p >
// Perform an initial calculation when the contentDom has just been built /*
		 * CKE only exposes the editor.document.on method at first creation of
		 * the editor, however if a setData is called, then all events added in
		 * this manner are erased.  setData will perform a contentDom event
		 * every time it is called, so we must directly hook new listeners to
		 * the recreated document.
		 */ // This will only work if the paste as plain text plugin is available /*
	 * So that we don't have to hack around any of the main CKE javascript
	 * files, we need to directly modify the button that's added so that it is
	 * not fixed width and has no icon.
	 * Although not available in some browsers getElementsByClassName is a good
	 * way of doing this.
	 */ // We know that each button has two spans - the icon and text