MCPcopy Index your code
hub / github.com/pyscript/pyscript / pyEditor

Function pyEditor

core/src/plugins/py-editor.js:511–525  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

509
510// triggered both ASAP on the living DOM and via MutationObserver later
511const pyEditor = () => {
512 if (timeout) return;
513 timeout = setTimeout(resetTimeout, 250);
514 for (const [type, interpreter] of TYPES) {
515 const selector = `script[type="${type}-editor"]`;
516 for (const script of document.querySelectorAll(selector)) {
517 // avoid any further bootstrap by changing the type as active
518 script.type += "-active";
519 // don't await in here or multiple calls might happen
520 // while the first script is being initialized
521 queue = queue.then(() => init(script, type, interpreter));
522 }
523 }
524 return queue;
525};
526
527new MutationObserver(pyEditor).observe(document, {
528 childList: true,

Callers 2

resetTimeoutFunction · 0.85
py-editor.jsFile · 0.85

Calls 1

initFunction · 0.70

Tested by

no test coverage detected