(doc: Document, docWindow: Window, plugin: CodeSpacePlugin)
| 371 | } |
| 372 | |
| 373 | function queueAllCodeEmbedsInDocument(doc: Document, docWindow: Window, plugin: CodeSpacePlugin) { |
| 374 | doc.querySelectorAll(".file-embed").forEach((element) => { |
| 375 | const embedEl = element as HTMLElement; |
| 376 | const sourcePath = resolveSourcePathForEmbed(embedEl, plugin); |
| 377 | if (!sourcePath) { |
| 378 | docWindow.setTimeout(() => { |
| 379 | const retrySourcePath = resolveSourcePathForEmbed(embedEl, plugin); |
| 380 | if (!retrySourcePath) return; |
| 381 | rememberSourcePath(embedEl, retrySourcePath); |
| 382 | scheduleProcessCodeEmbed(embedEl, plugin, retrySourcePath); |
| 383 | }, 120); |
| 384 | return; |
| 385 | } |
| 386 | |
| 387 | rememberSourcePath(embedEl, sourcePath); |
| 388 | scheduleProcessCodeEmbed(embedEl, plugin, sourcePath); |
| 389 | }); |
| 390 | } |
| 391 | |
| 392 | export function queueCodeEmbedsInElement(rootEl: HTMLElement, plugin: CodeSpacePlugin, sourcePath: string) { |
| 393 | if (!sourcePath) return; |
no test coverage detected