* Initialize extension app * @param {HTMLElement} el
(el)
| 98 | * @param {HTMLElement} el |
| 99 | */ |
| 100 | function initApp(el) { |
| 101 | container = el; |
| 102 | container.classList.add("extensions"); |
| 103 | container.content = $header; |
| 104 | |
| 105 | if (!$searchResult) { |
| 106 | $searchResult = <ul className="list search-result scroll" />; |
| 107 | container.append($searchResult); |
| 108 | } |
| 109 | |
| 110 | if (!$explore) { |
| 111 | $explore = collapsableList(strings.explore); |
| 112 | $explore.ontoggle = loadExplore; |
| 113 | $explore.$ul.onscroll = handleScroll; |
| 114 | container.append($explore); |
| 115 | } |
| 116 | |
| 117 | if (!$installed) { |
| 118 | $installed = collapsableList(strings.installed); |
| 119 | $installed.ontoggle = loadInstalled; |
| 120 | container.append($installed); |
| 121 | } |
| 122 | |
| 123 | Sidebar.on("show", onSelected); |
| 124 | document.head.append($style); |
| 125 | } |
| 126 | |
| 127 | async function handleScroll(e) { |
| 128 | if (isLoading || !hasMore) return; |
nothing calls this directly
no test coverage detected