ckeditor

Enable CKEditor toolbar button only with valid text selection?

你说的曾经没有我的故事 提交于 2020-01-11 10:31:29
问题 I'm working on a CKEditor plugin for annotating text and adding margin comments, but I'd like some of my custom toolbar buttons to be enabled only when the user has already selected a range of text. Whenever the user is typing, or the cursor is at a single-point (instead of a range), the buttons (and their associated commands) should be disabled. I'm a pretty experienced plugin author, and I've spent a fair amount of time hunting through the core API docs, but I haven't found anything yet

ckeditor dialog positioning

陌路散爱 提交于 2020-01-11 08:13:07
问题 Dialog windows for CKEditor by default appear in the middle of the page but if the page is an iframe with a big height the dialogs appear way down the page. Is it possible to configure CKEditor to position the dialogs in a different quadrant of the page? For example top middle? 回答1: Yes, the link MDaubs gives will guide you to do what you want. I've had to do this in the past and the following snippet will demonstrate a solution for your problem: CKEDITOR.on('dialogDefinition', function(e) {

CKEditor Carrierwave Cloudinary

流过昼夜 提交于 2020-01-11 03:24:17
问题 I'm trying to get CKEditor to work with Carrierwave and Cloudinary. So far, non-CKEditor enabled views with a regular file upload field are working perfectly with Carrierwave & Cloudinary. However, when I try to upload a file in CKEditor and "Send it to the Server" I'm getting a NoMethodError - undefined method 'each' for "image/jpeg":String: Prior to removing the local storage config from the CKEditor classes it was working, but saving the file locally. Here is my current CKEditor uploader:

CKEditor Carrierwave Cloudinary

你说的曾经没有我的故事 提交于 2020-01-11 03:24:06
问题 I'm trying to get CKEditor to work with Carrierwave and Cloudinary. So far, non-CKEditor enabled views with a regular file upload field are working perfectly with Carrierwave & Cloudinary. However, when I try to upload a file in CKEditor and "Send it to the Server" I'm getting a NoMethodError - undefined method 'each' for "image/jpeg":String: Prior to removing the local storage config from the CKEditor classes it was working, but saving the file locally. Here is my current CKEditor uploader:

Drupal7所见即所得模块CKEditor

北城余情 提交于 2020-01-11 01:44:55
初学Drupal(7.26),刚好遇到一个需要用到CKEditor模块的项目,于是就摸索着把它给装上了。 图片上传出问题 回到Drupal7的管理页面后刚好发现了对于CKEditor的“状态报告”(错误报告): You are using a feature that requires $cookie_domain to be set, but it is not set in your settings.php (CKFinder is enabled in the Advanced profile) 需要修改修改 sites\default\settings.php文件: $cookie_domain = 'localhost';//去掉注释,填写正确的路径 这样就没有错误,图片也可以正常上传了。但还是有警告:You are using an unlicensed version of the CKEditor module for Drupal. Visit http://cksource.com/ckeditor-for-drupal to purchase a licensed version that also includes a license for a full-featured file browser, CKFinder, and a dedicated

ckeditor content into textarea on change event - multiple ckeditors on form

三世轮回 提交于 2020-01-10 10:49:14
问题 With a lot of help I finally got the CKEditor to update the associated text area. See the post here. However, I am stumped of how to get the CKEditor to update each associated text area when there is more than 1 CKEditor on the form. Here is the jquery that I currently have. It only updates the last CKEditor associated text area on the form: for (var i in CKEDITOR.instances) { CKEDITOR.instances[i].on('change', function() { CKEDITOR.instances[i].updateElement() }); //update the relative

Force CKEditor to add a class to p-tags

天涯浪子 提交于 2020-01-09 11:33:55
问题 I must configure CKEditor to add a class-attribute to every p-tag in the content. You can do something similar with config.format_p but it will only apply the class-attribute to text that is marked as "normal" wich is not default. Anyone? Edit: I'm using the current version 3.6.2. Here are the relevant parts of my config: CKEDITOR.editorConfig = function( config ) { config.removeFormatTags = 'b,div,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var,form,input

Force CKEditor to add a class to p-tags

折月煮酒 提交于 2020-01-09 11:33:51
问题 I must configure CKEditor to add a class-attribute to every p-tag in the content. You can do something similar with config.format_p but it will only apply the class-attribute to text that is marked as "normal" wich is not default. Anyone? Edit: I'm using the current version 3.6.2. Here are the relevant parts of my config: CKEDITOR.editorConfig = function( config ) { config.removeFormatTags = 'b,div,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var,form,input

Force CKEditor to add a class to p-tags

不问归期 提交于 2020-01-09 11:33:11
问题 I must configure CKEditor to add a class-attribute to every p-tag in the content. You can do something similar with config.format_p but it will only apply the class-attribute to text that is marked as "normal" wich is not default. Anyone? Edit: I'm using the current version 3.6.2. Here are the relevant parts of my config: CKEDITOR.editorConfig = function( config ) { config.removeFormatTags = 'b,div,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var,form,input

how can I set writer rules for all elements in ckeditor

a 夏天 提交于 2020-01-07 08:47:13
问题 how could I set this global for all elements: CKEDITOR.on('instanceReady', function(ev){ var el = [ "p", "div", "table", "tbody", "tr", "td", "h1", "h2", "h3", "h4", "h5", "h6", "ul", "center" ]; el.forEach(function(v) { ev.editor.dataProcessor.writer.setRules(v, { indent: false, breakBeforeOpen: true, breakAfterOpen: false, breakBeforeClose: false, breakAfterClose: false } ); }); }); it is boring to make this as array of elements? does anybody know how to fix this? 回答1: There's no API which