gpt4 book ai didi

salesforce - 如何将 Salesforce 富文本编辑器转换为 "full mode"编辑器?

转载 作者:行者123 更新时间:2023-12-03 16:45:32 25 4
gpt4 key购买 nike

随着最近 12 年 Spring 的到来,转换富编辑器的旧“黑客”将不再起作用。如何在 spring 12 之后保留完整的 CKEditor 功能?

最佳答案

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

    $(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
});
});
});

结果:

enter image description here

关于salesforce - 如何将 Salesforce 富文本编辑器转换为 "full mode"编辑器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9228900/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com