PageSourceSearch

https://www.maxautomation.com/js/common.js

js maxautomation.com collected 2026-10-10 02:39:15 UTC 5,932 bytes, 178 lines download raw bytes

1jQuery(`
2    <div 
3        class="nav-toggle" 
4        role="button" 
5        tabindex="0"
6        aria-label="Open navigation menu"
7        aria-expanded="false"
8        aria-controls="main-menu"
9    >
10        <div class="nav-toggle-icon" aria-hidden="true"></div>
11        <span class="sr-only">Open navigation menu</span>
12    </div>
13`)
14    .appendTo('.header .container')
15    .eq(0)
16    .on('touchstart mousedown', toggleNavigation);
17jQuery('<div class="nav-shade"/>')
18    .appendTo(jQuery('body'))
19    .on('touchstart mousedown', toggleNavigation);
20
21jQuery('.nav-main--tree>li').each(function (i) {
22    if (jQuery('ul', this).length) {
23        jQuery(
24            '<input type="checkbox" class="nav-drop-sensor" id="nav-drop--' + i + '">'
25        ).insertBefore(jQuery('ul', this));
26        jQuery('<label class="nav-drop-trigger" for="nav-drop--' + i + '"></label>').appendTo(
27            jQuery(this)
28        );
29    }
30});
31
32function toggleNavigation(e) {
33    e.stopPropagation();
34    e.preventDefault();
35    var navOpen = jQuery('html').toggleClass('nav-open').hasClass('nav-open');
36}
37
38function adjustNavigation() {
39    var $items = $('.nav-main--tree>li').css({ 'max-width': '' }),
40        navWidth = jQuery('.nav-main--tree').eq(0).outerWidth();
41
42    if (jQuery(window).width() < 1024) {
43        return false;
44    }
45
46    $items.css({ 'max-width': Math.floor(navWidth / $items.length) + 'px' });
47}
48
49/* Debounced resize event */
50var resizeTimeout;
51$(window).on('resize', function () {
52    clearTimeout(resizeTimeout);
53    resizeTimeout = setTimeout(function () {
54        adjustElements();
55    }, 500);
56});
57
58/* Initial adjustment */
59//adjustElements();
60
61function adjustElements() {
62    //adjustNavigation();
63    //equalizeHeights();
64    //adjustFooterSpace();
65}
66
67/* ================================================================================ */
68/* Adjust main bottom margin to account for the footer height */
69
70function adjustFooterSpace() {
71    $('.main').css({ 'margin-bottom': '' });
72    if ($(window).width() < 800) {
73        return false;
74    }
75    setTimeout(function () {
76        $('.main').css({ 'margin-bottom': $('.footer').eq(0).outerHeight() + 'px' }); //console.log(1);
77    }, 1000);
78}
79
80/* ================================================================================ */
81//     /* Back to top */
82$('<div class="totop" role="button" aria-label="Back to top" title="Back to top" tabindex="0"/>')
83    .prependTo($('footer > .container').eq(0))
84    .on('mousedown touchstart', function () {
85        $('html, body').animate({ scrollTop: 0 }, 2000);
86    });
87
88/* ================================================================================ */
89/* Equalize block heights */
90
91function equalizeHeights() {
92    $('.section--sameheight .block-container').each(function () {
93        var $blocks = $('.block', this);
94
95        /* Remove previously set inline styles */
96        $('.block,.content,figure,.iconteaser,.ir-item-box', this)
97            .removeClass('responsive')
98            .css({ height: '', 'padding-top': '', 'padding-bottom': '' });
99
100        /* No equalization < 1025px */
101        if ($(window).width() < 1025) {
102            return false;
103        }
104
105        /* Adjust all image block content heights in a first step */
106
107        var mh = 0;
108        $('.block--image', this)
109            .each(function (i) {
110                var ch = $('.content', this).eq(0).outerHeight();
111                mh = ch > mh ? ch : mh;
112            })
113            .find('.content')
114            .css({ height: mh + 'px' });
115
116        /* Get blockset height */
117        var mh = $(this).outerHeight();
118
119        /* Adjust block heights */
120        $blocks.each(function (i) {
121            var bh = $(this).outerHeight(),
122                lh = mh - bh;
123
124            if (lh > 0) {
125                /* Image block: adjust image height */
126                if ($(this).hasClass('block--image')) {
127                    var fh = $('figure', this).eq(0).height();
128                    $('figure', this)
129                        .addClass('responsive')
130                        .css('height', fh + lh);
131                }
132
133                /* Regular content block: set height */
134                if ($(this).hasClass('block--content')) {
135                    $(this).css({ height: mh + 'px' });
136                }
137
138                /* Vertical centering */
139                if ($(this).hasClass('block--vcenter')) {
140                    var pt = parseFloat($(this).css('padding-top')),
141                        pb = parseFloat($(this).css('padding-bottom'));
142                    $(this).css({
143                        'padding-top': lh / 2 + pt + 'px',
144                        'padding-bottom': lh / 2 + pb + 'px'
145                    });
146                }
147
148                /* Icon teasers: set height */
149                if ($(this).hasClass('block--iconteaser')) {
150                    $('.iconteaser', this).css({ height: mh + 'px' });
151                }
152
153                /* IR Items */
154                if ($(this).hasClass('block--ircontent')) {
155                    var $items = $('.ir-item-box', this);
156                    var ilh = lh / $items.length;
157                    $items.each(function () {
158                        var pt = parseFloat($(this).css('padding-top')),
159                            pb = parseFloat($(this).css('padding-bottom'));
160                        $(this).css({
161                            'padding-top': ilh / 2 + pt + 'px',
162                            'padding-bottom': ilh / 2 + pb + 'px'
163                        });
164                    });
165                }
166            }
167        });
168    });
169}
170// setTimeout(function () {
171//     equalizeHeights();
172// }, 1000);
173document.getElementById('cookienotice-dismiss').addEventListener('click', function () {
174    document.cookie = 'cookies-agreed=yes;path=/';
175    document
176        .getElementById('cookienotice')
177        .parentNode.removeChild(document.getElementById('cookienotice'));
178});

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.