MCPcopy
hub / github.com/gildas-lormeau/SingleFile / initPage

Function initPage

lib/single-file-extension-editor.js:2183–2205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2181 }
2182
2183 async function initPage() {
2184 document.querySelectorAll("iframe").forEach(element => {
2185 const pointerEvents = "pointer-events";
2186 element.style.setProperty("-sf-" + pointerEvents, element.style.getPropertyValue(pointerEvents), element.style.getPropertyPriority(pointerEvents));
2187 element.style.setProperty(pointerEvents, "none", "important");
2188 });
2189 document.querySelectorAll("[data-single-file-note-refs]").forEach(noteRefElement => noteRefElement.dataset.singleFileNoteRefs = noteRefElement.dataset.singleFileNoteRefs.replace(/,/g, " "));
2190 deserializeShadowRoots(document);
2191 reflowNotes();
2192 await waitResourcesLoad();
2193 reflowNotes();
2194 document.querySelectorAll(NOTE_TAGNAME).forEach(containerElement => attachNoteListeners(containerElement, true));
2195 insertHighlightStylesheet(document);
2196 maskPageElement = getMaskElement(PAGE_MASK_CLASS, PAGE_MASK_CONTAINER_CLASS);
2197 maskNoteElement = getMaskElement(NOTE_MASK_CLASS);
2198 document.documentElement.onmousedown = onMouseDown;
2199 document.documentElement.onmouseup = document.documentElement.ontouchend = onMouseUp;
2200 document.documentElement.onmouseover = onMouseOver;
2201 document.documentElement.onmouseout = onMouseOut;
2202 document.documentElement.onkeydown = onKeyDown;
2203 document.documentElement.ontouchstart = document.documentElement.ontouchmove = onTouchMove;
2204 window.onclick = event => event.preventDefault();
2205 }
2206
2207 async function initConstants() {
2208 [NOTES_WEB_STYLESHEET, MASK_WEB_STYLESHEET, HIGHLIGHTS_WEB_STYLESHEET] = await Promise.all([

Callers 2

initFunction · 0.70
cancelFormatPageFunction · 0.70

Calls 9

getPropertyValueMethod · 0.80
deserializeShadowRootsFunction · 0.70
reflowNotesFunction · 0.70
waitResourcesLoadFunction · 0.70
attachNoteListenersFunction · 0.70
getMaskElementFunction · 0.70
forEachMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected