diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 6402d5db6..e2b196dc3 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -18,7 +18,31 @@ tinyMCE.init({ add_unload_trigger : false, remove_linebreaks : false, convert_urls: false, - content_css: "$baseurl/view/custom_tinymce.css" + content_css: "$baseurl/view/custom_tinymce.css", + //Character count + theme_advanced_path : false, + setup : function(ed) { + ed.onKeyUp.add(function(ed, e) { + var txt = tinyMCE.activeEditor.getContent(); + var text = txt.length; + if(txt.length <= 140) { + $('#character-counter').removeClass('red'); + $('#character-counter').removeClass('orange'); + $('#character-counter').addClass('grey'); + } + if((txt.length > 140) && (txt .length <= 420)) { + $('#character-counter').removeClass('grey'); + $('#character-counter').removeClass('red'); + $('#character-counter').addClass('orange'); + } + if(txt.length > 420) { + $('#character-counter').removeClass('grey'); + $('#character-counter').removeClass('orange'); + $('#character-counter').addClass('red'); + } + $('#character-counter').text(text); + }); + } }); diff --git a/view/jot.tpl b/view/jot.tpl index 9e9ab6468..718277210 100644 --- a/view/jot.tpl +++ b/view/jot.tpl @@ -1,8 +1,10 @@
-What's on your mind? -
+ +