PageSourceSearch

https://www.muko-berlin-brandenburg.de/_assets/22cf45b1172aadb18e2…/JavaScript/tooltip.js?1783036244

js muko-berlin-brandenburg.de collected 2026-10-04 17:13:45 UTC 1,372 bytes, 39 lines download raw bytes

1$(document).ready(function () {
2    const tooltipMap = {
3        "CF": "Cystische Fibrose, andere Bezeichnung für Mukoviszidose"
4    };
5
6    function replaceInTextNodes(element) {
7        element.contents().each(function () {
8            if (this.nodeType === Node.TEXT_NODE) {
9                let text = this.nodeValue;
10                let replaced = false;
11
12                for (const [key, value] of Object.entries(tooltipMap)) {
13                    const regex = new RegExp(`\\b${key}\\b`, "g");
14
15                    if (regex.test(text)) {
16                        const html = text.replace(regex, `<abbr class="tooltip-target" data-toggle="tooltip" data-placement="top" title="${value}">${key}</abbr>`);
17                        $(this).replaceWith(html);
18                        replaced = true;
19                        break;
20                    }
21                }
22
23                if (replaced) {
24                    replaceInTextNodes(element);
25                    return false;
26                }
27            } else if (
28                this.nodeType === Node.ELEMENT_NODE &&
29                !['SCRIPT', 'STYLE', 'ABBR'].includes(this.tagName)&&
30                !$(this).is('nav.breadcrumb-wrap')) {
31                replaceInTextNodes($(this));
32            }
33        });
34    }
35
36    replaceInTextNodes($(".main"));
37
38    $('[data-toggle="tooltip"]').tooltip();
39});

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.