XPage下如何配置CKEditor? [英] How to configure the CKEditor under XPages?

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

问题描述

我的目标是向 CKEditor(版本 3.6.6.2)添加一些自定义样式.

My goal is to add some custom-styles to the CKEditor (Version 3.6.6.2).

我已经找到了解决方案,但它们会干扰内置的图片上传功能.

I already got a solution, but they interfere with the build-in image-upload functionality.

添加图像,然后将其存储在当前文档中的功能消失了.

The feature to add an image, which is then stored in the current document, is gone.

所以我担心它还有更多目前尚未发现的问题.

So i am afraid that there are more, currently undiscovered, problems with it.

我目前的解决方案

    <xp:inputRichText value="#{document1.Body}" id="html1" htmlFilter="identity" htmlFilterIn="identity" />
    <xp:scriptBlock id="scriptBlock1" type="text/javascript">
       <xp:this.value><![CDATA[
           var ckEditorClientId = "#{javascript: getClientId("html1")}";                        
           CKEDITOR.replace( ckEditorClientId,
               {stylesSet: [
                   { name : 'MyStyle', element : 'span', attributes : { 'class' : 'myStyle' } }
               ],
               toolbar : CKEDITOR.config.toolbar_Full                               
               }            
           );                   
       ]]></xp:this.value>
    </xp:scriptBlock>

我一整天都试图通过 dojoAttributes 和/或 config.js 来实现这一点 -对我来说没有任何效果,但那个.

I haved tried to achieve that via dojoAttributes and/or config.js all day long - nothing worked out for me, but that.

如果有人能告诉我在 XPage 下配置 CKEditor 的正确方法,我会很高兴.

I would be so happy, if anybody can tell me the right way to configure the CKEditor under XPages.

推荐答案

这仍然适用吗?intec.co.uk/xpages-8-5-2-rich-text-extending-the-ckeditor 可能不是,现在很多资源都在插件中

Is this still relevant? intec.co.uk/xpages-8-5-2-rich-text-extending-the-ckeditor It may not be, now a lot of the resources are in a plugin

[丹尼斯 K. 编辑]

解决方案

<xp:inputRichText value="#{document1.html}" id="html1" htmlFilter="identity" htmlFilterIn="identity">
    <xp:this.dojoAttributes>
        <xp:dojoAttribute name="extraPlugins" value="stylesheetparser"></xp:dojoAttribute>
        <xp:dojoAttribute name="toolbarType" value="Full"></xp:dojoAttribute>
        <xp:dojoAttribute name="contentsCss" value="CKStyles.css"></xp:dojoAttribute>
    </xp:this.dojoAttributes>
</xp:inputRichText>

CKStyles.css

CKStyles.css

//Example
span.myClass {
   color: #00A6C7;
   font-size: 1.8em;
   font-weight:normal;
}

这篇关于XPage下如何配置CKEditor?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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