ckeditor5

CKEditor 5 – get editor instances

丶灬走出姿态 提交于 2019-12-17 16:53:17
问题 I am migrating from CKEditor 4.7 to 5. In CKE4, I would do something like this: CKEDITOR.replace('text_area'); and then in another JS function I could get the data by CKEDITOR.instances.text_area.getData() . But it doesn't appear that CKE5 has a function ClassicEditor.instances or something analogous. I know I can store the editor instance as a global JS variable, but the code I am working with creates the editors in a general function, so I can't just create a global variable since I don't

CKEditor 5 – get editor instances

£可爱£侵袭症+ 提交于 2019-12-17 16:53:01
问题 I am migrating from CKEditor 4.7 to 5. In CKE4, I would do something like this: CKEDITOR.replace('text_area'); and then in another JS function I could get the data by CKEDITOR.instances.text_area.getData() . But it doesn't appear that CKE5 has a function ClassicEditor.instances or something analogous. I know I can store the editor instance as a global JS variable, but the code I am working with creates the editors in a general function, so I can't just create a global variable since I don't

CKEditor5 use model in custom Data Processor

好久不见. 提交于 2019-12-13 20:27:50
问题 I was playing with CKEDitor5, and I tried to create a custom Data Processor. I'd like to use the model in the toData conversion, but the method is called with the view/DocumentFragment object. So my question is that how could I convert that into a model/DocumentFragment object (or how to access the model from a data processor). Update (as it cannot fit into a comment): Let me try to better explain what exactly I try to do (or I already did so far) in a bit more detail. I figured out how to

Insert image to CKEditor

和自甴很熟 提交于 2019-12-13 03:13:59
问题 I trying to use CKEditor5 and CKEditor-react in my electron app. And i want to paste image in editor, but i have an error filerepository-no-upload-adapter: Upload adapter is not defined. Docs says that I mast using cloud. But my app must working locally and without internet Can someone help me? 回答1: The docs say, in short, this: To handle image upload in CKEditor 5 you can use one of these: use the built-in Easy Image adapter (cloud service), use the built-in CKFinder adapter (can work

ckeditor5 & CakePHP 2.3: How do I make the tables work?

血红的双手。 提交于 2019-12-11 15:15:08
问题 I have a CakePHP 2.3 app that for years has had whatever version CK Editor. I'm working in developing mode, hoping to upgrade it to CKEditor 5. I easily and quickly got rid of all old code and files to make ckeditor5 work just fine in its most basic version. This was a go! However, I do need tables. I'm now working on getting the table feature set up and just cannot get it working. Here's their doc on this: https://docs.ckeditor.com/ckeditor5/latest/features/table.html npm install --save

How to implement a placeholder plugin that works with plain text placeholders?

左心房为你撑大大i 提交于 2019-12-11 08:25:55
问题 I'am trying to implement a plugin that translates plaintext placeholders of type __firstName__ into a model like <placeholder key="__firstName__"></placeholder> and vice versa. I followed the tutorial on implementing an inline widget which really helped to get started. I got the upcast part working which parses the text, splits it up and creates text- and placeholder-elements. So: <p>Hi __firstName__,</p> becomes: <$root> <paragraph> "Hi " <placeholder key="__firstName__"> </placeholder> ","

CKEditor 5 save selected text and set it again as selected after recover the content

痴心易碎 提交于 2019-12-10 18:18:34
问题 I've been working around with the CKEditor 5 with: var mySelection = editor.getSelection(); to get selected text and being able to save it to a database for example. I wanted to know if there is an easier way to save selected text to a database and then after recovering the text a way to set it as selected automatically in the editor window. An easy way to save selection and set selection again in the same text. Is there a plugin or something similar? Regards 回答1: This is the way to get stuff

How to set CKEditor 5 height

安稳与你 提交于 2019-12-05 20:50:10
Using CKeditor angular component How to set the editor height? According to the docs, it can be done by setting the editor style to: min-height: 500px !important; But it doesn't work! Maciej Bukowski If you add it to the global stylesheet the following should work: .ck-editor__editable_inline { min-height: 500px !important; } But if you want to style through the component.css you need to type this: :host ::ng-deep .ck-editor__editable_inline { min-height: 500px !important; } 来源: https://stackoverflow.com/questions/52485000/how-to-set-ckeditor-5-height

How to implement custom image uploader for CKEditor5 in Angular 5?

♀尐吖头ヾ 提交于 2019-12-05 18:59:21
I am looking for an example showing an implementation of custom image uploader for CKEditor 5 using Angular 5. There's no need for the Angular-specific version of that adapter. You can use for example this: https://github.com/pourquoi/ckeditor5-simple-upload or try to integrate it with the CKFinder . Then, all you need to do is to pass the configuration object to the <ckeditor [config]='config'> component. Don't forget to set allowJs: true in your tsconfig.json file to allow bundling local JS files. Alternatively, you can create it on your own. This should be the base skeleton of the upload

Listen to event fired when the content has changed in CKEditor 5

旧街凉风 提交于 2019-12-05 05:46:26
How can I listen to the "input" event in ckeditor5 ? I would like to be able to use Observables like this: Observable.fromEvent(this.editor, "input").debounceTime(250).subscribe(() => {}); So far, I've been able to listen to some events like this: Observable.fromEvent(this.editor.editing.view, 'selectionChangeDone').subscribe(() => { }); But I don't find the name of the event that would be fired as soon as data changed in the editor. I tried "change" but it only fires when the editor get or lost focus. oleq Since CKEditor5 v11.0.0 (since 21 July 2018) What you probably need is the Document