MVC5、CKEditor 自定义文件管理器 API
我的界面运行良好,但是当我单击“图像”按钮选择要插入的图像时,用于文件选择的新窗口会显示在系统的主监视器上(运行 4 个监视器)。因此,如果我使用监视器 3 进行在线编辑,则必须转到主监视器来选择图像会让人分心。最好在我当前窗口的顶部打开新窗口。
我不知道如何解决这个问题。我无法轻松找到 CKEditor 配置设置,而且我不明白如何强制打开视图,或者不在特定位置打开。
这是我调用 CKEditor 的设置脚本:
@Section Scripts
<script src="~/scripts/ckeditor/ckeditor.js"></script>
<script>
CKEDITOR.replace('Model.UserPost.Body', {
filebrowserBrowseUrl: '/BlogsAndForums/UserPost/ImageDisplay?AnchorPostID=' + @Model.AnchorPostID, //This line routes to the ImageDisplay method and view. Needs more configuration
toolbarGroups: [ // Define the toolbar groups as it is a more accessible solution.
{ "name": "basicstyles", "groups": ["basicstyles"] },
{ "name": "links", "groups": ["links"] },
{ "name": "paragraph", "groups": ["list", "blocks"] },
{ "name": "document", "groups": ["mode"] },
{ "name": "insert", "groups": ["insert"] },
{ "name": "styles", "groups": ["styles"] },
{ "name": "about", "groups": ["about"] }
],
removeButtons: 'Underline,Strike,Subscript,Superscript,Anchor,Styles,Specialchar' // Remove the redundant buttons from toolbar groups defined above.
});
</script>
@Scripts.Render("~/bundles/jqueryval")
End Section
ImageDisplay 方法(见 filebrowserBrowseUrl: 规范)(1) 显示可供选择的图像列表。(2) 单击图像后,它 (3) 关闭并返回 CKEditor。(4) 图像的 URL 已填充,之后一切正常。
我遇到的唯一问题是 ImageDisplay 视图出现在我的显示器上的位置。