function changeEditorCount(editorCount, remaining) {
	$(editorCount).html(remaining);
    if (remaining <= 0) {
    	$(editorCount).css('color', '#990019');

    	if (remaining === 0) {
    		$('input[type="submit"]').prop('disabled', false);
    	} else {
    		$('input[type="submit"]').prop('disabled', true);
    	}
    } else {
    	$(editorCount).css('color', '#b5839b');
    	$('input[type="submit"]').prop('disabled', false);
    }
}

function noCKEditor(editor) {
	var editorName = editor.attr('id');
	var editorData = editor.val();
  	var editorCount = '#' + editorName + '_count';
	var remaining = 2000 - editorData.length;

	 changeEditorCount(editorCount, remaining);
}

function yesCKEditor(editor) {
	var editorCount = '#' + editor.name + '_count';
    var remaining = 2000 - editor.getData().length;

	changeEditorCount(editorCount, remaining);
}

var onReadyCharacterCount = function() {
	CKEDITOR.on("instanceReady", function(event) {
		var editor;
	  	editor = event.editor;

	  	yesCKEditor(editor);

	  	return editor.on('change', function() {
	  		yesCKEditor(editor);
	  	});
	});

	if ($('body').hasClass('pages home')) {
		$('#moment_why').bind('keyup', function() {
			noCKEditor($(this));
		});
	}

	if (newOrEdit(['moments'])) {
		noCKEditor($('#strategy_description'));

		$('#strategy_description').bind('keyup', function() {
			noCKEditor($(this));
		});
	}

	if (isShow(['moments', 'strategies', 'meetings'])) {
		$('#comment_comment').bind('keyup', function() {
			noCKEditor($(this));
		});
	}
};

$(document).on("page:load ready", onReadyCharacterCount);

@@ -46,17 +46,18 @@
 ning) %7B%0A
-%09
+  
 $(editor
@@ -80,16 +80,17 @@
 ining);%0A
+%0A
     if (
@@ -107,25 +107,26 @@
 %3C= 0) %7B%0A    
-%09
+  
 $(editorCoun
@@ -158,17 +158,18 @@
 );%0A%0A    
-%09
+  
 if (rema
@@ -183,26 +183,28 @@
 == 0) %7B%0A    
-%09%09
+    
 $('input%5Btyp
@@ -246,17 +246,18 @@
 e);%0A    
-%09
+  
 %7D else %7B
@@ -261,18 +261,20 @@
 e %7B%0A    
-%09%09
+    
 $('input
@@ -319,17 +319,18 @@
 e);%0A    
-%09
+  
 %7D%0A    %7D 
@@ -340,17 +340,18 @@
 e %7B%0A    
-%09
+  
 $(editor
@@ -386,17 +386,18 @@
 ');%0A    
-%09
+  
 $('input
@@ -470,33 +470,34 @@
 ditor(editor) %7B%0A
-%09
+  
 var editorName =
@@ -516,17 +516,18 @@
 ('id');%0A
-%09
+  
 var edit
@@ -551,17 +551,16 @@
 al();%0A  
-%09
 var edit
@@ -598,17 +598,18 @@
 count';%0A
-%09
+  
 var rema
@@ -722,17 +722,18 @@
 itor) %7B%0A
-%09
+  
 var edit
@@ -772,18 +772,16 @@
 count';%0A
-  
   var re
@@ -823,17 +823,18 @@
 ength;%0A%0A
-%09
+  
 changeEd
@@ -912,17 +912,18 @@
 ion() %7B%0A
-%09
+  
 CKEDITOR
@@ -965,26 +965,16 @@
 ) %7B%0A
-%09%09
+    
 var 
-editor;%0A%09  %09
 edit
@@ -993,20 +993,20 @@
 ditor;%0A%0A
-%09
+  
   
-%09
 yesCKEdi
@@ -1019,20 +1019,20 @@
 itor);%0A%0A
-%09
   
-%09
+  
 return e
@@ -1067,13 +1067,14 @@
 ) %7B%0A
-%09  %09%09
+      
 yesC
@@ -1094,23 +1094,25 @@
 r);%0A
-%09
   
-%09
+  
 %7D);%0A
-%09
+  
 %7D);%0A%0A
-%09
+  
 if (
@@ -1143,26 +1143,28 @@
 s home')) %7B%0A
-%09%09
+    
 $('#moment_w
@@ -1187,35 +1187,38 @@
 ', function() %7B%0A
-%09%09%09
+      
 noCKEditor($(thi
@@ -1218,35 +1218,39 @@
 r($(this));%0A
-%09%09
+    
 %7D);%0A
-%09%7D%0A%0A%09
+  %7D%0A%0A  
 if (newOrEdi
@@ -1267,18 +1267,20 @@
 s'%5D)) %7B%0A
-%09%09
+    
 noCKEdit
@@ -1312,18 +1312,20 @@
 on'));%0A%0A
-%09%09
+    
 $('#stra
@@ -1362,35 +1362,38 @@
 ', function() %7B%0A
-%09%09%09
+      
 noCKEditor($(thi
@@ -1401,19 +1401,23 @@
 ));%0A
-%09%09
+    
 %7D);%0A
-%09%7D%0A%0A%09
+  %7D%0A%0A  
 if (
@@ -1465,18 +1465,20 @@
 s'%5D)) %7B%0A
-%09%09
+    
 $('#comm
@@ -1522,11 +1522,14 @@
 ) %7B%0A
-%09%09%09
+      
 noCK
@@ -1549,15 +1549,18 @@
 ));%0A
-%09%09
+    
 %7D);%0A
-%09
+  
 %7D%0A%7D;

Fix the indentation in character_count.js