如何在ckeditor中添加自定义config.js.

时间:2015-07-28 06:18:18

标签: javascript jquery grails ckeditor

我无法在grails中向ckeditor添加自定义配置文件 这是我的代码:

function applyEditor() {
    try {

        CKEDITOR.replace('editor1', {
            customConfig : '../ckeditor/custom_config.js',

            toolbarGroups : [ {"name" : "basicstyles",
                "groups" : [ "basicstyles", "cleanup" ]
            }, {
                "name" : "links",
                "groups" : [ "links" ]
            }, {
                "name" : "insert",
                "groups" : [ "insert" ]
            }, {
                "name" : "paragraph",
                "groups" : [ "list", "blocks", "align" ]
            },
            {
                "name" : "styles"
            },
            {
                "name" : 'colors'
            }, {
                "name" : 'editing',
                "groups" : [ 'find', 'selection', 'spellchecker' ]
            }, ],
            removeButtons : 'Image,Flash,Iframe'
        });
    } catch (e) {
        // TODO: handle exception
    }
}

Custom_config.js位于 /target/work/plugins/ckeditor-4.4.1.0/web-app/js/ckeditor/custom_config.js

请帮帮我。 提前完成。

1 个答案:

答案 0 :(得分:3)

您正在以正确的方式使用。再次检查您的代码。一定有其他一些问题。 将自定义配置添加到您的ckeditor:

CKEDITOR.config.customConfig = '/your/path/ckeditor_config.js';

您可以参考此处了解详情:LINK

相关问题