本文介绍了如何将Salesforce RTF编辑器转换为“完整模式"?编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着这些天的春季'12的到来,转换丰富的编辑器的旧"hack"将不再起作用.在春季12之后如何做才能保留CKEditor的全部功能?

With the spring '12 coming over these days, the old "hack" to convert the rich editor will not work any more. What can be done to retain full CKEditor functionality after spring 12?

推荐答案

新的CKEditor是对象而不是基于URL的,因此需要一种新的方法.如果有人需要,以下脚本将用完整版本替换工厂编辑器布局,并允许使用其他格式选项(字体,颜色等).注意,我将高度设置为600px,根据您的需要进行调整.而且,和以前一样,这只能在您自己的VF页面中使用,不能更改工厂"页面布局的行为.

New CKEditor is object rather than URL based and a new approach is needed. In case anyone needs it, the following script will replace factory editor layout with a full version allowing additional formating options (fonts, colors, etc). Note, I set the height to 600px, adjust for your own needs. Also, as before, this can only work in your own VF pages, you cannot change the behavior of "factory" page layouts.

    $(document).ready(function(){

        CKEDITOR.on('instanceReady', function(e) {
            if (e.editor.config.magic) return;
            var target = e.editor.config.bodyId;
            var name = e.editor.name;
            e.editor.destroy();

            CKEDITOR.editorConfig = function( config ) { config.magic = true; }
            CKEDITOR.replace(name, {
                        height : 600, 
                        bodyId : target
            });
        });
    });

结果:

这篇关于如何将Salesforce RTF编辑器转换为“完整模式"?编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 19:50