终端查看调试应用内文件

    继续阅读
MXlwq's avatar
MXlwq 3月 01, 2017
 | 
} else { if (index_content < 0) { index_content = 0; } if (i === 0) { first_occur = index_content; } } }); } // show search results if (isMatch) { str += '
  • '+ data_title; var content = data.content.trim().replace(/<[^>]+>/g, ''); if (first_occur >= 0) { // cut out characters var start = first_occur - 6; var end = first_occur + 6; if (start < 0) { start = 0; } if (start === 0) { end = 10; } if (end > content.length) { end = content.length; } var match_content = content.substr(start, end); // highlight all keywords keywords.forEach(function(keyword) { var regS = new RegExp(keyword, 'gi'); match_content = match_content.replace(regS, ''+keyword+''); }) str += '

    ' + match_content + '...

    ' +'
    '; } } }); $resultContent.innerHTML = str; }); } }); }