/* 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/snapscreen.js']) {
  _$jscoverage['plugins/snapscreen.js'] = [];
  _$jscoverage['plugins/snapscreen.js'][20] = 0;
  _$jscoverage['plugins/snapscreen.js'][21] = 0;
  _$jscoverage['plugins/snapscreen.js'][25] = 0;
  _$jscoverage['plugins/snapscreen.js'][31] = 0;
  _$jscoverage['plugins/snapscreen.js'][33] = 0;
  _$jscoverage['plugins/snapscreen.js'][34] = 0;
  _$jscoverage['plugins/snapscreen.js'][35] = 0;
  _$jscoverage['plugins/snapscreen.js'][36] = 0;
  _$jscoverage['plugins/snapscreen.js'][37] = 0;
  _$jscoverage['plugins/snapscreen.js'][38] = 0;
  _$jscoverage['plugins/snapscreen.js'][39] = 0;
  _$jscoverage['plugins/snapscreen.js'][41] = 0;
  _$jscoverage['plugins/snapscreen.js'][42] = 0;
  _$jscoverage['plugins/snapscreen.js'][43] = 0;
  _$jscoverage['plugins/snapscreen.js'][44] = 0;
  _$jscoverage['plugins/snapscreen.js'][48] = 0;
  _$jscoverage['plugins/snapscreen.js'][50] = 0;
  _$jscoverage['plugins/snapscreen.js'][51] = 0;
  _$jscoverage['plugins/snapscreen.js'][52] = 0;
  _$jscoverage['plugins/snapscreen.js'][54] = 0;
  _$jscoverage['plugins/snapscreen.js'][55] = 0;
  _$jscoverage['plugins/snapscreen.js'][58] = 0;
  _$jscoverage['plugins/snapscreen.js'][59] = 0;
  _$jscoverage['plugins/snapscreen.js'][60] = 0;
  _$jscoverage['plugins/snapscreen.js'][62] = 0;
  _$jscoverage['plugins/snapscreen.js'][68] = 0;
  _$jscoverage['plugins/snapscreen.js'][71] = 0;
  _$jscoverage['plugins/snapscreen.js'][72] = 0;
  _$jscoverage['plugins/snapscreen.js'][74] = 0;
  _$jscoverage['plugins/snapscreen.js'][75] = 0;
  _$jscoverage['plugins/snapscreen.js'][76] = 0;
  _$jscoverage['plugins/snapscreen.js'][77] = 0;
  _$jscoverage['plugins/snapscreen.js'][78] = 0;
  _$jscoverage['plugins/snapscreen.js'][79] = 0;
  _$jscoverage['plugins/snapscreen.js'][81] = 0;
  _$jscoverage['plugins/snapscreen.js'][82] = 0;
  _$jscoverage['plugins/snapscreen.js'][84] = 0;
}
_$jscoverage['plugins/snapscreen.js'].source = ["<span class=\"c\">/**</span>","<span class=\"c\"> * &#25130;&#23631;</span>","<span class=\"c\"> * @file</span>","<span class=\"c\"> * @since 1.2.6.1</span>","<span class=\"c\"> */</span>","","<span class=\"c\">/**</span>","<span class=\"c\"> * &#25130;&#23631;</span>","<span class=\"c\"> * @command snapscreen</span>","<span class=\"c\"> * @method execCommand</span>","<span class=\"c\"> * @param { String } cmd &#21629;&#20196;&#23383;&#31526;&#20018;</span>","<span class=\"c\"> * @example</span>","<span class=\"c\"> * ```javascript</span>","<span class=\"c\"> * //editor&#26159;&#32534;&#36753;&#22120;&#23454;&#20363;</span>","<span class=\"c\"> * //&#25191;&#34892;&#25130;&#23631;&#21629;&#20196;&#65292; &#38656;&#35201;&#26381;&#21153;&#22120;&#31471;&#37197;&#21512;&#25509;&#25910;&#22270;&#29255;</span>","<span class=\"c\"> * editor.execCommand( 'snapscreen' );</span>","<span class=\"c\"> * ```</span>","<span class=\"c\"> */</span>","","UE<span class=\"k\">.</span>plugins<span class=\"k\">[</span><span class=\"s\">'snapscreen'</span><span class=\"k\">]</span> <span class=\"k\">=</span> <span class=\"k\">function</span><span class=\"k\">()</span><span class=\"k\">{</span>","    <span class=\"k\">var</span> me <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">,</span>","        doc<span class=\"k\">,</span>","        snapplugin<span class=\"k\">;</span>","","    me<span class=\"k\">.</span>setOpt<span class=\"k\">(</span><span class=\"k\">{</span>","        snapscreenServerPort<span class=\"k\">:</span> location<span class=\"k\">.</span>port                                    <span class=\"c\">//&#23631;&#24149;&#25130;&#22270;&#30340;server&#31471;&#31471;&#21475;</span>","        <span class=\"k\">,</span>snapscreenImgAlign<span class=\"k\">:</span> <span class=\"s\">''</span>                                <span class=\"c\">//&#25130;&#22270;&#30340;&#22270;&#29255;&#40664;&#35748;&#30340;&#25490;&#29256;&#26041;&#24335;</span>","        <span class=\"k\">,</span>snapscreenHost<span class=\"k\">:</span> location<span class=\"k\">.</span>hostname                                 <span class=\"c\">//&#23631;&#24149;&#25130;&#22270;&#30340;server&#31471;&#25991;&#20214;&#25152;&#22312;&#30340;&#32593;&#31449;&#22320;&#22336;&#25110;&#32773;ip&#65292;&#35831;&#19981;&#35201;&#21152;http://</span>","","    <span class=\"k\">}</span><span class=\"k\">);</span>","    me<span class=\"k\">.</span>commands<span class=\"k\">[</span><span class=\"s\">'snapscreen'</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><span class=\"k\">{</span>","            <span class=\"k\">var</span> me <span class=\"k\">=</span> <span class=\"k\">this</span><span class=\"k\">,</span>lang <span class=\"k\">=</span> me<span class=\"k\">.</span>getLang<span class=\"k\">(</span><span class=\"s\">\"snapScreen_plugin\"</span><span class=\"k\">);</span>","            <span class=\"k\">if</span><span class=\"k\">(!</span>snapplugin<span class=\"k\">)</span><span class=\"k\">{</span>","                <span class=\"k\">var</span> container <span class=\"k\">=</span> me<span class=\"k\">.</span>container<span class=\"k\">;</span>","                doc <span class=\"k\">=</span> container<span class=\"k\">.</span>ownerDocument <span class=\"k\">||</span> container<span class=\"k\">.</span>document<span class=\"k\">;</span>","                snapplugin <span class=\"k\">=</span> doc<span class=\"k\">.</span>createElement<span class=\"k\">(</span><span class=\"s\">\"object\"</span><span class=\"k\">);</span>","                <span class=\"k\">try</span><span class=\"k\">{</span>snapplugin<span class=\"k\">.</span>type <span class=\"k\">=</span> <span class=\"s\">\"application/x-pluginbaidusnap\"</span><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\">return</span><span class=\"k\">;</span>","                <span class=\"k\">}</span>","                snapplugin<span class=\"k\">.</span>style<span class=\"k\">.</span>cssText <span class=\"k\">=</span> <span class=\"s\">\"position:absolute;left:-9999px;\"</span><span class=\"k\">;</span>","                snapplugin<span class=\"k\">.</span>setAttribute<span class=\"k\">(</span><span class=\"s\">\"width\"</span><span class=\"k\">,</span><span class=\"s\">\"0\"</span><span class=\"k\">);</span>","                snapplugin<span class=\"k\">.</span>setAttribute<span class=\"k\">(</span><span class=\"s\">\"height\"</span><span class=\"k\">,</span><span class=\"s\">\"0\"</span><span class=\"k\">);</span>","                container<span class=\"k\">.</span>appendChild<span class=\"k\">(</span>snapplugin<span class=\"k\">);</span>","            <span class=\"k\">}</span>","","","           <span class=\"k\">var</span> editorOptions <span class=\"k\">=</span> me<span class=\"k\">.</span>options<span class=\"k\">;</span>","","            <span class=\"k\">var</span> onSuccess <span class=\"k\">=</span> <span class=\"k\">function</span><span class=\"k\">(</span>rs<span class=\"k\">)</span><span class=\"k\">{</span>","                <span class=\"k\">try</span><span class=\"k\">{</span>","                    rs <span class=\"k\">=</span> eval<span class=\"k\">(</span><span class=\"s\">\"(\"</span><span class=\"k\">+</span> rs <span class=\"k\">+</span><span class=\"s\">\")\"</span><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>","                    alert<span class=\"k\">(</span>lang<span class=\"k\">.</span>callBackErrorMsg<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>rs<span class=\"k\">.</span>state <span class=\"k\">!=</span> <span class=\"s\">'SUCCESS'</span><span class=\"k\">)</span><span class=\"k\">{</span>","                    alert<span class=\"k\">(</span>rs<span class=\"k\">.</span>state<span class=\"k\">);</span>","                    <span class=\"k\">return</span><span class=\"k\">;</span>","                <span class=\"k\">}</span>","                me<span class=\"k\">.</span>execCommand<span class=\"k\">(</span><span class=\"s\">'insertimage'</span><span class=\"k\">,</span> <span class=\"k\">{</span>","                    src<span class=\"k\">:</span> editorOptions<span class=\"k\">.</span>snapscreenPath <span class=\"k\">+</span> rs<span class=\"k\">.</span>url<span class=\"k\">,</span>","                    floatStyle<span class=\"k\">:</span> editorOptions<span class=\"k\">.</span>snapscreenImgAlign<span class=\"k\">,</span>","                    _src<span class=\"k\">:</span>editorOptions<span class=\"k\">.</span>snapscreenPath <span class=\"k\">+</span> rs<span class=\"k\">.</span>url","                <span class=\"k\">}</span><span class=\"k\">);</span>","            <span class=\"k\">}</span><span class=\"k\">;</span>","            <span class=\"k\">var</span> onStartUpload <span class=\"k\">=</span> <span class=\"k\">function</span><span class=\"k\">()</span><span class=\"k\">{</span>","                <span class=\"c\">//&#24320;&#22987;&#25130;&#22270;&#19978;&#20256;</span>","            <span class=\"k\">}</span><span class=\"k\">;</span>","            <span class=\"k\">var</span> onError <span class=\"k\">=</span> <span class=\"k\">function</span><span class=\"k\">()</span><span class=\"k\">{</span>","                alert<span class=\"k\">(</span>lang<span class=\"k\">.</span>uploadErrorMsg<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> port <span class=\"k\">=</span> editorOptions<span class=\"k\">.</span>snapscreenServerPort <span class=\"k\">+</span> <span class=\"s\">''</span><span class=\"k\">;</span>","                editorOptions<span class=\"k\">.</span>snapscreenServerUrl <span class=\"k\">=</span> editorOptions<span class=\"k\">.</span>snapscreenServerUrl<span class=\"k\">.</span>split<span class=\"k\">(</span> editorOptions<span class=\"k\">.</span>snapscreenHost <span class=\"k\">);</span>","                editorOptions<span class=\"k\">.</span>snapscreenServerUrl <span class=\"k\">=</span> editorOptions<span class=\"k\">.</span>snapscreenServerUrl<span class=\"k\">[</span><span class=\"s\">1</span><span class=\"k\">]</span> <span class=\"k\">||</span> editorOptions<span class=\"k\">.</span>snapscreenServerUrl<span class=\"k\">[</span><span class=\"s\">0</span><span class=\"k\">];</span>","                <span class=\"k\">if</span><span class=\"k\">(</span> editorOptions<span class=\"k\">.</span>snapscreenServerUrl<span class=\"k\">.</span>indexOf<span class=\"k\">(</span><span class=\"s\">\":\"</span><span class=\"k\">+</span>port<span class=\"k\">)</span> <span class=\"k\">===</span> <span class=\"s\">0</span> <span class=\"k\">)</span> <span class=\"k\">{</span>","                    editorOptions<span class=\"k\">.</span>snapscreenServerUrl <span class=\"k\">=</span> editorOptions<span class=\"k\">.</span>snapscreenServerUrl<span class=\"k\">.</span>substring<span class=\"k\">(</span> port<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\">var</span> ret <span class=\"k\">=</span>snapplugin<span class=\"k\">.</span>saveSnapshot<span class=\"k\">(</span>editorOptions<span class=\"k\">.</span>snapscreenHost<span class=\"k\">,</span> editorOptions<span class=\"k\">.</span>snapscreenServerUrl<span class=\"k\">,</span> port<span class=\"k\">);</span>","                onSuccess<span class=\"k\">(</span>ret<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>","                me<span class=\"k\">.</span>ui<span class=\"k\">.</span>_dialogs<span class=\"k\">[</span><span class=\"s\">'snapscreenDialog'</span><span class=\"k\">].</span>open<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/snapscreen.js'][20]++;
UE.plugins.snapscreen = (function () {
  _$jscoverage['plugins/snapscreen.js'][21]++;
  var me = this, doc, snapplugin;
  _$jscoverage['plugins/snapscreen.js'][25]++;
  me.setOpt({snapscreenServerPort: location.port, snapscreenImgAlign: "", snapscreenHost: location.hostname});
  _$jscoverage['plugins/snapscreen.js'][31]++;
  me.commands.snapscreen = {execCommand: (function () {
  _$jscoverage['plugins/snapscreen.js'][33]++;
  var me = this, lang = me.getLang("snapScreen_plugin");
  _$jscoverage['plugins/snapscreen.js'][34]++;
  if ((! snapplugin)) {
    _$jscoverage['plugins/snapscreen.js'][35]++;
    var container = me.container;
    _$jscoverage['plugins/snapscreen.js'][36]++;
    doc = (container.ownerDocument || container.document);
    _$jscoverage['plugins/snapscreen.js'][37]++;
    snapplugin = doc.createElement("object");
    _$jscoverage['plugins/snapscreen.js'][38]++;
    try {
      _$jscoverage['plugins/snapscreen.js'][38]++;
      snapplugin.type = "application/x-pluginbaidusnap";
    }
    catch (e) {
      _$jscoverage['plugins/snapscreen.js'][39]++;
      return;
    }
    _$jscoverage['plugins/snapscreen.js'][41]++;
    snapplugin.style.cssText = "position:absolute;left:-9999px;";
    _$jscoverage['plugins/snapscreen.js'][42]++;
    snapplugin.setAttribute("width", "0");
    _$jscoverage['plugins/snapscreen.js'][43]++;
    snapplugin.setAttribute("height", "0");
    _$jscoverage['plugins/snapscreen.js'][44]++;
    container.appendChild(snapplugin);
  }
  _$jscoverage['plugins/snapscreen.js'][48]++;
  var editorOptions = me.options;
  _$jscoverage['plugins/snapscreen.js'][50]++;
  var onSuccess = (function (rs) {
  _$jscoverage['plugins/snapscreen.js'][51]++;
  try {
    _$jscoverage['plugins/snapscreen.js'][52]++;
    rs = eval(("(" + rs + ")"));
  }
  catch (e) {
    _$jscoverage['plugins/snapscreen.js'][54]++;
    alert(lang.callBackErrorMsg);
    _$jscoverage['plugins/snapscreen.js'][55]++;
    return;
  }
  _$jscoverage['plugins/snapscreen.js'][58]++;
  if ((rs.state != "SUCCESS")) {
    _$jscoverage['plugins/snapscreen.js'][59]++;
    alert(rs.state);
    _$jscoverage['plugins/snapscreen.js'][60]++;
    return;
  }
  _$jscoverage['plugins/snapscreen.js'][62]++;
  me.execCommand("insertimage", {src: (editorOptions.snapscreenPath + rs.url), floatStyle: editorOptions.snapscreenImgAlign, _src: (editorOptions.snapscreenPath + rs.url)});
});
  _$jscoverage['plugins/snapscreen.js'][68]++;
  var onStartUpload = (function () {
});
  _$jscoverage['plugins/snapscreen.js'][71]++;
  var onError = (function () {
  _$jscoverage['plugins/snapscreen.js'][72]++;
  alert(lang.uploadErrorMsg);
});
  _$jscoverage['plugins/snapscreen.js'][74]++;
  try {
    _$jscoverage['plugins/snapscreen.js'][75]++;
    var port = (editorOptions.snapscreenServerPort + "");
    _$jscoverage['plugins/snapscreen.js'][76]++;
    editorOptions.snapscreenServerUrl = editorOptions.snapscreenServerUrl.split(editorOptions.snapscreenHost);
    _$jscoverage['plugins/snapscreen.js'][77]++;
    editorOptions.snapscreenServerUrl = (editorOptions.snapscreenServerUrl[1] || editorOptions.snapscreenServerUrl[0]);
    _$jscoverage['plugins/snapscreen.js'][78]++;
    if ((editorOptions.snapscreenServerUrl.indexOf((":" + port)) === 0)) {
      _$jscoverage['plugins/snapscreen.js'][79]++;
      editorOptions.snapscreenServerUrl = editorOptions.snapscreenServerUrl.substring((port.length + 1));
    }
    _$jscoverage['plugins/snapscreen.js'][81]++;
    var ret = snapplugin.saveSnapshot(editorOptions.snapscreenHost, editorOptions.snapscreenServerUrl, port);
    _$jscoverage['plugins/snapscreen.js'][82]++;
    onSuccess(ret);
  }
  catch (e) {
    _$jscoverage['plugins/snapscreen.js'][84]++;
    me.ui._dialogs.snapscreenDialog.open();
  }
})};
});
