ckeditor

CKEditor: set cursor/caret positon

好久不见. 提交于 2019-12-02 02:26:13
问题 How can I position the caret in CKEditor3.x? I have 2 positions and I want use insertHTML() on both positions. Pseudo-code: editor.setCaret(20); // function does not exists editor.insertHtml('::'); editor.setCaret(40); // function does not exists editor.insertHtml('::'); I have tried (to set caret to position: 20): var ranges = []; var range = new CKEDITOR.dom.range( this.document ); range.startOffset = 20; range.endOffset = 20; ranges.push( range ); editor.getSelection().selectRanges( ranges

CKEditor “overflow: scroll” on parent causes toolbar to freeze at initial position

眉间皱痕 提交于 2019-12-02 02:15:29
When you add a CKEditor to a div inside a div with: "overflow: scroll" the toolbar won't move when scrolling the parent div... <div id="wrapper" style="overflow: scroll;"> <div contenteditable="true">This is the ckedito</div> </div> An example can be found here: ​ http://jsfiddle.net/W8Dt4/ Does anyone know a workaround around this problem? I think the desired behaviour would be: Keep the toolbar at the top of the editor div when there's enough room. Move the toolbar to the bottom of the editor div when there's not enough room on top and there is enough room on the bottom. Using version 4.4.3,

CKEditor禁用浏览服务器的功能

a 夏天 提交于 2019-12-02 02:03:54
在CKeditor的config.js文件中,添加以下内容,重启服务器,图片、flash、video中的浏览服务器按钮就会消失掉 /*按下“ 浏览服务器”按钮时应启动的外部文件管理器的位置。如果已配置,则“ 浏览服务器”按钮将出现在“ 链接”,“ 图像 ”和“ Flash”对话框窗口中。*/ config.filebrowserBrowseUrl = '';// (empty string = disabled); /*在Flash对话框窗口中按“ 浏览服务器”按钮时应启动的外部文件浏览器的位置。 查看资料 如果未设置,则CKEditor将使用filebrowserBrowseUrl。*/ config.filebrowserFlashBrowseUrl = ''; /*当 在“ 图像”对话框窗口中单击“ 浏览服务器”按钮时应启动的外部文件管理器的位置。 查看资料 如果未设置,则CKEditor将使用filebrowserBrowseUrl。*/ config.filebrowserImageBrowseUrl = ''; /*当在“ 图像”对话框窗口 的“ 链接”选项卡中按下“ 浏览服务器”按钮时应启动的外部文件管理器的位置。 查看资料 如果未设置,则CKEditor将使用filebrowserBrowseUrl。*/ config

CKEditor 4 combinate css

社会主义新天地 提交于 2019-12-02 01:42:18
I use CSS on my website to style the items. In my (own developed) CMS I use CKEditor as WYSIWYG-editor. I would like the editor to have the same style as the content on my webpage. The CSS of my page looks like this: .content { ... } .content ul, .content ol { ... } .content p { ... } But the stylesheet of CKEditor (contents.css) looks like this: body { ... } ol,ul,dl { ... } h1,h2,h3,h4,h5,h6 { ... } Is there a way to make this in to one stylesheet, or to edit CKEditor, so a div.content is added? I found the answer, change config.js to: CKEDITOR.editorConfig = function( config ) { config

ckeditor on focus not working

老子叫甜甜 提交于 2019-12-02 01:27:10
Just trying to do a simple on focus command with ckeditor and jquery. var foo = // what can i do here to signal ckeditor? $(foo).focus(function(){ $(".class1").hide(); $(".class2").show(); }); Maybe this is really simple and I'm just overlooking it but any advice or links are greatly appreciated. Have tried: CKEditor on focus remove default value How to listen to basic events in CKEditor? http://docs.ckeditor.com/#!/api/CKEDITOR.focusManager-method-constructor http://www.mytechlogy.com/professionals/questions/forum-details/158/how-to-make-focus-in-ckeditor-using-js/?ref=related_posts#

How to indent the first line of a paragraph in CKEditor

痞子三分冷 提交于 2019-12-02 01:26:19
I'm using CKEditor and I want to indent just the first line of the paragraph. What I've done before is click "Source" and edit the <p> style to include text-indent:12.7mm; , but when I click "Source" again to go back to the normal editor, my changes are gone and I have no idea why. My preference would be to create a custom toolbar button, but I'm not sure how to do so or where to edit so that clicking a custom button would edit the <p> with the style attribute I want it to have. Depending on which version of CKE you use, your changes most likely disappear because ether the style attribute or

Is CKEditor 4 really ready for HTML5

橙三吉。 提交于 2019-12-02 00:57:22
问题 I try new CKEditor 4 because code correction in version 3.6 can't accept HTML 5 valid code like this: <a href="#"><p>something</p></a> But new CKEditor version still repair this code, so where is problem? Is necessary to set HTML 5 as default in config? 回答1: Nope. CKEditor parsers are using static DTD. HTML5 cannot be described with static DTD so at the moment CKEditor cannot support this kind of markup. See the ticket to know more. 回答2: For future people coming to this with the same issue, I

CKEditor variable is available in console, but not from a Chrome userscript?

吃可爱长大的小学妹 提交于 2019-12-02 00:44:43
I'm writing a Chrome userscript to locally auto-save content in a CKEditor . I'm using this CKEditor auto-save plugin as inspiration. I have written a function that fires every half second (via an interval) to register the CKEditor event handler: var intervalId = window.setInterval(function() { if (CKEDITOR) { window.clearInterval(intervalId); CKEDITOR.plugins.add("user-script-auto-save", { init : function(editor) { editor.on('key', startTimer); } }); } }, 500); However, it never properly completes, and complains that "CKEDITOR is undefined" on the if (CKEDITOR) statement. Meanwhile, if I drop

Using ckeditor in jsf page

两盒软妹~` 提交于 2019-12-02 00:30:28
How do I use a custom CKEditor in a jsf page ? I'm having lots of trouble trying to implement it. What I did: I made a custom CKEditor with the ckEditor builder Downloaded and placed it in my webcontent folder. test.xhtml page: <script src="/ckeditor/ckeditor.js"></script> <form> <textarea name="editor1" id="editor1" rows="10" cols="80"/> <script> CKEDITOR.replace( 'editor1'); </script> </form> Not working, just had a standard textarea. So I changed the src to: <script src="ckeditor/ckeditor.js"></script> It's was working but it wasn't my custom CKEditor build it was the vanilla one. So I used

Programmatically set the position of CKEditor's dialogs

谁说我不能喝 提交于 2019-12-01 21:17:07
I'm trying to find a way to programmatically set the position of a CKEditor dialog whenever a new one is opened up. The actual setting of the position part seems easy, but what I can't seem to figure out is how to trap the event of a new CKEditor dialog being created and shown. I'm assuming it will be something along the lines of... CKEDITOR.on('dialogCreated', function(e) { ... } ); But can't seem to actually find it in the documentation. After spending several hours today, I was able to figure this out by complete luck. Dialog definitions can be manipulated at load time. Within your config