开发者

Adding custom buttons to WMD Editor

Is there a way to add custom buttons to the WMD Editor that extends the editor's functionality?

My ideas for various buttons I want to add are to:

Thanks

Turgs


Yes, you can.

1) you need extend the Images "wmd-buttons.jpg"

edit the image and add a button for extended functionality. 2) Add Script for the button to bind with an event(like inserting some text)

        var Insertbutton= document.createElement("li");
        Insertbutton.className = "wmd-button";
        Insertbutton.id = "wmd-insertsometext-button";
        Insertbutton.title = "Emphasis <em> Ctrl+v";
        Insertbutton.XShift = "-60px";
        Insertbutton.textOp = command.inserttext;
        setupButton(inserttextButton, true);
        buttonRow.appendChild(inserttextButton);

3) Now Define inserttext function and place your insertion code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜