{"id":4396,"date":"2024-02-03T12:56:42","date_gmt":"2024-02-03T03:56:42","guid":{"rendered":"https:\/\/taitan916.info\/blog\/?p=4396"},"modified":"2024-01-29T13:07:18","modified_gmt":"2024-01-29T04:07:18","slug":"post-4396","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/4396","title":{"rendered":"CKEditor5(WYSIWYG\u30a8\u30c7\u30a3\u30bf)\u3092\u30da\u30fc\u30b8\u9077\u79fb\u7121\u3057\u3067textarea\u306b\u5207\u308a\u66ff\u3048\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u3067CKEditor5(\u30a6\u30a3\u30b8\u30a6\u30a3\u30b0\u30a8\u30c7\u30a3\u30bf)\u3068\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2\u306e\u5207\u308a\u66ff\u3048\u3092\u884c\u3044\u305f\u3044\u3002\u307e\u305f\u3001WordPress\u306e\u30a8\u30c7\u30a3\u30bf\u306e\u3088\u3046\u306b\u30da\u30fc\u30b8\u9077\u79fb\u7121\u3057\u3067\u3001\u5c1a\u4e14\u3064\u5165\u529b\u5185\u5bb9\u306f\u305d\u306e\u307e\u307e\u3067\u5207\u308a\u66ff\u3048\u305f\u3044\u3002\u8abf\u3079\u305f\u3068\u3053\u308d<a href=\"https:\/\/ckeditor.com\/docs\/ckeditor5\/latest\/api\/module_editor-inline_inlineeditor-InlineEditor.html#function-destroy\" target=\"_blank\" rel=\"noopener\">destroy()<\/a>\u30e1\u30bd\u30c3\u30c9\u3067\u5bfe\u5fdc\u3067\u304d\u305d\u3046\u3002\u4ee5\u4e0b\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3068\u30b5\u30f3\u30d7\u30eb\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u516c\u5f0f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/h2>\n<p><a href=\"https:\/\/ckeditor.com\/docs\/ckeditor5\/latest\/index.html\" target=\"_blank\" rel=\"noopener\">https:\/\/ckeditor.com\/docs\/ckeditor5\/latest\/index.html<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<p><a href=\"https:\/\/taitan916.info\/sample\/CKEditor\/switching\/\" target=\"_blank\" rel=\"noopener\">https:\/\/taitan916.info\/sample\/CKEditor\/switching\/<\/a><\/p>\n<p>\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u3067CKEditor\u21d4\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2\u3092\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;html lang=\"ja\"&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\"&gt;\r\n&lt;title&gt;CKEditor\u3068\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2\u306e\u5207\u308a\u66ff\u3048\u30b5\u30f3\u30d7\u30eb&lt;\/title&gt;\r\n&lt;style&gt;\r\n.ck-editor__editable_inline {\r\n    min-height: 200px;\r\n}\r\ntextarea{\r\n    width: 100%;\r\n}\r\n&lt;\/style&gt;\r\n\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n    &lt;form action=\"\/\" method=\"post\"&gt;\r\n        &lt;div&gt;\r\n            &lt;label&gt;\r\n                &lt;input type=\"radio\" value=\"on\" name=\"switching\" checked&gt;CKEditor\r\n            &lt;\/label&gt;\r\n            &lt;label&gt;\r\n                &lt;input type=\"radio\" value=\"off\" name=\"switching\"&gt;\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2\r\n            &lt;\/label&gt;\r\n        &lt;\/div&gt;\r\n        &lt;textarea name=\"editor\" id=\"editor\"&gt;&lt;\/textarea&gt;&lt;br&gt;\r\n        &lt;input type=\"submit\" value=\"\u9001\u4fe1\"&gt;\r\n    &lt;\/form&gt;\r\n\r\n    &lt;script src=\"https:\/\/code.jquery.com\/jquery-3.7.1.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.ckeditor.com\/ckeditor5\/33.0.0\/classic\/ckeditor.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.ckeditor.com\/ckeditor5\/33.0.0\/classic\/translations\/ja.js\"&gt;&lt;\/script&gt;\r\n\r\n    &lt;script&gt;\r\n    $(function(){\r\n\r\n        var ckeditor = ClassicEditor.create(document.querySelector('#editor'), {\r\n            language: 'ja'\r\n        }).then(e =&gt; {\r\n            ckeditor = e;\r\n        });\r\n\r\n        $('input[name=\"switching\"]').on('change', function(){\r\n            if( $(this).val() == 'on' ){\r\n                ClassicEditor.create(document.querySelector('#editor'), {\r\n                    language: 'ja'\r\n                }).then(e =&gt; {\r\n                    ckeditor = e;\r\n                });\r\n            }else{\r\n                ckeditor.destroy();\r\n            }\r\n        });\r\n    });\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u6240\u611f<\/h2>\n<p>\u904e\u53bb\u306b\u30e1\u30e2\u3057\u305f<a href=\"https:\/\/taitan916.info\/blog\/archives\/3621\" target=\"_blank\" rel=\"noopener\">\u753b\u50cf\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6a5f\u80fd<\/a>\u3068\u5408\u308f\u305b\u308b\u3068\u5b9f\u904b\u7528\u3067\u304d\u305d\u3046\u3002\u4eca\u5f8cWYSIWYG\u30a8\u30c7\u30a3\u30bf\u3092\u7d44\u307f\u8fbc\u3080\u6848\u4ef6\u304c\u3042\u308c\u3070CKEditor5\u3092\u4f7f\u3063\u3066\u3044\u304d\u305f\u3044\u3068\u3053\u308d\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u53c2\u8003\u30b5\u30a4\u30c8<\/h2>\n<p><a href=\"https:\/\/dev.to\/pcmagas\/ckeditor-destroy-does-not-exist-how-to-fix-it-on-multiple-ckeditor-instance-intialization-3pe6\" target=\"_blank\" rel=\"noopener\">https:\/\/dev.to\/pcmagas\/ckeditor-destroy-does-not-exist-how-to-fix-it-on-multiple-ckeditor-instance-intialization-3pe6<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u3067CKEditor5(\u30a6\u30a3\u30b8\u30a6\u30a3\u30b0\u30a8\u30c7\u30a3\u30bf)\u3068\u30c6\u30ad\u30b9\u30c8 ... <\/p>\n","protected":false},"author":1,"featured_media":1067,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[86],"class_list":["post-4396","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-wysiwyg"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/4396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=4396"}],"version-history":[{"count":1,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/4396\/revisions"}],"predecessor-version":[{"id":4397,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/4396\/revisions\/4397"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/1067"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=4396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=4396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=4396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}