/* 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['plugins/dragdrop.js']) {
  _$jscoverage['plugins/dragdrop.js'] = [];
  _$jscoverage['plugins/dragdrop.js'][1] = 0;
  _$jscoverage['plugins/dragdrop.js'][3] = 0;
  _$jscoverage['plugins/dragdrop.js'][4] = 0;
  _$jscoverage['plugins/dragdrop.js'][5] = 0;
  _$jscoverage['plugins/dragdrop.js'][6] = 0;
  _$jscoverage['plugins/dragdrop.js'][7] = 0;
  _$jscoverage['plugins/dragdrop.js'][9] = 0;
  _$jscoverage['plugins/dragdrop.js'][11] = 0;
  _$jscoverage['plugins/dragdrop.js'][12] = 0;
  _$jscoverage['plugins/dragdrop.js'][13] = 0;
  _$jscoverage['plugins/dragdrop.js'][14] = 0;
  _$jscoverage['plugins/dragdrop.js'][16] = 0;
  _$jscoverage['plugins/dragdrop.js'][21] = 0;
  _$jscoverage['plugins/dragdrop.js'][22] = 0;
  _$jscoverage['plugins/dragdrop.js'][23] = 0;
  _$jscoverage['plugins/dragdrop.js'][24] = 0;
  _$jscoverage['plugins/dragdrop.js'][25] = 0;
  _$jscoverage['plugins/dragdrop.js'][26] = 0;
  _$jscoverage['plugins/dragdrop.js'][27] = 0;
  _$jscoverage['plugins/dragdrop.js'][30] = 0;
  _$jscoverage['plugins/dragdrop.js'][31] = 0;
  _$jscoverage['plugins/dragdrop.js'][33] = 0;
  _$jscoverage['plugins/dragdrop.js'][34] = 0;
  _$jscoverage['plugins/dragdrop.js'][36] = 0;
  _$jscoverage['plugins/dragdrop.js'][37] = 0;
  _$jscoverage['plugins/dragdrop.js'][45] = 0;
  _$jscoverage['plugins/dragdrop.js'][46] = 0;
  _$jscoverage['plugins/dragdrop.js'][47] = 0;
  _$jscoverage['plugins/dragdrop.js'][48] = 0;
  _$jscoverage['plugins/dragdrop.js'][49] = 0;
  _$jscoverage['plugins/dragdrop.js'][50] = 0;
  _$jscoverage['plugins/dragdrop.js'][51] = 0;
}
_$jscoverage['plugins/dragdrop.js'].source = ["UE<span class=\"k\">.</span>plugins<span class=\"k\">[</span><span class=\"s\">'dragdrop'</span><span class=\"k\">]</span> <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>","    me<span class=\"k\">.</span>ready<span class=\"k\">(</span><span class=\"k\">function</span><span class=\"k\">()</span><span class=\"k\">{</span>","        domUtils<span class=\"k\">.</span>on<span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>body<span class=\"k\">,</span><span class=\"s\">'dragend'</span><span class=\"k\">,</span><span class=\"k\">function</span><span class=\"k\">()</span><span class=\"k\">{</span>","            <span class=\"k\">var</span> rng <span class=\"k\">=</span> me<span class=\"k\">.</span>selection<span class=\"k\">.</span>getRange<span class=\"k\">();</span>","            <span class=\"k\">var</span> node <span class=\"k\">=</span> rng<span class=\"k\">.</span>getClosedNode<span class=\"k\">()||</span>me<span class=\"k\">.</span>selection<span class=\"k\">.</span>getStart<span class=\"k\">();</span>","","            <span class=\"k\">if</span><span class=\"k\">(</span>node <span class=\"k\">&amp;&amp;</span> node<span class=\"k\">.</span>tagName <span class=\"k\">==</span> <span class=\"s\">'IMG'</span><span class=\"k\">)</span><span class=\"k\">{</span>","","                <span class=\"k\">var</span> pre <span class=\"k\">=</span> node<span class=\"k\">.</span>previousSibling<span class=\"k\">,</span>next<span class=\"k\">;</span>","                <span class=\"k\">while</span><span class=\"k\">(</span>next <span class=\"k\">=</span> node<span class=\"k\">.</span>nextSibling<span class=\"k\">)</span><span class=\"k\">{</span>","                    <span class=\"k\">if</span><span class=\"k\">(</span>next<span class=\"k\">.</span>nodeType <span class=\"k\">==</span> <span class=\"s\">1</span> <span class=\"k\">&amp;&amp;</span> next<span class=\"k\">.</span>tagName <span class=\"k\">==</span> <span class=\"s\">'SPAN'</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>next<span class=\"k\">.</span>firstChild<span class=\"k\">)</span><span class=\"k\">{</span>","                        domUtils<span class=\"k\">.</span>remove<span class=\"k\">(</span>next<span class=\"k\">)</span>","                    <span class=\"k\">}</span><span class=\"k\">else</span><span class=\"k\">{</span>","                        <span class=\"k\">break</span><span class=\"k\">;</span>","                    <span class=\"k\">}</span>","                <span class=\"k\">}</span>","","","                <span class=\"k\">if</span><span class=\"k\">((</span>pre <span class=\"k\">&amp;&amp;</span> pre<span class=\"k\">.</span>nodeType <span class=\"k\">==</span> <span class=\"s\">1</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>domUtils<span class=\"k\">.</span>isEmptyBlock<span class=\"k\">(</span>pre<span class=\"k\">)</span> <span class=\"k\">||</span> <span class=\"k\">!</span>pre<span class=\"k\">)</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">(!</span>next <span class=\"k\">||</span> next <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>domUtils<span class=\"k\">.</span>isEmptyBlock<span class=\"k\">(</span>next<span class=\"k\">)))</span><span class=\"k\">{</span>","                    <span class=\"k\">if</span><span class=\"k\">(</span>pre <span class=\"k\">&amp;&amp;</span> pre<span class=\"k\">.</span>tagName <span class=\"k\">==</span> <span class=\"s\">'P'</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>domUtils<span class=\"k\">.</span>isEmptyBlock<span class=\"k\">(</span>pre<span class=\"k\">))</span><span class=\"k\">{</span>","                        pre<span class=\"k\">.</span>appendChild<span class=\"k\">(</span>node<span class=\"k\">);</span>","                        domUtils<span class=\"k\">.</span>moveChild<span class=\"k\">(</span>next<span class=\"k\">,</span>pre<span class=\"k\">);</span>","                        domUtils<span class=\"k\">.</span>remove<span class=\"k\">(</span>next<span class=\"k\">);</span>","                    <span class=\"k\">}</span><span class=\"k\">else</span>  <span class=\"k\">if</span><span class=\"k\">(</span>next <span class=\"k\">&amp;&amp;</span> next<span class=\"k\">.</span>tagName <span class=\"k\">==</span> <span class=\"s\">'P'</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>domUtils<span class=\"k\">.</span>isEmptyBlock<span class=\"k\">(</span>next<span class=\"k\">))</span><span class=\"k\">{</span>","                        next<span class=\"k\">.</span>insertBefore<span class=\"k\">(</span>node<span class=\"k\">,</span>next<span class=\"k\">.</span>firstChild<span class=\"k\">);</span>","                    <span class=\"k\">}</span>","","                    <span class=\"k\">if</span><span class=\"k\">(</span>pre <span class=\"k\">&amp;&amp;</span> pre<span class=\"k\">.</span>tagName <span class=\"k\">==</span> <span class=\"s\">'P'</span> <span class=\"k\">&amp;&amp;</span> domUtils<span class=\"k\">.</span>isEmptyBlock<span class=\"k\">(</span>pre<span class=\"k\">))</span><span class=\"k\">{</span>","                        domUtils<span class=\"k\">.</span>remove<span class=\"k\">(</span>pre<span class=\"k\">)</span>","                    <span class=\"k\">}</span>","                    <span class=\"k\">if</span><span class=\"k\">(</span>next <span class=\"k\">&amp;&amp;</span> next<span class=\"k\">.</span>tagName <span class=\"k\">==</span> <span class=\"s\">'P'</span> <span class=\"k\">&amp;&amp;</span> domUtils<span class=\"k\">.</span>isEmptyBlock<span class=\"k\">(</span>next<span class=\"k\">))</span><span class=\"k\">{</span>","                        domUtils<span class=\"k\">.</span>remove<span class=\"k\">(</span>next<span class=\"k\">)</span>","                    <span class=\"k\">}</span>","                    rng<span class=\"k\">.</span>selectNode<span class=\"k\">(</span>node<span class=\"k\">).</span>select<span class=\"k\">();</span>","                    me<span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'saveScene'</span><span class=\"k\">);</span>","","                <span class=\"k\">}</span>","","            <span class=\"k\">}</span>","","        <span class=\"k\">}</span><span class=\"k\">)</span>","    <span class=\"k\">}</span><span class=\"k\">);</span>","    me<span class=\"k\">.</span>addListener<span class=\"k\">(</span><span class=\"s\">'keyup'</span><span class=\"k\">,</span> <span class=\"k\">function</span><span class=\"k\">(</span>type<span class=\"k\">,</span> evt<span class=\"k\">)</span> <span class=\"k\">{</span>","        <span class=\"k\">var</span> keyCode <span class=\"k\">=</span> evt<span class=\"k\">.</span>keyCode <span class=\"k\">||</span> evt<span class=\"k\">.</span>which<span class=\"k\">;</span>","        <span class=\"k\">if</span> <span class=\"k\">(</span>keyCode <span class=\"k\">==</span> <span class=\"s\">13</span><span class=\"k\">)</span> <span class=\"k\">{</span>","            <span class=\"k\">var</span> rng <span class=\"k\">=</span> me<span class=\"k\">.</span>selection<span class=\"k\">.</span>getRange<span class=\"k\">(),</span>node<span class=\"k\">;</span>","            <span class=\"k\">if</span><span class=\"k\">(</span>node <span class=\"k\">=</span> domUtils<span class=\"k\">.</span>findParentByTagName<span class=\"k\">(</span>rng<span class=\"k\">.</span>startContainer<span class=\"k\">,</span><span class=\"s\">'p'</span><span class=\"k\">,</span><span class=\"k\">true</span><span class=\"k\">))</span><span class=\"k\">{</span>","                <span class=\"k\">if</span><span class=\"k\">(</span>domUtils<span class=\"k\">.</span>getComputedStyle<span class=\"k\">(</span>node<span class=\"k\">,</span><span class=\"s\">'text-align'</span><span class=\"k\">)</span> <span class=\"k\">==</span> <span class=\"s\">'center'</span><span class=\"k\">)</span><span class=\"k\">{</span>","                    domUtils<span class=\"k\">.</span>removeStyle<span class=\"k\">(</span>node<span class=\"k\">,</span><span class=\"s\">'text-align'</span><span class=\"k\">)</span>","                <span class=\"k\">}</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span>","    <span class=\"k\">}</span><span class=\"k\">)</span>","<span class=\"k\">}</span><span class=\"k\">;</span>"];
_$jscoverage['plugins/dragdrop.js'][1]++;
UE.plugins.dragdrop = (function () {
  _$jscoverage['plugins/dragdrop.js'][3]++;
  var me = this;
  _$jscoverage['plugins/dragdrop.js'][4]++;
  me.ready((function () {
  _$jscoverage['plugins/dragdrop.js'][5]++;
  domUtils.on(this.body, "dragend", (function () {
  _$jscoverage['plugins/dragdrop.js'][6]++;
  var rng = me.selection.getRange();
  _$jscoverage['plugins/dragdrop.js'][7]++;
  var node = (rng.getClosedNode() || me.selection.getStart());
  _$jscoverage['plugins/dragdrop.js'][9]++;
  if ((node && (node.tagName == "IMG"))) {
    _$jscoverage['plugins/dragdrop.js'][11]++;
    var pre = node.previousSibling, next;
    _$jscoverage['plugins/dragdrop.js'][12]++;
    while ((next = node.nextSibling)) {
      _$jscoverage['plugins/dragdrop.js'][13]++;
      if (((next.nodeType == 1) && (next.tagName == "SPAN") && (! next.firstChild))) {
        _$jscoverage['plugins/dragdrop.js'][14]++;
        domUtils.remove(next);
      }
      else {
        _$jscoverage['plugins/dragdrop.js'][16]++;
        break;
      }
}
    _$jscoverage['plugins/dragdrop.js'][21]++;
    if ((((pre && (pre.nodeType == 1) && (! domUtils.isEmptyBlock(pre))) || (! pre)) && ((! next) || (next && (! domUtils.isEmptyBlock(next)))))) {
      _$jscoverage['plugins/dragdrop.js'][22]++;
      if ((pre && (pre.tagName == "P") && (! domUtils.isEmptyBlock(pre)))) {
        _$jscoverage['plugins/dragdrop.js'][23]++;
        pre.appendChild(node);
        _$jscoverage['plugins/dragdrop.js'][24]++;
        domUtils.moveChild(next, pre);
        _$jscoverage['plugins/dragdrop.js'][25]++;
        domUtils.remove(next);
      }
      else {
        _$jscoverage['plugins/dragdrop.js'][26]++;
        if ((next && (next.tagName == "P") && (! domUtils.isEmptyBlock(next)))) {
          _$jscoverage['plugins/dragdrop.js'][27]++;
          next.insertBefore(node, next.firstChild);
        }
      }
      _$jscoverage['plugins/dragdrop.js'][30]++;
      if ((pre && (pre.tagName == "P") && domUtils.isEmptyBlock(pre))) {
        _$jscoverage['plugins/dragdrop.js'][31]++;
        domUtils.remove(pre);
      }
      _$jscoverage['plugins/dragdrop.js'][33]++;
      if ((next && (next.tagName == "P") && domUtils.isEmptyBlock(next))) {
        _$jscoverage['plugins/dragdrop.js'][34]++;
        domUtils.remove(next);
      }
      _$jscoverage['plugins/dragdrop.js'][36]++;
      rng.selectNode(node).select();
      _$jscoverage['plugins/dragdrop.js'][37]++;
      me.fireEvent("saveScene");
    }
  }
}));
}));
  _$jscoverage['plugins/dragdrop.js'][45]++;
  me.addListener("keyup", (function (type, evt) {
  _$jscoverage['plugins/dragdrop.js'][46]++;
  var keyCode = (evt.keyCode || evt.which);
  _$jscoverage['plugins/dragdrop.js'][47]++;
  if ((keyCode == 13)) {
    _$jscoverage['plugins/dragdrop.js'][48]++;
    var rng = me.selection.getRange(), node;
    _$jscoverage['plugins/dragdrop.js'][49]++;
    if ((node = domUtils.findParentByTagName(rng.startContainer, "p", true))) {
      _$jscoverage['plugins/dragdrop.js'][50]++;
      if ((domUtils.getComputedStyle(node, "text-align") == "center")) {
        _$jscoverage['plugins/dragdrop.js'][51]++;
        domUtils.removeStyle(node, "text-align");
      }
    }
  }
}));
});
