当前位置: 代码迷 >> Java Web开发 >> 调用多个KindEditor插件编辑器的有关问题
  详细解决方案

调用多个KindEditor插件编辑器的有关问题

热度:3408   发布时间:2016-04-10 22:35:12.0
调用多个KindEditor插件编辑器的问题
<script>
var editor1,editor2,editor3,editor4,editor5;
 KindEditor.ready(function(K) {
    var editor1 = K.create('textarea[name="project.content"]', {
        cssPath : '../kindeditor/plugins/code/prettify.css',
        uploadJson : '../kindeditor/jsp/upload_json.jsp',
        fileManagerJson : '../kindeditor/jsp/file_manager_json.jsp',
        allowFileManager : true,
        afterCreate : function() {
            var self = this;
            K.ctrl(document, 13, function() {
                self.sync();
                document.forms['example'].submit();
            });
            K.ctrl(self.edit.doc, 13, function() {
                self.sync();
                document.forms['example'].submit();
            });
        }
    });
    prettyPrint();
}); 

 KindEditor.ready(function(K) {
    var editor2 = K.create('textarea[name="project.conOne"]', {
        cssPath : '../kindeditor/plugins/code/prettify.css',
        uploadJson : '../kindeditor/jsp/upload_json.jsp',
        fileManagerJson : '../kindeditor/jsp/file_manager_json.jsp',
        allowFileManager : true,
        afterCreate : function() {
            var self = this;
            K.ctrl(document, 13, function() {
                self.sync();
                document.forms['example'].submit();
            });
            K.ctrl(self.edit.doc, 13, function() {
                self.sync();
                document.forms['example'].submit();
            });
        }
    });
    prettyPrint();
}); 

KindEditor.ready(function(K) {
     editor3 = K.create('textarea[name="project.conTwo"]', {
        cssPath : '../kindeditor/plugins/code/prettify.css',
        uploadJson : '../kindeditor/jsp/upload_json.jsp',
        fileManagerJson : '../kindeditor/jsp/file_manager_json.jsp',
        allowFileManager : true,
        afterCreate : function() {
            var self = this;
            K.ctrl(document, 13, function() {
                self.sync();
                document.forms['example'].submit();
            });
            K.ctrl(self.edit.doc, 13, function() {
                self.sync();
                document.forms['example'].submit();
            });
        }
    });
    prettyPrint();
});

KindEditor.ready(function(K) {
     editor4 = K.create('textarea[name="project.conThree"]', {
        cssPath : '../kindeditor/plugins/code/prettify.css',
        uploadJson : '../kindeditor/jsp/upload_json.jsp',