PageSourceSearch

https://www.mattaricocoro.com/wp-content/themes/jinr/lib/js/wp-lightbox-reparent.js?ver=1.4.9

js mattaricocoro.com collected 2026-10-04 04:39:39 UTC 1,113 bytes, 44 lines download raw bytes

1/**
2 * WordPress 標準ライトボックスのオーバーレイを inert 祖先の外へ移す。
3 * inert 配下ではオーバーレイのクリック(閉じる)が無効化されるため、body 直下へリペアレントする。
4 */
5(function () {
6	'use strict';
7
8	var OVERLAY_SELECTOR = '.wp-lightbox-overlay';
9
10	function reparentOverlay(el) {
11		if (!el || el.parentNode === document.body) {
12			return;
13		}
14		document.body.appendChild(el);
15	}
16
17	function scanForOverlays(root) {
18		if (!root || root.nodeType !== 1) {
19			return;
20		}
21		if (root.matches && root.matches(OVERLAY_SELECTOR)) {
22			reparentOverlay(root);
23		}
24		if (root.querySelectorAll) {
25			root.querySelectorAll(OVERLAY_SELECTOR).forEach(reparentOverlay);
26		}
27	}
28
29	function init() {
30		scanForOverlays(document.body);
31
32		new MutationObserver(function (mutations) {
33			mutations.forEach(function (mutation) {
34				mutation.addedNodes.forEach(scanForOverlays);
35			});
36		}).observe(document.body, { childList: true, subtree: true });
37	}
38
39	if (document.body) {
40		init();
41	} else {
42		document.addEventListener('DOMContentLoaded', init);
43	}
44})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.