指定为CKEditor的自定义配置文件 [英] Specifying a custom configuration file for CKEditor

查看:295
本文介绍了指定为CKEditor的自定义配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想加的CKEditor到我目前正在开发一个页面,但我有得到它拿起我的自定义配置文件的问题?我使用的CKEditor在Visual Studio.NET 2008年。我需要自定义显示的工具栏,作为基本太最小的,全会给按钮的压倒性量给用户。

我声明在aspx页面编辑如下:

 <脚本类型=文/ JavaScript的>
    CKEDITOR.replace(的document.getElementById(&下;%= txtTourItinerary.ClientID%gt;中),
        {customConfig:myconfig.js'}
    );
< / SCRIPT>

在myconfig.js文件本身就是在CKEditor的根目录下(如config.js所在)。

不过,desipite渲染CKEditor的本身,它似乎完全无视我的自定义配置文件。我想知道如果任何人有什么建议?

谢谢!

在自定义配置文件的内容如下:

  CKEDITOR.editorConfig =功能(配置)
{
    //定义更改此默认配置。例如:
    config.language ='恩';
    config.defaultLanguage ='恩';
    config.uiColor ='#000000';
};CKEDITOR.config.toolbar_Full = ['保存',' - ','preVIEW',' - '打印'],
    [撤消,重做],[剪切,复制,粘贴,PasteFromWord','全选'],
    ['查找','替换'],
    '/',
    ['粗体'​​,'斜体','Unnderline','击',' - ','下标','上标']];


解决方案

想我会张贴了一份解决方案。在路径:

  CKEDITOR.replace(的document.getElementById(<%= txtTourItinerary.ClientID%GT;),
  {customConfig:myconfig.js'}

是从网站的根目录,而不是相对于从CKEditor的目录。​​

所以我的声明应该是如下:

 <脚本类型=文/ JavaScript的>
    CKEDITOR.replace(的document.getElementById(&下;%= txtTourItinerary.ClientID%gt;中),
        {customConfig:/ckeditor/myconfig.js'}
    );
< / SCRIPT>

在一个类似的船作为CKEditor的其他文件我希望有可能帮助别人是在地面上薄一点。

I am trying to add the CKEditor to a page I am currently developing but am having problems getting it to pick up my custom configuration file? I am using CKEditor in Visual Studio.NET 2008. I need to customize the toolbars that are displayed, as Basic is too minimal and Full would give an overwhelming amount of buttons to the user.

I am declaring the editor in the aspx page as follows:

<script type="text/javascript">
    CKEDITOR.replace(document.getElementById("<%= txtTourItinerary.ClientID %>"),
        { customConfig: 'myconfig.js' }
    );
</script>

the myconfig.js file itself is in the root of the ckeditor directory (where config.js resides).

However, desipite rendering the CKEditor itself, it seems to be completely ignoring my custom config file. I was wondering if anyone had any suggestions?

Thanks!

The contents of the custom config file are as follows:

CKEDITOR.editorConfig = function( config )
{
    // Define changes to default configuration here. For example:
    config.language = 'en';
    config.defaultLanguage = 'en';
    config.uiColor = '#000000';
};

CKEDITOR.config.toolbar_Full = [['Save', '-', 'Preview', '-' 'Print'],
    ['Undo', 'Redo'], ['Cut', 'Copy', 'Paste', 'PasteFromWord', 'SelectAll'], 
    ['Find', 'Replace'],
    '/',
    ['Bold', 'Italic', 'Unnderline', 'Strike', '-', 'Subscript', 'Superscript']];

解决方案

Thought I'd post up a solution. The path in the:

CKEDITOR.replace(document.getElementById("<%= txtTourItinerary.ClientID %>"),        
  { customConfig: 'myconfig.js' }

is from the root of the website, not relative to the directory from CKEditor.

So my declaration should have been as follows

<script type="text/javascript">
    CKEDITOR.replace(document.getElementById("<%= txtTourItinerary.ClientID %>"),
        { customConfig: '/ckeditor/myconfig.js' }
    );
</script>

Hopefully I might have helped someone else in a similar boat as documentation on CKEditor is a little thin on the ground.

这篇关于指定为CKEditor的自定义配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆