ckeditor

access javascript ckeditor object within an iframe

最后都变了- 提交于 2020-01-17 02:20:13
问题 Lets say I have a page with an iframe and within the iframe I have a ckeditor instance that I want to destroy from the containing page. I would usually try something like this: var iframe_document = document.getElementById("iframe_id").contentWindow.document; for(var i in iframe_document.CKEDITOR.instances) iframe_document.CKEDITOR.instances[i].destroy(); However it appears that the ckeditor instance can not be accessed this way. Is it possible to destroy the instance from outside the

Jquery events on CKeditor

穿精又带淫゛_ 提交于 2020-01-16 18:15:14
问题 Hello in a form with a textarea with id "ckeditor_input" $("#ckeditor_input").ckeditor(); $("#ckeditor_input").html(); // can get the value ("#ckeditor_input").click/blur/keydown/keypressed( function(){ alert("OK"); } ); //doesn't work! the problem is ckeditor! If I don't start an instance of ckeditor on the textarea all events work fine! What is the right way to get events on a ckeditor instance? Thank you 回答1: CKEditor uses an iframe... very annoying for jQuery events. You could try: $($('

How to assign a css class or id to smileys?

邮差的信 提交于 2020-01-16 18:00:33
问题 I'm setting up CKEditor in Drupal 7 and what I need is assign an additional CSS class (or ID, no matter) to smileys to style them differently from other images. What is the best way to do it? Thanks in advance. 回答1: /* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.dialog.add("smiley", function (f) { for (var e = f.config, a = f.lang.smiley, h = e.smiley_images, g = e.smiley_columns || 8, k,

CKEditor: Keep source indentation

依然范特西╮ 提交于 2020-01-16 13:21:26
问题 I'm using following config for CKEditor: var wysiwyg = ck.replace(el[0], { allowedContent: true, protectedSource: [/\r|\n/g] }); I'm loading HTML source into CKEditor as: <div style='font-weight: bold;'> <div> <div> test </div> </div> </div> On wysiwyg.getData() I receive: <div style="font-weight: bold;"> <div> <div>test</div> </div> </div> How can I force CKEditor to keep my indentation as per source? I tried to use different regex inside protectedSource to protect everything between HTML >.

CKEditor gem delete cached files

孤街浪徒 提交于 2020-01-16 04:56:08
问题 I am using the ckeditor gem for quite a while now and I just noticed that if I change my config.js it doesn't actually change anything in the browser. I made a lot of changes in there and it worked fine until now. All of the sudden if I change anything it uses the old files that must be cached somewhere. I tried deleting precompiled assets and re-precompile them, deleting cache on the browser... Is this a gem problem or am I just missing something? My config.js: CKEDITOR.editorConfig =

CKEditor , how to disable HTML indented format

帅比萌擦擦* 提交于 2020-01-15 11:58:11
问题 I'd like to ask if there is a way to disable indented format of HTML source code in CKEditor. I don't want the HTML to be formatted because I want to store it in a database and there is no need for extra characters (line breaks and spaces). I just want the raw html without spaces and lines. for example the HTML output in CKEditor is <p> test 1</p> <p> test 2</p> <p> test 3</p> but what I need is <p>test 1</p><p>test 2</p><p>test 3</p> 回答1: This doc at the CKEditor howto shows how you can

CKEditor , how to disable HTML indented format

孤人 提交于 2020-01-15 11:58:07
问题 I'd like to ask if there is a way to disable indented format of HTML source code in CKEditor. I don't want the HTML to be formatted because I want to store it in a database and there is no need for extra characters (line breaks and spaces). I just want the raw html without spaces and lines. for example the HTML output in CKEditor is <p> test 1</p> <p> test 2</p> <p> test 3</p> but what I need is <p>test 1</p><p>test 2</p><p>test 3</p> 回答1: This doc at the CKEditor howto shows how you can

How to display the placeholder attribute in HTML5 textarea when CKEditor is activated?

≯℡__Kan透↙ 提交于 2020-01-14 14:48:09
问题 I have a textarea in a HTML5 website with a proper placeholder="Sample text" attribute. It is displaying nicely until I add RichText support through CKEditor. The CKEditor GUI is recreating the textarea and is not displaying the placeholder text inside. Is there a way to display placeholders in CKEditor or switch some configuration options? 回答1: You can use the new version of configHelper plugin: http://alfonsoml.blogspot.com.es/2012/04/placeholder-text-in-ckeditor.html it will use

CKEditor - Add Context Menu Item to Images

坚强是说给别人听的谎言 提交于 2020-01-14 13:39:12
问题 I want to add a context menu item for selected image elements only. The context menu item is currently working but it shows up on every element instead of only image elements. Here is my code so far: CKEDITOR.on('instanceReady', function(ev) { editor.addCommand('editImgCmd', { exec : function( editor ) { alert('editImgCmd'); } }); var editImgCmd = { label : editor.lang.image.menu, command : 'editImgCmd', group : 'image' }; editor.contextMenu.addListener(function(element, selection ) { return

PrimeFaces Extensions CKEditor: cannot access custom config

允我心安 提交于 2020-01-14 05:15:06
问题 I need my pe:ckEditor to load custom config, but I have been unsuccessful in this matter for some time, I will welcome any suggestions how to make it work. (I need it do work because I have this problem: PrimeFaces Extensions CKEditor: when saving content, foreign characters get "twisted", which might be solved by this https://ckeditor.com/old/forums/CKEditor-3.x/utf-8-ckeditor or something like this https://ckeditor.com/old/forums/Support/Change-charset-UTF-8) The custom config file is in