【发布时间】:2013-09-20 15:28:45
【问题描述】:
我想知道如何在 popline 项目中添加更改颜色的可能性。
https://github.com/kenshin54/popline
我需要编写类似https://github.com/kenshin54/popline/tree/master/scripts/plugins 之一的插件
但我失败了
【问题讨论】:
标签: jquery jquery-plugins open-source
我想知道如何在 popline 项目中添加更改颜色的可能性。
https://github.com/kenshin54/popline
我需要编写类似https://github.com/kenshin54/popline/tree/master/scripts/plugins 之一的插件
但我失败了
【问题讨论】:
标签: jquery jquery-plugins open-source
我想通了:
;(function($) {
$.popline.addButton({
justify: {
iconClass: "icon-pencil red",
mode: "edit",
buttons: {
justifyLeft: {
iconClass: "icon-tint green",
action: function(event) {
document.execCommand('ForeColor', false, '#468858');
}
},
justifyCenter: {
iconClass: "icon-tint red",
action: function(event) {
document.execCommand('ForeColor', false, '#a74240');
}
},
justifyRight: {
iconClass: "icon-tint grey",
action: function(event) {
document.execCommand('ForeColor', false, '#8f8f8f');
}
},
indent: {
iconClass: "icon-tint orange",
action: function(event) {
document.execCommand('ForeColor', false, '#c99a4a');
}
},
outdent: {
iconClass: "icon-tint blue",
action: function(event) {
document.execCommand('ForeColor', false, '#2d6987');
}
}
}
}
});
})(jQuery);
【讨论】: