PageSourceSearch

https://www.albathyment.com.pl/AlbaThyment/wp-content/themes/enfold/js/avia-snippet-widget.js

js albathyment.com.pl collected 2026-09-26 16:56:14 UTC 2,614 bytes, 86 lines download raw bytes

1(function($) {
2
3    "use strict";
4
5    $(document).ready(function() {
6
7        $('.avia_auto_toc').each(function(){
8
9            var $toc_section = $(this).attr('id');
10            var $levels = 'h1';
11            var $levelslist = new Array();
12            var $excludeclass = '';
13
14            var $toc_container = $(this).find('.avia-toc-container');
15
16            if ($toc_container.length){
17                var $levels_attr = $toc_container.attr('data-level');
18                var $excludeclass_attr = $toc_container.attr('data-exclude');
19
20                if(typeof $levels_attr !== undefined) {
21                    $levels = $levels_attr;
22                }
23                if(typeof $excludeclass_attr !== undefined) {
24                    $excludeclass = $excludeclass_attr;
25                }
26            }
27
28            $levelslist = $levels.split(',');
29
30            $('.entry-content-wrapper').find($levels).each( function() {
31
32                var $h_id = $(this).attr('id');
33                var $tagname = $(this).prop('tagName').toLowerCase();
34                var $txt = $(this).text();
35                var $pos = $levelslist.indexOf($tagname);
36                var $extraclass = '';
37
38                if ($h_id == undefined){
39                    var $new_id = av_pretty_url($txt);
40                    $(this).attr('id',$new_id);
41                    $h_id = $new_id;
42                }
43
44                if ( ! $(this).hasClass('av-no-toc') && ! $(this).hasClass($excludeclass) && ! $(this).parent().hasClass($excludeclass)){
45                    var $list_tag = '<a href="#' + $h_id + '" class="avia-toc-link avia-toc-level-' + $pos + '"><span>' + $txt + '</span></a>';
46                }
47
48                $toc_container.append($list_tag);
49
50            });
51
52
53            // Smooth Scrolling
54
55            $(".avia-toc-smoothscroll .avia-toc-link").on('click',function(e){
56                e.preventDefault();
57                var $target = $(this).attr('href');
58
59                var $offset = 50;
60
61                // calculate offset if there is a sticky header
62                var $sticky_header = $('.html_header_top.html_header_sticky #header');
63
64                if ( $sticky_header.length ) {
65                    $offset =  $sticky_header.outerHeight() + 50;
66                }
67
68                $('html,body').animate({scrollTop:$($target).offset().top - $offset})
69            });
70
71
72        });
73
74    });
75
76
77    function av_pretty_url(text) {
78
79        return text.toLowerCase()
80            .replace(/[^a-z0-9]+/g, "-")
81            .replace(/^-+|-+$/g, "-")
82            .replace(/^-+|-+$/g, '');
83
84    }
85
86})( jQuery );

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.