首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MVC中的CKEditor和Roxy-fileman

MVC中的CKEditor和Roxy-fileman
EN

Stack Overflow用户
提问于 2014-08-03 22:50:39
回答 1查看 4.4K关注 0票数 4

我希望这里的人有关于CKeditor和Roxy-fileman的经验。我在我的项目中安装了CKeditor,为了能够上传文件,我尝试添加Roxy-fileman。

根据http://www.roxyfileman.com/demo,我所需要做的就是添加以下代码:

代码语言:javascript
复制
<script src="ckeditor/ckeditor.js"></script>
<textarea id="editor1" name="editor1" rows="10" cols="80"></textarea>
<script>
var roxyFileman = '/fileman/index.html?integration=ckeditor';
$(function(){
  CKEDITOR.replace( 'editor1',{filebrowserBrowseUrl:roxyFileman, 
                               filebrowserImageBrowseUrl:roxyFileman+'&type=image',
                               removeDialogTabs: 'link:upload;image:upload'});
});
</script>

但是所有这些都是在我的页面上添加一个“新的”ckEditor。例如,当我单击要更改的元素时,我想用它来替换显示的旧元素。我知道这不太可能,但也许有人能给我指明正确的方向。谢谢!

EN

回答 1

Stack Overflow用户

发布于 2014-09-05 21:10:39

将以下代码放入您的config.js文件(位于“ckeditor”文件夹中):

代码语言:javascript
复制
var roxyFileman = '/fileman/index.html?integration=ckeditor';
config.filebrowserBrowseUrl = roxyFileman;
config.filebrowserImageBrowseUrl = roxyFileman + '&type=image';
config.removeDialogTabs = 'link:upload;image:upload';

您的文件将如下所示:

代码语言:javascript
复制
/**
 * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.html or http://ckeditor.com/license
 */

CKEDITOR.editorConfig = function (config) {
    var roxyFileman = '/fileman/index.html?integration=ckeditor';
    config.filebrowserBrowseUrl = roxyFileman;
    config.filebrowserImageBrowseUrl = roxyFileman + '&type=image';
    config.removeDialogTabs = 'link:upload;image:upload';
};
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25105855

复制
相关文章

相似问题

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