ckeditor

Get computed font size for DOM element in JS

て烟熏妆下的殇ゞ 提交于 2019-11-26 15:19:59
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 only when within a span that has an explicit font-size set, which is the current behaviour). You could try

CKEditor unwanted   characters

为君一笑 提交于 2019-11-26 15:19:33
问题 How can I disable CKEditor to get me every time   , when i don't want them? I'm using CKEditor with jQuery adapter. I don't want to have any   tags. 回答1: After some research I might shed some light on this issue - unfortunately there is no out-of-the-box solution. In the CKEditor there are four ways a no-break space can occur (anybody know more?): Automatic filling of empty blocks. This can be disabled in the config: config.fillEmptyBlocks = false; Automatic insertion when pressing TAB-key.

How to configure ckeditor to not wrap content in <p> block?

北慕城南 提交于 2019-11-26 15:14:11
问题 I am using ckeditor on my website to make it easier for users to input HTML. However, the data I get back from ckeditor is wrapped in <p></p> blocks. (Which I don't want.) Is there some configuration setting that forces the editor to not wrap the text in anything? 回答1: Add the following to your config.js file for CKEditor: config.enterMode = CKEDITOR.ENTER_BR; Example: ... CKEDITOR.editorConfig = function (config) { config.enterMode = CKEDITOR.ENTER_BR; ... }; Details The configuration

Jquery validation not working with ckeditor

天大地大妈咪最大 提交于 2019-11-26 14:48:28
问题 I am using jQuery to validate forms.. but when I use CKeditor and try to validate it using jQuery, it's not working. Here is the snippet of HTML code <form class="form-horizontal" role="form" name="f3" id="f3" > <div class="col-xs-8"> <textarea class="ckeditor" name="cktext" id="cktext"></textarea> </div> <button type="submit" class="btn btn-default btn-success">Submit</button> </form> Here is the form validation code <script> $(document).ready(function(){ $("#f3").validate( { debug: false,

CKEDITOR - how to add permanent onclick event?

旧城冷巷雨未停 提交于 2019-11-26 14:10:00
问题 I am looking for a way to make the CKEDITOR wysiwyg content interactive. This means for example adding some onclick events to the specific elements. I can do something like this: CKEDITOR.instances['editor1'].document.getById('someid').setAttribute('onclick','alert("blabla")'); After processing this action it works nice. But consequently if I change the mode to source-mode and then return to wysiwyg-mode, the javascript won't run. The onclick action is still visible in the source-mode, but is

How to set cursor position to end of text in CKEditor?

我只是一个虾纸丫 提交于 2019-11-26 14:07:33
问题 Is there a way to set the cursor to be at the end of the contents of a CKEditor? This developer asked too, but received no answers: http://cksource.com/forums/viewtopic.php?f=11&t=19877&hilit=cursor+end I would like to set the focus at the end of the text inside a CKEditor. When I use: ckEditor.focus(); It takes me to the beginning of the text already inside the CKEditor. 回答1: Dan's answer got strange results for me, but minor change (in addition to typo fix) made it work: var range = me

Ckeditor update textarea

假如想象 提交于 2019-11-26 12:57:42
问题 I am trying to get the ckeditor working. Obviously it doesn\'t make use of the textarea so on submit the form doesn\'t submit the text in the editor. Beceause I make use of polymorphic associations etc. I can\'t make a onsubmit function to get the value of the textarea (when the form is submitted) . So I found this question: Using jQuery to grab the content from CKEditor's iframe with some very good answers. The answers posted there keep the textarea up to date. That is very nice and just

How to add a custom button to the toolbar that calls a JavaScript function?

一笑奈何 提交于 2019-11-26 11:46:30
问题 I\'d like to add a button to the toolbar that calls a JavaScript function like Tada() ? Any ideas on how to add this? 回答1: I am in the process of developing a number of custom Plugins for CKEditor and here's my survival pack of bookmarks: A StackOverflow post linking to and talking about a plugins tutorial that got me started (Tim Down already mentioned this) A number of ready-made plugins for FCK and CKEditor that may improve one's understanding of the system The Blog of AlfonsoML, one of

ckeditor 自定义上传图片,丢弃原来的上传 示例代码

穿精又带淫゛_ 提交于 2019-11-26 11:40:50
之前一直是Fckeditor 在线编辑器,最近发现对Chorme 支持不是很友好,所以决定采用最新版本ckeditor 4.01版本。 为了保持和之前上传风格,我决定对ckeditor 进行再次改造。 和网上任何一个上传都不一样。纯自己想出来的。送给需要的同学。 首先是调用方式: <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <script type="text/javascript"> window.onload = function () { CKEDITOR.replace( 'FContent'); // FContent:这个对应文本域 }; // 插入图片 并插入编辑器 function InsertHTML(s) { var editor = CKEDITOR.instances.FContent; // FContent:这个对应文本域 if (editor.mode == 'wysiwyg' ) { editor.insertHtml(s); } CKEDITOR.dialog.getCurrent().hide(); // 隐藏弹出层 } 注册JS: config.toolbarGroups = [ { name: 'clipboard', groups: [

How do I customize a ckeditor 4.2 builtin plugin like links?

冷暖自知 提交于 2019-11-26 11:19:38
问题 If I want to add a tab to the links plugin, what\'s the best practice approach? I don\'t want to alter the release code just override it with a version with my customizations. So it\'s easy to update with new releases. Does CKEDITOR 4.2 have a how-to for this? I\'m using the new inline style toolbars. If I get the source code can I rebuild the release version without the links plugin? and then do an external plugin using my customized version of the links plugin? 回答1: You got to observe