/* automatically generated by JSCoverage - do not edit */
try {
  if (typeof top === 'object' && top !== null && typeof top.opener === 'object' && top.opener !== null) {
    // this is a browser window that was opened from another window

    if (! top.opener._$jscoverage) {
      top.opener._$jscoverage = {};
    }
  }
}
catch (e) {}

try {
  if (typeof top === 'object' && top !== null) {
    // this is a browser window

    try {
      if (typeof top.opener === 'object' && top.opener !== null && top.opener._$jscoverage) {
        top._$jscoverage = top.opener._$jscoverage;
      }
    }
    catch (e) {}

    if (! top._$jscoverage) {
      top._$jscoverage = {};
    }
  }
}
catch (e) {}

try {
  if (typeof top === 'object' && top !== null && top._$jscoverage) {
    _$jscoverage = top._$jscoverage;
  }
}
catch (e) {}
if (typeof _$jscoverage !== 'object') {
  _$jscoverage = {};
}
if (! _$jscoverage['ui/colorbutton.js']) {
  _$jscoverage['ui/colorbutton.js'] = [];
  _$jscoverage['ui/colorbutton.js'][6] = 0;
  _$jscoverage['ui/colorbutton.js'][7] = 0;
  _$jscoverage['ui/colorbutton.js'][13] = 0;
  _$jscoverage['ui/colorbutton.js'][14] = 0;
  _$jscoverage['ui/colorbutton.js'][16] = 0;
  _$jscoverage['ui/colorbutton.js'][18] = 0;
  _$jscoverage['ui/colorbutton.js'][19] = 0;
  _$jscoverage['ui/colorbutton.js'][24] = 0;
  _$jscoverage['ui/colorbutton.js'][27] = 0;
  _$jscoverage['ui/colorbutton.js'][32] = 0;
  _$jscoverage['ui/colorbutton.js'][36] = 0;
  _$jscoverage['ui/colorbutton.js'][37] = 0;
  _$jscoverage['ui/colorbutton.js'][40] = 0;
  _$jscoverage['ui/colorbutton.js'][43] = 0;
  _$jscoverage['ui/colorbutton.js'][44] = 0;
  _$jscoverage['ui/colorbutton.js'][47] = 0;
  _$jscoverage['ui/colorbutton.js'][48] = 0;
  _$jscoverage['ui/colorbutton.js'][49] = 0;
  _$jscoverage['ui/colorbutton.js'][53] = 0;
  _$jscoverage['ui/colorbutton.js'][54] = 0;
  _$jscoverage['ui/colorbutton.js'][58] = 0;
}
_$jscoverage['ui/colorbutton.js'].source = ["<span class=\"c\">///import core</span>","<span class=\"c\">///import uicore</span>","<span class=\"c\">///import ui/colorpicker.js</span>","<span class=\"c\">///import ui/popup.js</span>","<span class=\"c\">///import ui/splitbutton.js</span>","<span class=\"k\">(</span><span class=\"k\">function</span> <span class=\"k\">()</span><span class=\"k\">{</span>","    <span class=\"k\">var</span> utils <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>utils<span class=\"k\">,</span>","        uiUtils <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>ui<span class=\"k\">.</span>uiUtils<span class=\"k\">,</span>","        ColorPicker <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>ui<span class=\"k\">.</span>ColorPicker<span class=\"k\">,</span>","        Popup <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>ui<span class=\"k\">.</span>Popup<span class=\"k\">,</span>","        SplitButton <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>ui<span class=\"k\">.</span>SplitButton<span class=\"k\">,</span>","        ColorButton <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>ui<span class=\"k\">.</span>ColorButton <span class=\"k\">=</span> <span class=\"k\">function</span> <span class=\"k\">(</span>options<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>initOptions<span class=\"k\">(</span>options<span class=\"k\">);</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>initColorButton<span class=\"k\">();</span>","        <span class=\"k\">}</span><span class=\"k\">;</span>","    ColorButton<span class=\"k\">.</span>prototype <span class=\"k\">=</span> <span class=\"k\">{</span>","        initColorButton<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">()</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> me <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">;</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>popup <span class=\"k\">=</span> <span class=\"k\">new</span> Popup<span class=\"k\">(</span><span class=\"k\">{</span>","                content<span class=\"k\">:</span> <span class=\"k\">new</span> ColorPicker<span class=\"k\">(</span><span class=\"k\">{</span>","                    noColorText<span class=\"k\">:</span> me<span class=\"k\">.</span>editor<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"clearColor\"</span><span class=\"k\">),</span>","                    editor<span class=\"k\">:</span>me<span class=\"k\">.</span>editor<span class=\"k\">,</span>","                    onpickcolor<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>t<span class=\"k\">,</span> color<span class=\"k\">)</span><span class=\"k\">{</span>","                        me<span class=\"k\">.</span>_onPickColor<span class=\"k\">(</span>color<span class=\"k\">);</span>","                    <span class=\"k\">}</span><span class=\"k\">,</span>","                    onpicknocolor<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>t<span class=\"k\">,</span> color<span class=\"k\">)</span><span class=\"k\">{</span>","                        me<span class=\"k\">.</span>_onPickNoColor<span class=\"k\">(</span>color<span class=\"k\">);</span>","                    <span class=\"k\">}</span>","                <span class=\"k\">}</span><span class=\"k\">),</span>","                editor<span class=\"k\">:</span>me<span class=\"k\">.</span>editor","            <span class=\"k\">}</span><span class=\"k\">);</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>initSplitButton<span class=\"k\">();</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        _SplitButton_postRender<span class=\"k\">:</span> SplitButton<span class=\"k\">.</span>prototype<span class=\"k\">.</span>postRender<span class=\"k\">,</span>","        postRender<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">()</span><span class=\"k\">{</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>_SplitButton_postRender<span class=\"k\">();</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>getDom<span class=\"k\">(</span><span class=\"s\">'button_body'</span><span class=\"k\">).</span>appendChild<span class=\"k\">(</span>","                uiUtils<span class=\"k\">.</span>createElementByHtml<span class=\"k\">(</span><span class=\"s\">'&lt;div id=\"'</span> <span class=\"k\">+</span> <span class=\"k\">this</span><span class=\"k\">.</span>id <span class=\"k\">+</span> <span class=\"s\">'_colorlump\" class=\"edui-colorlump\"&gt;&lt;/div&gt;'</span><span class=\"k\">)</span>","            <span class=\"k\">);</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>getDom<span class=\"k\">().</span>className <span class=\"k\">+=</span> <span class=\"s\">' edui-colorbutton'</span><span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        setColor<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>color<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>getDom<span class=\"k\">(</span><span class=\"s\">'colorlump'</span><span class=\"k\">).</span>style<span class=\"k\">.</span>backgroundColor <span class=\"k\">=</span> color<span class=\"k\">;</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>color <span class=\"k\">=</span> color<span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        _onPickColor<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>color<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'pickcolor'</span><span class=\"k\">,</span> color<span class=\"k\">)</span> <span class=\"k\">!==</span> <span class=\"k\">false</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                <span class=\"k\">this</span><span class=\"k\">.</span>setColor<span class=\"k\">(</span>color<span class=\"k\">);</span>","                <span class=\"k\">this</span><span class=\"k\">.</span>popup<span class=\"k\">.</span>hide<span class=\"k\">();</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        _onPickNoColor<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>color<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'picknocolor'</span><span class=\"k\">)</span> <span class=\"k\">!==</span> <span class=\"k\">false</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                <span class=\"k\">this</span><span class=\"k\">.</span>popup<span class=\"k\">.</span>hide<span class=\"k\">();</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span>","    <span class=\"k\">}</span><span class=\"k\">;</span>","    utils<span class=\"k\">.</span>inherits<span class=\"k\">(</span>ColorButton<span class=\"k\">,</span> SplitButton<span class=\"k\">);</span>","","<span class=\"k\">}</span><span class=\"k\">)();</span>"];
_$jscoverage['ui/colorbutton.js'][6]++;
(function () {
  _$jscoverage['ui/colorbutton.js'][7]++;
  var utils = baidu.editor.utils, uiUtils = baidu.editor.ui.uiUtils, ColorPicker = baidu.editor.ui.ColorPicker, Popup = baidu.editor.ui.Popup, SplitButton = baidu.editor.ui.SplitButton, ColorButton = (baidu.editor.ui.ColorButton = (function (options) {
  _$jscoverage['ui/colorbutton.js'][13]++;
  this.initOptions(options);
  _$jscoverage['ui/colorbutton.js'][14]++;
  this.initColorButton();
}));
  _$jscoverage['ui/colorbutton.js'][16]++;
  ColorButton.prototype = {initColorButton: (function () {
  _$jscoverage['ui/colorbutton.js'][18]++;
  var me = this;
  _$jscoverage['ui/colorbutton.js'][19]++;
  this.popup = new Popup({content: new ColorPicker({noColorText: me.editor.getLang("clearColor"), editor: me.editor, onpickcolor: (function (t, color) {
  _$jscoverage['ui/colorbutton.js'][24]++;
  me._onPickColor(color);
}), onpicknocolor: (function (t, color) {
  _$jscoverage['ui/colorbutton.js'][27]++;
  me._onPickNoColor(color);
})}), editor: me.editor});
  _$jscoverage['ui/colorbutton.js'][32]++;
  this.initSplitButton();
}), _SplitButton_postRender: SplitButton.prototype.postRender, postRender: (function () {
  _$jscoverage['ui/colorbutton.js'][36]++;
  this._SplitButton_postRender();
  _$jscoverage['ui/colorbutton.js'][37]++;
  this.getDom("button_body").appendChild(uiUtils.createElementByHtml(("<div id=\"" + this.id + "_colorlump\" class=\"edui-colorlump\"></div>")));
  _$jscoverage['ui/colorbutton.js'][40]++;
  this.getDom().className += " edui-colorbutton";
}), setColor: (function (color) {
  _$jscoverage['ui/colorbutton.js'][43]++;
  this.getDom("colorlump").style.backgroundColor = color;
  _$jscoverage['ui/colorbutton.js'][44]++;
  this.color = color;
}), _onPickColor: (function (color) {
  _$jscoverage['ui/colorbutton.js'][47]++;
  if ((this.fireEvent("pickcolor", color) !== false)) {
    _$jscoverage['ui/colorbutton.js'][48]++;
    this.setColor(color);
    _$jscoverage['ui/colorbutton.js'][49]++;
    this.popup.hide();
  }
}), _onPickNoColor: (function (color) {
  _$jscoverage['ui/colorbutton.js'][53]++;
  if ((this.fireEvent("picknocolor") !== false)) {
    _$jscoverage['ui/colorbutton.js'][54]++;
    this.popup.hide();
  }
})};
  _$jscoverage['ui/colorbutton.js'][58]++;
  utils.inherits(ColorButton, SplitButton);
})();
