J
J
JULIKK2015-12-13 19:50:41
JavaScript
JULIKK, 2015-12-13 19:50:41

How to disable edit mode in ckeditor 4?

How to initialize ckeditor 4 so that all its plugins are initialized but the toolbar and editing mode were not available
tried to do something like

CKEDITOR.disableAutoInline = false;
                var editor = CKEDITOR.inline(elm[0], {
                    extraAllowedContent: '*',
                    toolbarStartupExpanded : false,
                    toolbarCanCollapse  : false,
                    startupFocus: false,                    
                });
                
                editor.on('instanceReady', function (ev) {
                    var ed = ev.editor;
                    ed.setReadOnly(true);
                    editor.removeListener();
                });
                editor.on('focus', function (event) {
                    return false;
                });
                editor.on('blur', function () {
                    return false;
                });

thanks to
editor.on('focus', function (event) {
                    return false;
                });

for this code, the toolbar is turned off , but still, when you right-click, the
ckeditora menu appears, i.e. all the same, it is initialized for editing .
it did not "enter" the edit mode, i.e. only to display the saved content (which was entered through the same editor earlier) but the toolbar and the ckeditora menu (what was not displayed when right-clicking)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JULIKK, 2015-01-01
@JULIKK

In general, I just rendered html and connected the plugin with the code separately
<script>hljs.initHighlightingOnLoad();</script>

S
seriogja, 2015-12-26
@seriogja

Good afternoon!
Skeditor is a text editor. Why do you need an editor at all if you are going to use it as a renderer? Why not just load a page whose content you say you've already saved? But, if you have some kind of intricate functionality planned, here the solution seems to be described.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question