R
R
Roman Koff2015-05-04 16:43:53
CKEditor
Roman Koff, 2015-05-04 16:43:53

How to combine CKEditor and CodeMirror?

The web application has two content editors connected: CKEditor and CodeMirror.
The scenario is as follows:
1. When the form is loaded, the field containing the content is displayed in the "View" mode, i.e. rendered as normal html code.
2. Above the field, respectively, there are three buttons (switches) "View", "Markup", "Code".
3. When you click on the "Markup" button for the content, the CKEditor mode is turned on.
4. When you click on the "Code" button for the content, the CodeMirror mode is turned on.
5. When you click on the "View" button, the final html markup is displayed.
I know that there is a ready-made plugin for CKEditor that adds a code editing mode (including using codemirror), but it uses the old version of CodeMirror, and besides, all the settings are built into the plugin code. I don't want to mix two different packages into one dump, I want to be able to configure them separately in standard ways. Therefore, I want to write a separate module in JS, which would switch editors for textarea on the fly. Who - a thread faced such task?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question