TinyMCEに絵文字を追加したい
公式ドキュメント:TinyMCE Emoticons plugin
https://www.tiny.cloud/docs/plugins/emoticons/
これ↓を追加すればよい??
tinymce.init({
selector: "textarea", // change this value according to your HTML
plugins: "emoticons",
toolbar: "emoticons"
});
早速行きます。
<!DOCTYPE html>
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.3.1.slim.js"
integrity="sha256-fNXJFIlca05BIO2Y5zh1xrShK3ME+/lYZ0j+ChxX2DA="
crossorigin="anonymous"></script>
<script src="tinymce/js/tinymce/tinymce.min.js"></script>
<script>
tinymce.init({
mode : "specific_textareas",
editor_selector : "mceEditor",
plugins: "emoticons",
toolbar: "emoticons",
init_instance_callback: function (editor) {
editor.on('change', function (e) {
$('#preview_area').html(editor.getContent());
});
}
});
</script>
</head>
<body>
<h1>テキストを入力してください</h1>
<textarea id="myTextArea" class="mceEditor">TinyMCE Editor</textarea>
<div style="border:1px solid; width:200px; height:200px;" id="preview_area"></div>
</body>
</html>
すくな!?デフォルトだと16種類しかない!? うーむ、困ったぞー これ、tinyMCEのバージョンが最新なら、絵文字の種類も増えるとかある??

ああああああああああ、なるほど、emoticonsのimgフォルダに入っている画像を使ってるのね。
utf-8の絵文字、👿👹👺などをパレットで選べるようにしたいですねー