ckeditor

How to listen to focus event in CKEditor 5

若如初见. 提交于 2021-02-08 04:38:54
问题 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

Replace ckeditor content and add undo history entry

佐手、 提交于 2021-02-07 20:26:08
问题 I have a basic functionality I need to implement and can't find the information on how to do it: I simply want to replace all of CKEditor's content with custom markup and add an undo history entry so you can go back to the version before replacing. So the basic command for replacing the content is editor.setData but it won't add an undo history, entry wrapping the call in editor.model.change won't change the behavior too. Then there is somewhere deep in the documentationthe information on how

Get the highlighted/selected text in CKEDITOR 5

不羁岁月 提交于 2021-02-07 19:53:16
问题 I have my Inline CKeditor let globalEditor; InlineEditor.create(document.querySelector("#textarea"), { toolbar: { items: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'insertTable', 'undo', 'redo'] } }).then(editor => { globalEditor = editor; }).catch(err => { console.error(err.stack); }); I also have a button that supposed to be getting the highlighted/selected text inside the ckeditor $("#btnAddTag").click(function (e) { e.preventDefault(); var

CKEditor automatically removes style attribute and add xss attribute 'Removed'

纵饮孤独 提交于 2021-02-07 09:58:33
问题 CKEditor automatically removes style attribute and add xss attribute 'removed' like if I put a style attribute in a element: <div class="text-center" style="text-align: center;">Test Heading</div> After save I got the following output: <div class="text-center" xss="removed">Test Heading</div> My configuration is: var toolbar_custom=[ { name: 'document', items: [ 'Source' ] }, { name: 'editing', items: [ 'Scayt' ] }, { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike',

how to get data from CKEditor?

限于喜欢 提交于 2021-02-05 08:13:14
问题 I am trying to get the data from CKEditor? I am trying getData function but it doesnt seem to be working. Below is the HTML <ckeditor [editor]="Editor" id="Editor" [data]="editorData"></ckeditor> Below is the Typescript import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic'; public Editor = ClassicEditor; ClassicEditor.create(document.querySelector('#Editor'), { toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote'], heading: { options: [

ng2-ckeditor Add Placeholder plugin using typescript and angular 2.0

喜夏-厌秋 提交于 2021-02-02 09:01:58
问题 I am trying to get placeholder plugin in the CKEditor toolbar but getting following error when adding extraPlugins:'placeholder' to CKEditor config - Error: [CKEDITOR.resourceManager.load] Resource name "placeholder" was not found at "//cdn.ckeditor.com/4.5.9/standard/plugins/placeholder/plugin.js?t=G6DD". Here is console log screenshot - I have also created a plunker. I have installed "ng2-ckeditor": "^1.0.4" via npm. Can i get some help ? 回答1: you should use that: <script src="https://cdn

How to understand CKEditor4's “justify” option?

自闭症网瘾萝莉.ら 提交于 2021-01-29 14:21:42
问题 I integrate the latest version of the CKEditor 4 Standard Version (v4.15 at the time of writing) via this link: https://cdn.jsdelivr.net/npm/ckeditor4/ckeditor.js By definition, the CKEditor 4 Standard Version does NOT include the "Justify" plugin, which is responsible for aligning text (left, right, center, justify) - at least to my understanding – according to the presets: https://ckeditor.com/cke4/builder And indeed, if I configure my setup with align rules, CKEditor won't recognise them:

Adding simple upload adapter to ckeditor in Angular

a 夏天 提交于 2021-01-29 10:30:56
问题 I did started classic ckeditor in my angular project by installing... npm install --save @ckeditor/ckeditor5-angular npm install --save @ckeditor/ckeditor5-build-classic In my component I've imported it... import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic'; initiated object... public Editor = ClassicEditor; and in template started like this <ckeditor [config]="{ toolbar: [ 'heading', '|', 'bold', 'italic' ] }" name="Blog" placeholder="About your ride" [(ngModel)]="formModel

WYSIWYG editor, markdown or bbcode or wiki or what

£可爱£侵袭症+ 提交于 2021-01-28 19:35:58
问题 I'm finding some editors that say they use bbcode or markdown or wiki, etc. Can someone explain what this is all about? 回答1: It's a simplified set of mark-up language tags to help with formatting of content in situations where you do not trust the data being entered, it will prevent users having to enter direct html that may otherwise break a page or permit exploits from working their way into the page's output. These tags will be processed and formatted into HTML by the software. Typing this

WYSIWYG editor, markdown or bbcode or wiki or what

本小妞迷上赌 提交于 2021-01-28 19:20:31
问题 I'm finding some editors that say they use bbcode or markdown or wiki, etc. Can someone explain what this is all about? 回答1: It's a simplified set of mark-up language tags to help with formatting of content in situations where you do not trust the data being entered, it will prevent users having to enter direct html that may otherwise break a page or permit exploits from working their way into the page's output. These tags will be processed and formatted into HTML by the software. Typing this