PageSourceSearch

https://www.cegema.de/_assets/edb4f517f670dc083919197ece387a78/JavaScript/main.js?1780571688

js cegema.de collected 2026-10-07 04:15:05 UTC 4,635 bytes, 151 lines download raw bytes

1$(function () {
2     
3        headerSticky();
4   
5//  const hash = '#tx-cegema-products';
6//     const header = $('header');
7//     const headerHeight = header.outerHeight() || 0;
8
9//     if (window.location.hash === hash) {
10//         const target = $(hash);
11//         if (target.length) {
12           
13           
14//                 $('html, body').animate({
15//                     scrollTop: $('#tx-cegema-products').offset().top - headerHeight
16//                 }, 100, 'swing', function () {
17                   
18//                     history.replaceState(null, null, window.location.pathname + window.location.search);
19//                 });
20            
21//         }
22//     }
23    headerMobile();
24fillJobTitle();
25    // Events
26    $(window).on('scroll', headerSticky);
27    $(window).on('resize', headerMobile);
28
29    // Menu toggle button
30    $('.navbar-toggler').on('click', function () {
31        $('body').toggleClass('no-scroll');
32        $(this).toggleClass('close');
33    });
34
35    // Collapse events
36    $('#navbarPrimary').on('shown.bs.collapse', function () {
37        $('.navbar-toggler').addClass('close');
38    });
39
40    $('#navbarPrimary').on('hidden.bs.collapse', function () {
41        $('body').removeClass('no-scroll');
42        $('.navbar-toggler').removeClass('close');
43    });
44    const $form = $('form[id^="jobanfrage-"]');
45
46    if ($form.length > 0) {
47        $('.grey-muted-text').removeClass('d-none').addClass('d-block');
48    }
49    const $div = $('div[id^="jobanfrage-"]');
50
51    if ($div.length > 0) {
52        $('.body-conf').addClass('d-none');
53    }
54    if (window.location.hash && window.location.hash.startsWith('#jobanfrage')) {
55        history.replaceState(null, null, window.location.pathname + window.location.search);
56        $('html, body').animate({ scrollTop: 0 }, 0);
57    }
58    // const urlParams = new URLSearchParams(window.location.search);
59    // const isThankYou = urlParams.get('tx_form_formframework[action]') === 'perform';
60
61    // if (isThankYou) {
62    //     // Scroll to top
63    //     $('html, body').animate({ scrollTop: 0 }, 500);
64
65    //     // Remove URL params without reloading
66    //     history.replaceState(null, null, window.location.pathname);
67    // }
68
69       const urlParams = new URLSearchParams(window.location.search);
70    const currentPath = window.location.pathname;
71
72    const isProductDetailPage = currentPath.includes('/produkte/produktdetail');
73    const isThankYou = urlParams.get('tx_form_formframework[action]') === 'perform';
74
75    if (isProductDetailPage && isThankYou) {
76      
77        history.replaceState(null, null, currentPath + window.location.search);
78
79        
80        setTimeout(function () {
81            const $thankYouTarget = $('.confirmation-page'); 
82            if ($thankYouTarget.length) {
83                $('html, body').animate({ scrollTop: $thankYouTarget.offset().top - 112 }, 0);
84            }
85        }, 100); 
86    }
87    // else {
88    //     $('html, body').animate({ scrollTop: 0 }, 500);
89
90    //     // Remove URL params without reloading
91    //     history.replaceState(null, null, window.location.pathname);
92
93    // }
94});
95
96function headerSticky() {
97    const header = $('header');
98    const headerHeight = header.outerHeight();
99
100    if ($(window).scrollTop() > headerHeight) {
101        header.addClass('sticky');
102        // $('body').addClass('withsticky');
103    } else {
104        header.removeClass('sticky');
105         
106    }
107}
108
109let currentMobile = null;
110
111function headerMobile() {
112    const isMobile = window.matchMedia("(max-width: 992px)").matches;
113    const $navWrapper = $('.navbars-wrapper');
114
115    if (isMobile !== currentMobile) {
116        currentMobile = isMobile;
117
118        if (isMobile) {
119            $navWrapper.detach().appendTo('header');
120        } else {
121            $navWrapper.detach().appendTo('.navbar.navbar-expand-lg');
122        }
123    }
124}
125
126function fillJobTitle() {
127$(document).ready(function () {
128    const referrer = document.referrer;
129    const urlParams = new URLSearchParams(window.location.search);
130    const jobTitle = urlParams.get('job');
131
132    if (jobTitle) {
133        // Find label with exact text "Stellenbeschreibung"
134        const label = $("label").filter(function () {
135            return $(this).text().trim() === "Stellenbeschreibung";
136        });
137
138        if (label.length) {
139            const inputId = label.attr("for");
140            const input = $("#" + inputId);
141
142            if (input.length) {
143                input.val(jobTitle); // Set the job title
144                input.closest(".form-group").find("input, select, textarea, button").prop("readonly", true);
145            }
146        }
147    }
148});
149
150
151}

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.