PageSourceSearch

https://www.hemmingen.de/fileadmin/templates/js/classes/components/tooltip.js

js hemmingen.de collected 2026-10-02 16:47:33 UTC 3,821 bytes, 131 lines download raw bytes

1/**
2 * @typedef {Object} AccordionContentSelectors
3 * @property {string}  titleClass;
4 * @property {string}  contentClass;
5 *
6 */
7
8
9import tippy$1 from '../../libs/tippy/tippy.js';
10import {document} from "../../libs/ssr-window/ssr-window.esm.js";
11var i = 0;
12// decrypt helper function
13function decryptCharcode(n,start,end,offset) {
14    n = n + offset;
15    if (offset > 0 && n > end) {
16        n = start + (n - end - 1);
17    } else if (offset < 0 && n < start) {
18        n = end - (start - n - 1);
19    }
20    return String.fromCharCode(n);
21}
22// decrypt string
23function decryptString(enc,offset) {
24    var dec = "";
25    var len = enc.length;
26    for(var i=0; i < len; i++) {
27        var n = enc.charCodeAt(i);
28        if (n >= 0x2B && n <= 0x3A) {
29            dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :
30        } else if (n >= 0x40 && n <= 0x5A) {
31            dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @
32        } else if (n >= 0x61 && n <= 0x7A) {
33            dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z
34        } else {
35            dec += enc.charAt(i);
36        }
37    }
38    return dec;
39}
40// decrypt spam-protected emails
41function linkTo_UnCryptMailto(s) {
42    location.href = decryptString(s,-2);
43}
44
45
46
47let mails = document.getElementsByClassName("mail");
48let mailsList = [];
49
50
51/**
52 * @param {AccordionContentSelectors} cssSelectors
53 */
54export class Tooltip {
55    
56    /**
57     * Instantiates a Basic Accordion for HW Projects
58     * @param {HWLib} hwLib - the current HWLib instance
59     */
60    constructor(hwLib) {
61        
62        if (hwLib.isDebugMode) console.groupCollapsed("Tooltip Constructor");
63        
64        if (!hwLib) {
65            console.error("There is no HWLIB!!!!!!!");
66            console.groupEnd();
67            return;
68        }
69        
70        this._hwLib = hwLib;
71        
72        /*--If there are any mails, add a tooltip--*/
73        // if (mails.length) {
74        //     var w;
75        //     for (w = 0; w < mails.length; w++) {
76        //         this.initMail();
77        //         i++;
78        //     }
79        // }
80
81        
82        console.groupEnd();
83    }
84
85
86    normalizeMail(x) {
87        var href = document.getElementsByClassName("mail")[x].href;  //Hole alle hrefs bei der Klasse mail
88        var mail = decryptString(href,-2);
89        mail = mail.replace("hytyqapgnr8jgliRm_SlApwnrKygjrm('mailto:","");
90        mail = mail.replace("\\","");
91        mail = mail.replace("');","");
92        return mail;
93    }
94
95    identifyMail(y) {
96        var hrefid = document.getElementsByClassName("mail")[y].href;  //Hole alle hrefs bei der Klasse mail
97        hrefid = hrefid.replace("javascript:linkTo_UnCryptMailto('ocknvq,","");
98        hrefid = hrefid.replace("');","");
99        hrefid = hrefid.slice(hrefid.indexOf("\\"));
100        return hrefid;
101    }
102
103    
104    initMail() {
105        //console.log("initMail");
106        //var href = document.getElementsByClassName("mail")[0].href;  //Hole alle hrefs bei der Klasse mail
107        //var mail = decryptString(href,-2);
108         //mail = mail.replace("hytyqapgnr8jgliRm_SlApwnrKygjrm('mailto:","");
109         //mail = mail.replace("\\","");
110         //mail = mail.replace("');","");
111
112        var mailist = document.querySelectorAll('.mail');
113        var hreflist = document.querySelectorAll('[href*=vguvuejoguvBvguv0fg]');
114        console.log(hreflist);
115        console.log(mailist);
116
117        tippy$1(document.querySelectorAll("[href*="+ this.identifyMail(i) + "]"), {
118            distance: 12,
119            arrow: true,
120            arrowType: 'sharp',
121            arrowTransform: 'scale(0.7)',
122            interactive: true,
123            placement: "right",
124            content: this.normalizeMail(i) })
125            console.log(this.identifyMail(i));
126        console.log(this.normalizeMail(i));
127
128    }
129    
130    
131}

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.