MCPcopy Index your code
hub / github.com/MALSync/MALSync / createTable

Function createTable

webpackConfig/descriptions.js:20–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19createTable();
20function createTable() {
21 let animehtml = '';
22 let mangahtml = '';
23
24 for (let page in pages) {
25 page = pages[page];
26
27 if (typeof page.domain === 'object') page.domain = page.domain[0];
28
29 const htmlContent = `<tr>
30 <td><a href="${page.domain}"><img src="https://favicon.malsync.moe/?domain=${page.domain}"> ${
31 page.name
32 }</a></td>
33 <td>${page.languages.join(', ')}</td>
34 ${rowCondition(typeof page.overview !== 'undefined')}
35 ${rowCondition(typeof page.sync.nextEpUrl !== 'undefined')}
36 ${rowCondition(typeof page.database !== 'undefined')}
37 ${rowCondition(typeof page.overview !== 'undefined' && typeof page.overview.list !== 'undefined')}
38 </tr>`;
39
40 if (typeof page.type !== undefined && page.type === 'anime') animehtml += htmlContent;
41 else mangahtml += htmlContent;
42 }
43
44 const html = `
45 <h1>Anime</h1>
46 <table>
47 <thead>
48 <tr>
49 <th>Page</th>
50 <th>Languages</th>
51 <th>Overview Page</th>
52 <th>Next Episode</th>
53 <th>Database Support</th>
54 <th>Episode Highlight</th>
55 </tr>
56 </thead>
57 <tbody>
58 ${animehtml}
59 </tbody>
60 </table>
61 <h1>Manga</h1>
62 <table>
63 <thead>
64 <tr>
65 <th>Page</th>
66 <th>Languages</th>
67 <th>Overview Page</th>
68 <th>Next Chapter</th>
69 <th>Database Support</th>
70 <th>Chapter Higlight</th>
71 </tr>
72 </thead>
73 <tbody>
74 ${mangahtml}
75 </tbody>
76 </table>
77 `;

Callers 1

descriptions.jsFile · 0.85

Calls 2

rowConditionFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected