EWA DEMO emp-script emp-script-utils emp-script-static ffmpeg-utils weixin

[BUG] HtmlCreator 当执行FrameMin时 @ 参数没有替换

2016-05-25

包:com.gdxsoft.easyweb.script.display

类:HtmlCreator

方法:getPageMin

MStr.replace 只执行一次,但内容可能回出现多次 @ 符号

/**
 * 仅生成对象本身,不包括头部和尾部等
 * 
 * @return
 * @throws Exception
 */
public String getPageMin() throws Exception {
    MStr sb = new MStr();
    _DebugFrames.addDebug(this, "HTML", "开始合成脚本-min");

    String css = this._Document.getCss().toString();
    if (css.trim().length() > 0) {
        sb.appendLine("<style type='text/css'>");
        sb.append(css);
        sb.appendLine("</style>");
    }
    // js top
    String jsTop = this._Document.getJsTop().getScripts(true);
    jsTop = _ItemValues.replaceJsParameters(jsTop);
    // js bottom
    String jsBottom = this._Document.getJsBottom().getScripts(true);
    jsBottom = _ItemValues.replaceJsParameters(jsBottom);

    sb.al(jsTop);
    // sb.al("<div>");
    String cnt = this._Document.getFrameHtml();
    cnt = _ItemValues.replaceParameters(cnt, true);
    sb.appendLine(cnt);
    // sb.al("</div>");
    sb.al(jsBottom);

    // 这是错误的
    // sb.replace("\1\2$$##GDX~##JZY$$\3\4", "@");

    _DebugFrames.addDebug(this, "HTML", "结束合成脚本");

    return sb.toString().replace("\1\2$$##GDX~##JZY$$\3\4", "@");
}