ckeditor

How to use CKEditor in a Bootstrap Modal?

自作多情 提交于 2019-11-26 11:06:07
问题 If I use the CKEditor plugin in an HTML page based on a Bootstrap template, it works great, however if I insert the editor on a Bootstrap Modal like this <!-- Modal --> <div class=\"modal fade\" id=\"modalAddBrand\" tabindex=\"-1\" role=\"dialog\" aria labelledby=\"modalAddBrandLabel\" aria-hidden=\"true\"> <div class=\"modal-dialog modal-lg\"> <div class=\"modal-content\"> <div class=\"modal-header\"> <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×<

How do I set a value in CKEditor with Javascript?

放肆的年华 提交于 2019-11-26 10:55:39
问题 I am wondering how I can set a value in CKEditor using Javascript? I have tried the following, but neither of them work... document.[form name].[textarea name].value=data; $(\'#textareaID\').val(data); However, both these work without the editor applied. Is there a way I can do this with the editor? 回答1: Use the CKEditor method setData(): CKEDITOR.instances[**fieldname**].setData(**your data**) 回答2: The insertHtml() and insertText() methods will insert data into the editor window, adding to

Using jQuery to grab the content from CKEditor&#39;s iframe

房东的猫 提交于 2019-11-26 09:25:57
问题 I have a custom-written CMS that uses CKEditor *(FCKEditor v3) for editing content. I\'m also using the jQuery Validation plugin to check all fields for error prior to AJAX-based submission. I\'m using the serialize() function to passing the data to the PHP backend. Problem is, serialize manages to grab all fields correctly, except for the actual content typed in CKEditor. Like every other WYSIWYG editor, this one too overlays an iframe over an existing textbox. And serialize ignores the

How to ajax-submit a form textarea input from CKEditor?

試著忘記壹切 提交于 2019-11-26 08:02:50
问题 I am using CKEditor, jQuery and jQuery form plugin and I would like to submit contents of the CkEditor form via an Ajax query. Here is my code: <form id=\"article-form\" name=\"article-form\" method=\"post\" action=\"/myproject/save\"> <textarea name=\"bodyText\" style=\"visibility: hidden; display: none;\"></textarea> <script type=\"text/javascript\"> CKEDITOR.replace(\'bodyText\'); </script> <a onClick=\"$(\"#article-form\").ajaxSubmit();\">Submit</a> </form> Unfortunately, it seems that

How can you integrate a custom file browser/uploader with CKEditor?

感情迁移 提交于 2019-11-26 07:51:45
问题 The official documentation is less than clear - what\'s the correct way to integrate a custom file browser/uploader with CKEditor? (v3 - not FCKEditor) 回答1: Start by registering your custom browser/uploader when you instantiate CKEditor. You can designate different URLs for an image browser vs. a general file browser. <script type="text/javascript"> CKEDITOR.replace('content', { filebrowserBrowseUrl : '/browser/browse/type/all', filebrowserUploadUrl : '/browser/upload/type/all',

Change form values after submit button pressed

我的未来我决定 提交于 2019-11-26 07:43:24
问题 [EDIT] After a lot of digging around, I found out that the problem was in how I integrated the CKEditor into my page. The simple and obvious way does work in this case, as laid out in the accepted answer. Hi, I need to change the values of a form, after the submit button has been pressed, but before the actual submission has taken place. I\'ve tried hooking into the \"submit\" event of the form, and changing the text field values there manually, but it looks like that doesn\'t actually change

CKEditor strips <i> Tag

江枫思渺然 提交于 2019-11-26 07:27:24
问题 I\'m trying to find a solution to avoid CKEditor, but also the older FCKeditor strips out any <i> tag from previously inserted content to the db. Case: I insert html content to the db, some content contain the <i> elements. I do this with the CKEditor. Everything works perfect and the content shows up on the webpage. But when i want to edit the previously inserted content, the <i> elements are missing. In my specific case i use: <i class=\"fa-icon-fullscreen fa-icon-xxlarge main-color\"></i>

CKEditor instance already exists

孤街浪徒 提交于 2019-11-26 07:00:21
问题 I am using jquery dialogs to present forms (fetched via AJAX). On some forms I am using a CKEditor for the textareas. The editor displays fine on the first load. When the user cancels the dialog, I am removing the contents so that they are loaded fresh on a later request. The issue is, once the dialog is reloaded, the CKEditor claims the editor already exists. uncaught exception: [CKEDITOR.editor] The instance \"textarea_name\" already exists. The API includes a method for destroying existing

How to enable image upload support in CKEditor 5?

一个人想着一个人 提交于 2019-11-26 06:44:03
问题 I will use the ckeditor v5 into my project. I´ve trying to use the image plugin, but I don´t find enough informations about it. If you see the Demoe here, you easily upload images with Drag&Drop. But when I will try it with the download ballon zip nothing happens when I try to Drag&Drop a image. There is also no error. Is there a way to use this image support in the downladable variant? 回答1: Yes, image upload is included in all the available builds. In order to make it work, though, you need

Get computed font size for DOM element in JS

六月ゝ 毕业季﹏ 提交于 2019-11-26 04:19:51
问题 Is it possible to detect the computed font-size of a DOM element, taking into consideration generic settings made elsewhere (In the body tag for example), inherited values, and so on? A framework-independent approach would be nice, as I\'m working on a script that should work standalone, but that is not a requirement of course. Background: I\'m trying to tweak CKEditor\'s font selector plugin (source here) so that it always shows the font size of the current cursor position (as opposed to