PageSourceSearch

https://www.dispex-graphics.de/templates/shaper_helixultimate/js/main.js

js dispex-graphics.de collected 2026-10-06 06:15:06 UTC 7,351 bytes, 217 lines download raw bytes

1/**
2 * @package Helix Ultimate Framework
3 * @author JoomShaper https://www.joomshaper.com
4 * @copyright Copyright (c) 2010 - 2018 JoomShaper
5 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
6*/
7
8jQuery(function ($) {
9
10    // Stikcy Header
11    if ($('body').hasClass('sticky-header')) {
12        var header = $('#sp-header');
13        var topbar = $('#sp-topbar');
14
15        if($('#sp-header').length) {
16            var headerHeight = header.outerHeight();
17            var stickyHeaderTop = header.offset().top;
18            var stickyHeader = function () {
19                var scrollTop = $(window).scrollTop();
20                if (scrollTop > stickyHeaderTop) {
21                    header.addClass('header-sticky');
22                    /* if(topbar.length) {
23                        topbar.addClass('topbar-sticky');
24                    } */
25                } else {
26                    if (header.hasClass('header-sticky')) {
27                        header.removeClass('header-sticky');
28                    }
29
30                   /* if(topbar.length && topbar.hasClass('topbar-sticky')) {
31                        topbar.removeClass('topbar-sticky');
32                    } */
33                }
34            };
35            stickyHeader();
36            $(window).scroll(function () {
37                stickyHeader();
38            });
39        }
40
41        if ($('body').hasClass('layout-boxed')) {
42            var windowWidth = header.parent().outerWidth();
43            header.css({"max-width": windowWidth, "left": "auto"});
44        }
45    }
46
47    // go to top
48    $(window).scroll(function () {
49        if ($(this).scrollTop() > 100) {
50            $('.sp-scroll-up').fadeIn();
51        } else {
52            $('.sp-scroll-up').fadeOut(400);
53        }
54    });
55
56    $('.sp-scroll-up').click(function () {
57        $("html, body").animate({
58            scrollTop: 0
59        }, 600);
60        return false;
61    });
62
63    // Preloader
64    $(window).on('load', function () {
65        $('.sp-preloader').fadeOut(500, function() {
66            $(this).remove();
67        });
68    });
69
70    //mega menu
71    $('.sp-megamenu-wrapper').parent().parent().css('position', 'static').parent().css('position', 'relative');
72    $('.sp-menu-full').each(function () {
73        $(this).parent().addClass('menu-justify');
74    });
75
76    // Offcanvs
77    $('#offcanvas-toggler').on('click', function (event) {
78        event.preventDefault();
79        $('.offcanvas-init').addClass('offcanvas-active');
80    });
81
82    $('.close-offcanvas, .offcanvas-overlay').on('click', function (event) {
83        event.preventDefault();
84        $('.offcanvas-init').removeClass('offcanvas-active');
85    });
86    
87    $(document).on('click', '.offcanvas-inner .menu-toggler', function(event){
88        event.preventDefault();
89        $(this).closest('.menu-parent').toggleClass('menu-parent-open').find('>.menu-child').slideToggle(400);
90    });
91
92    //Tooltip
93    $('[data-toggle="tooltip"]').tooltip();
94
95    // Article Ajax voting
96    $('.article-ratings .rating-star').on('click', function (event) {
97        event.preventDefault();
98        var $parent = $(this).closest('.article-ratings');
99
100        var request = {
101            'option': 'com_ajax',
102            'template': template,
103            'action': 'rating',
104            'rating': $(this).data('number'),
105            'article_id': $parent.data('id'),
106            'format': 'json'
107        };
108
109        $.ajax({
110            type: 'POST',
111            data: request,
112            beforeSend: function () {
113                $parent.find('.fa-spinner').show();
114            },
115            success: function (response) {
116                var data = $.parseJSON(response);
117                $parent.find('.ratings-count').text(data.message);
118                $parent.find('.fa-spinner').hide();
119
120                if(data.status)
121                {
122                    $parent.find('.rating-symbol').html(data.ratings)
123                }
124
125                setTimeout(function(){
126                    $parent.find('.ratings-count').text('(' + data.rating_count + ')')
127                }, 3000);
128            }
129        });
130    });
131
132    //  Cookie consent
133    $('.sp-cookie-allow').on('click', function(event) {
134        event.preventDefault();
135        
136        var date = new Date();
137        date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000));
138        var expires = "; expires=" + date.toGMTString();               
139        document.cookie = "spcookie_status=ok" + expires + "; path=/";
140
141        $(this).closest('.sp-cookie-consent').fadeOut();
142    });
143
144    $(".btn-group label:not(.active)").click(function() {
145        var label = $(this);
146        var input = $('#' + label.attr('for'));
147        
148        if (!input.prop('checked')) {
149            label.closest('.btn-group').find("label").removeClass('active btn-success btn-danger btn-primary');
150            if (input.val() === '') {
151                label.addClass('active btn-primary');
152            } else if (input.val() == 0) {
153                label.addClass('active btn-danger');
154            } else {
155                label.addClass('active btn-success');
156            }
157            input.prop('checked', true);
158            input.trigger('change');
159        }
160        var parent = $(this).parents('#attrib-helix_ultimate_blog_options'); 
161        if( parent ){ 
162            showCategoryItems( parent, input.val() )
163        }
164	});
165	$(".btn-group input[checked=checked]").each(function() {
166        if ($(this).val() == '') {
167            $("label[for=" + $(this).attr('id') + "]").addClass('active btn btn-primary');
168        } else if ($(this).val() == 0) {
169            $("label[for=" + $(this).attr('id') + "]").addClass('active btn btn-danger');
170        } else {
171            $("label[for=" + $(this).attr('id') + "]").addClass('active btn btn-success');
172        }
173        var parent = $(this).parents('#attrib-helix_ultimate_blog_options'); 
174        if( parent ){
175            parent.find('*[data-showon]').each( function() {
176                $(this).hide();
177            })
178        }
179    });
180        
181
182    function showCategoryItems(parent, value){
183        var controlGroup = parent.find('*[data-showon]'); 
184        controlGroup.each( function() {
185            var data = $(this).attr('data-showon')
186            data = typeof data !== 'undefined' ? JSON.parse( data ) : []
187            if( data.length > 0 ){
188                if(typeof data[0].values !== 'undefined' && data[0].values.includes( value )){
189                    $(this).slideDown();
190                }else{
191                    $(this).hide();
192                }
193            }
194        })
195    };
196
197    $(window).on('scroll', function(){
198        var scrollBar = $(".sp-reading-progress-bar");
199        if( scrollBar.length > 0 ){
200            var s = $(window).scrollTop(),
201                d = $(document).height(),
202                c = $(window).height();
203            var scrollPercent = (s / (d - c)) * 100;
204            const postition = scrollBar.data('position')
205            if( postition === 'top' ){
206                // var sticky = $('.header-sticky');
207                // if( sticky.length > 0 ){
208                //     sticky.css({ top: scrollBar.height() })
209                // }else{
210                //     sticky.css({ top: 0 })
211                // }
212            }
213            scrollBar.css({width: `${scrollPercent}%` })
214        }        
215    }); 
216
217});

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.