// 显示列表 showList = (text, index, listnum) => { window.info = []; Object.keys(index).filter(key => { let v = index[key]; let name = v.name; let desc = v.desc let reg = new RegExp(text, "i"); let match1 = reg.exec(name); let match2 = reg.exec(desc) if (match1 || match2) { let initial = name.slice(0, 1).toUpperCase(); if (match1) name = highlightList(name, match1[0]); if (match2) desc = highlightList(desc, match2[0]); window.info.push(`
${initial}
${v.type}
${name}
${desc}
`); } }) $("#mainlist").html(window.info.slice(0, listnum).join('')); $(".info:first").addClass('select'); let num = $(".info").length utools.setExpendHeight(num > 11 ? 550 : 50 * num); } // 显示手册 showManual = path => { utools.setExpendHeight(550); if (/^((ht|f)tps?):\/\//.test(path)) { window.open(path); } else { let p = path.split('.html#') if (p.length == 2) { var file = p[0] + '.html'; var id = '#' + p[1]; } else { var file = p[0] } window.read(`${window.baseDir}/docs/${file}`, (err, data) => { if (!err) { $("#mainlist").fadeOut(); $("#content").fadeOut().promise().done(() => { $("#content").html(`