PageSourceSearch

https://megamebel.com/local/templates/megamebel/assets/js/custom_new1.js

js megamebel.com collected 2026-10-07 19:42:42 UTC 1,375 bytes, 43 lines download raw bytes

1(function () {
2    function fixDigiUnits(root) {
3        var scope = root || document;
4        var nodes = scope.querySelectorAll
5            ? scope.querySelectorAll(".digi-product__sizes .digi-product__sizes_value")
6            : [];
7
8        nodes.forEach(function (el) {
9            var text = (el.textContent || "").trim();
10            // 292 мм / 292мм / 292 мм -> 292 см
11            var next = text.replace(/(\d)\s*мм/gi, "$1 см");
12            if (next !== text) el.textContent = next;
13        });
14    }
15
16    function init() {
17        fixDigiUnits(document);
18
19        if (!document.body) return;
20        new MutationObserver(function (mutations) {
21            mutations.forEach(function (m) {
22                m.addedNodes.forEach(function (n) {
23                    if (!n || n.nodeType !== 1) return;
24                    fixDigiUnits(n);
25                });
26            });
27        }).observe(document.body, { childList: true, subtree: true });
28
29        // страховка для поздней отрисовки Diginetica
30        var i = 0;
31        var t = setInterval(function () {
32            fixDigiUnits(document);
33            i++;
34            if (i > 20) clearInterval(t);
35        }, 500);
36    }
37
38    if (document.readyState === "loading") {
39        document.addEventListener("DOMContentLoaded", init);
40    } else {
41        init();
42    }
43})();

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.