将自定义按钮添加到WMD编辑器
-
12-10-2019 - |
题
解决方案
是的你可以。
1)您需要扩展图像“ wmd-buttons.jpg”
编辑图像并添加一个按钮以进行扩展功能。 2)为按钮添加脚本与事件绑定(例如插入一些文本)
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)现在定义插入功能并放置插入代码。
不隶属于 StackOverflow