您的位置:首页 > 其它

如何保持用户使用CKeditor时的设置选项(获取+恢复)

2014-12-23 14:14 288 查看
1. 对于B Bold, I: Italic, U: Underline, 可以通过使用editor.getCommand(command).state来获取是否设置 (CKEDITOR.TRISTATE_ON, CKEDITOR.TRISTATE_OFF),

    然后通过editor.execCommand(command)来恢复用户设置的选项;

2. 对于Styles, Font Name, Font Size drop-down list里的选择,暂时还没有找到获取的方法。

               editor.getStylesSet(function(stylesDefinitions) {

                    for (var i = 0, count = stylesDefinitions.length; i < count; i++) {

                        var styleDefinition = stylesDefinitions[i];

                        $wnd.alert(styleDefinition.name);

                    }

                });

上面的这段代码,只能获取styles的配置信息,不能获取用户的选择。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐