// 显示列表 showList = (text, index, listnum) => { window.info = []; Object.keys(index).filter(path => { let description = index[path]; let p = path.split('.html#') if (p.length == 2) { var type = `
${p[0]}
`; var name = p[1]; } else { var type = ''; name = p[0].replace('.html', ''); } let reg = new RegExp(text, "i"); let match1 = reg.exec(name); let match2 = reg.exec(description) if (match1 || match2) { let index = name.slice(0, 1).toUpperCase(); if (match1) name = highlightList(name, match1[0]); if (match2) description = highlightList(description, match2[0]); window.info.push(`
${index}
${type}
${name}
${description}
`); } }) $("#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(`docs/${window.code}/${file}`, (err, data) => { if (!err) { $("#mainlist").fadeOut(); $("#content").fadeOut().promise().done(() => { $("#content").html(`