()
| 5198 | } |
| 5199 | |
| 5200 | function ensureSearchEverywhereModal() { |
| 5201 | if (searchEverywhereModal) return searchEverywhereModal; |
| 5202 | |
| 5203 | const overlay = document.createElement("div"); |
| 5204 | overlay.id = "searchEverywhereModal"; |
| 5205 | overlay.style.cssText = ` |
| 5206 | position: fixed; |
| 5207 | inset: 0; |
| 5208 | background: rgba(0,0,0,0.55); |
| 5209 | z-index: 4000; |
| 5210 | display: none; |
| 5211 | align-items: center; |
| 5212 | justify-content: center; |
| 5213 | padding: 16px; |
| 5214 | `; |
| 5215 | |
| 5216 | const card = document.createElement("div"); |
| 5217 | card.className = "search-everywhere-card"; |
| 5218 | card.style.cssText = ` |
| 5219 | max-width: 720px; |
| 5220 | width: 100%; |
| 5221 | border-radius: 12px; |
| 5222 | padding: 16px; |
| 5223 | position: relative; |
| 5224 | box-shadow: 0 12px 35px rgba(0,0,0,0.35); |
| 5225 | `; |
| 5226 | card.innerHTML = ` |
| 5227 | <button type="button" |
| 5228 | class="editor-close-btn" |
| 5229 | aria-label="${t("close") || "Close"}" |
| 5230 | id="searchEverywhereClose" |
| 5231 | style="top:8px; right:8px;">×</button> |
| 5232 | <div class="d-flex align-items-center" style="gap:10px; margin-bottom:10px;"> |
| 5233 | <i class="material-icons" aria-hidden="true">travel_explore</i> |
| 5234 | <div> |
| 5235 | <div style="font-weight:600;">${t("search_everywhere_title") || "Search Everywhere"}</div> |
| 5236 | <div class="text-muted" style="font-size:12px;">${t("search_everywhere_desc") || "ACL-aware search across all folders you can access."}</div> |
| 5237 | </div> |
| 5238 | </div> |
| 5239 | <div class="form-group" style="margin-bottom:8px;"> |
| 5240 | <input type="text" id="searchEverywhereInput" class="form-control" placeholder="${t("search_everywhere_placeholder") || "Type to search across all folders"}" autocomplete="off" /> |
| 5241 | </div> |
| 5242 | <div class="d-flex align-items-center" style="gap:8px; margin-bottom:10px; flex-wrap: wrap;"> |
| 5243 | <div class="search-everywhere-source-wrap" style="display:flex; align-items:center; gap:6px;"> |
| 5244 | <label for="searchEverywhereSource" class="mb-0" style="font-size:12px;">${t("search_everywhere_source_label") || "Source"}</label> |
| 5245 | <select id="searchEverywhereSource" class="form-control" style="max-width:220px;"></select> |
| 5246 | </div> |
| 5247 | <label for="searchEverywhereLimit" class="mb-0" style="font-size:12px;">${t("search_everywhere_limit") || "Result limit"}</label> |
| 5248 | <input type="number" id="searchEverywhereLimit" class="form-control" style="max-width:100px;" min="1" max="200" /> |
| 5249 | <button type="button" class="btn btn-primary btn-sm" id="searchEverywhereRun">${t("search_everywhere_run") || "Search"}</button> |
| 5250 | </div> |
| 5251 | <div id="searchEverywhereResults" style="max-height:320px; overflow:auto; border:1px solid #e0e0e0; border-radius:10px; padding:8px; background:rgba(0,0,0,0.02);"> |
| 5252 | <div class="text-muted" style="font-size:12px;">${t("search_everywhere_hint") || "Results will appear here."}</div> |
| 5253 | </div> |
| 5254 | `; |
| 5255 | |
| 5256 | overlay.appendChild(card); |
| 5257 | document.body.appendChild(overlay); |
no test coverage detected