TinyMCE add Custom Characters

Problem:

The Hawaiian language has the kahako but tinymce does not have these in their charmap.

 

Solution:

To add more characters to the custom character map in tinymce, find the file:

themes/advanced/js/charmap.js

If you are using wordpress that directory is located in wp-includes/js/tinymce/

Open that file and you’ll see a list of characters in the charmap.  The first parameter is the html code, the second is the unicode character, the third is whether to display or not, the fourth is a description.   The easiest way to do this is to first know how many characters you are adding.  Then comment out that many lines which are displayed (have “true” as the third parameter).  Then add you characters.  Below are the characters I added for Hawaiian.

 

	['Ā',     'Ā',  true,'A kahako'],
	['Ē',     'Ē',  true,'E kahako'],
	['Ī',     'Ī',  true,'I kahako'],
	['Ō',     'Ō',  true,'O kahako'],
	['Ū',     'Ū',  true,'U kahako'],

	['ā',     'ā',  true,'a kahako'],
	['ē',     'ē',  true,'e kahako'],
	['ī',     'ī',  true,'i kahako'],
	['ō',     'ō',  true,'o kahako'],
	['ū',     'ū',  true,'u kahako'],

 

 

For a full explanation to add characters or if you don’t want to comment out existing characters, visit:  http://www.patrickgmj.net/node/66

Posted in Coding Tagged with: , ,

Leave a Reply