---------- 开发者只需要关注上面的代码 ---------- //
962978
@Override
    public boolean onPrepareOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_all_activity, menu);
        return true;
    }
1196727
function (layoutName, data, moduleName) {
            if (layoutName === undefined) {
                return '';
            }

            if (moduleName === undefined && typeof data === 'string') {
                moduleName = data;
                data = undefined;
            }

            if (moduleName === undefined) {
                // 未指定模块时默认渲染当前模块下layout
                moduleName = resLocals.current_module;
                return renderLayout(layoutName, data, moduleName);
            } else {
                // 跨模块渲染, 在指定模块下完成layout渲染, 完成后切换回原模块
                var lastModule = resLocals.current_module;
                self.logger.trace('set current module from:%s to:%s', resLocals.current_module, moduleName);
                resLocals.current_module = moduleName;
                var html = renderLayout(layoutName, data, moduleName);
                self.logger.trace('set current module from:%s to:%s', resLocals.current_module, lastModule);
                resLocals.current_module = lastModule;
                return html;
            }
        }
154722
function onReady() {
  const self = this;

  /***
   * 判断页面是否已经ready
   */
  if (this.hasInited) return;
  this.hasInited = true;

  /***
   * window.document.body的jQuery
   */
  this.bodyDOM = window.document.body;

  /***
   * 存放完全单例对象的容器
   */
  this.singleInstances = null;

  /***
   * 创建page切换时的遮罩层
   */
  this.maskDOM = $(
    "<div class='ct-page-mask'>" +
    " <div opt='animation' class='la-ball-circus la-dark' style='color:#3e98f0;'>" +
    "   <div></div>" +
    "   <div></div>" +
    "   <div></div>" +
    "   <div></div>" +
    "   <div></div>" +
    " </div>" +
    "</div>")[0];
  this.bodyDOM.appendChild(this.maskDOM);

  fireEvent(window.document, "pageBeforeChange", [CtMobileFactory.getUrlParam(window.location.hash)]);
  /***
   * 初始化第一页
   * TODO:初始化第一页
   */
  createPage.call(this, this.getFirstId(), (Component) => {
    Component.start(0, () => {
        /***
         * if(有hash值) 加载的不是首页而是某一个指定的页面 {
         *   调用startPage即可
         *   startPage需要三部分值
         *   1.html的路径
         *   2.pageId
         *   3.parameter
         * }
         */
        const hash = window.location.hash;
        if (!hash) return false;

        const pageId = self.getPageIdByHash();
        if (!pageId) return false;

        const url = `#${pageId}`;
        const parameter = self.getParameterByHash();
        const searchObj = CtMobileFactory.getUrlParam(`${url}${parameter}`);

        self.startPage(`${url}${parameter}${parameter ? (searchObj.pageId ? '' : `&pageId=${pageId}`) : `?pageId=${pageId}`}`, {
          reload: self.config.linkCaptureReload
        });
      }
    );
  });

}
1072419
function getCustomDeps(info) {
    var res = [];

    if (info.modules && Array.isArray(info.modules)) {
        info = info.modules;
    }
    else {
        info = [];
    }

    info.forEach(function (item) {
        // 只包含额外需要包含的模块
        // 对额外排除的模块不做处理
        if (item.charAt(0) === '~') {
            res.push(item.substring(1));
        }
    });

    return res;
}
515957
function () {
            var reg = new RegExp(domUtils.fillChar, 'g'),
                html = this.body.innerHTML.replace(/[\n\r]/g, '');//ie要先去了\n在处理
            html = html.replace(/<(p|div)[^>]*>(<br\/?>|&nbsp;)<\/\1>/gi, '\n')
                .replace(/<br\/?>/gi, '\n')
                .replace(/<[^>/]+>/g, '')
                .replace(/(\n)?<\/([^>]+)>/g, function (a, b, c) {
                    return dtd.$block[c] ? '\n' : b ? b : '';
                });
            //取出来的空格会有c2a0会变成乱码，处理这种情况\u00a0
            return html.replace(reg, '').replace(/\u00a0/g, ' ').replace(/&nbsp;/g, ' ');
        }
914647
function init() {
  const {supportCordova = false} = this.config;

  onReady = onReady.bind(this);

  /***
   * 如果开启了对cordova的支持
   */
  if (supportCordova) {
    /***
     * 如果开启了对cordova的支持，那么页面完成事件和cordova的deviceReady事件必须同时完成后才能支持后续代码
     */
    Promise.all([
      readyPromise(),
      DOMContentLoadedPromise(),
      devicereadyPromise()
    ]).then(() => {
      onReady();
      fireEvent(window.document, "DOMContentAndDeviceReady");
    }).catch((error) => {

    });
  }
  else {
    /***
     * 页面载入完成事件
     */
    $(window.document).ready(onReady);

    /***
     * 自动 init
     */
    window.addEventListener("DOMContentLoaded", onReady);
  }
}
1134331
function (template) {
        var code,
            nextChar,
            matchedText,
            processor = new ParseProcessor(template),
            contentProcessor = new ContentProcessor();

        while (processor.position < processor.source.length) {
            if (processor.state === stateEnum.client) {
                code = processor.readMarkup();
                contentProcessor.addSegment({
                    data: code,
                    type: modeEnum.markup
                });
            } else {
                nextChar = processor.readNextChars(1);
                //跳过@符号。Pass the @
                if (nextChar === configure.symbol) {
                    processor.position++;
                    nextChar = processor.readNextChars(1);
                    //@@
                    if (nextChar === configure.symbol) {
                        processor.position++;
                        processor.state = stateEnum.client;
                        contentProcessor.addSegment({
                            data: configure.symbol,
                            type: modeEnum.markup
                        });
                    }
                    //@//...
                    else if (nextChar === '/' && processor.readNextChars(2) === '//') {
                        matchedText = processor.readNextChars().match(/\/\/.*/)[0];
                        processor.position += matchedText.length;
                        processor.state = stateEnum.client;
                    }
                    //@*...*@
                    else if (nextChar === '*') {
                        if (new RegExp('\\*[\\s\\S]*?\\*' + configure.symbol).test(processor.readNextChars())) {
                            matchedText = processor.readNextChars().match(new RegExp('\\*[\\s\\S]*?\\*' + configure.symbol))[0];
                            processor.position += matchedText.length;
                            processor.state = stateEnum.client;
                        } else {
                            throw new SakerError('Comments ' + configure.symbol + '* not found the matched *' + configure.symbol + ' ！', processor.getStackString('Comments ' + configure.symbol + '* not found the matched *' + configure.symbol + ' ！', processor.getLineNum(processor.position)));
                        }
                    }
                    //@(...)
                    else if (nextChar === '(') {
                        code = processor.readBracketCode();
                        if (/^\(\s*\)$/.test(code)) {
                            code = '';
                        }
                        contentProcessor.addSegment({
                            data: code,
                            type: modeEnum.expression
                        });
                    }
                    //@{...}
                    else if (nextChar === '{') {
                        code = processor.readBlockServerCode();
                        contentProcessor.addSegment({
                            data: code,
                            type: modeEnum.script
                        });
                    }
                    //@if(){...}
                    else if (nextChar === 'i' && processor.readNextChars(2) === 'if' && /^if\s*?\([\s\S]+?\)\s*\{/.test(processor.readNextChars())) {
                        matchedText = processor.readNextChars().match(/^if\s*?\([\s\S]+?\)\s*\{/)[0];
                        processor.position += matchedText.length;
                        processor.braces.push({
                            type: bracesEnum.atIf,
                            position: processor.position
                        });
                        code = processor.readBlockServerCode();
                        contentProcessor.addSegment({
                            data: matchedText + code,
                            type: modeEnum.script
                        });
                    }
                    //@for(){...}
                    else if (nextChar === 'f' && processor.readNextChars(3) === 'for' && /^for\s*?\([\s\S]+?\)\s*\{/.test(processor.readNextChars())) {
                        matchedText = processor.readNextChars().match(/^for\s*?\([\s\S]+?\)\s*\{/)[0];
                        processor.position += matchedText.length;
                        processor.braces.push({
                            type: bracesEnum.atFor,
                            position: processor.position
                        });
                        code = processor.readBlockServerCode();
                        contentProcessor.addSegment({
                            data: matchedText + code,
                            type: modeEnum.script
                        });
                    }
                    //@while(){...}
                    else if (nextChar === 'w' && processor.readNextChars(5) === 'while' && /^while\s*?\([\s\S]+?\)\s*\{/.test(processor.readNextChars())) {
                        matchedText = processor.readNextChars().match(/^while\s*?\([\s\S]+?\)\s*\{/)[0];
                        processor.position += matchedText.length;
                        processor.braces.push({
                            type: bracesEnum.atWhile,
                            position: processor.position
                        });
                        code = processor.readBlockServerCode();
                        contentProcessor.addSegment({
                            data: matchedText + code,
                            type: modeEnum.script
                        });
                    }
                    //@do{}
                    else if (nextChar === 'd' && processor.readNextChars(2) === 'do' && /^do\s*?\{/.test(processor.readNextChars())) {
                        matchedText = processor.readNextChars().match(/^do\s*?\{/)[0];
                        processor.position += matchedText.length;
                        processor.braces.push({
                            type: bracesEnum.atDo,
                            position: processor.position
                        });
                        code = processor.readBlockServerCode();
                        contentProcessor.addSegment({
                            data: matchedText + code,
                            type: modeEnum.script
                        });
                    }
                    //@switch(){...}
                    else if (nextChar === 's' && processor.readNextChars(6) === 'switch' && /^switch\s*?\([\s\S]+?\)\s*\{/.test(processor.readNextChars())) {
                        matchedText = processor.readNextChars().match(/^switch\s*?\([\s\S]+?\)\s*\{/)[0];
                        processor.position += matchedText.length;
                        processor.braces.push({
                            type: bracesEnum.atSwitch,
                            position: processor.position
                        });
                        code = processor.readBlockServerCode();
                        contentProcessor.addSegment({
                            data: matchedText + code,
                            type: modeEnum.script
                        });
                    }
                    //@try{}
                    else if (nextChar === 't' && processor.readNextChars(3) === 'try' && /^try\s*?\{/.test(processor.readNextChars())) {
                        matchedText = processor.readNextChars().match(/^try\s*?\{/)[0];
                        processor.position += matchedText.length;
                        processor.braces.push({
                            type: bracesEnum.atTry,
                            position: processor.position
                        });
                        code = processor.readBlockServerCode();
                        contentProcessor.addSegment({
                            data: matchedText + code,
                            type: modeEnum.script
                        });
                    }
                    //@abc, @_a, @[1,2], @!true
                    else if (/[A-Za-z_[!]/.test(nextChar)) {
                        code = processor.readLineServerCode();
                        contentProcessor.addSegment({
                            data: code,
                            type: modeEnum.expression
                        });
                    }
                    //@ abc, @", @?等其他特殊字符
                    else {
                        throw new SakerError('Illegal character after ' + configure.symbol + ' ! ', processor.getStackString('Illegal character after ' + configure.symbol + ' ! ', processor.getLineNum(processor.position)));
                    }
                } else {
                    code = processor.readBlockServerCode();
                    contentProcessor.addSegment({
                        data: code,
                        type: modeEnum.script
                    });
                }
            }
        }
        //匹配情况检查。Check match.
        if (processor.tags.length > 0) {
            throw new SakerError('There exists unclosed tags！', processor.getStackString('There exists unclosed tags！', processor.getLineNum(processor.tags[processor.tags.length - 1].position)));
        }
        if (processor.braces.length > 0) {
            throw new SakerError('There exists unmatched braces！', processor.getStackString('There exists unmatched braces！', processor.getLineNum(processor.braces[processor.braces.length - 1].position)));
        }
        if (processor.brackets.length > 0) {
            throw new SakerError('There exits unmatched brackets！', processor.getStackString('There exits unmatched brackets！', processor.getLineNum(processor.brackets[processor.brackets.length - 1])));
        }
        return contentProcessor;
    }
1289987
function InitOralProcess(client, req) {
    return new Promise(function (resolve, reject) {
        // 通过client对象调用想要访问的接口，需要传入请求对象以及响应回调函数
        client.InitOralProcess(req, function (err, response) {
            if (err) {
                reject(err)
                return;
            }
            resolve(response)
        });
    })
}
563000
function renderRouterStructure(virtualFolder) {
        if (!Array.isArray(virtualFolder)) {
            throw new TypeError('The virtualFolder should be a array');
        }

        return virtualFolder.map(virtualChild => {
            const router = {};

            const path = _.isString(virtualChild) ?
                // 普通路由
                virtualChild :
                // 父路由
                virtualChild.path;

            const relativePageDirPath = Path.relative(pageDirPath, path).replace(/\\/g, '/');

            router.path = Config.path({relativePageDirPath});
            router.componentPath = Config.componentPath({routerIndexPath, path});
            router.componentPkg = Config.componentPkg({relativePageDirPath}) || '$base';

            // 普通路由
            if (_.isString(virtualChild)) {
                router.name = Config.name({relativePageDirPath});
            } else {
                router.children = renderRouterStructure(virtualChild.child);
                router.componentPath =
                    Path.join(router.componentPath, 'layout', 'layout.vue').replace(/\\/g, '/');
            }

            if (loadRouterHook) {
                loadRouterHook(router);
            }

            return router;
        });
    }
1276419
function (e) {
    var self = this
    var info = this.getInfo()
    var subs = this._subs
    var i
    var l

    // 如果不等于上次方向，则触发
    if (info.landscape !== this.info.landscape) {
      this.info = merge(info)
      info.originEvent = e
      info.originType = e.type

      // 执行on
      for (i = 0, l = subs.on.length; i < l; i++) {
        subs.on[i].call(self, e)
      }

      // 执行after
      setTimeout(function () {
        for (i = 0, l = subs.after.length; i < l; i++) {
          subs.after[i].call(self, e)
        }
      }, 0)
    }
  }
746314
function newInstance({Class, id, pageId}) {
  const typeofName = (typeof Class).toLowerCase();

  const ctDataMode = getTemplateConfig.call(this, pageId, "ct-data-mode");

  let Constructor;

  /***
   * 如果Class可以实例化
   */
  if (typeofName === "function") {
    Constructor = Class;
  }
  /***
   * 如果Class不可以实例化则用缺省的Page进行实例化
   */
  else if (typeofName === "undefined") {
    Constructor = Page;
  }

  if (!Constructor) {
    throw "页面管理类无法初始化";
    return false;
  }

  /***
   * 如果是singleInstance 或 singleInstanceResult
   */
  if (ctDataMode.toLowerCase().indexOf("singleinstance") !== -1) {
    if (!this.getSingleInstance(pageId)) {
      this.singleInstances[pageId] = new Constructor(this, id);
    }
    return this.singleInstances[pageId];
  } else {
    return new Constructor(this, id);
  }
}
806550
function pageStartTransitionEndCallback(e) {
  const self = this;
  /***
   * 如果当前页面的transition为material则肯定不会执行webkitTransitionEnd事件
   */
  if ((e.type === "webkitTransitionEnd" && e.target.getAttribute("ct-data-role") !== "page") ||
    (e.type === "webkitAnimationEnd" && e.target.getAttribute("ct-data-role") !== "page")) {
    return;
  }

  e.stopPropagation();
  e.preventDefault();

  /***
   * 当前页移除materialShow
   */
  self.getPageDOM().classList.remove("materialShow");
  /***
   * 最后一页隐藏
   */
  self.ctmobile.getLastPage().getPageDOM().classList.remove("active");

  self.ctmobile.maskDOM.style.display = "none";
  self.changeKey = false;

  /***
   * 当前页入历史
   */
  self.ctmobile.router.addPage(self);

  /***
   * 当前页显示之后事件
   */
  self.ctmobile.fireEvent(self.getPageDOM(), "pageAfterShow");

  /***
   * 当前页之前的页面暂停之后
   */
  if (self.ctmobile.getHistoryLength() >= 2) {
    self.ctmobile.fireEvent(self.ctmobile.getPageByIndex(self.ctmobile.getHistoryLength() - 2).getPageDOM(), "pageAfterPause");
  }

  if (self.pageTransitionEndCallback) {
    self.pageTransitionEndCallback();
  }
}
465824
function getHtmlContent(jQuery, fileArr, urlFunc, scriptAttr) {
    var $ = jQuery,
        jsArr = [],
        cssArr = [];

    // 获得js和css文件数组
    fileArr.forEach(function (item) {
        var extName = path.extname(item.filePathInHtml);
        switch (extName) {
            case '.js':
                jsArr.push(item);
                break;
            case '.css':
                cssArr.push(item);
                break;
            default :
                break;
        }
    });

    //处理JS
    if (jsArr.length) {
        var scriptDomArr = $('script[' + scriptAttr + ']');

        scriptDomArr.each(function () {
            var scriptDom = $(this),
                scriptUrl = scriptDom.attr(scriptAttr);

            if (!util.isExternalUrl(scriptUrl)) {
                for (var i = 0, length = jsArr.length; i < length; i++) {
                    var one = jsArr[i];

                    if (util.isMatch(scriptUrl, one.filePathInHtml)) {
                        urlFunc(scriptDom, scriptUrl, one, scriptAttr);

                        if (scriptAttr === "data-main") {
                            dataMainUrl = scriptUrl;
                        }

                        break;
                    }
                }
            }
        });

    }

    //处理CSS
    if (cssArr.length) {
        var cssDomArr = $('link[rel="stylesheet"][href]');

        cssDomArr.each(function () {
            var cssDom = $(this),
                cssUrl = cssDom.attr('href');

            if (!util.isExternalUrl(cssUrl)) {
                for (var i = 0, length = cssArr.length; i < length; i++) {
                    var one = cssArr[i];

                    if (util.isMatch(cssUrl, one.filePathInHtml)) {
                        urlFunc(cssDom, cssUrl, one, 'href');
                        break;
                    }
                }
            }
        });
    }

    return $.html();
}
950288
function renderView(req,res,afterRender) {
    var view;

    if(!req.input||req.input.error) {

        //如果页面加载，是错误信息页面
        res.proxyData = res.proxyData?res.proxyData:{};
        res.proxyData.reloadUrl = req.url;
        res.proxyData.message = req.input ? req.input.message : '';
        view = 'error/error';
        req.app.yolog.log('error','error view:',res.proxyData);
    } else { 

        //获取视图
        view = req.input.config.view || getView(req.input.config.route);
    }

    //设置VO
    res.locals = res.proxyData;
    debug('res.proxyData:');
    debug(res.proxyData);
    //如果是pjax，不组装布局
    if (req.headers['x-pjax']) {
        res.locals.layout = false;
    } else {
        delete res.locals.layout;
    }    

    debug('view:'+ view);
    req.app.yolog.log('verbose','view %s | pjax vo: %j',view,res.proxyData);
    //渲染HTML
    res.render(view,function(err,str) {

        //错误处理
        if(err) {
            req.next(err);
            return;
        }

        debug('view_html');

        //在发送渲染结果前的一些操作
        if(afterRender) {
            str = afterRender(res,str);
        }

        debug('after view_html');

        //发送渲染结果
        res.send(str);
        return;
    });
}
916799
public function ShowTime()
    {
        //循环输出css内容
        ob_start(function ($css) {
            $css = preg_replace('#\/\*[^*]*\*+([^/][^*]*\*+)*\/#isU', '', $css);  // 清除块级注释
            $css = str_replace(array('<!--', '-->'), '', $css);
            $css = str_replace(array("\r", "\r", "", "\t"), '', $css); // 清除换行、缩进
            $css = preg_replace("/\s(?=\s)/", '', $css); // 连续的空格替换为一个空格
            $css = preg_replace("#\s*(:|;|\{|\})\s*#", "$1", $css); // 清除一些特定字符前后的空格，这里是可以扩展的，可以根据你的实际情况，添加或删除某些字符
            if ($css) {
                return "\n<style>" . $css . "</style>\n";
            } else {
                return '';
            }
        });
        foreach (self::$Component[self::CSS] as $cssfile) {
            ob_start();
            include $cssfile;
            $css_contents = ob_get_clean();
            //加上名字作为css的前缀,防止冲突
            $basename = current(explode('vue.', basename($cssfile)));
            $csss = explode("\n", $css_contents);
            foreach ($csss as $key => $css_contents) {
                $line = trim($css_contents);
                if ($line && substr($line, -1) == '{') {
                    //$csss[$key] = "[css-{$basename}] " . $line;
                    $csss[$key] =  $line;
                }
            }
            echo join("\n", $csss);
        }
        ob_end_flush();

        //输出定制的js代码
        foreach (self::$Component[self::JS_FILE] as $jsfile) {
            ?>
            <script type="application/javascript">
                <?php
                ob_start();
                include $jsfile;
                echo (new JavaScriptPacker(ob_get_clean(), 'none', true, false))
                    ->pack();
                ?>
            </script>
            <?php
        }
        //输出组件js的内容
        foreach (self::$Component[self::JS] as $jscode) {
            if ($jscode) {
                echo $jscode . "\n";
            }
        }
        ?>
        <script type="application/javascript"> var VUE_CONFIG={};var <?=$this->getAppid()?> =new Vue({data:{VUE_CONFIG:VUE_CONFIG,}, mixins: [<?=join(',', $this->getmixins())?>],}).$mount('#<?=$this->getAppid()?>');window.<?=$this->getAppid()?> = <?=$this->getAppid()?>;</script>
        <?php
    }
784485
function loadModule( moduleId ) {
        if ( loadingModules[ moduleId ] || modModules[ moduleId ] ) {
            return;
        }

        loadingModules[ moduleId ] = 1;

        // 创建script标签
        //
        // 这里不挂接onerror的错误处理
        // 因为高级浏览器在devtool的console面板会报错
        // 再throw一个Error多此一举了
        var script = document.createElement( 'script' );
        script.setAttribute( 'data-require-id', moduleId );
        script.src = toUrl( moduleId + '.js' ) ;
        script.async = true;
        if ( script.readyState ) {
            script.onreadystatechange = loadedListener;
        }
        else {
            script.onload = loadedListener;
        }
        appendScript( script );

        /**
         * script标签加载完成的事件处理函数
         *
         * @ignore
         */
        function loadedListener() {
            var readyState = script.readyState;
            if (
                typeof readyState === 'undefined'
                || /^(loaded|complete)$/.test( readyState )
            ) {
                script.onload = script.onreadystatechange = null;
                script = null;

                completePreDefine( moduleId );
            }
        }
    }
1122289
function connectWebViewJavascriptBridge(callback) {
    //如果桥接对象已存在，则直接调用callback函数
    if (window.WebViewJavascriptBridge) {
      callback(WebViewJavascriptBridge)
    }
    //否则添加一个监听器来执行callback函数
    else {
      document.addEventListener('WebViewJavascriptBridgeReady', function () {
        callback(WebViewJavascriptBridge)
      }, false)
    }
  }