Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMCE, show character count instead of word count

The title says it all. How do I get TinyMCE to show character count instead of word count?

enter image description here

like image 404
Rusty Avatar asked Dec 27 '15 15:12

Rusty


People also ask

How do you get word count on TinyMCE?

Show a word count in the TinyMCE status bar.Clicking Word Count in the status bar switches between counting words and characters. A dialog box with both word and character counts can be opened using the menu item situated in the Tools drop-down, or the toolbar button.

How do you calculate character count?

You can get a character count in a Word document by selecting the "Review" tab and clicking "Word Count." You can find both the number of characters with spaces and the character count not including spaces.

How do I get rid of powered by tiny?

Use the branding option to disable the “Powered by Tiny” link displayed in the status bar for product attribution.


1 Answers

wordcount plugin now can count and show characters:

Clicking Word Count in the status bar switches between counting words and characters.

By default mode is "words", but it's pretty easy emulate click in status bar to switch it.

Alter your editor config following way:

tinymce.init({
   plugins: "wordcount",

   // ... 

   init_instance_callback: function (editor) {
      $(editor.getContainer()).find('button.tox-statusbar__wordcount').click();  // if you use jQuery
   }
});

That's all. You have character count now.

like image 173
Mikhail Gerasimov Avatar answered Sep 20 '22 13:09

Mikhail Gerasimov