()
| 8 | } |
| 9 | |
| 10 | function main() { |
| 11 | try { |
| 12 | let data = JSON.parse(localStorage.ufs_fb_searchGroupForOther) || []; |
| 13 | let owner = |
| 14 | JSON.parse(localStorage.ufs_fb_searchGroupForOther_owner || "{}") || {}; |
| 15 | console.log(data, owner); |
| 16 | |
| 17 | let link = "https://fb.com/" + owner.uid; |
| 18 | ownerLink.innerHTML = ` |
| 19 | <a href="${link}" target="_blank" style="display: inline-block;"> |
| 20 | <img style="max-height: 80px;border-radius: 50%" src="${owner.avatar}" /> |
| 21 | ${owner.name} |
| 22 | </a>`; |
| 23 | searchCount.innerHTML = data.length; |
| 24 | |
| 25 | tableDiv.innerHTML = ` |
| 26 | <tr> |
| 27 | <th>STT</th> |
| 28 | <th>Ảnh</th> |
| 29 | <th>Tên</th> |
| 30 | <th>Mô tả</th> |
| 31 | <th>Thành viên</th> |
| 32 | </tr> |
| 33 | ${data |
| 34 | .map((c, i) => { |
| 35 | let link = `https://fb.com/${c.id}`; |
| 36 | |
| 37 | return `<tr> |
| 38 | <td>${i + 1}</td> |
| 39 | <td><img src="${ |
| 40 | c.image |
| 41 | }" style="max-height: 80px;max-width:130px"></img></td> |
| 42 | <td> |
| 43 | <a style="font-size: 1.1em" href="${link}" target="_blank">${ |
| 44 | c.title |
| 45 | }</a> |
| 46 | </td> |
| 47 | <td style="max-width:150px">${ |
| 48 | c.subTitle?.split?.("\n")?.[1] || "" |
| 49 | }</td> |
| 50 | <td style="text-align: right">${numberWithCommas( |
| 51 | c.membersCount |
| 52 | )}</td> |
| 53 | </tr>`; |
| 54 | }) |
| 55 | .join("")} |
| 56 | `; |
| 57 | |
| 58 | inputSearch.oninput = (e) => { |
| 59 | search(inputSearch.value); |
| 60 | }; |
| 61 | } catch (e) { |
| 62 | alert("ERROR: " + e); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | function search(text) { |
| 67 | let count = 0; |
no test coverage detected