-1

我徘徊在如何添加更改 popline 项目颜色的可能性。

https://github.com/kenshin54/popline

我需要编写像这样的插件之一https://github.com/kenshin54/popline/tree/master/scripts/plugins

但我失败了

4

1 回答 1

0

我想到了:

;(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);
于 2013-09-20T16:40:53.277 回答