How to configure the CKEditor under XPages?

萝らか妹 提交于 2019-12-23 05:29:05

问题


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.

My Current Solution

    <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>

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

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


回答1:


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

[Edit by Dennis K.]

Solution

<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

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


来源:https://stackoverflow.com/questions/23083997/how-to-configure-the-ckeditor-under-xpages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!