ckeditor

CKEditor instance in a jQuery dialog

二次信任 提交于 2019-11-30 14:14:00
I am using jQuery to open a dialog window with a textarea transformed into an instance of CKEditor. I'm using the jQuery adapter provided by the CKEditor team but when the dialog window opens up I cannot interact with the editor (it's created but "null" is written in the content space and I can't click on anything or modify the content). This bug report seems to say that by using a patch provided the issue is fixed but it doesn't seem to be working for me... Here's my code (maybe I did something wrong programmatically): HTML: <div id="ad_div" title="Analyse documentaire"> <textarea id="ad

How to add class or attribute automatically to img tags in CKEditor?

丶灬走出姿态 提交于 2019-11-30 14:03:42
I'm using CKEditor version 3.6 I want to automatically add class="newsleft" to any image tag added through the WYSIWYG. I've seen a few posts that mention dataProcessor but have no idea which file this should be added or how to do it. Can someone tell me where I would place the following code? editor.dataProcessor.htmlFilter.addRules( { elements: { img: function( element ) { if ( !element.attributes.alt ) element.attributes.alt = 'An image'; } } } ); Basically put it in instanceReady listener and it will be fine (3.x and 4.x) ( fiddle ): CKEDITOR.replace( 'editor', { plugins: 'wysiwygarea

Preserving SCRIPT tags (and more) in CKEditor

馋奶兔 提交于 2019-11-30 12:56:09
Is it possible to create a block of code within the CKEditor that will not be touched by the editor itself, and will be maintained in its intended-state until explicitly changed by the user? I've been attempting to input javascript variables (bound in script tags) and a flash movie following, but CKEditor continues to rewrite my pasted code/markup, and in doing so breaking my code. I'm working with the following setup: <script type="text/javascript"> var editor = CKEDITOR.replace("content", { height : "500px", width : "680px", resize_maxWidth : "680px", resize_minWidth : "680px", toolbar : [ [

How to configure CKEditor in Rails 3.1 (gem + Asset Pipeline)

限于喜欢 提交于 2019-11-30 12:45:50
I've successfully configured the ckeditor gem from https://github.com/galetahub/ckeditor on my Rails 3.1 app. My problem now is that I can't figure out how to configure the CKEditor. The files that are used according to the Readme simply don't exists in a Rails 3.1 application with the asset pipeline enabled. The answer was easy once i've figured out the thrown error message. /app/assets/javascript/ckeditor CKEDITOR.editorConfig = function( config ) { config.toolbar_MyToolbar = [ { name: 'document', items : [ 'NewPage','Preview' ] }, { name: 'clipboard', items : [ 'Cut','Copy','Paste',

How to set up CKEditor for multiple instances with different heights?

半世苍凉 提交于 2019-11-30 12:18:26
I'd like to have multiple instances of CKEditor based on the same config settings, but with different heights. I tried setting up config with the default height, setting up the 1st instance, then overriding the height & setting up the 2nd instance: var config = { ..... height:'400' }; $('#editor1').ckeditor(config); config.height = '100'; $('#editor2').ckeditor(config); ...but I get two CKEditor instances that both have 100px height. I also tried this: CKEDITOR.replace('editor2',{ height: '100' }); .. I got error messages that the instance already existed. I searched around a bit & found

Compare TinyMCE and CKeditor for a Wiki

旧巷老猫 提交于 2019-11-30 10:54:57
For a custom wiki django-wakawaka , i want to be able to add a WYSIWYG support. TinyMCE is obviously the most popular plugin, used even by Wordpress. But CK-editor seems more feature full. Those who have used either of these or both, which is better and why. Are there some better packages, that I am missing? Is there something that I am missing when I conclude CKeditor is better, by going through them (because it is not as widely used). I want to use it with django and jquery, with multiple instances of WYSIWYG widget per page. Does one offer advantage over the other. I spent some time

using CKEditor with jQuery validation plugin not working

♀尐吖头ヾ 提交于 2019-11-30 10:31:47
I'm using CKeditor and the jQuery validation plugin from basistance. My textarea (with the CKEditor on it) is being validated by jQuery, but that only works after the second click on my submit button. In short: the first time I submit the form when data is entered in the CKEditor, it says "field is empty". The second time it says it's ok and the form is being submitted. I read a solution for this: "you could work around this problem by calling CKEDITOR.editor::updateElement right before every validation routine." I cannot find how to implement it though: $(document).ready(function(){ CKEDITOR

Save data to PHP / Mysql with inline edit in CKEditor

≯℡__Kan透↙ 提交于 2019-11-30 10:10:17
I want to use "inline edit" of the new CKEditor 4 ( http://docs.ckeditor.com/#!/guide/dev_inline-section-2 ), but can not find any example of how to save the data with PHP / MySQL. Can you help me? You need some AJAX magic. Via JavaScript inside the page you get the edited HTML. Then you send it to the server where a PHP script gets it and can pass it onto MySQL. Here is a simple test case which will show you the ropes. Let's start with the editable HTML. <div id='textToBeSaved' contenteditable='true'> <p>Using the <strong>Terminal</strong> in OS X makes you all-powerful.</p> </div> We also

Autocomplete lists in CKEditor [closed]

只愿长相守 提交于 2019-11-30 09:48:13
I need to add a functionality to my CKEditor to give suggestions to user when he types '#' in document, the suggestions can change on the fly depending on some other fields on the page. please help In order to make a suggestion box, you will have to make your custom plugin to use context menu as suggestion box, please check out the link for the basic knowledge of making ckeditor plugin from here a link Add this to your config.js, where autocomplete is name of the plugin config.extraPlugins = 'autocomplete'; Then create a following directory structure/file in the ckeditor folder ckeditor-

Adding custom styles to CKEditor

…衆ロ難τιáo~ 提交于 2019-11-30 07:26:07
问题 I recently added CKEditor to my app and I would like to include my own CSS stylesheets within the editor so that I can select them within the editor. How do I accomplish this? My code so far looks like this: <script type="text/javascript"> CKEDITOR.replace( 'editor1',{ uiColor : '#9AB8F3', }); </script> 回答1: Please look at @metavida answer for a better answer than this <script type="text/javascript"> CKEDITOR.replace( 'editor1',{ uiColor : '#9AB8F3', stylesSet.add('default', [ { name: 'My