ckeditor

Changing skin for ckeditor

有些话、适合烂在心里 提交于 2021-02-11 18:10:26
问题 Am I able to change skin? I'm creating angular app, that has light and dark theme. I have prepared two ckeditor skins. But even if I destroy ck instance, next instance has previuos skin - not current. 回答1: CKEditor4 skins are applied to instance creation, so recreating instance is a good way to dynamically update editor skin. You should be able to pass configuration option config.skin when replacing DOM element with an editor to indicate its skin e.g: CKEDITOR.replace( 'editor', { skin:

CKEDITOR - <p> instead of <br/> causing copy-paste issues

橙三吉。 提交于 2021-02-11 18:08:13
问题 Some time ago I changed the CKEDITOR to not use <br> tag and use <p> instead. This makes things alot easier for me. But today I spotted a problem here... When I paste into ckeditor this text: Text More text CKEDITOR makes this: <p>Text</p><p>More text</p> . How can I configure ckeditor so that it will put put only single <p> tag over whole text, and inside it will put <br/> 's? 回答1: There's no configuration option for pasting itself. You can, however, change behaviour of entire CKEditor if

ckfinder 3.4.5 - Does it still create thumbnails upon upload?

﹥>﹥吖頭↗ 提交于 2021-02-11 15:19:22
问题 I've been using ckeditor4 for ages in my custom CMS and I've just integrated ckfinder3 so I can use drag & drop image uploading via ckeditor4. Everything is working properly and I have it resizing images upon upload (set in ckfinder/config.php) - all good. My issue is I want it to create a thumbnail of the image too, as it did in the past (I've been using an earlier version of ckfinder). They used to be uploaded to userfiles/_thumbs/images/ but now it doesn't seem to do it. I have a few

Changing configuration options of a CKEditor instance

时光总嘲笑我的痴心妄想 提交于 2021-02-11 15:02:27
问题 I have a CKEditor instance attached to a textarea . I would like to be able change some configuration options of this instance after its creation, depending on the value of another form field. Is it possible to do this, or else it's necessary to destroy the instance and attach another one, with the new options? I've checked in the CKEditor docs, but found nothing about this subject. Thanks in advance, 回答1: Usually the configuration options will work only upon creation. You might be able to

Changing configuration options of a CKEditor instance

∥☆過路亽.° 提交于 2021-02-11 15:01:32
问题 I have a CKEditor instance attached to a textarea . I would like to be able change some configuration options of this instance after its creation, depending on the value of another form field. Is it possible to do this, or else it's necessary to destroy the instance and attach another one, with the new options? I've checked in the CKEditor docs, but found nothing about this subject. Thanks in advance, 回答1: Usually the configuration options will work only upon creation. You might be able to

Can't add mathtype plugin locally in CKEditor

走远了吗. 提交于 2021-02-11 14:10:29
问题 import React from 'react' import CKEditor4 from 'ckeditor4-react' export default function App () { return ( <CKEditor4 data='<h1>hello</h1>' config={{ extraPlugins: ['ckeditor_wiris'], allowedContent: true, height: 300, startupFocus: 'end', skin: 'moono' }} onBeforeLoad={(CKEDITOR) => { CKEDITOR.plugins.addExternal( 'ckeditor_wiris', 'https://www.wiris.net/demo/plugins/ckeditor/', 'plugin.js' ) }} /> ) } I created a react app using CRA , this code will render CKEditor with Mathtype plugin. I

Is there a way to detect users select all content?

无人久伴 提交于 2021-02-10 14:53:59
问题 I'm implementing a plugin and have a use case need to detect when user select all content. I trying create a select all selection like this const selectAllSelection = editor.model.createSelection(editor.model.document.getRoot(), 'in') and compare with current model.document.selection but they are not the same. 回答1: Those selections are a bit different as the one created with createSelection() will start directly in <$root> . Real document selection will start inside the first <paragraph> .

Create non editable block with text in CKEditor 5

为君一笑 提交于 2021-02-10 13:25:12
问题 How do I Create a non editable block with text in CKEditor 5. I need something which in the final view generate a: <div>Non editable message here</div> I tried to use a UIElement and then set innerHTML but that still makes the element editable. Just for reference: Her is the plugin I ended up using. import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; import DecoupledEditor from '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor'; import Essentials from '@ckeditor/ckeditor5

Register click listener on ckeditor5 dropdown items

旧巷老猫 提交于 2021-02-08 05:13:09
问题 I am currently trying to write a plugin for the CKEditor 5 to support automatic translations. I was able to find out how to write plugins and how to create dropdowns in the documentation. But in the documentation there is no mention (or I missed it) how to be informed about a click on the values: There is an Execute Handler for the button that opens the dropdown, but how do I register a listener for a click on one of the values? Can I assign an id or similar to my items to recognize the click

How to listen to focus event in CKEditor 5

老子叫甜甜 提交于 2021-02-08 04:39:21
问题 I'd like to listen to the focus event in CKEditor 5. I thought something like this would work but the callback is never called: document.querySelector("#editable"); ClassicEditor.create(el).then(editor => { editor.on('focus', () => { console.log("Focused"); }); }); The editor is successfully created but the callback is not called. Any ideas? 回答1: The editor comes with a FocusTracker (and the observable #isFocused property) for that purpose: editor.ui.focusTracker.on( 'change:isFocused', ( evt