首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CKEditor配置不会将文本更改为从右到左。

CKEditor配置不会将文本更改为从右到左。
EN

Stack Overflow用户
提问于 2013-12-24 12:50:21
回答 1查看 2.9K关注 0票数 2

我编辑了config.js

代码语言:javascript
复制
CKEDITOR.editorConfig = function( config )
{
    // Define changes to default configuration here. For example:
    config.language = 'ar';
    config.contentsLangDirection = 'rtl';
    contentsLanguage:'ar';
    config.dialog_buttonsOrder = 'rtl';
};

但在我的Question2Answer平台上,我仍然可以让编辑器从左到右。我该怎么做才能让我的编辑从右到左?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-24 14:12:29

遵循HTML和脚本为我工作,而不是使用全局配置文件的应用程序,我使用内联配置如下-

代码语言:javascript
复制
<textarea id="editor" name="editor1">&lt;p&gt;Initial value.&lt;/p&gt;</textarea>

脚本

代码语言:javascript
复制
<script type="text/javascript">
        CKEDITOR.on('dialogDefinition', function (ev) {
            // Take the dialog name and its definition from the event data.
            var dialogName = ev.data.name;
            var dialogDefinition = ev.data.definition;
            // Check if the definition is from the dialog we're
            // interested in (the 'image' dialog).
            if (dialogName == 'image') {
                // Get a reference to the 'Image Info' tab.
                var infoTab = dialogDefinition.getContents('info');
                // Remove unnecessary widgets/elements from the 'Image Info' tab.
                infoTab.remove('browse');
                infoTab.remove('txtHSpace');
                infoTab.remove('txtVSpace');
                infoTab.remove('txtBorder');
                infoTab.remove('txtAlt');
                infoTab.remove('txtWidth');
                infoTab.remove('txtHeight');
                infoTab.remove('htmlPreview');
                infoTab.remove('cmbAlign');
                infoTab.remove('ratioLock');
            }
        });

CKEDITOR.config.contentsLangDirection = 'rtl';

代码语言:javascript
复制
        CKEDITOR.replace('editor');
    </script>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20761284

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档