/* 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/undo.js']) {
  _$jscoverage['plugins/undo.js'] = [];
  _$jscoverage['plugins/undo.js'][10] = 0;
  _$jscoverage['plugins/undo.js'][11] = 0;
  _$jscoverage['plugins/undo.js'][12] = 0;
  _$jscoverage['plugins/undo.js'][16] = 0;
  _$jscoverage['plugins/undo.js'][19] = 0;
  _$jscoverage['plugins/undo.js'][20] = 0;
  _$jscoverage['plugins/undo.js'][21] = 0;
  _$jscoverage['plugins/undo.js'][22] = 0;
  _$jscoverage['plugins/undo.js'][23] = 0;
  _$jscoverage['plugins/undo.js'][24] = 0;
  _$jscoverage['plugins/undo.js'][25] = 0;
  _$jscoverage['plugins/undo.js'][27] = 0;
  _$jscoverage['plugins/undo.js'][30] = 0;
  _$jscoverage['plugins/undo.js'][31] = 0;
  _$jscoverage['plugins/undo.js'][32] = 0;
  _$jscoverage['plugins/undo.js'][34] = 0;
  _$jscoverage['plugins/undo.js'][35] = 0;
  _$jscoverage['plugins/undo.js'][37] = 0;
  _$jscoverage['plugins/undo.js'][40] = 0;
  _$jscoverage['plugins/undo.js'][41] = 0;
  _$jscoverage['plugins/undo.js'][42] = 0;
  _$jscoverage['plugins/undo.js'][43] = 0;
  _$jscoverage['plugins/undo.js'][44] = 0;
  _$jscoverage['plugins/undo.js'][45] = 0;
  _$jscoverage['plugins/undo.js'][46] = 0;
  _$jscoverage['plugins/undo.js'][47] = 0;
  _$jscoverage['plugins/undo.js'][48] = 0;
  _$jscoverage['plugins/undo.js'][49] = 0;
  _$jscoverage['plugins/undo.js'][51] = 0;
  _$jscoverage['plugins/undo.js'][52] = 0;
  _$jscoverage['plugins/undo.js'][53] = 0;
  _$jscoverage['plugins/undo.js'][54] = 0;
  _$jscoverage['plugins/undo.js'][57] = 0;
  _$jscoverage['plugins/undo.js'][60] = 0;
  _$jscoverage['plugins/undo.js'][61] = 0;
  _$jscoverage['plugins/undo.js'][62] = 0;
  _$jscoverage['plugins/undo.js'][63] = 0;
  _$jscoverage['plugins/undo.js'][64] = 0;
  _$jscoverage['plugins/undo.js'][65] = 0;
  _$jscoverage['plugins/undo.js'][68] = 0;
  _$jscoverage['plugins/undo.js'][72] = 0;
  _$jscoverage['plugins/undo.js'][73] = 0;
  _$jscoverage['plugins/undo.js'][74] = 0;
  _$jscoverage['plugins/undo.js'][75] = 0;
  _$jscoverage['plugins/undo.js'][76] = 0;
  _$jscoverage['plugins/undo.js'][77] = 0;
  _$jscoverage['plugins/undo.js'][78] = 0;
  _$jscoverage['plugins/undo.js'][81] = 0;
  _$jscoverage['plugins/undo.js'][82] = 0;
  _$jscoverage['plugins/undo.js'][84] = 0;
  _$jscoverage['plugins/undo.js'][85] = 0;
  _$jscoverage['plugins/undo.js'][86] = 0;
  _$jscoverage['plugins/undo.js'][87] = 0;
  _$jscoverage['plugins/undo.js'][92] = 0;
  _$jscoverage['plugins/undo.js'][93] = 0;
  _$jscoverage['plugins/undo.js'][94] = 0;
  _$jscoverage['plugins/undo.js'][97] = 0;
  _$jscoverage['plugins/undo.js'][98] = 0;
  _$jscoverage['plugins/undo.js'][100] = 0;
  _$jscoverage['plugins/undo.js'][103] = 0;
  _$jscoverage['plugins/undo.js'][104] = 0;
  _$jscoverage['plugins/undo.js'][105] = 0;
  _$jscoverage['plugins/undo.js'][107] = 0;
  _$jscoverage['plugins/undo.js'][108] = 0;
  _$jscoverage['plugins/undo.js'][109] = 0;
  _$jscoverage['plugins/undo.js'][110] = 0;
  _$jscoverage['plugins/undo.js'][111] = 0;
  _$jscoverage['plugins/undo.js'][112] = 0;
  _$jscoverage['plugins/undo.js'][116] = 0;
  _$jscoverage['plugins/undo.js'][118] = 0;
  _$jscoverage['plugins/undo.js'][123] = 0;
  _$jscoverage['plugins/undo.js'][124] = 0;
  _$jscoverage['plugins/undo.js'][125] = 0;
  _$jscoverage['plugins/undo.js'][128] = 0;
  _$jscoverage['plugins/undo.js'][131] = 0;
  _$jscoverage['plugins/undo.js'][133] = 0;
  _$jscoverage['plugins/undo.js'][134] = 0;
  _$jscoverage['plugins/undo.js'][136] = 0;
  _$jscoverage['plugins/undo.js'][137] = 0;
  _$jscoverage['plugins/undo.js'][139] = 0;
  _$jscoverage['plugins/undo.js'][140] = 0;
  _$jscoverage['plugins/undo.js'][142] = 0;
  _$jscoverage['plugins/undo.js'][145] = 0;
  _$jscoverage['plugins/undo.js'][146] = 0;
  _$jscoverage['plugins/undo.js'][147] = 0;
  _$jscoverage['plugins/undo.js'][149] = 0;
  _$jscoverage['plugins/undo.js'][150] = 0;
  _$jscoverage['plugins/undo.js'][151] = 0;
  _$jscoverage['plugins/undo.js'][152] = 0;
  _$jscoverage['plugins/undo.js'][153] = 0;
  _$jscoverage['plugins/undo.js'][154] = 0;
  _$jscoverage['plugins/undo.js'][156] = 0;
  _$jscoverage['plugins/undo.js'][157] = 0;
  _$jscoverage['plugins/undo.js'][158] = 0;
  _$jscoverage['plugins/undo.js'][162] = 0;
  _$jscoverage['plugins/undo.js'][163] = 0;
  _$jscoverage['plugins/undo.js'][164] = 0;
  _$jscoverage['plugins/undo.js'][165] = 0;
  _$jscoverage['plugins/undo.js'][168] = 0;
  _$jscoverage['plugins/undo.js'][169] = 0;
  _$jscoverage['plugins/undo.js'][170] = 0;
  _$jscoverage['plugins/undo.js'][173] = 0;
  _$jscoverage['plugins/undo.js'][174] = 0;
  _$jscoverage['plugins/undo.js'][176] = 0;
  _$jscoverage['plugins/undo.js'][177] = 0;
  _$jscoverage['plugins/undo.js'][178] = 0;
  _$jscoverage['plugins/undo.js'][181] = 0;
  _$jscoverage['plugins/undo.js'][183] = 0;
  _$jscoverage['plugins/undo.js'][186] = 0;
  _$jscoverage['plugins/undo.js'][191] = 0;
  _$jscoverage['plugins/undo.js'][200] = 0;
  _$jscoverage['plugins/undo.js'][201] = 0;
  _$jscoverage['plugins/undo.js'][202] = 0;
  _$jscoverage['plugins/undo.js'][203] = 0;
  _$jscoverage['plugins/undo.js'][205] = 0;
  _$jscoverage['plugins/undo.js'][206] = 0;
  _$jscoverage['plugins/undo.js'][210] = 0;
  _$jscoverage['plugins/undo.js'][215] = 0;
  _$jscoverage['plugins/undo.js'][216] = 0;
  _$jscoverage['plugins/undo.js'][218] = 0;
  _$jscoverage['plugins/undo.js'][219] = 0;
  _$jscoverage['plugins/undo.js'][220] = 0;
  _$jscoverage['plugins/undo.js'][221] = 0;
  _$jscoverage['plugins/undo.js'][222] = 0;
  _$jscoverage['plugins/undo.js'][224] = 0;
  _$jscoverage['plugins/undo.js'][225] = 0;
  _$jscoverage['plugins/undo.js'][226] = 0;
  _$jscoverage['plugins/undo.js'][227] = 0;
  _$jscoverage['plugins/undo.js'][229] = 0;
  _$jscoverage['plugins/undo.js'][230] = 0;
  _$jscoverage['plugins/undo.js'][232] = 0;
  _$jscoverage['plugins/undo.js'][233] = 0;
  _$jscoverage['plugins/undo.js'][235] = 0;
  _$jscoverage['plugins/undo.js'][236] = 0;
  _$jscoverage['plugins/undo.js'][237] = 0;
  _$jscoverage['plugins/undo.js'][238] = 0;
  _$jscoverage['plugins/undo.js'][240] = 0;
  _$jscoverage['plugins/undo.js'][241] = 0;
  _$jscoverage['plugins/undo.js'][242] = 0;
  _$jscoverage['plugins/undo.js'][243] = 0;
  _$jscoverage['plugins/undo.js'][244] = 0;
  _$jscoverage['plugins/undo.js'][245] = 0;
  _$jscoverage['plugins/undo.js'][248] = 0;
  _$jscoverage['plugins/undo.js'][250] = 0;
  _$jscoverage['plugins/undo.js'][253] = 0;
  _$jscoverage['plugins/undo.js'][254] = 0;
  _$jscoverage['plugins/undo.js'][255] = 0;
  _$jscoverage['plugins/undo.js'][256] = 0;
  _$jscoverage['plugins/undo.js'][260] = 0;
  _$jscoverage['plugins/undo.js'][261] = 0;
  _$jscoverage['plugins/undo.js'][262] = 0;
  _$jscoverage['plugins/undo.js'][263] = 0;
  _$jscoverage['plugins/undo.js'][264] = 0;
  _$jscoverage['plugins/undo.js'][265] = 0;
  _$jscoverage['plugins/undo.js'][266] = 0;
  _$jscoverage['plugins/undo.js'][267] = 0;
}
_$jscoverage['plugins/undo.js'].source = ["<span class=\"c\">///import core</span>","<span class=\"c\">///commands &#25764;&#38144;&#21644;&#37325;&#20570;</span>","<span class=\"c\">///commandsName  Undo,Redo</span>","<span class=\"c\">///commandsTitle  &#25764;&#38144;,&#37325;&#20570;</span>","<span class=\"c\">/*</span>","<span class=\"c\"> * @description &#22238;&#36864;</span>","<span class=\"c\"> * @author zhanyi</span>","<span class=\"c\"> */</span>","","UE<span class=\"k\">.</span>plugins<span class=\"k\">[</span><span class=\"s\">'undo'</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> saveSceneTimer<span class=\"k\">;</span>","    <span class=\"k\">var</span> me <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">,</span>","        maxUndoCount <span class=\"k\">=</span> me<span class=\"k\">.</span>options<span class=\"k\">.</span>maxUndoCount <span class=\"k\">||</span> <span class=\"s\">20</span><span class=\"k\">,</span>","        maxInputCount <span class=\"k\">=</span> me<span class=\"k\">.</span>options<span class=\"k\">.</span>maxInputCount <span class=\"k\">||</span> <span class=\"s\">20</span><span class=\"k\">,</span>","        fillchar <span class=\"k\">=</span> <span class=\"k\">new</span> RegExp<span class=\"k\">(</span>domUtils<span class=\"k\">.</span>fillChar <span class=\"k\">+</span> <span class=\"s\">'|&lt;</span><span class=\"t\">\\/</span><span class=\"s\">hr&gt;'</span><span class=\"k\">,</span> <span class=\"s\">'gi'</span><span class=\"k\">);</span><span class=\"c\">// ie&#20250;&#20135;&#29983;&#22810;&#20313;&#30340;&lt;/hr&gt;</span>","    <span class=\"k\">var</span> noNeedFillCharTags <span class=\"k\">=</span> <span class=\"k\">{</span>","        ol<span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span>ul<span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span>table<span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span>tbody<span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span>tr<span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span>body<span class=\"k\">:</span><span class=\"s\">1</span>","    <span class=\"k\">}</span><span class=\"k\">;</span>","    <span class=\"k\">var</span> orgState <span class=\"k\">=</span> me<span class=\"k\">.</span>options<span class=\"k\">.</span>autoClearEmptyNode<span class=\"k\">;</span>","    <span class=\"k\">function</span> compareAddr<span class=\"k\">(</span>indexA<span class=\"k\">,</span> indexB<span class=\"k\">)</span> <span class=\"k\">{</span>","        <span class=\"k\">if</span> <span class=\"k\">(</span>indexA<span class=\"k\">.</span>length <span class=\"k\">!=</span> indexB<span class=\"k\">.</span>length<span class=\"k\">)</span>","            <span class=\"k\">return</span> <span class=\"s\">0</span><span class=\"k\">;</span>","        <span class=\"k\">for</span> <span class=\"k\">(</span><span class=\"k\">var</span> i <span class=\"k\">=</span> <span class=\"s\">0</span><span class=\"k\">,</span> l <span class=\"k\">=</span> indexA<span class=\"k\">.</span>length<span class=\"k\">;</span> i <span class=\"k\">&lt;</span> l<span class=\"k\">;</span> i<span class=\"k\">++)</span> <span class=\"k\">{</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>indexA<span class=\"k\">[</span>i<span class=\"k\">]</span> <span class=\"k\">!=</span> indexB<span class=\"k\">[</span>i<span class=\"k\">])</span>","                <span class=\"k\">return</span> <span class=\"s\">0</span>","        <span class=\"k\">}</span>","        <span class=\"k\">return</span> <span class=\"s\">1</span><span class=\"k\">;</span>","    <span class=\"k\">}</span>","","    <span class=\"k\">function</span> compareRangeAddress<span class=\"k\">(</span>rngAddrA<span class=\"k\">,</span> rngAddrB<span class=\"k\">)</span> <span class=\"k\">{</span>","        <span class=\"k\">if</span> <span class=\"k\">(</span>rngAddrA<span class=\"k\">.</span>collapsed <span class=\"k\">!=</span> rngAddrB<span class=\"k\">.</span>collapsed<span class=\"k\">)</span> <span class=\"k\">{</span>","            <span class=\"k\">return</span> <span class=\"s\">0</span><span class=\"k\">;</span>","        <span class=\"k\">}</span>","        <span class=\"k\">if</span> <span class=\"k\">(!</span>compareAddr<span class=\"k\">(</span>rngAddrA<span class=\"k\">.</span>startAddress<span class=\"k\">,</span> rngAddrB<span class=\"k\">.</span>startAddress<span class=\"k\">)</span> <span class=\"k\">||</span> <span class=\"k\">!</span>compareAddr<span class=\"k\">(</span>rngAddrA<span class=\"k\">.</span>endAddress<span class=\"k\">,</span> rngAddrB<span class=\"k\">.</span>endAddress<span class=\"k\">))</span> <span class=\"k\">{</span>","            <span class=\"k\">return</span> <span class=\"s\">0</span><span class=\"k\">;</span>","        <span class=\"k\">}</span>","        <span class=\"k\">return</span> <span class=\"s\">1</span><span class=\"k\">;</span>","    <span class=\"k\">}</span>","","    <span class=\"k\">function</span> UndoManager<span class=\"k\">()</span> <span class=\"k\">{</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>list <span class=\"k\">=</span> <span class=\"k\">[];</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">=</span> <span class=\"s\">0</span><span class=\"k\">;</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>hasUndo <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">;</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>hasRedo <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">;</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>undo <span class=\"k\">=</span> <span class=\"k\">function</span> <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>hasUndo<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>list<span class=\"k\">[</span><span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">-</span> <span class=\"s\">1</span><span class=\"k\">]</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">.</span>length <span class=\"k\">==</span> <span class=\"s\">1</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                    <span class=\"k\">this</span><span class=\"k\">.</span>reset<span class=\"k\">();</span>","                    <span class=\"k\">return</span><span class=\"k\">;</span>","                <span class=\"k\">}</span>","                <span class=\"k\">while</span> <span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">[</span><span class=\"k\">this</span><span class=\"k\">.</span>index<span class=\"k\">].</span>content <span class=\"k\">==</span> <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">[</span><span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">-</span> <span class=\"s\">1</span><span class=\"k\">].</span>content<span class=\"k\">)</span> <span class=\"k\">{</span>","                    <span class=\"k\">this</span><span class=\"k\">.</span>index<span class=\"k\">--;</span>","                    <span class=\"k\">if</span> <span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">==</span> <span class=\"s\">0</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                        <span class=\"k\">return</span> <span class=\"k\">this</span><span class=\"k\">.</span>restore<span class=\"k\">(</span><span class=\"s\">0</span><span class=\"k\">);</span>","                    <span class=\"k\">}</span>","                <span class=\"k\">}</span>","                <span class=\"k\">this</span><span class=\"k\">.</span>restore<span class=\"k\">(--</span><span class=\"k\">this</span><span class=\"k\">.</span>index<span class=\"k\">);</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span><span class=\"k\">;</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>redo <span class=\"k\">=</span> <span class=\"k\">function</span> <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>hasRedo<span class=\"k\">)</span> <span class=\"k\">{</span>","                <span class=\"k\">while</span> <span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">[</span><span class=\"k\">this</span><span class=\"k\">.</span>index<span class=\"k\">].</span>content <span class=\"k\">==</span> <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">[</span><span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">+</span> <span class=\"s\">1</span><span class=\"k\">].</span>content<span class=\"k\">)</span> <span class=\"k\">{</span>","                    <span class=\"k\">this</span><span class=\"k\">.</span>index<span class=\"k\">++;</span>","                    <span class=\"k\">if</span> <span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">==</span> <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">.</span>length <span class=\"k\">-</span> <span class=\"s\">1</span><span class=\"k\">)</span> <span class=\"k\">{</span>","                        <span class=\"k\">return</span> <span class=\"k\">this</span><span class=\"k\">.</span>restore<span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>index<span class=\"k\">);</span>","                    <span class=\"k\">}</span>","                <span class=\"k\">}</span>","                <span class=\"k\">this</span><span class=\"k\">.</span>restore<span class=\"k\">(++</span><span class=\"k\">this</span><span class=\"k\">.</span>index<span class=\"k\">);</span>","            <span class=\"k\">}</span>","        <span class=\"k\">}</span><span class=\"k\">;</span>","","        <span class=\"k\">this</span><span class=\"k\">.</span>restore <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>editor<span class=\"k\">;</span>","            <span class=\"k\">var</span> scene <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">[</span><span class=\"k\">this</span><span class=\"k\">.</span>index<span class=\"k\">];</span>","            <span class=\"k\">var</span> root <span class=\"k\">=</span> UE<span class=\"k\">.</span>htmlparser<span class=\"k\">(</span>scene<span class=\"k\">.</span>content<span class=\"k\">.</span>replace<span class=\"k\">(</span>fillchar<span class=\"k\">,</span> <span class=\"s\">''</span><span class=\"k\">));</span>","            me<span class=\"k\">.</span>options<span class=\"k\">.</span>autoClearEmptyNode <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">;</span>","            me<span class=\"k\">.</span>filterInputRule<span class=\"k\">(</span>root<span class=\"k\">);</span>","            me<span class=\"k\">.</span>options<span class=\"k\">.</span>autoClearEmptyNode <span class=\"k\">=</span> orgState<span class=\"k\">;</span>","            <span class=\"c\">//trace:873</span>","            <span class=\"c\">//&#21435;&#25481;&#23637;&#20301;&#31526;</span>","            me<span class=\"k\">.</span>document<span class=\"k\">.</span>body<span class=\"k\">.</span>innerHTML <span class=\"k\">=</span> root<span class=\"k\">.</span>toHtml<span class=\"k\">();</span>","            me<span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'afterscencerestore'</span><span class=\"k\">);</span>","            <span class=\"c\">//&#22788;&#29702;undo&#21518;&#31354;&#26684;&#19981;&#23637;&#20301;&#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>","                utils<span class=\"k\">.</span>each<span class=\"k\">(</span>domUtils<span class=\"k\">.</span>getElementsByTagName<span class=\"k\">(</span>me<span class=\"k\">.</span>document<span class=\"k\">,</span><span class=\"s\">'td th caption p'</span><span class=\"k\">),</span><span class=\"k\">function</span><span class=\"k\">(</span>node<span class=\"k\">)</span><span class=\"k\">{</span>","                    <span class=\"k\">if</span><span class=\"k\">(</span>domUtils<span class=\"k\">.</span>isEmptyNode<span class=\"k\">(</span>node<span class=\"k\">))</span><span class=\"k\">{</span>","                        domUtils<span class=\"k\">.</span>fillNode<span class=\"k\">(</span>me<span class=\"k\">.</span>document<span class=\"k\">,</span> node<span class=\"k\">);</span>","                    <span class=\"k\">}</span>","                <span class=\"k\">}</span><span class=\"k\">)</span>","            <span class=\"k\">}</span>","","            <span class=\"k\">try</span><span class=\"k\">{</span>","                <span class=\"k\">var</span> rng <span class=\"k\">=</span> <span class=\"k\">new</span> dom<span class=\"k\">.</span>Range<span class=\"k\">(</span>me<span class=\"k\">.</span>document<span class=\"k\">).</span>moveToAddress<span class=\"k\">(</span>scene<span class=\"k\">.</span>address<span class=\"k\">);</span>","                rng<span class=\"k\">.</span>select<span class=\"k\">(</span>noNeedFillCharTags<span class=\"k\">[</span>rng<span class=\"k\">.</span>startContainer<span class=\"k\">.</span>nodeName<span class=\"k\">.</span>toLowerCase<span class=\"k\">()]);</span>","            <span class=\"k\">}</span><span class=\"k\">catch</span><span class=\"k\">(</span>e<span class=\"k\">)</span><span class=\"k\">{}</span>","","            <span class=\"k\">this</span><span class=\"k\">.</span>update<span class=\"k\">();</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>clearKey<span class=\"k\">();</span>","            <span class=\"c\">//&#19981;&#33021;&#25226;&#33258;&#24049;reset&#20102;</span>","            me<span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'reset'</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\">this</span><span class=\"k\">.</span>getScene <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>editor<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>","                rngAddress <span class=\"k\">=</span> rng<span class=\"k\">.</span>createAddress<span class=\"k\">(</span><span class=\"k\">false</span><span class=\"k\">,</span><span class=\"k\">true</span><span class=\"k\">);</span>","            me<span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'beforegetscene'</span><span class=\"k\">);</span>","            <span class=\"k\">var</span> root <span class=\"k\">=</span> UE<span class=\"k\">.</span>htmlparser<span class=\"k\">(</span>me<span class=\"k\">.</span>body<span class=\"k\">.</span>innerHTML<span class=\"k\">);</span>","            me<span class=\"k\">.</span>options<span class=\"k\">.</span>autoClearEmptyNode <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">;</span>","            me<span class=\"k\">.</span>filterOutputRule<span class=\"k\">(</span>root<span class=\"k\">);</span>","            me<span class=\"k\">.</span>options<span class=\"k\">.</span>autoClearEmptyNode <span class=\"k\">=</span> orgState<span class=\"k\">;</span>","            <span class=\"k\">var</span> cont <span class=\"k\">=</span> root<span class=\"k\">.</span>toHtml<span class=\"k\">();</span>","            <span class=\"c\">//trace:3461</span>","            <span class=\"c\">//&#36825;&#20010;&#20250;&#24341;&#36215;&#22238;&#36864;&#26102;&#23548;&#33268;&#31354;&#26684;&#20002;&#22833;&#30340;&#24773;&#20917;</span>","<span class=\"c\">//            browser.ie &amp;&amp; (cont = cont.replace(/&gt;&amp;nbsp;&lt;/g, '&gt;&lt;').replace(/\\s*&lt;/g, '&lt;').replace(/&gt;\\s*/g, '&gt;'));</span>","            me<span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'aftergetscene'</span><span class=\"k\">);</span>","","            <span class=\"k\">return</span> <span class=\"k\">{</span>","                address<span class=\"k\">:</span>rngAddress<span class=\"k\">,</span>","                content<span class=\"k\">:</span>cont","            <span class=\"k\">}</span>","        <span class=\"k\">}</span><span class=\"k\">;</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>save <span class=\"k\">=</span> <span class=\"k\">function</span> <span class=\"k\">(</span>notCompareRange<span class=\"k\">,</span>notSetCursor<span class=\"k\">)</span> <span class=\"k\">{</span>","            clearTimeout<span class=\"k\">(</span>saveSceneTimer<span class=\"k\">);</span>","            <span class=\"k\">var</span> currentScene <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>getScene<span class=\"k\">(</span>notSetCursor<span class=\"k\">),</span>","                lastScene <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">[</span><span class=\"k\">this</span><span class=\"k\">.</span>index<span class=\"k\">];</span>","            <span class=\"c\">//&#20869;&#23481;&#30456;&#21516;&#20301;&#32622;&#30456;&#21516;&#19981;&#23384;</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>lastScene <span class=\"k\">&amp;&amp;</span> lastScene<span class=\"k\">.</span>content <span class=\"k\">==</span> currentScene<span class=\"k\">.</span>content <span class=\"k\">&amp;&amp;</span>","                <span class=\"k\">(</span> notCompareRange <span class=\"k\">?</span> <span class=\"s\">1</span> <span class=\"k\">:</span> compareRangeAddress<span class=\"k\">(</span>lastScene<span class=\"k\">.</span>address<span class=\"k\">,</span> currentScene<span class=\"k\">.</span>address<span class=\"k\">)</span> <span class=\"k\">)</span>","                <span class=\"k\">)</span> <span class=\"k\">{</span>","                <span class=\"k\">return</span><span class=\"k\">;</span>","            <span class=\"k\">}</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>list <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">.</span>slice<span class=\"k\">(</span><span class=\"s\">0</span><span class=\"k\">,</span> <span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">+</span> <span class=\"s\">1</span><span class=\"k\">);</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">.</span>push<span class=\"k\">(</span>currentScene<span class=\"k\">);</span>","            <span class=\"c\">//&#22914;&#26524;&#22823;&#20110;&#26368;&#22823;&#25968;&#37327;&#20102;&#65292;&#23601;&#25226;&#26368;&#21069;&#30340;&#21076;&#38500;</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">.</span>length <span class=\"k\">&gt;</span> maxUndoCount<span class=\"k\">)</span> <span class=\"k\">{</span>","                <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">.</span>shift<span class=\"k\">();</span>","            <span class=\"k\">}</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">.</span>length <span class=\"k\">-</span> <span class=\"s\">1</span><span class=\"k\">;</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>clearKey<span class=\"k\">();</span>","            <span class=\"c\">//&#36319;&#26032;undo/redo&#29366;&#24577;</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>update<span class=\"k\">();</span>","","        <span class=\"k\">}</span><span class=\"k\">;</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>update <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>hasRedo <span class=\"k\">=</span> <span class=\"k\">!!</span><span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">[</span><span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">+</span> <span class=\"s\">1</span><span class=\"k\">];</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>hasUndo <span class=\"k\">=</span> <span class=\"k\">!!</span><span class=\"k\">this</span><span class=\"k\">.</span>list<span class=\"k\">[</span><span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">-</span> <span class=\"s\">1</span><span class=\"k\">];</span>","        <span class=\"k\">}</span><span class=\"k\">;</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>reset <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>list <span class=\"k\">=</span> <span class=\"k\">[];</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>index <span class=\"k\">=</span> <span class=\"s\">0</span><span class=\"k\">;</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>hasUndo <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">;</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>hasRedo <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">;</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>clearKey<span class=\"k\">();</span>","        <span class=\"k\">}</span><span class=\"k\">;</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>clearKey <span class=\"k\">=</span> <span class=\"k\">function</span> <span class=\"k\">()</span> <span class=\"k\">{</span>","            keycont <span class=\"k\">=</span> <span class=\"s\">0</span><span class=\"k\">;</span>","            lastKeyCode <span class=\"k\">=</span> <span class=\"k\">null</span><span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">;</span>","    <span class=\"k\">}</span>","","    me<span class=\"k\">.</span>undoManger <span class=\"k\">=</span> <span class=\"k\">new</span> UndoManager<span class=\"k\">();</span>","    me<span class=\"k\">.</span>undoManger<span class=\"k\">.</span>editor <span class=\"k\">=</span> me<span class=\"k\">;</span>","    <span class=\"k\">function</span> saveScene<span class=\"k\">()</span> <span class=\"k\">{</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>undoManger<span class=\"k\">.</span>save<span class=\"k\">();</span>","    <span class=\"k\">}</span>","","    me<span class=\"k\">.</span>addListener<span class=\"k\">(</span><span class=\"s\">'saveScene'</span><span class=\"k\">,</span> <span class=\"k\">function</span> <span class=\"k\">()</span> <span class=\"k\">{</span>","        <span class=\"k\">var</span> args <span class=\"k\">=</span> Array<span class=\"k\">.</span>prototype<span class=\"k\">.</span>splice<span class=\"k\">.</span>call<span class=\"k\">(</span>arguments<span class=\"k\">,</span><span class=\"s\">1</span><span class=\"k\">);</span>","        <span class=\"k\">this</span><span class=\"k\">.</span>undoManger<span class=\"k\">.</span>save<span class=\"k\">.</span>apply<span class=\"k\">(</span><span class=\"k\">this</span><span class=\"k\">.</span>undoManger<span class=\"k\">,</span>args<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\">'beforeexeccommand'</span><span class=\"k\">,</span> saveScene<span class=\"k\">);</span>","    me<span class=\"k\">.</span>addListener<span class=\"k\">(</span><span class=\"s\">'afterexeccommand'</span><span class=\"k\">,</span> saveScene<span class=\"k\">);</span>","","    me<span class=\"k\">.</span>addListener<span class=\"k\">(</span><span class=\"s\">'reset'</span><span class=\"k\">,</span> <span class=\"k\">function</span> <span class=\"k\">(</span>type<span class=\"k\">,</span> exclude<span class=\"k\">)</span> <span class=\"k\">{</span>","        <span class=\"k\">if</span> <span class=\"k\">(!</span>exclude<span class=\"k\">)</span> <span class=\"k\">{</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>undoManger<span class=\"k\">.</span>reset<span class=\"k\">();</span>","        <span class=\"k\">}</span>","    <span class=\"k\">}</span><span class=\"k\">);</span>","    me<span class=\"k\">.</span>commands<span class=\"k\">[</span><span class=\"s\">'redo'</span><span class=\"k\">]</span> <span class=\"k\">=</span> me<span class=\"k\">.</span>commands<span class=\"k\">[</span><span class=\"s\">'undo'</span><span class=\"k\">]</span> <span class=\"k\">=</span> <span class=\"k\">{</span>","        execCommand<span class=\"k\">:</span><span class=\"k\">function</span> <span class=\"k\">(</span>cmdName<span class=\"k\">)</span> <span class=\"k\">{</span>","            <span class=\"k\">this</span><span class=\"k\">.</span>undoManger<span class=\"k\">[</span>cmdName<span class=\"k\">]();</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        queryCommandState<span class=\"k\">:</span><span class=\"k\">function</span> <span class=\"k\">(</span>cmdName<span class=\"k\">)</span> <span class=\"k\">{</span>","            <span class=\"k\">return</span> <span class=\"k\">this</span><span class=\"k\">.</span>undoManger<span class=\"k\">[</span><span class=\"s\">'has'</span> <span class=\"k\">+</span> <span class=\"k\">(</span>cmdName<span class=\"k\">.</span>toLowerCase<span class=\"k\">()</span> <span class=\"k\">==</span> <span class=\"s\">'undo'</span> <span class=\"k\">?</span> <span class=\"s\">'Undo'</span> <span class=\"k\">:</span> <span class=\"s\">'Redo'</span><span class=\"k\">)]</span> <span class=\"k\">?</span> <span class=\"s\">0</span> <span class=\"k\">:</span> <span class=\"k\">-</span><span class=\"s\">1</span><span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">,</span>","        notNeedUndo<span class=\"k\">:</span><span class=\"s\">1</span>","    <span class=\"k\">}</span><span class=\"k\">;</span>","","    <span class=\"k\">var</span> keys <span class=\"k\">=</span> <span class=\"k\">{</span>","            <span class=\"c\">//  /*Backspace*/ 8:1, /*Delete*/ 46:1,</span>","            <span class=\"c\">/*Shift*/</span> <span class=\"s\">16</span><span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span> <span class=\"c\">/*Ctrl*/</span> <span class=\"s\">17</span><span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span> <span class=\"c\">/*Alt*/</span> <span class=\"s\">18</span><span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span>","            <span class=\"s\">37</span><span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span> <span class=\"s\">38</span><span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span> <span class=\"s\">39</span><span class=\"k\">:</span><span class=\"s\">1</span><span class=\"k\">,</span> <span class=\"s\">40</span><span class=\"k\">:</span><span class=\"s\">1</span>","","        <span class=\"k\">}</span><span class=\"k\">,</span>","        keycont <span class=\"k\">=</span> <span class=\"s\">0</span><span class=\"k\">,</span>","        lastKeyCode<span class=\"k\">;</span>","    <span class=\"c\">//&#36755;&#20837;&#27861;&#29366;&#24577;&#19979;&#19981;&#35745;&#31639;&#23383;&#31526;&#25968;</span>","    <span class=\"k\">var</span> inputType <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">;</span>","    me<span class=\"k\">.</span>addListener<span class=\"k\">(</span><span class=\"s\">'ready'</span><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\">'compositionstart'</span><span class=\"k\">,</span> <span class=\"k\">function</span> <span class=\"k\">()</span> <span class=\"k\">{</span>","            inputType <span class=\"k\">=</span> <span class=\"k\">true</span><span class=\"k\">;</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\">'compositionend'</span><span class=\"k\">,</span> <span class=\"k\">function</span> <span class=\"k\">()</span> <span class=\"k\">{</span>","            inputType <span class=\"k\">=</span> <span class=\"k\">false</span><span class=\"k\">;</span>","        <span class=\"k\">}</span><span class=\"k\">)</span>","    <span class=\"k\">}</span><span class=\"k\">);</span>","    <span class=\"c\">//&#24555;&#25463;&#38190;</span>","    me<span class=\"k\">.</span>addshortcutkey<span class=\"k\">(</span><span class=\"k\">{</span>","        <span class=\"s\">\"Undo\"</span><span class=\"k\">:</span><span class=\"s\">\"ctrl+90\"</span><span class=\"k\">,</span> <span class=\"c\">//undo</span>","        <span class=\"s\">\"Redo\"</span><span class=\"k\">:</span><span class=\"s\">\"ctrl+89\"</span> <span class=\"c\">//redo</span>","","    <span class=\"k\">}</span><span class=\"k\">);</span>","    <span class=\"k\">var</span> isCollapsed <span class=\"k\">=</span> <span class=\"k\">true</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> me <span class=\"k\">=</span> <span class=\"k\">this</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>keys<span class=\"k\">[</span>keyCode<span class=\"k\">]</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>evt<span class=\"k\">.</span>ctrlKey <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>evt<span class=\"k\">.</span>metaKey <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>evt<span class=\"k\">.</span>shiftKey <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>evt<span class=\"k\">.</span>altKey<span class=\"k\">)</span> <span class=\"k\">{</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>inputType<span class=\"k\">)</span>","                <span class=\"k\">return</span><span class=\"k\">;</span>","","            <span class=\"k\">if</span><span class=\"k\">(!</span>me<span class=\"k\">.</span>selection<span class=\"k\">.</span>getRange<span class=\"k\">().</span>collapsed<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\">false</span><span class=\"k\">,</span><span class=\"k\">true</span><span class=\"k\">);</span>","                isCollapsed <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\">if</span> <span class=\"k\">(</span>me<span class=\"k\">.</span>undoManger<span class=\"k\">.</span>list<span class=\"k\">.</span>length <span class=\"k\">==</span> <span class=\"s\">0</span><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\">true</span><span class=\"k\">);</span>","            <span class=\"k\">}</span>","            clearTimeout<span class=\"k\">(</span>saveSceneTimer<span class=\"k\">);</span>","            <span class=\"k\">function</span> save<span class=\"k\">(</span>cont<span class=\"k\">)</span><span class=\"k\">{</span>","","                <span class=\"k\">if</span> <span class=\"k\">(</span>cont<span class=\"k\">.</span>selection<span class=\"k\">.</span>getRange<span class=\"k\">().</span>collapsed<span class=\"k\">)</span>","                    cont<span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'contentchange'</span><span class=\"k\">);</span>","                cont<span class=\"k\">.</span>undoManger<span class=\"k\">.</span>save<span class=\"k\">(</span><span class=\"k\">false</span><span class=\"k\">,</span><span class=\"k\">true</span><span class=\"k\">);</span>","                cont<span class=\"k\">.</span>fireEvent<span class=\"k\">(</span><span class=\"s\">'selectionchange'</span><span class=\"k\">);</span>","            <span class=\"k\">}</span>","            saveSceneTimer <span class=\"k\">=</span> setTimeout<span class=\"k\">(</span><span class=\"k\">function</span><span class=\"k\">()</span><span class=\"k\">{</span>","                <span class=\"k\">if</span><span class=\"k\">(</span>inputType<span class=\"k\">)</span><span class=\"k\">{</span>","                    <span class=\"k\">var</span> interalTimer <span class=\"k\">=</span> setInterval<span class=\"k\">(</span><span class=\"k\">function</span><span class=\"k\">()</span><span class=\"k\">{</span>","                        <span class=\"k\">if</span><span class=\"k\">(!</span>inputType<span class=\"k\">)</span><span class=\"k\">{</span>","                            save<span class=\"k\">(</span>me<span class=\"k\">);</span>","                            clearInterval<span class=\"k\">(</span>interalTimer<span class=\"k\">)</span>","                        <span class=\"k\">}</span>","                    <span class=\"k\">}</span><span class=\"k\">,</span><span class=\"s\">300</span><span class=\"k\">)</span>","                    <span class=\"k\">return</span><span class=\"k\">;</span>","                <span class=\"k\">}</span>","                save<span class=\"k\">(</span>me<span class=\"k\">);</span>","            <span class=\"k\">}</span><span class=\"k\">,</span><span class=\"s\">200</span><span class=\"k\">);</span>","","            lastKeyCode <span class=\"k\">=</span> keyCode<span class=\"k\">;</span>","            keycont<span class=\"k\">++;</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>keycont <span class=\"k\">&gt;=</span> maxInputCount <span class=\"k\">)</span> <span class=\"k\">{</span>","                save<span class=\"k\">(</span>me<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>keys<span class=\"k\">[</span>keyCode<span class=\"k\">]</span> <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>evt<span class=\"k\">.</span>ctrlKey <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>evt<span class=\"k\">.</span>metaKey <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>evt<span class=\"k\">.</span>shiftKey <span class=\"k\">&amp;&amp;</span> <span class=\"k\">!</span>evt<span class=\"k\">.</span>altKey<span class=\"k\">)</span> <span class=\"k\">{</span>","            <span class=\"k\">if</span> <span class=\"k\">(</span>inputType<span class=\"k\">)</span>","                <span class=\"k\">return</span><span class=\"k\">;</span>","            <span class=\"k\">if</span><span class=\"k\">(!</span>isCollapsed<span class=\"k\">)</span><span class=\"k\">{</span>","                <span class=\"k\">this</span><span class=\"k\">.</span>undoManger<span class=\"k\">.</span>save<span class=\"k\">(</span><span class=\"k\">false</span><span class=\"k\">,</span><span class=\"k\">true</span><span class=\"k\">);</span>","                isCollapsed <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>","","<span class=\"k\">}</span><span class=\"k\">;</span>"];
_$jscoverage['plugins/undo.js'][10]++;
UE.plugins.undo = (function () {
  _$jscoverage['plugins/undo.js'][11]++;
  var saveSceneTimer;
  _$jscoverage['plugins/undo.js'][12]++;
  var me = this, maxUndoCount = (me.options.maxUndoCount || 20), maxInputCount = (me.options.maxInputCount || 20), fillchar = new RegExp((domUtils.fillChar + "|</hr>"), "gi");
  _$jscoverage['plugins/undo.js'][16]++;
  var noNeedFillCharTags = {ol: 1, ul: 1, table: 1, tbody: 1, tr: 1, body: 1};
  _$jscoverage['plugins/undo.js'][19]++;
  var orgState = me.options.autoClearEmptyNode;
  _$jscoverage['plugins/undo.js'][20]++;
  function compareAddr(indexA, indexB) {
    _$jscoverage['plugins/undo.js'][21]++;
    if ((indexA.length != indexB.length)) {
      _$jscoverage['plugins/undo.js'][22]++;
      return 0;
    }
    _$jscoverage['plugins/undo.js'][23]++;
    for (var i = 0, l = indexA.length; (i < l); (i++)) {
      _$jscoverage['plugins/undo.js'][24]++;
      if ((indexA[i] != indexB[i])) {
        _$jscoverage['plugins/undo.js'][25]++;
        return 0;
      }
}
    _$jscoverage['plugins/undo.js'][27]++;
    return 1;
}
  _$jscoverage['plugins/undo.js'][30]++;
  function compareRangeAddress(rngAddrA, rngAddrB) {
    _$jscoverage['plugins/undo.js'][31]++;
    if ((rngAddrA.collapsed != rngAddrB.collapsed)) {
      _$jscoverage['plugins/undo.js'][32]++;
      return 0;
    }
    _$jscoverage['plugins/undo.js'][34]++;
    if (((! compareAddr(rngAddrA.startAddress, rngAddrB.startAddress)) || (! compareAddr(rngAddrA.endAddress, rngAddrB.endAddress)))) {
      _$jscoverage['plugins/undo.js'][35]++;
      return 0;
    }
    _$jscoverage['plugins/undo.js'][37]++;
    return 1;
}
  _$jscoverage['plugins/undo.js'][40]++;
  function UndoManager() {
    _$jscoverage['plugins/undo.js'][41]++;
    this.list = [];
    _$jscoverage['plugins/undo.js'][42]++;
    this.index = 0;
    _$jscoverage['plugins/undo.js'][43]++;
    this.hasUndo = false;
    _$jscoverage['plugins/undo.js'][44]++;
    this.hasRedo = false;
    _$jscoverage['plugins/undo.js'][45]++;
    this.undo = (function () {
  _$jscoverage['plugins/undo.js'][46]++;
  if (this.hasUndo) {
    _$jscoverage['plugins/undo.js'][47]++;
    if (((! this.list[(this.index - 1)]) && (this.list.length == 1))) {
      _$jscoverage['plugins/undo.js'][48]++;
      this.reset();
      _$jscoverage['plugins/undo.js'][49]++;
      return;
    }
    _$jscoverage['plugins/undo.js'][51]++;
    while ((this.list[this.index].content == this.list[(this.index - 1)].content)) {
      _$jscoverage['plugins/undo.js'][52]++;
      (this.index--);
      _$jscoverage['plugins/undo.js'][53]++;
      if ((this.index == 0)) {
        _$jscoverage['plugins/undo.js'][54]++;
        return this.restore(0);
      }
}
    _$jscoverage['plugins/undo.js'][57]++;
    this.restore((--this.index));
  }
});
    _$jscoverage['plugins/undo.js'][60]++;
    this.redo = (function () {
  _$jscoverage['plugins/undo.js'][61]++;
  if (this.hasRedo) {
    _$jscoverage['plugins/undo.js'][62]++;
    while ((this.list[this.index].content == this.list[(this.index + 1)].content)) {
      _$jscoverage['plugins/undo.js'][63]++;
      (this.index++);
      _$jscoverage['plugins/undo.js'][64]++;
      if ((this.index == (this.list.length - 1))) {
        _$jscoverage['plugins/undo.js'][65]++;
        return this.restore(this.index);
      }
}
    _$jscoverage['plugins/undo.js'][68]++;
    this.restore((++this.index));
  }
});
    _$jscoverage['plugins/undo.js'][72]++;
    this.restore = (function () {
  _$jscoverage['plugins/undo.js'][73]++;
  var me = this.editor;
  _$jscoverage['plugins/undo.js'][74]++;
  var scene = this.list[this.index];
  _$jscoverage['plugins/undo.js'][75]++;
  var root = UE.htmlparser(scene.content.replace(fillchar, ""));
  _$jscoverage['plugins/undo.js'][76]++;
  me.options.autoClearEmptyNode = false;
  _$jscoverage['plugins/undo.js'][77]++;
  me.filterInputRule(root);
  _$jscoverage['plugins/undo.js'][78]++;
  me.options.autoClearEmptyNode = orgState;
  _$jscoverage['plugins/undo.js'][81]++;
  me.document.body.innerHTML = root.toHtml();
  _$jscoverage['plugins/undo.js'][82]++;
  me.fireEvent("afterscencerestore");
  _$jscoverage['plugins/undo.js'][84]++;
  if (browser.ie) {
    _$jscoverage['plugins/undo.js'][85]++;
    utils.each(domUtils.getElementsByTagName(me.document, "td th caption p"), (function (node) {
  _$jscoverage['plugins/undo.js'][86]++;
  if (domUtils.isEmptyNode(node)) {
    _$jscoverage['plugins/undo.js'][87]++;
    domUtils.fillNode(me.document, node);
  }
}));
  }
  _$jscoverage['plugins/undo.js'][92]++;
  try {
    _$jscoverage['plugins/undo.js'][93]++;
    var rng = new (dom.Range)(me.document).moveToAddress(scene.address);
    _$jscoverage['plugins/undo.js'][94]++;
    rng.select(noNeedFillCharTags[rng.startContainer.nodeName.toLowerCase()]);
  }
  catch (e) {
  }
  _$jscoverage['plugins/undo.js'][97]++;
  this.update();
  _$jscoverage['plugins/undo.js'][98]++;
  this.clearKey();
  _$jscoverage['plugins/undo.js'][100]++;
  me.fireEvent("reset", true);
});
    _$jscoverage['plugins/undo.js'][103]++;
    this.getScene = (function () {
  _$jscoverage['plugins/undo.js'][104]++;
  var me = this.editor;
  _$jscoverage['plugins/undo.js'][105]++;
  var rng = me.selection.getRange(), rngAddress = rng.createAddress(false, true);
  _$jscoverage['plugins/undo.js'][107]++;
  me.fireEvent("beforegetscene");
  _$jscoverage['plugins/undo.js'][108]++;
  var root = UE.htmlparser(me.body.innerHTML);
  _$jscoverage['plugins/undo.js'][109]++;
  me.options.autoClearEmptyNode = false;
  _$jscoverage['plugins/undo.js'][110]++;
  me.filterOutputRule(root);
  _$jscoverage['plugins/undo.js'][111]++;
  me.options.autoClearEmptyNode = orgState;
  _$jscoverage['plugins/undo.js'][112]++;
  var cont = root.toHtml();
  _$jscoverage['plugins/undo.js'][116]++;
  me.fireEvent("aftergetscene");
  _$jscoverage['plugins/undo.js'][118]++;
  return ({address: rngAddress, content: cont});
});
    _$jscoverage['plugins/undo.js'][123]++;
    this.save = (function (notCompareRange, notSetCursor) {
  _$jscoverage['plugins/undo.js'][124]++;
  clearTimeout(saveSceneTimer);
  _$jscoverage['plugins/undo.js'][125]++;
  var currentScene = this.getScene(notSetCursor), lastScene = this.list[this.index];
  _$jscoverage['plugins/undo.js'][128]++;
  if ((lastScene && (lastScene.content == currentScene.content) && (notCompareRange? 1: compareRangeAddress(lastScene.address, currentScene.address)))) {
    _$jscoverage['plugins/undo.js'][131]++;
    return;
  }
  _$jscoverage['plugins/undo.js'][133]++;
  this.list = this.list.slice(0, (this.index + 1));
  _$jscoverage['plugins/undo.js'][134]++;
  this.list.push(currentScene);
  _$jscoverage['plugins/undo.js'][136]++;
  if ((this.list.length > maxUndoCount)) {
    _$jscoverage['plugins/undo.js'][137]++;
    this.list.shift();
  }
  _$jscoverage['plugins/undo.js'][139]++;
  this.index = (this.list.length - 1);
  _$jscoverage['plugins/undo.js'][140]++;
  this.clearKey();
  _$jscoverage['plugins/undo.js'][142]++;
  this.update();
});
    _$jscoverage['plugins/undo.js'][145]++;
    this.update = (function () {
  _$jscoverage['plugins/undo.js'][146]++;
  this.hasRedo = (! (! this.list[(this.index + 1)]));
  _$jscoverage['plugins/undo.js'][147]++;
  this.hasUndo = (! (! this.list[(this.index - 1)]));
});
    _$jscoverage['plugins/undo.js'][149]++;
    this.reset = (function () {
  _$jscoverage['plugins/undo.js'][150]++;
  this.list = [];
  _$jscoverage['plugins/undo.js'][151]++;
  this.index = 0;
  _$jscoverage['plugins/undo.js'][152]++;
  this.hasUndo = false;
  _$jscoverage['plugins/undo.js'][153]++;
  this.hasRedo = false;
  _$jscoverage['plugins/undo.js'][154]++;
  this.clearKey();
});
    _$jscoverage['plugins/undo.js'][156]++;
    this.clearKey = (function () {
  _$jscoverage['plugins/undo.js'][157]++;
  keycont = 0;
  _$jscoverage['plugins/undo.js'][158]++;
  lastKeyCode = null;
});
}
  _$jscoverage['plugins/undo.js'][162]++;
  me.undoManger = new UndoManager();
  _$jscoverage['plugins/undo.js'][163]++;
  me.undoManger.editor = me;
  _$jscoverage['plugins/undo.js'][164]++;
  function saveScene() {
    _$jscoverage['plugins/undo.js'][165]++;
    this.undoManger.save();
}
  _$jscoverage['plugins/undo.js'][168]++;
  me.addListener("saveScene", (function () {
  _$jscoverage['plugins/undo.js'][169]++;
  var args = Array.prototype.splice.call(arguments, 1);
  _$jscoverage['plugins/undo.js'][170]++;
  this.undoManger.save.apply(this.undoManger, args);
}));
  _$jscoverage['plugins/undo.js'][173]++;
  me.addListener("beforeexeccommand", saveScene);
  _$jscoverage['plugins/undo.js'][174]++;
  me.addListener("afterexeccommand", saveScene);
  _$jscoverage['plugins/undo.js'][176]++;
  me.addListener("reset", (function (type, exclude) {
  _$jscoverage['plugins/undo.js'][177]++;
  if ((! exclude)) {
    _$jscoverage['plugins/undo.js'][178]++;
    this.undoManger.reset();
  }
}));
  _$jscoverage['plugins/undo.js'][181]++;
  me.commands.redo = (me.commands.undo = {execCommand: (function (cmdName) {
  _$jscoverage['plugins/undo.js'][183]++;
  (this.undoManger[cmdName])();
}), queryCommandState: (function (cmdName) {
  _$jscoverage['plugins/undo.js'][186]++;
  return (this.undoManger[("has" + ((cmdName.toLowerCase() == "undo")? "Undo": "Redo"))]? 0: -1);
}), notNeedUndo: 1});
  _$jscoverage['plugins/undo.js'][191]++;
  var keys = {16: 1, 17: 1, 18: 1, 37: 1, 38: 1, 39: 1, 40: 1}, keycont = 0, lastKeyCode;
  _$jscoverage['plugins/undo.js'][200]++;
  var inputType = false;
  _$jscoverage['plugins/undo.js'][201]++;
  me.addListener("ready", (function () {
  _$jscoverage['plugins/undo.js'][202]++;
  domUtils.on(this.body, "compositionstart", (function () {
  _$jscoverage['plugins/undo.js'][203]++;
  inputType = true;
}));
  _$jscoverage['plugins/undo.js'][205]++;
  domUtils.on(this.body, "compositionend", (function () {
  _$jscoverage['plugins/undo.js'][206]++;
  inputType = false;
}));
}));
  _$jscoverage['plugins/undo.js'][210]++;
  me.addshortcutkey({"Undo": "ctrl+90", "Redo": "ctrl+89"});
  _$jscoverage['plugins/undo.js'][215]++;
  var isCollapsed = true;
  _$jscoverage['plugins/undo.js'][216]++;
  me.addListener("keydown", (function (type, evt) {
  _$jscoverage['plugins/undo.js'][218]++;
  var me = this;
  _$jscoverage['plugins/undo.js'][219]++;
  var keyCode = (evt.keyCode || evt.which);
  _$jscoverage['plugins/undo.js'][220]++;
  if (((! keys[keyCode]) && (! evt.ctrlKey) && (! evt.metaKey) && (! evt.shiftKey) && (! evt.altKey))) {
    _$jscoverage['plugins/undo.js'][221]++;
    if (inputType) {
      _$jscoverage['plugins/undo.js'][222]++;
      return;
    }
    _$jscoverage['plugins/undo.js'][224]++;
    if ((! me.selection.getRange().collapsed)) {
      _$jscoverage['plugins/undo.js'][225]++;
      me.undoManger.save(false, true);
      _$jscoverage['plugins/undo.js'][226]++;
      isCollapsed = false;
      _$jscoverage['plugins/undo.js'][227]++;
      return;
    }
    _$jscoverage['plugins/undo.js'][229]++;
    if ((me.undoManger.list.length == 0)) {
      _$jscoverage['plugins/undo.js'][230]++;
      me.undoManger.save(true);
    }
    _$jscoverage['plugins/undo.js'][232]++;
    clearTimeout(saveSceneTimer);
    _$jscoverage['plugins/undo.js'][233]++;
    function save(cont) {
      _$jscoverage['plugins/undo.js'][235]++;
      if (cont.selection.getRange().collapsed) {
        _$jscoverage['plugins/undo.js'][236]++;
        cont.fireEvent("contentchange");
      }
      _$jscoverage['plugins/undo.js'][237]++;
      cont.undoManger.save(false, true);
      _$jscoverage['plugins/undo.js'][238]++;
      cont.fireEvent("selectionchange");
}
    _$jscoverage['plugins/undo.js'][240]++;
    saveSceneTimer = setTimeout((function () {
  _$jscoverage['plugins/undo.js'][241]++;
  if (inputType) {
    _$jscoverage['plugins/undo.js'][242]++;
    var interalTimer = setInterval((function () {
  _$jscoverage['plugins/undo.js'][243]++;
  if ((! inputType)) {
    _$jscoverage['plugins/undo.js'][244]++;
    save(me);
    _$jscoverage['plugins/undo.js'][245]++;
    clearInterval(interalTimer);
  }
}), 300);
    _$jscoverage['plugins/undo.js'][248]++;
    return;
  }
  _$jscoverage['plugins/undo.js'][250]++;
  save(me);
}), 200);
    _$jscoverage['plugins/undo.js'][253]++;
    lastKeyCode = keyCode;
    _$jscoverage['plugins/undo.js'][254]++;
    (keycont++);
    _$jscoverage['plugins/undo.js'][255]++;
    if ((keycont >= maxInputCount)) {
      _$jscoverage['plugins/undo.js'][256]++;
      save(me);
    }
  }
}));
  _$jscoverage['plugins/undo.js'][260]++;
  me.addListener("keyup", (function (type, evt) {
  _$jscoverage['plugins/undo.js'][261]++;
  var keyCode = (evt.keyCode || evt.which);
  _$jscoverage['plugins/undo.js'][262]++;
  if (((! keys[keyCode]) && (! evt.ctrlKey) && (! evt.metaKey) && (! evt.shiftKey) && (! evt.altKey))) {
    _$jscoverage['plugins/undo.js'][263]++;
    if (inputType) {
      _$jscoverage['plugins/undo.js'][264]++;
      return;
    }
    _$jscoverage['plugins/undo.js'][265]++;
    if ((! isCollapsed)) {
      _$jscoverage['plugins/undo.js'][266]++;
      this.undoManger.save(false, true);
      _$jscoverage['plugins/undo.js'][267]++;
      isCollapsed = true;
    }
  }
}));
});
