如何在KindEditor添加一行,然后在那行上添加按钮。注意:必须和快捷按钮放一起。

解决方案 »

  1.   

    官方的API好简单的
    没介绍怎么在现有功能按钮的基础上在添加按钮。
      

  2.   

    把你的查找的关键词 改为  添加插件
    http://www.kindsoft.net/docs/plugin.html(个人推荐)
    http://down.chinaz.com/try/201106/711_1.htm(如果你想改官方js)
      

  3.   

    <!doctype html>
    <html>
            <head>
                    <meta charset="utf-8" />
                    <title>Hello</title>
                    <link rel="stylesheet" href="themes/default/default.css" />
                    <script charset="utf-8" src="kindeditor.js"></script>
                    <script charset="utf-8" src="lang/zh_CN.js"></script>
                    <script>
                     KindEditor.plugin('hello', function(K) {
            var editor = this, name = 'hello';
            // 点击图标时执行
            editor.clickToolbar(name, function() {
                    editor.insertHtml('你好');
            });
    });
                            KindEditor.lang({
                                    hello : '你好'
                            });
                            KindEditor.ready(function(K) {
                                    K.create('textarea[name="content"]', {
                                            items : ['hello', 'source']
                                    });
                            });
                    </script>
                    <style>
                            .ke-icon-hello {
                                    background-image: url("icon.png");
            width: 16px;
            height: 16px;
                            }
                    </style>
            </head>
            <body>
                    <textarea id="editor_ideditor_id" name="content" style="width:700px;height:300px;"></textarea>
            </body>
    </html>
      

  4.   

    注意langType,themeType属性
    我在原来的themes下建立my/my.css
    看过源码:
    _loadStyle(options.themesPath + 'default/default.css');
    _loadStyle(options.themesPath + themeType + '/' + themeType + '.css');
    所以
            var editor;
            KindEditor.ready(function(K) {
                    editor = K.create('#editor_id', {
                            themeType : 'my'
                    });
            });
    就能使用,我在lang/*.js直接改文字