ckeditor

Using CKEditor inside blade template [Laravel 3.x]

蓝咒 提交于 2019-12-04 05:36:40
问题 I'd like to use this bundle: laravel-ckeditor but I have troubles in nesting it in my view (all previous installation steps I've done successfully). How can i connect Form::text() with this bundle? When I add <?php $ckeditor = new CKEditor(); $config = array(); $config['toolbar'] = array( array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ), array( 'Image', 'Link', 'Unlink', 'Anchor' ) ); $events['instanceReady'] = 'function (ev) { alert("Loaded: " + ev.editor.name); }'; $ckeditor-

CKEditor Inline selection wrapping

你。 提交于 2019-12-04 05:35:33
问题 I'm looking for a way to add a inline span element with attributes to a selection. The hard part of this is getting it working with selections that pass over multiple block level elements. I was looking in the sourcecode of the StyleCombobox and found this line. var style = styles[ value ], elementPath = editor.elementPath(); editor[ style.checkActive( elementPath ) ? 'removeStyle' : 'applyStyle' ]( style ); This way it already works on multiple block level elements. The only thing is that i

Ckeditor gem issue with production mode

白昼怎懂夜的黑 提交于 2019-12-04 04:40:47
I'm using the CKEditor gem . My config for application.js and routes.rb are like the followings: # application.js //= require ckeditor/init # routes.rb mount Ckeditor::Engine => '/ckeditor' The gem works fine in development mode, but when moving to the production mode, I got the error 404 when browsers request the js and css files in ckeditor folder: GET http://mydomain/assets/ckeditor/config.js?t=D2LI 404 (Not Found) GET http://mydomain/assets/ckeditor/skins/moono/editor.css?t=D2LI 404 (Not Found) GET http://mydomain/assets/ckeditor/lang/vi.js?t=D2LI 404 (Not Found) GET http://mydomain/assets

How to force CKEditor to preserve <br> tags

柔情痞子 提交于 2019-12-04 03:50:09
问题 I am using the latest version of CKEditor (4.7 to date) with the standard package, and I want to be able to force it to preserve line break elements ( <br> ). I have attempted to use the following config, without success: CKEDITOR.replace('ck', { allowedContent: true, enterMode: CKEDITOR.ENTER_BR }); As you can see in this jsfiddle, when you open Source mode, <br> tags have been replaced with a   . How do you achieve that? 回答1: A workaround (or at least partial workaround) was given on this

Integrating CKeditor to my symfony2 project

淺唱寂寞╮ 提交于 2019-12-04 03:06:28
I was trying to integrate ckeditor to my symfony2 project so that some of the textarea will have the ckeditor html editor. I brought the ckeditor on my required textarea by calling the class="ckeditor" in my form. The issue that I am facing now is that when I use the ckeditor the submit button of my form will not work instead I will have to use the built in "Save" option of the ckeditor toolbar for submitting the form. When I remove the ckeditor from the textareas and use normal textarea the submit button seems to work. I do not want to use the "Save" button on the ckeditor toolbar to submit

Enable CKEditor4 inline on span and other inline tags

怎甘沉沦 提交于 2019-12-04 02:43:06
I'd like to know if it's possible and how to enable the CKEditor4 inline/contenteditable editing feature on <span> and other inline elements. This is something which I cannot find in the official docs. With this markup: <span id="editable" contenteditable="true"></span> And either the standard configuration (AutoInline enabled) or this configuration: <script> CKEDITOR.disableAutoInline = true; CKEDITOR.inline('editable'); // ID of the element to edit </script> An error is reported: The specified element mode is not supported on element: "span". The same error is reported for <a> tags. Hack way

How can I highlight elements that match a regex in CKeditor?

好久不见. 提交于 2019-12-04 02:23:43
I want to be able to highlight (i.e. wrap in a span with a color, or some other way) all text that matches a regex in CKEditor. I'd probably add a button to do this, and a button to remove highlighting. My specific use case is to highlight all mustache variables in my HTML templates (make it really easy to see where there are mustache variables). I've implemented a version where I replace a regex matching mustaches with a span and then the capture group. This appears to break on some templates when I test. To remove the highlighting, I use editor.removeStyle, which doesn't seem to work in all

How to prevent CKEditor from stripping < and > (greater-than/less-than)

我的未来我决定 提交于 2019-12-04 01:26:48
问题 Every time I enter < or > in a CKEditor window, save, and then come back to it, CKEditor replaces them with whatever was typed within the brackets and the accompanying end tag. For example: if I type <configuration details> , CKEditor will assume it is an HTML tag and put <configuration details></configuration details> in the html source, thus stripping it out altogether from the text. Argh! Any ideas? 回答1: Yeah, this is a real pain. The only workaround I've found so far is to use CKEDITOR

JavaScript convert mouse position to selection range

旧街凉风 提交于 2019-12-04 00:20:59
I would like to be able to convert the current mouse position to a range, in CKEditor in particular. The CKEditor provides an API for setting the cursor according to a range: var ranges = new CKEDITOR.dom.range( editor.document ); editor.getSelection().selectRanges( [ ranges ] ); Since CKEditor provides this API, the problem may be simplified by removing this requirement and just find a way to produce the range from the mouse coordinates over a div containing various HTML elements. However, this is not the same as converting a mouse coordinate into the cursor position in a textarea since

HTML WYSIWYG edtor: why is the editable content moved in an iFrame

人走茶凉 提交于 2019-12-04 00:12:56
问题 Why is the editable html moved into an iFrame? I analysed different editors (TinyMce, CKEditor, etc) and all move the editable content into a separate iFrame which they lay over the original text. What is the technical reason for this. I experimented with the contenteditable="true" , which is the base of all this editors too, and didn't find a reason yet to do this. 回答1: I'm CKEditor core developer. Not for a long time - just for last half of the year, but I've learnt a lot about why we use