/* 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/tablepicker.js']) {
  _$jscoverage['ui/tablepicker.js'] = [];
  _$jscoverage['ui/tablepicker.js'][3] = 0;
  _$jscoverage['ui/tablepicker.js'][4] = 0;
  _$jscoverage['ui/tablepicker.js'][8] = 0;
  _$jscoverage['ui/tablepicker.js'][9] = 0;
  _$jscoverage['ui/tablepicker.js'][10] = 0;
  _$jscoverage['ui/tablepicker.js'][12] = 0;
  _$jscoverage['ui/tablepicker.js'][21] = 0;
  _$jscoverage['ui/tablepicker.js'][24] = 0;
  _$jscoverage['ui/tablepicker.js'][25] = 0;
  _$jscoverage['ui/tablepicker.js'][43] = 0;
  _$jscoverage['ui/tablepicker.js'][44] = 0;
  _$jscoverage['ui/tablepicker.js'][47] = 0;
  _$jscoverage['ui/tablepicker.js'][48] = 0;
  _$jscoverage['ui/tablepicker.js'][49] = 0;
  _$jscoverage['ui/tablepicker.js'][50] = 0;
  _$jscoverage['ui/tablepicker.js'][51] = 0;
  _$jscoverage['ui/tablepicker.js'][52] = 0;
  _$jscoverage['ui/tablepicker.js'][53] = 0;
  _$jscoverage['ui/tablepicker.js'][54] = 0;
  _$jscoverage['ui/tablepicker.js'][57] = 0;
  _$jscoverage['ui/tablepicker.js'][58] = 0;
  _$jscoverage['ui/tablepicker.js'][59] = 0;
  _$jscoverage['ui/tablepicker.js'][60] = 0;
  _$jscoverage['ui/tablepicker.js'][64] = 0;
  _$jscoverage['ui/tablepicker.js'][65] = 0;
  _$jscoverage['ui/tablepicker.js'][66] = 0;
  _$jscoverage['ui/tablepicker.js'][67] = 0;
  _$jscoverage['ui/tablepicker.js'][71] = 0;
  _$jscoverage['ui/tablepicker.js'][72] = 0;
  _$jscoverage['ui/tablepicker.js'][73] = 0;
  _$jscoverage['ui/tablepicker.js'][74] = 0;
  _$jscoverage['ui/tablepicker.js'][75] = 0;
  _$jscoverage['ui/tablepicker.js'][76] = 0;
  _$jscoverage['ui/tablepicker.js'][79] = 0;
  _$jscoverage['ui/tablepicker.js'][82] = 0;
}
_$jscoverage['ui/tablepicker.js'].source = ["<span class=\"c\">///import core</span>","<span class=\"c\">///import uicore</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>","        UIBase <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>ui<span class=\"k\">.</span>UIBase<span class=\"k\">;</span>","    ","    <span class=\"k\">var</span> TablePicker <span class=\"k\">=</span> baidu<span class=\"k\">.</span>editor<span class=\"k\">.</span>ui<span class=\"k\">.</span>TablePicker <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>initTablePicker<span class=\"k\">();</span>","    <span class=\"k\">}</span><span class=\"k\">;</span>","    TablePicker<span class=\"k\">.</span>prototype <span class=\"k\">=</span> <span class=\"k\">{</span>","        defaultNumRows<span class=\"k\">:</span> <span class=\"s\">10</span><span class=\"k\">,</span>","        defaultNumCols<span class=\"k\">:</span> <span class=\"s\">10</span><span class=\"k\">,</span>","        maxNumRows<span class=\"k\">:</span> <span class=\"s\">20</span><span class=\"k\">,</span>","        maxNumCols<span class=\"k\">:</span> <span class=\"s\">20</span><span class=\"k\">,</span>","        numRows<span class=\"k\">:</span> <span class=\"s\">10</span><span class=\"k\">,</span>","        numCols<span class=\"k\">:</span> <span class=\"s\">10</span><span class=\"k\">,</span>","        lengthOfCellSide<span class=\"k\">:</span> <span class=\"s\">22</span><span class=\"k\">,</span>","        initTablePicker<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>initUIBase<span class=\"k\">();</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        getHtmlTpl<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\">return</span> <span class=\"s\">'&lt;div id=\"##\" class=\"edui-tablepicker %%\"&gt;'</span> <span class=\"k\">+</span>","                 <span class=\"s\">'&lt;div class=\"edui-tablepicker-body\"&gt;'</span> <span class=\"k\">+</span>","                  <span class=\"s\">'&lt;div class=\"edui-infoarea\"&gt;'</span> <span class=\"k\">+</span>","                   <span class=\"s\">'&lt;span id=\"##_label\" class=\"edui-label\"&gt;&lt;/span&gt;'</span> <span class=\"k\">+</span>","                  <span class=\"s\">'&lt;/div&gt;'</span> <span class=\"k\">+</span>","                  <span class=\"s\">'&lt;div class=\"edui-pickarea\"'</span> <span class=\"k\">+</span>","                   <span class=\"s\">' onmousemove=\"$$._onMouseMove(event, this);\"'</span> <span class=\"k\">+</span>","                   <span class=\"s\">' onmouseover=\"$$._onMouseOver(event, this);\"'</span> <span class=\"k\">+</span>","                   <span class=\"s\">' onmouseout=\"$$._onMouseOut(event, this);\"'</span> <span class=\"k\">+</span>","                   <span class=\"s\">' onclick=\"$$._onClick(event, this);\"'</span> <span class=\"k\">+</span>","                  <span class=\"s\">'&gt;'</span> <span class=\"k\">+</span>","                    <span class=\"s\">'&lt;div id=\"##_overlay\" class=\"edui-overlay\"&gt;&lt;/div&gt;'</span> <span class=\"k\">+</span>","                  <span class=\"s\">'&lt;/div&gt;'</span> <span class=\"k\">+</span>","                 <span class=\"s\">'&lt;/div&gt;'</span> <span class=\"k\">+</span>","                <span class=\"s\">'&lt;/div&gt;'</span><span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        _UIBase_render<span class=\"k\">:</span> UIBase<span class=\"k\">.</span>prototype<span class=\"k\">.</span>render<span class=\"k\">,</span>","        render<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>holder<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>_UIBase_render<span class=\"k\">(</span>holder<span class=\"k\">);</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>getDom<span class=\"k\">(</span><span class=\"s\">'label'</span><span class=\"k\">).</span>innerHTML <span class=\"k\">=</span> <span class=\"s\">'0'</span><span class=\"k\">+</span><span class=\"k\">this</span><span class=\"k\">.</span>editor<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"t_row\"</span><span class=\"k\">)+</span><span class=\"s\">' x 0'</span><span class=\"k\">+</span><span class=\"k\">this</span><span class=\"k\">.</span>editor<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"t_col\"</span><span class=\"k\">);</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        _track<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>numCols<span class=\"k\">,</span> numRows<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> style <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>getDom<span class=\"k\">(</span><span class=\"s\">'overlay'</span><span class=\"k\">).</span>style<span class=\"k\">;</span>","            <span class=\"k\">var</span> sideLen <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>lengthOfCellSide<span class=\"k\">;</span>","            style<span class=\"k\">.</span>width <span class=\"k\">=</span> numCols <span class=\"k\">*</span> sideLen <span class=\"k\">+</span> <span class=\"s\">'px'</span><span class=\"k\">;</span>","            style<span class=\"k\">.</span>height <span class=\"k\">=</span> numRows <span class=\"k\">*</span> sideLen <span class=\"k\">+</span> <span class=\"s\">'px'</span><span class=\"k\">;</span>","            <span class=\"k\">var</span> label <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>getDom<span class=\"k\">(</span><span class=\"s\">'label'</span><span class=\"k\">);</span>","            label<span class=\"k\">.</span>innerHTML <span class=\"k\">=</span> numCols <span class=\"k\">+</span><span class=\"k\">this</span><span class=\"k\">.</span>editor<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"t_col\"</span><span class=\"k\">)+</span><span class=\"s\">' x '</span> <span class=\"k\">+</span> numRows <span class=\"k\">+</span> <span class=\"k\">this</span><span class=\"k\">.</span>editor<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"t_row\"</span><span class=\"k\">);</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>numCols <span class=\"k\">=</span> numCols<span class=\"k\">;</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>numRows <span class=\"k\">=</span> numRows<span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        _onMouseOver<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>evt<span class=\"k\">,</span> el<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> rel <span class=\"k\">=</span> evt<span class=\"k\">.</span>relatedTarget <span class=\"k\">||</span> evt<span class=\"k\">.</span>fromElement<span class=\"k\">;</span>","            <span class=\"k\">if</span> <span class=\"k\">(!</span>uiUtils<span class=\"k\">.</span>contains<span class=\"k\">(</span>el<span class=\"k\">,</span> rel<span class=\"k\">)</span> <span class=\"k\">&amp;&amp;</span> el <span class=\"k\">!==</span> rel<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\">'label'</span><span class=\"k\">).</span>innerHTML <span class=\"k\">=</span> <span class=\"s\">'0'</span><span class=\"k\">+</span><span class=\"k\">this</span><span class=\"k\">.</span>editor<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"t_col\"</span><span class=\"k\">)+</span><span class=\"s\">' x 0'</span><span class=\"k\">+</span><span class=\"k\">this</span><span class=\"k\">.</span>editor<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"t_row\"</span><span class=\"k\">);</span>","                <span class=\"k\">this</span><span class=\"k\">.</span>getDom<span class=\"k\">(</span><span class=\"s\">'overlay'</span><span class=\"k\">).</span>style<span class=\"k\">.</span>visibility <span class=\"k\">=</span> <span class=\"s\">''</span><span class=\"k\">;</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        _onMouseOut<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>evt<span class=\"k\">,</span> el<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> rel <span class=\"k\">=</span> evt<span class=\"k\">.</span>relatedTarget <span class=\"k\">||</span> evt<span class=\"k\">.</span>toElement<span class=\"k\">;</span>","            <span class=\"k\">if</span> <span class=\"k\">(!</span>uiUtils<span class=\"k\">.</span>contains<span class=\"k\">(</span>el<span class=\"k\">,</span> rel<span class=\"k\">)</span> <span class=\"k\">&amp;&amp;</span> el <span class=\"k\">!==</span> rel<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\">'label'</span><span class=\"k\">).</span>innerHTML <span class=\"k\">=</span> <span class=\"s\">'0'</span><span class=\"k\">+</span><span class=\"k\">this</span><span class=\"k\">.</span>editor<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"t_col\"</span><span class=\"k\">)+</span><span class=\"s\">' x 0'</span><span class=\"k\">+</span><span class=\"k\">this</span><span class=\"k\">.</span>editor<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"t_row\"</span><span class=\"k\">);</span>","                <span class=\"k\">this</span><span class=\"k\">.</span>getDom<span class=\"k\">(</span><span class=\"s\">'overlay'</span><span class=\"k\">).</span>style<span class=\"k\">.</span>visibility <span class=\"k\">=</span> <span class=\"s\">'hidden'</span><span class=\"k\">;</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        _onMouseMove<span class=\"k\">:</span> <span class=\"k\">function</span> <span class=\"k\">(</span>evt<span class=\"k\">,</span> el<span class=\"k\">)</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> style <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>getDom<span class=\"k\">(</span><span class=\"s\">'overlay'</span><span class=\"k\">).</span>style<span class=\"k\">;</span>","            <span class=\"k\">var</span> offset <span class=\"k\">=</span> uiUtils<span class=\"k\">.</span>getEventOffset<span class=\"k\">(</span>evt<span class=\"k\">);</span>","            <span class=\"k\">var</span> sideLen <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>lengthOfCellSide<span class=\"k\">;</span>","            <span class=\"k\">var</span> numCols <span class=\"k\">=</span> Math<span class=\"k\">.</span>ceil<span class=\"k\">(</span>offset<span class=\"k\">.</span>left <span class=\"k\">/</span> sideLen<span class=\"k\">);</span>","            <span class=\"k\">var</span> numRows <span class=\"k\">=</span> Math<span class=\"k\">.</span>ceil<span class=\"k\">(</span>offset<span class=\"k\">.</span>top <span class=\"k\">/</span> sideLen<span class=\"k\">);</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>_track<span class=\"k\">(</span>numCols<span class=\"k\">,</span> numRows<span class=\"k\">);</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        _onClick<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>fireEvent<span class=\"k\">(</span><span class=\"s\">'picktable'</span><span class=\"k\">,</span> <span class=\"k\">this</span><span class=\"k\">.</span>numCols<span class=\"k\">,</span> <span class=\"k\">this</span><span class=\"k\">.</span>numRows<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>TablePicker<span class=\"k\">,</span> UIBase<span class=\"k\">);</span>","<span class=\"k\">}</span><span class=\"k\">)();</span>"];
_$jscoverage['ui/tablepicker.js'][3]++;
(function () {
  _$jscoverage['ui/tablepicker.js'][4]++;
  var utils = baidu.editor.utils, uiUtils = baidu.editor.ui.uiUtils, UIBase = baidu.editor.ui.UIBase;
  _$jscoverage['ui/tablepicker.js'][8]++;
  var TablePicker = (baidu.editor.ui.TablePicker = (function (options) {
  _$jscoverage['ui/tablepicker.js'][9]++;
  this.initOptions(options);
  _$jscoverage['ui/tablepicker.js'][10]++;
  this.initTablePicker();
}));
  _$jscoverage['ui/tablepicker.js'][12]++;
  TablePicker.prototype = {defaultNumRows: 10, defaultNumCols: 10, maxNumRows: 20, maxNumCols: 20, numRows: 10, numCols: 10, lengthOfCellSide: 22, initTablePicker: (function () {
  _$jscoverage['ui/tablepicker.js'][21]++;
  this.initUIBase();
}), getHtmlTpl: (function () {
  _$jscoverage['ui/tablepicker.js'][24]++;
  var me = this;
  _$jscoverage['ui/tablepicker.js'][25]++;
  return "<div id=\"##\" class=\"edui-tablepicker %%\"><div class=\"edui-tablepicker-body\"><div class=\"edui-infoarea\"><span id=\"##_label\" class=\"edui-label\"></span></div><div class=\"edui-pickarea\" onmousemove=\"$$._onMouseMove(event, this);\" onmouseover=\"$$._onMouseOver(event, this);\" onmouseout=\"$$._onMouseOut(event, this);\" onclick=\"$$._onClick(event, this);\"><div id=\"##_overlay\" class=\"edui-overlay\"></div></div></div></div>";
}), _UIBase_render: UIBase.prototype.render, render: (function (holder) {
  _$jscoverage['ui/tablepicker.js'][43]++;
  this._UIBase_render(holder);
  _$jscoverage['ui/tablepicker.js'][44]++;
  this.getDom("label").innerHTML = ("0" + this.editor.getLang("t_row") + " x 0" + this.editor.getLang("t_col"));
}), _track: (function (numCols, numRows) {
  _$jscoverage['ui/tablepicker.js'][47]++;
  var style = this.getDom("overlay").style;
  _$jscoverage['ui/tablepicker.js'][48]++;
  var sideLen = this.lengthOfCellSide;
  _$jscoverage['ui/tablepicker.js'][49]++;
  style.width = ((numCols * sideLen) + "px");
  _$jscoverage['ui/tablepicker.js'][50]++;
  style.height = ((numRows * sideLen) + "px");
  _$jscoverage['ui/tablepicker.js'][51]++;
  var label = this.getDom("label");
  _$jscoverage['ui/tablepicker.js'][52]++;
  label.innerHTML = (numCols + this.editor.getLang("t_col") + " x " + numRows + this.editor.getLang("t_row"));
  _$jscoverage['ui/tablepicker.js'][53]++;
  this.numCols = numCols;
  _$jscoverage['ui/tablepicker.js'][54]++;
  this.numRows = numRows;
}), _onMouseOver: (function (evt, el) {
  _$jscoverage['ui/tablepicker.js'][57]++;
  var rel = (evt.relatedTarget || evt.fromElement);
  _$jscoverage['ui/tablepicker.js'][58]++;
  if (((! uiUtils.contains(el, rel)) && (el !== rel))) {
    _$jscoverage['ui/tablepicker.js'][59]++;
    this.getDom("label").innerHTML = ("0" + this.editor.getLang("t_col") + " x 0" + this.editor.getLang("t_row"));
    _$jscoverage['ui/tablepicker.js'][60]++;
    this.getDom("overlay").style.visibility = "";
  }
}), _onMouseOut: (function (evt, el) {
  _$jscoverage['ui/tablepicker.js'][64]++;
  var rel = (evt.relatedTarget || evt.toElement);
  _$jscoverage['ui/tablepicker.js'][65]++;
  if (((! uiUtils.contains(el, rel)) && (el !== rel))) {
    _$jscoverage['ui/tablepicker.js'][66]++;
    this.getDom("label").innerHTML = ("0" + this.editor.getLang("t_col") + " x 0" + this.editor.getLang("t_row"));
    _$jscoverage['ui/tablepicker.js'][67]++;
    this.getDom("overlay").style.visibility = "hidden";
  }
}), _onMouseMove: (function (evt, el) {
  _$jscoverage['ui/tablepicker.js'][71]++;
  var style = this.getDom("overlay").style;
  _$jscoverage['ui/tablepicker.js'][72]++;
  var offset = uiUtils.getEventOffset(evt);
  _$jscoverage['ui/tablepicker.js'][73]++;
  var sideLen = this.lengthOfCellSide;
  _$jscoverage['ui/tablepicker.js'][74]++;
  var numCols = Math.ceil((offset.left / sideLen));
  _$jscoverage['ui/tablepicker.js'][75]++;
  var numRows = Math.ceil((offset.top / sideLen));
  _$jscoverage['ui/tablepicker.js'][76]++;
  this._track(numCols, numRows);
}), _onClick: (function () {
  _$jscoverage['ui/tablepicker.js'][79]++;
  this.fireEvent("picktable", this.numCols, this.numRows);
})};
  _$jscoverage['ui/tablepicker.js'][82]++;
  utils.inherits(TablePicker, UIBase);
})();
