/* 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/enterkey.js']) {
  _$jscoverage['plugins/enterkey.js'] = [];
  _$jscoverage['plugins/enterkey.js'][10] = 0;
  _$jscoverage['plugins/enterkey.js'][11] = 0;
  _$jscoverage['plugins/enterkey.js'][14] = 0;
  _$jscoverage['plugins/enterkey.js'][16] = 0;
  _$jscoverage['plugins/enterkey.js'][17] = 0;
  _$jscoverage['plugins/enterkey.js'][18] = 0;
  _$jscoverage['plugins/enterkey.js'][23] = 0;
  _$jscoverage['plugins/enterkey.js'][25] = 0;
  _$jscoverage['plugins/enterkey.js'][26] = 0;
  _$jscoverage['plugins/enterkey.js'][27] = 0;
  _$jscoverage['plugins/enterkey.js'][28] = 0;
  _$jscoverage['plugins/enterkey.js'][29] = 0;
  _$jscoverage['plugins/enterkey.js'][30] = 0;
  _$jscoverage['plugins/enterkey.js'][34] = 0;
  _$jscoverage['plugins/enterkey.js'][35] = 0;
  _$jscoverage['plugins/enterkey.js'][36] = 0;
  _$jscoverage['plugins/enterkey.js'][37] = 0;
  _$jscoverage['plugins/enterkey.js'][38] = 0;
  _$jscoverage['plugins/enterkey.js'][39] = 0;
  _$jscoverage['plugins/enterkey.js'][40] = 0;
  _$jscoverage['plugins/enterkey.js'][41] = 0;
  _$jscoverage['plugins/enterkey.js'][43] = 0;
  _$jscoverage['plugins/enterkey.js'][44] = 0;
  _$jscoverage['plugins/enterkey.js'][45] = 0;
  _$jscoverage['plugins/enterkey.js'][46] = 0;
  _$jscoverage['plugins/enterkey.js'][48] = 0;
  _$jscoverage['plugins/enterkey.js'][53] = 0;
  _$jscoverage['plugins/enterkey.js'][54] = 0;
  _$jscoverage['plugins/enterkey.js'][58] = 0;
  _$jscoverage['plugins/enterkey.js'][60] = 0;
  _$jscoverage['plugins/enterkey.js'][65] = 0;
  _$jscoverage['plugins/enterkey.js'][66] = 0;
  _$jscoverage['plugins/enterkey.js'][67] = 0;
  _$jscoverage['plugins/enterkey.js'][68] = 0;
  _$jscoverage['plugins/enterkey.js'][69] = 0;
  _$jscoverage['plugins/enterkey.js'][70] = 0;
  _$jscoverage['plugins/enterkey.js'][72] = 0;
  _$jscoverage['plugins/enterkey.js'][73] = 0;
  _$jscoverage['plugins/enterkey.js'][76] = 0;
  _$jscoverage['plugins/enterkey.js'][78] = 0;
  _$jscoverage['plugins/enterkey.js'][80] = 0;
  _$jscoverage['plugins/enterkey.js'][84] = 0;
  _$jscoverage['plugins/enterkey.js'][85] = 0;
  _$jscoverage['plugins/enterkey.js'][86] = 0;
  _$jscoverage['plugins/enterkey.js'][89] = 0;
  _$jscoverage['plugins/enterkey.js'][92] = 0;
  _$jscoverage['plugins/enterkey.js'][94] = 0;
  _$jscoverage['plugins/enterkey.js'][98] = 0;
  _$jscoverage['plugins/enterkey.js'][100] = 0;
  _$jscoverage['plugins/enterkey.js'][102] = 0;
  _$jscoverage['plugins/enterkey.js'][103] = 0;
  _$jscoverage['plugins/enterkey.js'][104] = 0;
  _$jscoverage['plugins/enterkey.js'][105] = 0;
  _$jscoverage['plugins/enterkey.js'][110] = 0;
  _$jscoverage['plugins/enterkey.js'][111] = 0;
  _$jscoverage['plugins/enterkey.js'][117] = 0;
  _$jscoverage['plugins/enterkey.js'][119] = 0;
  _$jscoverage['plugins/enterkey.js'][120] = 0;
  _$jscoverage['plugins/enterkey.js'][121] = 0;
  _$jscoverage['plugins/enterkey.js'][122] = 0;
  _$jscoverage['plugins/enterkey.js'][123] = 0;
  _$jscoverage['plugins/enterkey.js'][124] = 0;
  _$jscoverage['plugins/enterkey.js'][125] = 0;
  _$jscoverage['plugins/enterkey.js'][126] = 0;
  _$jscoverage['plugins/enterkey.js'][127] = 0;
  _$jscoverage['plugins/enterkey.js'][129] = 0;
  _$jscoverage['plugins/enterkey.js'][131] = 0;
  _$jscoverage['plugins/enterkey.js'][132] = 0;
  _$jscoverage['plugins/enterkey.js'][133] = 0;
  _$jscoverage['plugins/enterkey.js'][134] = 0;
  _$jscoverage['plugins/enterkey.js'][135] = 0;
  _$jscoverage['plugins/enterkey.js'][136] = 0;
  _$jscoverage['plugins/enterkey.js'][138] = 0;
  _$jscoverage['plugins/enterkey.js'][140] = 0;
  _$jscoverage['plugins/enterkey.js'][142] = 0;
  _$jscoverage['plugins/enterkey.js'][143] = 0;
  _$jscoverage['plugins/enterkey.js'][144] = 0;
  _$jscoverage['plugins/enterkey.js'][147] = 0;
  _$jscoverage['plugins/enterkey.js'][152] = 0;
  _$jscoverage['plugins/enterkey.js'][153] = 0;
  _$jscoverage['plugins/enterkey.js'][158] = 0;
  _$jscoverage['plugins/enterkey.js'][159] = 0;
  _$jscoverage['plugins/enterkey.js'][160] = 0;
  _$jscoverage['plugins/enterkey.js'][161] = 0;
  _$jscoverage['plugins/enterkey.js'][162] = 0;
  _$jscoverage['plugins/enterkey.js'][163] = 0;
  _$jscoverage['plugins/enterkey.js'][165] = 0;
  _$jscoverage['plugins/enterkey.js'][167] = 0;
}
_$jscoverage['plugins/enterkey.js'].source = ["<span class=\"c\">///import core</span>","<span class=\"c\">///import plugins/undo.js</span>","<span class=\"c\">///commands &#35774;&#32622;&#22238;&#36710;&#26631;&#31614;p&#25110;br</span>","<span class=\"c\">///commandsName  EnterKey</span>","<span class=\"c\">///commandsTitle  &#35774;&#32622;&#22238;&#36710;&#26631;&#31614;p&#25110;br</span>","<span class=\"c\">/*</span>","<span class=\"c\"> * @description &#22788;&#29702;&#22238;&#36710;</span>","<span class=\"c\"> * @author zhanyi</span>","<span class=\"c\"> */</span>","UE<span class=\"k\">.</span>plugins<span class=\"k\">[</span><span class=\"s\">'enterkey'</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> hTag<span class=\"k\">,</span>","        me <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">,</span>","        tag <span class=\"k\">=</span> me<span class=\"k\">.</span>options<span class=\"k\">.</span>enterTag<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> range <span class=\"k\">=</span> me<span class=\"k\">.</span>selection<span class=\"k\">.</span>getRange<span class=\"k\">(),</span>","                start <span class=\"k\">=</span> range<span class=\"k\">.</span>startContainer<span class=\"k\">,</span>","                doSave<span class=\"k\">;</span>","","            <span class=\"c\">//&#20462;&#27491;&#22312;h1-h6&#37324;&#36793;&#22238;&#36710;&#21518;&#19981;&#33021;&#23884;&#22871;p&#30340;&#38382;&#39064;</span>","            <span class=\"k\">if</span> <span class=\"k\">(!</span>browser<span class=\"k\">.</span>ie<span class=\"k\">)</span> <span class=\"k\">{</span>","","                <span class=\"k\">if</span> <span class=\"k\">(</span><span class=\"s\">/h\\d/i</span><span class=\"k\">.</span>test<span class=\"k\">(</span>hTag<span class=\"k\">))</span> <span class=\"k\">{</span>","                    <span class=\"k\">if</span> <span class=\"k\">(</span>browser<span class=\"k\">.</span>gecko<span class=\"k\">)</span> <span class=\"k\">{</span>","                        <span class=\"k\">var</span> h <span class=\"k\">=</span> domUtils<span class=\"k\">.</span>findParentByTagName<span class=\"k\">(</span>start<span class=\"k\">,</span> <span class=\"k\">[</span> <span class=\"s\">'h1'</span><span class=\"k\">,</span> <span class=\"s\">'h2'</span><span class=\"k\">,</span> <span class=\"s\">'h3'</span><span class=\"k\">,</span> <span class=\"s\">'h4'</span><span class=\"k\">,</span> <span class=\"s\">'h5'</span><span class=\"k\">,</span> <span class=\"s\">'h6'</span><span class=\"k\">,</span><span class=\"s\">'blockquote'</span><span class=\"k\">,</span><span class=\"s\">'caption'</span><span class=\"k\">,</span><span class=\"s\">'table'</span><span class=\"k\">],</span> <span class=\"k\">true</span><span class=\"k\">);</span>","                        <span class=\"k\">if</span> <span class=\"k\">(!</span>h<span class=\"k\">)</span> <span class=\"k\">{</span>","                            me<span class=\"k\">.</span>document<span class=\"k\">.</span>execCommand<span class=\"k\">(</span><span class=\"s\">'formatBlock'</span><span class=\"k\">,</span> <span class=\"k\">false</span><span class=\"k\">,</span> <span class=\"s\">'&lt;p&gt;'</span><span class=\"k\">);</span>","                            doSave <span class=\"k\">=</span> <span class=\"s\">1</span><span class=\"k\">;</span>","                        <span class=\"k\">}</span>","                    <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                        <span class=\"c\">//chrome remove div</span>","                        <span class=\"k\">if</span> <span class=\"k\">(</span>start<span class=\"k\">.</span>nodeType <span class=\"k\">==</span> <span class=\"s\">1</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                            <span class=\"k\">var</span> tmp <span class=\"k\">=</span> me<span class=\"k\">.</span>document<span class=\"k\">.</span>createTextNode<span class=\"k\">(</span><span class=\"s\">''</span><span class=\"k\">),</span>div<span class=\"k\">;</span>","                            range<span class=\"k\">.</span>insertNode<span class=\"k\">(</span>tmp<span class=\"k\">);</span>","                            div <span class=\"k\">=</span> domUtils<span class=\"k\">.</span>findParentByTagName<span class=\"k\">(</span>tmp<span class=\"k\">,</span> <span class=\"s\">'div'</span><span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">);</span>","                            <span class=\"k\">if</span> <span class=\"k\">(</span>div<span class=\"k\">)</span> <span class=\"k\">{</span>","                                <span class=\"k\">var</span> p <span class=\"k\">=</span> me<span class=\"k\">.</span>document<span class=\"k\">.</span>createElement<span class=\"k\">(</span><span class=\"s\">'p'</span><span class=\"k\">);</span>","                                <span class=\"k\">while</span> <span class=\"k\">(</span>div<span class=\"k\">.</span>firstChild<span class=\"k\">)</span> <span class=\"k\">{</span>","                                    p<span class=\"k\">.</span>appendChild<span class=\"k\">(</span>div<span class=\"k\">.</span>firstChild<span class=\"k\">);</span>","                                <span class=\"k\">}</span>","                                div<span class=\"k\">.</span>parentNode<span class=\"k\">.</span>insertBefore<span class=\"k\">(</span>p<span class=\"k\">,</span> div<span class=\"k\">);</span>","                                domUtils<span class=\"k\">.</span>remove<span class=\"k\">(</span>div<span class=\"k\">);</span>","                                range<span class=\"k\">.</span>setStartBefore<span class=\"k\">(</span>tmp<span class=\"k\">).</span>setCursor<span class=\"k\">();</span>","                                doSave <span class=\"k\">=</span> <span class=\"s\">1</span><span class=\"k\">;</span>","                            <span class=\"k\">}</span>","                            domUtils<span class=\"k\">.</span>remove<span class=\"k\">(</span>tmp<span class=\"k\">);</span>","","                        <span class=\"k\">}</span>","                    <span class=\"k\">}</span>","","                    <span class=\"k\">if</span> <span class=\"k\">(</span>me<span class=\"k\">.</span>undoManger <span class=\"k\">&amp;&amp;</span> doSave<span class=\"k\">)</span> <span class=\"k\">{</span>","                        me<span class=\"k\">.</span>undoManger<span class=\"k\">.</span>save<span class=\"k\">();</span>","                    <span class=\"k\">}</span>","                <span class=\"k\">}</span>","                <span class=\"c\">//&#27809;&#26377;&#31449;&#20301;&#31526;&#65292;&#20250;&#20986;&#29616;&#22810;&#34892;&#30340;&#38382;&#39064;</span>","                browser<span class=\"k\">.</span>opera <span class=\"k\">&amp;&amp;</span>  range<span class=\"k\">.</span>select<span class=\"k\">();</span>","            <span class=\"k\">}</span><span class=\"k\">else</span><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\">true</span><span class=\"k\">,</span><span class=\"k\">true</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\">'keydown'</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=\"c\">//&#22238;&#36710;</span>","            <span class=\"k\">if</span><span class=\"k\">(</span>me<span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'beforeenterkeydown'</span><span class=\"k\">))</span><span class=\"k\">{</span>","                domUtils<span class=\"k\">.</span>preventDefault<span class=\"k\">(</span>evt<span class=\"k\">);</span>","                <span class=\"k\">return</span><span class=\"k\">;</span>","            <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\">true</span><span class=\"k\">,</span><span class=\"k\">true</span><span class=\"k\">);</span>","            hTag <span class=\"k\">=</span> <span class=\"s\">''</span><span class=\"k\">;</span>","","","            <span class=\"k\">var</span> range <span class=\"k\">=</span> me<span class=\"k\">.</span>selection<span class=\"k\">.</span>getRange<span class=\"k\">();</span>","","            <span class=\"k\">if</span> <span class=\"k\">(!</span>range<span class=\"k\">.</span>collapsed<span class=\"k\">)</span> <span class=\"k\">{</span>","                <span class=\"c\">//&#36328;td&#19981;&#33021;&#21024;</span>","                <span class=\"k\">var</span> start <span class=\"k\">=</span> range<span class=\"k\">.</span>startContainer<span class=\"k\">,</span>","                    end <span class=\"k\">=</span> range<span class=\"k\">.</span>endContainer<span class=\"k\">,</span>","                    startTd <span class=\"k\">=</span> domUtils<span class=\"k\">.</span>findParentByTagName<span class=\"k\">(</span>start<span class=\"k\">,</span> <span class=\"s\">'td'</span><span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">),</span>","                    endTd <span class=\"k\">=</span> domUtils<span class=\"k\">.</span>findParentByTagName<span class=\"k\">(</span>end<span class=\"k\">,</span> <span class=\"s\">'td'</span><span class=\"k\">,</span> <span class=\"k\">true</span><span class=\"k\">);</span>","                <span class=\"k\">if</span> <span class=\"k\">(</span>startTd <span class=\"k\">&amp;&amp;</span> endTd <span class=\"k\">&amp;&amp;</span> startTd <span class=\"k\">!==</span> endTd <span class=\"k\">||</span> <span class=\"k\">!</span>startTd <span class=\"k\">&amp;&amp;</span> endTd <span class=\"k\">||</span> startTd <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>endTd<span class=\"k\">)</span> <span class=\"k\">{</span>","                    evt<span class=\"k\">.</span>preventDefault <span class=\"k\">?</span> evt<span class=\"k\">.</span>preventDefault<span class=\"k\">()</span> <span class=\"k\">:</span> <span class=\"k\">(</span> evt<span class=\"k\">.</span>returnValue <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">);</span>","                    <span class=\"k\">return</span><span class=\"k\">;</span>","                <span class=\"k\">}</span>","            <span class=\"k\">}</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>tag <span class=\"k\">==</span> <span class=\"s\">'p'</span><span class=\"k\">)</span> <span class=\"k\">{</span>","","","                <span class=\"k\">if</span> <span class=\"k\">(!</span>browser<span class=\"k\">.</span>ie<span class=\"k\">)</span> <span class=\"k\">{</span>","","                    start <span class=\"k\">=</span> domUtils<span class=\"k\">.</span>findParentByTagName<span class=\"k\">(</span>range<span class=\"k\">.</span>startContainer<span class=\"k\">,</span> <span class=\"k\">[</span><span class=\"s\">'ol'</span><span class=\"k\">,</span><span class=\"s\">'ul'</span><span class=\"k\">,</span><span class=\"s\">'p'</span><span class=\"k\">,</span> <span class=\"s\">'h1'</span><span class=\"k\">,</span> <span class=\"s\">'h2'</span><span class=\"k\">,</span> <span class=\"s\">'h3'</span><span class=\"k\">,</span> <span class=\"s\">'h4'</span><span class=\"k\">,</span> <span class=\"s\">'h5'</span><span class=\"k\">,</span> <span class=\"s\">'h6'</span><span class=\"k\">,</span><span class=\"s\">'blockquote'</span><span class=\"k\">,</span><span class=\"s\">'caption'</span><span class=\"k\">],</span> <span class=\"k\">true</span><span class=\"k\">);</span>","","                    <span class=\"c\">//opera&#19979;&#25191;&#34892;formatblock&#20250;&#22312;table&#30340;&#22330;&#26223;&#19979;&#26377;&#38382;&#39064;&#65292;&#22238;&#36710;&#22312;opera&#21407;&#29983;&#25903;&#25345;&#24456;&#22909;&#65292;&#25152;&#20197;&#26242;&#26102;&#22312;opera&#21435;&#25481;&#35843;&#29992;&#36825;&#20010;&#21407;&#29983;&#30340;command</span>","                    <span class=\"c\">//trace:2431</span>","                    <span class=\"k\">if</span> <span class=\"k\">(!</span>start <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>browser<span class=\"k\">.</span>opera<span class=\"k\">)</span> <span class=\"k\">{</span>","","                        me<span class=\"k\">.</span>document<span class=\"k\">.</span>execCommand<span class=\"k\">(</span><span class=\"s\">'formatBlock'</span><span class=\"k\">,</span> <span class=\"k\">false</span><span class=\"k\">,</span> <span class=\"s\">'&lt;p&gt;'</span><span class=\"k\">);</span>","","                        <span class=\"k\">if</span> <span class=\"k\">(</span>browser<span class=\"k\">.</span>gecko<span class=\"k\">)</span> <span class=\"k\">{</span>","                            range <span class=\"k\">=</span> me<span class=\"k\">.</span>selection<span class=\"k\">.</span>getRange<span class=\"k\">();</span>","                            start <span class=\"k\">=</span> domUtils<span class=\"k\">.</span>findParentByTagName<span class=\"k\">(</span>range<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>","                            start <span class=\"k\">&amp;&amp;</span> domUtils<span class=\"k\">.</span>removeDirtyAttr<span class=\"k\">(</span>start<span class=\"k\">);</span>","                        <span class=\"k\">}</span>","","","                    <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                        hTag <span class=\"k\">=</span> start<span class=\"k\">.</span>tagName<span class=\"k\">;</span>","                        start<span class=\"k\">.</span>tagName<span class=\"k\">.</span>toLowerCase<span class=\"k\">()</span> <span class=\"k\">==</span> <span class=\"s\">'p'</span> <span class=\"k\">&amp;&amp;</span> browser<span class=\"k\">.</span>gecko <span class=\"k\">&amp;&amp;</span> domUtils<span class=\"k\">.</span>removeDirtyAttr<span class=\"k\">(</span>start<span class=\"k\">);</span>","                    <span class=\"k\">}</span>","","                <span class=\"k\">}</span>","","            <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                evt<span class=\"k\">.</span>preventDefault <span class=\"k\">?</span> evt<span class=\"k\">.</span>preventDefault<span class=\"k\">()</span> <span class=\"k\">:</span> <span class=\"k\">(</span> evt<span class=\"k\">.</span>returnValue <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">);</span>","","                <span class=\"k\">if</span> <span class=\"k\">(!</span>range<span class=\"k\">.</span>collapsed<span class=\"k\">)</span> <span class=\"k\">{</span>","                    range<span class=\"k\">.</span>deleteContents<span class=\"k\">();</span>","                    start <span class=\"k\">=</span> range<span class=\"k\">.</span>startContainer<span class=\"k\">;</span>","                    <span class=\"k\">if</span> <span class=\"k\">(</span>start<span class=\"k\">.</span>nodeType <span class=\"k\">==</span> <span class=\"s\">1</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">(</span>start <span class=\"k\">=</span> start<span class=\"k\">.</span>childNodes<span class=\"k\">[</span>range<span class=\"k\">.</span>startOffset<span class=\"k\">]))</span> <span class=\"k\">{</span>","                        <span class=\"k\">while</span> <span class=\"k\">(</span>start<span class=\"k\">.</span>nodeType <span class=\"k\">==</span> <span class=\"s\">1</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                            <span class=\"k\">if</span> <span class=\"k\">(</span>dtd<span class=\"k\">.</span>$empty<span class=\"k\">[</span>start<span class=\"k\">.</span>tagName<span class=\"k\">])</span> <span class=\"k\">{</span>","                                range<span class=\"k\">.</span>setStartBefore<span class=\"k\">(</span>start<span class=\"k\">).</span>setCursor<span class=\"k\">();</span>","                                <span class=\"k\">if</span> <span class=\"k\">(</span>me<span class=\"k\">.</span>undoManger<span class=\"k\">)</span> <span class=\"k\">{</span>","                                    me<span class=\"k\">.</span>undoManger<span class=\"k\">.</span>save<span class=\"k\">();</span>","                                <span class=\"k\">}</span>","                                <span class=\"k\">return</span> <span class=\"k\">false</span><span class=\"k\">;</span>","                            <span class=\"k\">}</span>","                            <span class=\"k\">if</span> <span class=\"k\">(!</span>start<span class=\"k\">.</span>firstChild<span class=\"k\">)</span> <span class=\"k\">{</span>","                                <span class=\"k\">var</span> br <span class=\"k\">=</span> range<span class=\"k\">.</span>document<span class=\"k\">.</span>createElement<span class=\"k\">(</span><span class=\"s\">'br'</span><span class=\"k\">);</span>","                                start<span class=\"k\">.</span>appendChild<span class=\"k\">(</span>br<span class=\"k\">);</span>","                                range<span class=\"k\">.</span>setStart<span class=\"k\">(</span>start<span class=\"k\">,</span> <span class=\"s\">0</span><span class=\"k\">).</span>setCursor<span class=\"k\">();</span>","                                <span class=\"k\">if</span> <span class=\"k\">(</span>me<span class=\"k\">.</span>undoManger<span class=\"k\">)</span> <span class=\"k\">{</span>","                                    me<span class=\"k\">.</span>undoManger<span class=\"k\">.</span>save<span class=\"k\">();</span>","                                <span class=\"k\">}</span>","                                <span class=\"k\">return</span> <span class=\"k\">false</span><span class=\"k\">;</span>","                            <span class=\"k\">}</span>","                            start <span class=\"k\">=</span> start<span class=\"k\">.</span>firstChild<span class=\"k\">;</span>","                        <span class=\"k\">}</span>","                        <span class=\"k\">if</span> <span class=\"k\">(</span>start <span class=\"k\">===</span> range<span class=\"k\">.</span>startContainer<span class=\"k\">.</span>childNodes<span class=\"k\">[</span>range<span class=\"k\">.</span>startOffset<span class=\"k\">])</span> <span class=\"k\">{</span>","                            br <span class=\"k\">=</span> range<span class=\"k\">.</span>document<span class=\"k\">.</span>createElement<span class=\"k\">(</span><span class=\"s\">'br'</span><span class=\"k\">);</span>","                            range<span class=\"k\">.</span>insertNode<span class=\"k\">(</span>br<span class=\"k\">).</span>setCursor<span class=\"k\">();</span>","","                        <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                            range<span class=\"k\">.</span>setStart<span class=\"k\">(</span>start<span class=\"k\">,</span> <span class=\"s\">0</span><span class=\"k\">).</span>setCursor<span class=\"k\">();</span>","                        <span class=\"k\">}</span>","","","                    <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                        br <span class=\"k\">=</span> range<span class=\"k\">.</span>document<span class=\"k\">.</span>createElement<span class=\"k\">(</span><span class=\"s\">'br'</span><span class=\"k\">);</span>","                        range<span class=\"k\">.</span>insertNode<span class=\"k\">(</span>br<span class=\"k\">).</span>setStartAfter<span class=\"k\">(</span>br<span class=\"k\">).</span>setCursor<span class=\"k\">();</span>","                    <span class=\"k\">}</span>","","","                <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                    br <span class=\"k\">=</span> range<span class=\"k\">.</span>document<span class=\"k\">.</span>createElement<span class=\"k\">(</span><span class=\"s\">'br'</span><span class=\"k\">);</span>","                    range<span class=\"k\">.</span>insertNode<span class=\"k\">(</span>br<span class=\"k\">);</span>","                    <span class=\"k\">var</span> parent <span class=\"k\">=</span> br<span class=\"k\">.</span>parentNode<span class=\"k\">;</span>","                    <span class=\"k\">if</span> <span class=\"k\">(</span>parent<span class=\"k\">.</span>lastChild <span class=\"k\">===</span> br<span class=\"k\">)</span> <span class=\"k\">{</span>","                        br<span class=\"k\">.</span>parentNode<span class=\"k\">.</span>insertBefore<span class=\"k\">(</span>br<span class=\"k\">.</span>cloneNode<span class=\"k\">(</span><span class=\"k\">true</span><span class=\"k\">),</span> br<span class=\"k\">);</span>","                        range<span class=\"k\">.</span>setStartBefore<span class=\"k\">(</span>br<span class=\"k\">);</span>","                    <span class=\"k\">}</span> <span class=\"k\">else</span> <span class=\"k\">{</span>","                        range<span class=\"k\">.</span>setStartAfter<span class=\"k\">(</span>br<span class=\"k\">);</span>","                    <span class=\"k\">}</span>","                    range<span class=\"k\">.</span>setCursor<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/enterkey.js'][10]++;
UE.plugins.enterkey = (function () {
  _$jscoverage['plugins/enterkey.js'][11]++;
  var hTag, me = this, tag = me.options.enterTag;
  _$jscoverage['plugins/enterkey.js'][14]++;
  me.addListener("keyup", (function (type, evt) {
  _$jscoverage['plugins/enterkey.js'][16]++;
  var keyCode = (evt.keyCode || evt.which);
  _$jscoverage['plugins/enterkey.js'][17]++;
  if ((keyCode == 13)) {
    _$jscoverage['plugins/enterkey.js'][18]++;
    var range = me.selection.getRange(), start = range.startContainer, doSave;
    _$jscoverage['plugins/enterkey.js'][23]++;
    if ((! browser.ie)) {
      _$jscoverage['plugins/enterkey.js'][25]++;
      if (/h\d/i.test(hTag)) {
        _$jscoverage['plugins/enterkey.js'][26]++;
        if (browser.gecko) {
          _$jscoverage['plugins/enterkey.js'][27]++;
          var h = domUtils.findParentByTagName(start, ["h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "caption", "table"], true);
          _$jscoverage['plugins/enterkey.js'][28]++;
          if ((! h)) {
            _$jscoverage['plugins/enterkey.js'][29]++;
            me.document.execCommand("formatBlock", false, "<p>");
            _$jscoverage['plugins/enterkey.js'][30]++;
            doSave = 1;
          }
        }
        else {
          _$jscoverage['plugins/enterkey.js'][34]++;
          if ((start.nodeType == 1)) {
            _$jscoverage['plugins/enterkey.js'][35]++;
            var tmp = me.document.createTextNode(""), div;
            _$jscoverage['plugins/enterkey.js'][36]++;
            range.insertNode(tmp);
            _$jscoverage['plugins/enterkey.js'][37]++;
            div = domUtils.findParentByTagName(tmp, "div", true);
            _$jscoverage['plugins/enterkey.js'][38]++;
            if (div) {
              _$jscoverage['plugins/enterkey.js'][39]++;
              var p = me.document.createElement("p");
              _$jscoverage['plugins/enterkey.js'][40]++;
              while (div.firstChild) {
                _$jscoverage['plugins/enterkey.js'][41]++;
                p.appendChild(div.firstChild);
}
              _$jscoverage['plugins/enterkey.js'][43]++;
              div.parentNode.insertBefore(p, div);
              _$jscoverage['plugins/enterkey.js'][44]++;
              domUtils.remove(div);
              _$jscoverage['plugins/enterkey.js'][45]++;
              range.setStartBefore(tmp).setCursor();
              _$jscoverage['plugins/enterkey.js'][46]++;
              doSave = 1;
            }
            _$jscoverage['plugins/enterkey.js'][48]++;
            domUtils.remove(tmp);
          }
        }
        _$jscoverage['plugins/enterkey.js'][53]++;
        if ((me.undoManger && doSave)) {
          _$jscoverage['plugins/enterkey.js'][54]++;
          me.undoManger.save();
        }
      }
      _$jscoverage['plugins/enterkey.js'][58]++;
      (browser.opera && range.select());
    }
    else {
      _$jscoverage['plugins/enterkey.js'][60]++;
      me.fireEvent("saveScene", true, true);
    }
  }
}));
  _$jscoverage['plugins/enterkey.js'][65]++;
  me.addListener("keydown", (function (type, evt) {
  _$jscoverage['plugins/enterkey.js'][66]++;
  var keyCode = (evt.keyCode || evt.which);
  _$jscoverage['plugins/enterkey.js'][67]++;
  if ((keyCode == 13)) {
    _$jscoverage['plugins/enterkey.js'][68]++;
    if (me.fireEvent("beforeenterkeydown")) {
      _$jscoverage['plugins/enterkey.js'][69]++;
      domUtils.preventDefault(evt);
      _$jscoverage['plugins/enterkey.js'][70]++;
      return;
    }
    _$jscoverage['plugins/enterkey.js'][72]++;
    me.fireEvent("saveScene", true, true);
    _$jscoverage['plugins/enterkey.js'][73]++;
    hTag = "";
    _$jscoverage['plugins/enterkey.js'][76]++;
    var range = me.selection.getRange();
    _$jscoverage['plugins/enterkey.js'][78]++;
    if ((! range.collapsed)) {
      _$jscoverage['plugins/enterkey.js'][80]++;
      var start = range.startContainer, end = range.endContainer, startTd = domUtils.findParentByTagName(start, "td", true), endTd = domUtils.findParentByTagName(end, "td", true);
      _$jscoverage['plugins/enterkey.js'][84]++;
      if (((startTd && endTd && (startTd !== endTd)) || ((! startTd) && endTd) || (startTd && (! endTd)))) {
        _$jscoverage['plugins/enterkey.js'][85]++;
        (evt.preventDefault? evt.preventDefault(): (evt.returnValue = false));
        _$jscoverage['plugins/enterkey.js'][86]++;
        return;
      }
    }
    _$jscoverage['plugins/enterkey.js'][89]++;
    if ((tag == "p")) {
      _$jscoverage['plugins/enterkey.js'][92]++;
      if ((! browser.ie)) {
        _$jscoverage['plugins/enterkey.js'][94]++;
        start = domUtils.findParentByTagName(range.startContainer, ["ol", "ul", "p", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "caption"], true);
        _$jscoverage['plugins/enterkey.js'][98]++;
        if (((! start) && (! browser.opera))) {
          _$jscoverage['plugins/enterkey.js'][100]++;
          me.document.execCommand("formatBlock", false, "<p>");
          _$jscoverage['plugins/enterkey.js'][102]++;
          if (browser.gecko) {
            _$jscoverage['plugins/enterkey.js'][103]++;
            range = me.selection.getRange();
            _$jscoverage['plugins/enterkey.js'][104]++;
            start = domUtils.findParentByTagName(range.startContainer, "p", true);
            _$jscoverage['plugins/enterkey.js'][105]++;
            (start && domUtils.removeDirtyAttr(start));
          }
        }
        else {
          _$jscoverage['plugins/enterkey.js'][110]++;
          hTag = start.tagName;
          _$jscoverage['plugins/enterkey.js'][111]++;
          ((start.tagName.toLowerCase() == "p") && browser.gecko && domUtils.removeDirtyAttr(start));
        }
      }
    }
    else {
      _$jscoverage['plugins/enterkey.js'][117]++;
      (evt.preventDefault? evt.preventDefault(): (evt.returnValue = false));
      _$jscoverage['plugins/enterkey.js'][119]++;
      if ((! range.collapsed)) {
        _$jscoverage['plugins/enterkey.js'][120]++;
        range.deleteContents();
        _$jscoverage['plugins/enterkey.js'][121]++;
        start = range.startContainer;
        _$jscoverage['plugins/enterkey.js'][122]++;
        if (((start.nodeType == 1) && (start = start.childNodes[range.startOffset]))) {
          _$jscoverage['plugins/enterkey.js'][123]++;
          while ((start.nodeType == 1)) {
            _$jscoverage['plugins/enterkey.js'][124]++;
            if (dtd.$empty[start.tagName]) {
              _$jscoverage['plugins/enterkey.js'][125]++;
              range.setStartBefore(start).setCursor();
              _$jscoverage['plugins/enterkey.js'][126]++;
              if (me.undoManger) {
                _$jscoverage['plugins/enterkey.js'][127]++;
                me.undoManger.save();
              }
              _$jscoverage['plugins/enterkey.js'][129]++;
              return false;
            }
            _$jscoverage['plugins/enterkey.js'][131]++;
            if ((! start.firstChild)) {
              _$jscoverage['plugins/enterkey.js'][132]++;
              var br = range.document.createElement("br");
              _$jscoverage['plugins/enterkey.js'][133]++;
              start.appendChild(br);
              _$jscoverage['plugins/enterkey.js'][134]++;
              range.setStart(start, 0).setCursor();
              _$jscoverage['plugins/enterkey.js'][135]++;
              if (me.undoManger) {
                _$jscoverage['plugins/enterkey.js'][136]++;
                me.undoManger.save();
              }
              _$jscoverage['plugins/enterkey.js'][138]++;
              return false;
            }
            _$jscoverage['plugins/enterkey.js'][140]++;
            start = start.firstChild;
}
          _$jscoverage['plugins/enterkey.js'][142]++;
          if ((start === range.startContainer.childNodes[range.startOffset])) {
            _$jscoverage['plugins/enterkey.js'][143]++;
            br = range.document.createElement("br");
            _$jscoverage['plugins/enterkey.js'][144]++;
            range.insertNode(br).setCursor();
          }
          else {
            _$jscoverage['plugins/enterkey.js'][147]++;
            range.setStart(start, 0).setCursor();
          }
        }
        else {
          _$jscoverage['plugins/enterkey.js'][152]++;
          br = range.document.createElement("br");
          _$jscoverage['plugins/enterkey.js'][153]++;
          range.insertNode(br).setStartAfter(br).setCursor();
        }
      }
      else {
        _$jscoverage['plugins/enterkey.js'][158]++;
        br = range.document.createElement("br");
        _$jscoverage['plugins/enterkey.js'][159]++;
        range.insertNode(br);
        _$jscoverage['plugins/enterkey.js'][160]++;
        var parent = br.parentNode;
        _$jscoverage['plugins/enterkey.js'][161]++;
        if ((parent.lastChild === br)) {
          _$jscoverage['plugins/enterkey.js'][162]++;
          br.parentNode.insertBefore(br.cloneNode(true), br);
          _$jscoverage['plugins/enterkey.js'][163]++;
          range.setStartBefore(br);
        }
        else {
          _$jscoverage['plugins/enterkey.js'][165]++;
          range.setStartAfter(br);
        }
        _$jscoverage['plugins/enterkey.js'][167]++;
        range.setCursor();
      }
    }
  }
}));
});
