ckeditor

CK Editor validates second time

一个人想着一个人 提交于 2019-11-28 14:53:00
I have two CKEditors in my HTML (I mean to say multiple ckeditors). Also I am using Validate plugin for checking if CKEditor is empty,if empty show error. Validation works perfectly, but it validates second time, whereas it should validate first time itself. I have checked all the questions and answers here, but none helped. I created a JS Fiddle . Code for validate : HTML <form action="" method="post" id="frmEditor"> <p> <label for="editor1"> Editor 1: </label> <textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10"></textarea> </p> <p> </p> <p> <label for="editor1"> Editor

mysql_result() expects parameter 1 to be resource, boolean given [duplicate]

感情迁移 提交于 2019-11-28 14:20:42
问题 This question already has an answer here: mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource or result 32 answers mysql_result() expects parameter 1 to be resource, boolean given error [duplicate] 2 answers mysql_result() expects parameter 1 to be resource, boolean given [duplicate] 3 answers The code below gives me the error: mysql_result() expects parameter 1 to be resource, boolean given I have double checked my database and all

How to apply ckeditor css to output

浪子不回头ぞ 提交于 2019-11-28 14:14:32
Ck-editor works itself good, after i save editet text from ckeditor to database, and then i load it to page. Generated html is unformated, is there any aditional ckeditor js functions that have to be applied to target area, or is there any detault class needed to be added to text container ? I checked ck-editor css files but there is no specific class, like when you check "contents.css" in ckeditor files and there is "img.left{border: 1px solid #ccc; .." thats pretty creepy since there is no specific class, it would work in plain iframe but if i show text from ckeditor in more complex page i

Force CKEditor to add a class to p-tags

馋奶兔 提交于 2019-11-28 13:27:53
I must configure CKEditor to add a class-attribute to every p-tag in the content. You can do something similar with config.format_p but it will only apply the class-attribute to text that is marked as "normal" wich is not default. Anyone? Edit: I'm using the current version 3.6.2. Here are the relevant parts of my config: CKEDITOR.editorConfig = function( config ) { config.removeFormatTags = 'b,div,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var,form,input,textarea'; config.format_p = { element: 'p', attributes: { 'class': 'tiny_p' } }; config.skin =

CKEditor 5 – get editor instances

青春壹個敷衍的年華 提交于 2019-11-28 12:55:05
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 know the name of the editor a priori. There can also be several editors active on the screen at the same

How to get data from CKEditor 5 instance

依然范特西╮ 提交于 2019-11-28 12:21:31
I know that for CKEditor 4, you can get the textarea data like this: var content = CKEDITOR.instances['comment'].getData(); How is this done for CKEditor 5? You can find the answer in the Basic API guide. Basically, in CKEditor 5 there's no single global editors repository (like the old CKEDITOR.instances global variable). This means that you need to keep the reference to the editor that you created and use that reference once you'll want to retrieve the data: ClassicEditor .create( document.querySelector( '#editor' ) ) .then( editor => { editor.getData(); // -> '<p>Foo!</p>' } ) .catch( error

How to find and replace text in CKEditor using Javascript?

不想你离开。 提交于 2019-11-28 11:33:55
How could I find and replace text in CKEditor using Javascript? Thanks for your suggestion! try this editor = CKEDITOR.instances.fck; //fck is just my instance name you will need to replace that with yours var edata = editor.getData(); var replaced_text = edata.replace("idontwant", "iwant this instead"); // you could also use a regex in the replace editor.setData(replaced_text); you may want to put that in a blur event or soemthing 来源: https://stackoverflow.com/questions/5635118/how-to-find-and-replace-text-in-ckeditor-using-javascript

CKEDITOR Error code: editor-destroy-iframe in Angular 2

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 11:33:29
问题 I am using ng2-ckeditor in my Angular2 project. It is working fine but when I go on another component, It shows warning message [CKEDITOR] Error code: editor-destroy-iframe . I google for solution and found below solution: for (name in CKEDITOR.instances) { CKEDITOR.instances[name].destroy(true); } But from where to get CKEDITOR . In ng2-ckeditor package, I can see only 2 library CKEditorModule, CKEditorComponent . Please help me to solve this. 回答1: Try adding the typescript definition file

How to block editing on certain part of content in CKEDITOR textarea?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 11:32:39
I have my CKEDITOR form prepopulated with hidden table which is being submitted together with user inputed text. This works fine, but sometimes user presses backspace too many times and deletes the hidden table. Is there a way to block editing on this hidden table inside ckeditor textarea? So when user presses backspace the hidden table isn't affected and stays in. As soon as CKEDITOR instance is ready this source (bellow) is put inside CkEditor Textarea (using setData() attribute) and User only sees the returned <p></p> value. In this case its <p>I really think I can do this!</p> . Its a

ckeditor removing empty span automatically

拟墨画扇 提交于 2019-11-28 10:47:14
i am using ckeditor and i have vary strange issue. it remove automatically empty <span> for example <span class="new-class"></span> removed automatically. i am searching for solution for last 2 days but no success. i try to put following code in config.js CKEDITOR.config.allowedContent = true; but no success. i also add following code in html where i use ckeditor but no success. <script> var editor = CKEDITOR.replace( 'editor1', { allowedContent: true, } ); </script> thanks Reinmar You'll find two valid answers in this question: CKEditor strips <i> Tag One says it's not possible to keep them