有没有人知道如何用Episerver Commerce SP2上的默认编辑器替换TinyMCE?
答案 0 :(得分:0)
使用以下控件:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditorControl.ascx.cs" Inherits="TinyMCEEditor.EditorControl" %>
tinyMCE.init({ // 常规选项 模式:“textareas”, 主题:“先进”, 插件:“分页,样式,图层,表,保存,advhr,advimage,advlink,情感,iespell,inlinepopups,insertdatetime,预览,媒体,searchreplace,打印,contextmenu,粘贴,方向性,全屏,不可编辑,visualchars,nonbreaking,xhtmlxtras ,模板,单词计数,advlist” file_browser_callback:“filebrowser”, setup:function(ed){ ed.onKeyPress.add( function(ed,evt){ } ); }, //主题选项 theme_advanced_buttons1:“粗体,斜体,下划线,|,charmap,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect”, theme_advanced_buttons2:“剪切,复制,粘贴,|,搜索,替换,|,bullist,numlist,|,outdent,indent,blockquote,|,撤消,重做,|,链接,取消链接,锚点,清理,代码,|,预览” theme_advanced_buttons3:“tablecontrols”, theme_advanced_buttons4:“”, theme_advanced_toolbar_location:“top”, theme_advanced_toolbar_align:“left”, theme_advanced_statusbar_location:“bottom”, theme_advanced_resizing:true, //示例内容CSS(应该是您的站点CSS) content_css:“css / content.css”, //删除链接/图像/媒体/模板对话框的列表 template_external_list_url:“lists / template_list.js”, external_link_list_url:“lists / link_list.js”, external_image_list_url:“lists / image_list.js”, media_external_list_url:“lists / media_list.js”, //样式格式 style_formats:[ {title:'粗体文字',内联:'b'}, {title:'Red text',inline:'span',styles:{color:'#ff0000'}}, {title:'Red header',block:'h1',styles:{color:'#ff0000'}}, {title:'示例1',内联:'span',类:'example1'}, {title:'示例2',内联:'span',类:'example2'}, {title:'表格样式'}, {title:'表格行1',选择器:'tr',类:'tablerow1'} ] //替换模板插件的值 template_replace_values:{ 用户名:“Some User”, staffid:“991234” } });
function filebrowser(field_name,url,type,win){
fileBrowserURL = "../FileManager/Default.aspx?sessionid=<%= Session.SessionID.ToString() %>";
tinyMCE.activeEditor.windowManager.open({
title: "Ajax File Manager",
url: fileBrowserURL,
width: 950,
height: 650,
inline: 0,
maximizable: 1,
close_previous: 0
}, {
window: win,
input: field_name,
sessionid: '<%= Session.SessionID.ToString() %>'
}
);
}
</script>
<script type="text/javascript" language="javascript">
$(".ajax__htmleditor_editor_toptoolbar").each(function (index) {
$(this).html($(this).html() + "<img onclick=showImgManager('" + index + "') src='../FileManager/icons/img-add-32.png' class='ajax__htmleditor_toolbar_button' /><img onclick=showFileManager('" + index + "') src='../FileManager/icons/Files-add-32.png' class='ajax__htmleditor_toolbar_button' /><div style='display:none;float:left;width:100%;padding-top:5px;' id='divImgManager" + index + "'></div>");
});
function openFileManager(index) {
window.open("../FileManager/Default.aspx?sessionid=<%= Session.SessionID %>&input=" + index, "myWindow", "status = 1, height = 650, width = 950, resizable = 0")
}
</script>
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 40%"
runat="server"></textarea>