PageSourceSearch

https://energizerholdings.com/wp-content/plugins/wp-timeline-designer-pro/public/js/wp-timeline-public.js

js energizerholdings.com collected 2026-10-02 09:59:49 UTC 20,502 bytes, 483 lines download raw bytes

1;
2'use strict';
3var wptlpublic = {
4    init: function() {
5        $ = jQuery;
6        this.do_height();
7        this.run_flexslider();
8    },
9    do_height: function() {
10        a = this;
11        a.set_height();
12        // $('.wtl-schedule-wrap').bind(
13        //     'DOMSubtreeModified',
14        //     function() {
15        //         a.set_height();
16        //     }
17        // );
18        $('.wtl-schedule-wrap').bind(
19            'MutationObserver',
20            function() {
21                a.set_height();
22            }
23        );
24    },
25    set_height: function() {
26        $('.wtl-schedule-meta-content').each(
27            function() {
28                h = $(this).height();
29                h = h + 'px';
30                $(this).parents('.wtl-schedule-post-content').css('min-height', h);
31                $('.wtl_template_hire_layout .wtl-schedule-wrap:before').css('float', 'inherit');
32            }
33        );
34    },
35    auto_height: function(target) {
36        var maxHeight = 0;
37        $ = jQuery;
38        $(target).each(function() {
39            if ($(this).outerHeight() > maxHeight) {
40                maxHeight = $(this).outerHeight() - 100;
41            }
42        }).height(maxHeight);
43    },
44    run_flexslider: function() {
45        if ($('.wtl-flexslider.flexslider').length > 0) {
46            $('.wtl-flexslider.flexslider').flexslider({ animation: "slide", controlNav: false, prevText: "", nextText: "", rtl: ajax_object.is_rtl });
47        }
48    },
49
50};;
51(function($) {
52    $(window).load(
53        function() {
54            wptlpublic.init();
55            if (typeof AOS != "undefined") {
56                AOS.init({ startEvent: 'DOMContentLoaded' });
57            }
58        }
59    );
60
61})(jQuery);
62
63jQuery(document).ready(
64    function() {
65        (function($) {
66            if (typeof AOS != "undefined") {
67                AOS.init();
68            }
69            // wptlpublic.auto_height('#wtl_boxy_layout .wtl_blog_template.media-grid');
70            //wptlpublic.auto_height('.blog_template.wise_block_blog');
71        }(jQuery))
72    }
73);
74
75jQuery(document).ready(
76    function() {
77        (function($) {
78            if ($(window).width() > 767) {
79                var parent_element = $('.wp_timeline_post_list.zigzag_layout .wtl-schedule-all-post-content .content-main');
80                parent_element.each(function() {
81                    var post = $(this),
82                        postScroll = post.height();
83                    postScroll = postScroll + 20;
84                });
85                var t_parent_element = $('.wp_timeline_post_list.top_divide_layout .wtl-main-social-cat-content');
86                t_parent_element.each(function() {
87                    var post = $(this),
88                        postScroll = post.height();
89
90                    postScroll = postScroll;
91
92                    post.parents('.wtl-post-content').find('.wtl-head-post').css('margin-bottom', postScroll);
93                });
94            }
95
96        }(jQuery))
97    }
98);
99jQuery(document).ready(
100    function() {
101        (function($) {
102        jQuery('.sportking_layout .wtl_al_slider .wtl-schedule-post-content:nth-child(3n-2)').addClass('wtl-boxOne-sl');
103
104		jQuery('.sportking_layout .wtl_al_slider .wtl-schedule-post-content:nth-child(3n-1)').addClass('wtl-boxTwo-sl');
105
106		jQuery('.sportking_layout .wtl_al_slider .wtl-schedule-post-content:nth-child(3n)').addClass('wtl-boxThree-sl');
107
108		jQuery('.sportking_layout .wtl_al_slider .wtl-schedule-post-content:nth-child(3n-1)').addClass('wtl-grid-sl-2');
109
110		jQuery('.sportking_layout .wtl_al_slider .wtl-schedule-post-content:nth-child(3n)').addClass('wtl-grid-sl');
111
112        }(jQuery))
113    }
114);
115
116jQuery(document).ready(
117    function() {
118        (function($) {
119            $('.leafty_layout .leftmdate').click(function(e) {
120                e.preventDefault();
121            });
122        }(jQuery))
123    }
124);
125
126jQuery(document).ready(
127    function() {
128        (function($) {
129            $('.sportking_layout .leftmdate').click(function(e) {
130                e.preventDefault();
131            });
132        }(jQuery))
133    }
134);
135
136
137(function($) {
138
139    $(document).ready(function() {
140        setupFade();
141        setupClickToScroll();
142        setupPostAnimation();
143        setupScrollToTop();
144        enableScrollAbortion();
145
146        // Trigger window.scroll, this will initiate some of the scripts
147        $(window).scroll();
148    });
149
150
151    // Allow user to cancel scroll animation by manually scrolling
152    function enableScrollAbortion() {
153        var $viewport = $('html, body');
154        $viewport.on('scroll mousedown DOMMouseScroll mousewheel keyup', function(e) {
155            if (e.which > 0 || e.type === 'mousedown' || e.type === 'mousewheel') {
156                $viewport.stop();
157            }
158        });
159    }
160
161    function setupScrollToTop() {
162        var scrollSpeed = 750;
163        $('.trigger-scroll-to-top').click(function(e) {
164            e.preventDefault();
165            $('html, body').animate({
166                scrollTop: 0
167            }, scrollSpeed);
168        });
169    }
170
171
172    function setupPostAnimation() {
173        var posts = $('.filledtimeline .wtl-schedule-wrap .wtl-schedule-post-content');
174        $(window).on('scroll resize', function() {
175
176            var currScroll = $(window).scrollTop() > $(document).scrollTop() ? $(window).scrollTop() : $(document).scrollTop(),
177                windowHeight = $(window).height(), // Needs to be here because window can resize
178                overScroll = Math.ceil(windowHeight * .20),
179                treshhold = (currScroll + windowHeight) - overScroll;
180
181            posts.each(function() {
182
183                var post = $(this),
184                    postScroll = post.offset().top
185
186                if (postScroll > treshhold) {
187                    post.addClass('hiddentext');
188                } else {
189                    post.removeClass('hiddentext');
190                }
191
192            });
193
194        });
195    }
196
197    function setupFade() {
198
199        var posts = $('.filledtimeline .wtl-schedule-wrap .wtl-schedule-post-content').reverse(),
200            stemWrapper = $('.stem-wrapper'),
201            stemWrappericon = $('.stem-wrappericon'),
202            halfScreen = $(window).height() / 2;
203
204        $(window).on('scroll resize', function() {
205
206            delay(function() {
207
208                var currScroll = $(window).scrollTop() > $(document).scrollTop() ? $(window).scrollTop() : $(document).scrollTop(),
209                    scrollSplit = currScroll + halfScreen;
210
211                posts.removeClass('topactive').each(function() {
212                    var post = $(this),
213                        postOffset = post.offset().top;
214
215                    if (scrollSplit > postOffset) {
216                        post.addClass('topactive');
217                    }
218                });
219
220                posts.removeClass('active').each(function() {
221
222                    var post = $(this),
223                        postOffset = post.offset().top;
224
225                    if (scrollSplit > postOffset) {
226
227                        // Add active class to fade in
228                        post.addClass('active');
229
230
231                        // Get post color
232                        var color = post.data('stem-color') ? post.data('stem-color') : null,
233                            allColors = 'color-green color-yellow color-white'
234
235                        stemWrapper.removeClass(allColors);
236                        if (color !== null) {
237                            stemWrapper.addClass('color-' + color);
238                        }
239
240                        var iconcolor = post.data('stem-color') ? post.data('stem-color') : null,
241                            iconallColors = 'color-green color-yellow color-white'
242
243                        stemWrappericon.removeClass(iconallColors);
244
245                        if (iconcolor !== null) {
246                            stemWrappericon.addClass('color-' + iconcolor);
247                        }
248
249                        return false;
250                    }
251
252                });
253            }, 20);
254
255        });
256
257    }
258
259
260    function setupClickToScroll(post) {
261
262        var scrollSpeed = 750;
263
264        $('.filledtimeline .wtl-schedule-wrap .wtl-schedule-post-content .wtl-post-center-image').click(function(e) {
265            e.preventDefault();
266
267            var icon = $(this),
268                post = icon.closest('.wtl-schedule-post-content'),
269                postTopOffset = post.offset().top,
270                postHeight = post.height(),
271                halfScreen = $(window).height() / 2,
272                scrollTo = postTopOffset - halfScreen + (postHeight / 2);
273
274            $('html, body').animate({
275                scrollTop: scrollTo
276            }, scrollSpeed);
277        });
278
279    }
280
281})(jQuery);
282
283jQuery(document).ready(
284    function() {
285        (function($) {
286            var parent_element = $('#wtl_classictimeline_layout').find('.wtl-blog-image');
287            parent_element.each(function() {
288                if ($(this).find('.schedule-image-wrapper.wtl-post-thumbnail').length == 0) {
289                    $(this).css('border', 'none');
290                }
291            });
292            var parent_element_hire = $('.wtl_template_hire_layout');
293            parent_element_hire.each(function() {
294                if ($(this).find('.schedule-image-wrapper.wtl-post-thumbnail')) {
295                    $('.wtl-post-content').css('margin-top', '30px');
296                }
297                if ($(window).width() < 768) {
298                    if ($(this).find('.schedule-image-wrapper.wtl-post-thumbnail')) {
299                        $('.wtl-post-title').css('margin-top', '30px');
300                        $('.wtl-post-content').css('margin-top', '0');
301                    }
302                }
303            });
304            var parent_element_divide = $('.divide_layout');
305            parent_element_divide.each(function() {
306                if ($(window).width() < 768) {
307                    if ($(this).find('.schedule-image-wrapper.wtl-post-thumbnail')) {
308                        $('.divide_layout span.wtl-post-content-ss-left i').css('top', '90%');
309                    } else {
310                        $('.divide_layout span.wtl-post-content-ss-left i').css('top', '75%');
311                    }
312                }
313            });
314            $(".popup_id").click(function(e) {
315                e.preventDefault();
316                var id = $(this).data('id');
317                $('#' + id).fadeIn($(this).data());
318            });
319
320            $(".js-modal-close").click(function(e) {
321                e.preventDefault();
322                $(".modal-box").fadeOut(500);
323            });
324            $(".blog_template.timeline_graph").each(function() {
325                if( $(this).find('.schedule-image-wrapper.wtl-post-thumbnail, .wp-post-default-no-image .wp-timeline-post-image.post-image').length == 0 ) {
326                    $(this).find('.horizantal-line').hide();
327                } else {
328                    $(this).find('.horizantal-line').show();
329                }
330            });
331            if( $(".wtl-read-more-div").length == 0 ) {
332                $(".popup_story").css("margin-left", "0");
333            } else {
334                $(".popup_story").css("margin-left", "10px");
335            }
336        }(jQuery))
337    }
338);
339
340var delay = (function() {
341    var timer = 0;
342    return function(callback, ms) {
343        clearTimeout(timer);
344        timer = setTimeout(callback, ms);
345    };
346})();
347
348jQuery.fn.reverse = function() {
349    return this.pushStack(this.get().reverse(), arguments);
350};
351
352jQuery(document).ready(function() {
353    jQuery('.wp-timeline-post-image.post-image figure .img-overlay a[rel^=lightcase], .post-image .img-overlay a[rel^=lightcase], .wtl-post-thumbnail .img-overlay a[rel^=lightcase]').lightcase({
354        transition: "elastic",
355        // speedIn: 250,
356        // speedOut: 250,
357        showTitle: true,
358        slideshow: true,
359        // timeout: 2000,
360        useKeys: true,
361        navigateEndless: true,
362        showSequenceInfo: true,
363        maxWidth: 500,
364        maxHeight: 500,
365    });
366
367    var addClassOnScroll = function () {
368        var windowTop = jQuery(window).scrollTop();
369        jQuery('.wtl-schedule-post-content .wtl_year, .wtl_blog_template.media-grid, .wtl_blog_single_post_wrapp, .wtl-blog-curve-timeline-inner .wtl-schedule-post-content, .filledtimeline .wtl-schedule-post-content, .fullwidth_layout_cover .wtl-schedule-post-content, .wtl-schedule-post-content.wtl_template_hire_layout, .infographic_layout_cover .wtl-schedule-post-content, .colorful_vertical_timeline_layout_cover .wtl-schedule-post-content, .schedule.wtl_single_post_wrapp, .soft-block-post-wrapper.wtl_single_post_wrapp, .story.blog-wrap, .vertical_blur_layout .wtl-schedule-post-content, .zigzag_layout .wtl-schedule-post-content, .wise_block_blog.wtl_blog_single_post_wrapp').each(function (index, elem) {
370            var offsetTop = jQuery(elem).offset().top;
371            var outerHeight = jQuery(this).outerHeight(true);
372
373            if( windowTop > (offsetTop - 50) && windowTop < ( offsetTop + outerHeight)) {
374                var elemId = jQuery(elem).attr('id');
375                jQuery(".wtl-bullets-container ul li a.active").removeClass('active');
376                jQuery(".wtl-bullets-container ul li a[href='#" + elemId + "']").addClass('active');
377            }
378        });
379    };
380
381    jQuery(function () {
382        jQuery(window).on('scroll', function () {
383            addClassOnScroll();
384        });
385    });
386    jQuery(document).on("click",".overlay_horizontal_cover .lb-left-arrow",function(){
387        if(jQuery("body").find(".lb-items-holder").length > 0 ){
388            jQuery(".lb-items-holder .lb-items").each(function(){
389                var width = jQuery(this).css("width");
390                jQuery(this).parent().removeAttr("style");
391                jQuery(this).parent().attr("style","width:"+width+" !important;");
392            });
393        }
394    });
395
396    jQuery(document).on("click",".leafty_layout .wtl-ss-right.slick-arrow ",function(){
397        if(jQuery("body").find(".wtl_al_slider").length > 0 ){
398            var height = jQuery(".wtl_al_slider > div.slick-list.draggable").css("height");
399            jQuery(".wtl_al_slider > div.slick-list.draggable .wtl-schedule-post-content").css("min-height",height);
400        }
401    });
402
403    jQuery(document).on("click",".full_vertical_layout .wtl-ss-right.slick-arrow ",function(){
404        if(jQuery("body").find(".wtl_al_slider").length > 0 ){
405            var height = jQuery(".wtl_al_slider > div.slick-list.draggable").css("height");
406            jQuery(".wtl_al_slider > div.slick-list.draggable .wtl-fullvertical-post-content").css("min-height",height);
407        }
408    });
409
410    if(jQuery(".wtl_wrapper").parent('[class*="brxe-"]').length > 0){
411        jQuery(".wtl_wrapper").parent('[class*="brxe-"]').addClass("wtl_brxe");
412    }
413
414    if(jQuery(".zigzag_layout .wtl-schedule-post-content").length > 0){
415        var lastnum = jQuery(".zigzag_layout .wtl-schedule-post-content").length + 1;
416        jQuery('.zigzag_layout .wtl-schedule-post-content:nth-child('+lastnum+') .cross-line').hide();
417    }
418    if(jQuery("#wtl_story_layout .wp_timeline_sortby_wrap").length > 0){
419        jQuery('#wtl_story_layout .wtl_blog_template.story .startup').css('left', '85px');
420    }
421
422    // tooltip
423    var timeout;
424    function hide() {
425    timeout = setTimeout(function () {
426        jQuery('.colorful_vertical_timeline_layout_cover .timeline-content-desc:not(.tooltip-on) .wtl-author, .colorful_vertical_timeline_layout_cover .category-link:not(.tooltip-on) .colorful_tm_display_pro, .colorful_vertical_timeline_layout_cover .tags:not(.tooltip-on) .colorful_tm_display_pro, .colorful_vertical_timeline_layout_cover .wtl-post-footer .timeline_footer_share_icon:not(.tooltip-on) .wtl_social_share_postion, .colorful_vertical_timeline_layout_cover .wtl-post-footer .wtl-post-date:not(.tooltip-on) .timeline_meta_date_data, .colorful_vertical_timeline_layout_cover .post-category.taxonomies:not(.tooltip-on) .timeline_icon_post_footer_tooltip_1').fadeOut(500);
427    }  , 100);
428    };
429    jQuery(document).on("mouseover",'.colorful_vertical_timeline_layout_cover .timeline-content-desc .wtl-author-title, .colorful_vertical_timeline_layout_cover .wtl-post-category .link-lable, .colorful_vertical_timeline_layout_cover .wtl-post-tags .link-lable, .colorful_vertical_timeline_layout_cover .timeline_footer_inner_share_icon, .colorful_vertical_timeline_layout_cover .timelin_meta_date_icon',function () {
430        jQuery('.colorful_vertical_timeline_layout_cover .tooltip-on').removeClass("tooltip-on");
431        jQuery(".colorful_vertical_timeline_layout_cover .timeline-layout").removeClass("current_tooltip_main");
432        jQuery(this).parents(".timeline-layout").addClass("current_tooltip_main");
433        jQuery(this).parent().addClass("tooltip-on");
434        jQuery(this).addClass("current-tooltip-lable");
435        clearTimeout(timeout);
436        jQuery(this).siblings('.colorful_vertical_timeline_layout_cover .wtl-author, .colorful_vertical_timeline_layout_cover .category-link .colorful_tm_display_pro, .colorful_vertical_timeline_layout_cover .tags .colorful_tm_display_pro, .colorful_vertical_timeline_layout_cover .wtl-post-footer .timeline_footer_share_icon .wtl_social_share_postion, .colorful_vertical_timeline_layout_cover .wtl-post-footer .wtl-post-date .timeline_meta_date_data, .colorful_vertical_timeline_layout_cover .post-category.taxonomies .timeline_icon_post_footer_tooltip_1').fadeIn(500);
437        }).mouseout(function(){
438            jQuery('.current-tooltip-lable').parent().removeClass("tooltip-on");
439            jQuery('.colorful_vertical_timeline_layout_cover .current-tooltip-lable').removeClass("current-tooltip-lable");
440            hide();
441        });
442        
443        jQuery(document).on("mouseover",' .colorful_vertical_timeline_layout_cover .wtl-author, .colorful_vertical_timeline_layout_cover .category-link .colorful_tm_display_pro, .colorful_vertical_timeline_layout_cover .tags .colorful_tm_display_pro, .colorful_vertical_timeline_layout_cover .wtl-post-footer .timeline_footer_share_icon .wtl_social_share_postion, .colorful_vertical_timeline_layout_cover .wtl-post-footer .wtl-post-date .timeline_meta_date_data',function () {
444        jQuery(".timeline-layout").removeClass("current_tooltip_main");
445        jQuery(this).parents(".timeline-layout").addClass("current_tooltip_main");
446        jQuery(this).parent().addClass("tooltip-on");
447        jQuery(this).addClass("current-tooltip-lable");
448        clearTimeout(timeout);
449        }).mouseout(function(){
450            jQuery('.current-tooltip-lable').parent().removeClass("tooltip-on");
451            jQuery('.current-tooltip-lable').removeClass("current-tooltip-lable");
452            hide();
453    });
454    // tooltip
455
456
457    jQuery(' .colorful_vertical_timeline_layout_cover .timeline_icon_post_footer_tooltip, .colorful_vertical_timeline_layout_cover .timeline_footer_share_icon .wtl_social_share_postion, .colorful_vertical_timeline_layout_cover .wtl-author.author, .colorful_vertical_timeline_layout_cover .timeline_meta_date_data, .colorful_vertical_timeline_layout_cover .colorful_tm_display_pro').addClass("timeline_icon_post_footer_tooltip_1");
458    jQuery(".colorful_vertical_timeline_layout_cover .timeline-content-desc .wtl-post-date, .colorful_vertical_timeline_layout_cover .category-link, .colorful_vertical_timeline_layout_cover .tags").css({"position": "relative"});
459    jQuery(".colorful_vertical_timeline_layout_cover .timeline-left-line-main").last().addClass("timeline-border-line-last-icon"); 
460
461    jQuery('.milestone_layout_four_wrap').each(function(){
462        var extra = 4 - jQuery(this).find('.wtl-schedule-post-content').length;
463        if(extra > 0 && extra != 4){
464            jQuery(this).addClass('tmp-extra');
465            var height = jQuery('.milestone_layout_four_wrap.tmp-extra .wtl-schedule-post-content:first-child').outerHeight();
466            while(extra > 0){
467                jQuery(this).append('<div class="wtl-schedule-post-content" style="height:'+height+'px"></div>');
468                extra--;
469            }
470            jQuery(this).removeClass('tmp-extra');
471        }
472    });
473
474
475    // asidebar class add
476    var widthGet = jQuery(".wp_timeline_post_list");
477    var result = widthGet.width();
478    if(result <= 970){
479        jQuery(widthGet).addClass("colorful_timeline_asidebar_dy");
480    };
481    // asidebar class add
482    jQuery("#wtl_advanced_layout .slick-slide .wtl-post-center-image").addClass("aos-animate"); 
483});

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.