如何从标题设置为它的iframe prevent CKEditor的? [英] How to prevent CKEditor from setting the title to its iframe?

查看:249
本文介绍了如何从标题设置为它的iframe prevent CKEditor的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的是CKEditor的,也是jQuery用户界面的工具提示插件。什么情况是,CKEditor的设置title属性的iframe元素和jQuery的工具提示插件其转换成一个提示,然后,当你用鼠标在编辑器中的任何部分(你必须做的每一次你编辑文本时)悬停,工具提示总是显示,称富文本编辑器,elementId。

I use the CKEditor and also the jQuery UI's tooltips plugin. What happens is that CKEditor sets the title attribute to its iframe element and the jQuery tooltips plugin converts that into a tooltip and then, whenever you hover with the mouse over any part of the Editor (which you have to do every time you edit text), the tooltip always shows, saying "Rich text editor, elementId".

即使我设置了提示插件的选择为*:不(IFRAME),它仍然没有它。我发现,到目前为止,让它不设置if​​rame的工具提示的唯一方法是排除选择格,但后来我也失去了工具提示编辑的粗体/斜体等选项。

Even if I set the tooltip plugin's selector to "*:not(iframe)", it still does it. The only way I've found so far to get it to not set the tooltip for the iframe is to exclude "div" from the selector, but then I also lose the tooltips for the bold/italic etc options of the Editor.

和我找不到CKEditor的的JavaScript,设置iframe的标题code的一部分,所以我可以将其删除。我发现的一个部分是语言文件,在那里我可以取代富文本编辑器用一个空字符串内的实际标题字符串,但它仍然将iframe的标题为{elementId}。

And I cannot find the part of the code in CKEditor's Javascript that sets the iframe title, so I could remove it. The one part that I have found is the actual title string inside the language files where I can replace "Rich text editor" with an empty string, but it still sets the iframe's title to ", {elementId}".

任何帮助AP preciated,我很想让这两个插件。

Any help appreciated, I would love to keep both plugins.

推荐答案

碰到了相同的问题,开发一个自定义的CMS另一开发商谁是不太可能很快需要屏幕阅读器随时随地。

Bumped into the exact same problem, developing a custom CMS for another developer who isn't likely to need a screen reader anytime soon.

mihaisimi 了解您的指针。带着几分挖掘到CKEditor的实例属性的,我结束了写下面的JS位去掉富文本编辑器,element_id从内容区域标题。

Thanks mihaisimi for your pointer. With a bit of digging into CKEditor instance properties, I ended up writing the JS bit below to remove the "Rich text editor, element_id" title from the content area.

CKEDITOR.on("instanceReady", function(e) {
 var $frame = $(e.editor.container.$).find(".cke_wysiwyg_div");
 if($frame) $frame.attr("title", "");
});

所以基本上只要CKEditor的负荷,我包裹的CKEditor的容器中,jQuery对象,我期待已久的实际内容 DIV .find()并与 .attr删除其标题()

请注意,这个解决方案需要jQuery的。我在格模式使用CKEditor的版本4.1.1。任何人都在'iframe中模式采用了类似的版本可能会不断变化的 .find(cke_wysiwyg_div)闪避 .find(。cke_wysiwyg_frame )

Please note this solution requires jQuery. I'm using CKEditor version 4.1.1 in 'div mode'. Anyone using a similar version in 'iframe mode' would probably get away with changing .find(".cke_wysiwyg_div") to .find(".cke_wysiwyg_frame").

您可以code的位追加到的CKEditor / config.js文件,例如。它不是pretty,但它的作品。

You could append the bit of code to the ckeditor/config.js file, for example. Its not pretty, but it works.

希望我的解决方案可以帮助任何人碰到这个问题。

Hope my solution helps anyone bumping into this problem.

这篇关于如何从标题设置为它的iframe prevent CKEditor的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆