在popline项目上更改颜色选项

时间:2013-09-20 15:28:46

标签: jquery jquery-plugins open-source

我喜欢如何添加改变popline项目颜色的可能性。

https://github.com/kenshin54/popline

我需要像其中一个https://github.com/kenshin54/popline/tree/master/scripts/plugins

一样编写插件

但我失败了

1 个答案:

答案 0 :(得分: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);