PageSourceSearch

https://hram-sveta.ru/templates/i-Blog/js/scripts.js

js hram-sveta.ru collected 2026-09-30 14:33:42 UTC 8,771 bytes, 250 lines download raw bytes

1
2(function($) {
3    "use strict";
4    /*==============================
5        Is mobile
6    ==============================*/
7    var isMobile = {
8        Android: function() {
9            return navigator.userAgent.match(/Android/i);
10        },
11        BlackBerry: function() {
12            return navigator.userAgent.match(/BlackBerry/i);
13        },
14        iOS: function() {
15            return navigator.userAgent.match(/iPhone|iPad|iPod/i);
16        },
17        Opera: function() {
18            return navigator.userAgent.match(/Opera Mini/i);
19        },
20        Windows: function() {
21            return navigator.userAgent.match(/IEMobile/i);
22        },
23        any: function() {
24            return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
25        }
26    }
27    var windowWidth = window.innerWidth,
28        windowHeight = $(window).height();
29
30
31
32    /*==============================
33        Image cover
34    ==============================*/
35    function imgCover() {
36        $('.image-cover, .blog-grid .post-media .image-wrap, .blog-grid-2 .post-media .image-wrap, .blog-list .post-media').each(function() {
37            var $this = $(this),
38                image = $this.find('img'),
39                heightWrap = $this.outerHeight(),
40                widthImage = image.outerWidth(),
41                heightImage = image.outerHeight();
42                if (heightImage < heightWrap) {
43                  image.css({
44                    'height': '100%',
45                    'width': 'auto'
46                  });
47                }
48        });
49    }
50
51    function piPlaceholder() {
52        var $ph = $('input[type="search"], input[type="text"], input[type="email"], textarea');
53        $ph.each(function() {
54            var value = $(this).val();
55            $(this).focus(function() {
56                if ($(this).val() === value) {
57                    $(this).val('');
58                }
59            });
60            $(this).blur(function() {
61                if ($(this).val() === '') {
62                    $(this).val(value);
63                }
64            });
65        });
66    }
67
68
69    // READY FUNCTION
70    $(document).ready(function() {
71
72        if (isMobile.any()) {
73            $('html').addClass('ismobile');
74        }
75
76        $('.post-share').each(function() {
77            $(this).find('.share-toggle').click(function() {
78                $(this).toggleClass('toggle-active');
79                $(this).siblings('.share').toggleClass('share-active');
80            });
81        });
82
83        $('.widget_latest_post .content-text').each(function() {
84            var numLine = 2,
85                fontSize = 14,
86                lineHeight = 1.7,
87                height = fontSize * lineHeight * numLine;
88            $(this).find('a').css({
89                'font-size': fontSize + 'px',
90                'line-height': lineHeight + 'em',
91                'max-height': height,
92                'overflow': 'hidden'
93            });
94        });
95
96        if ($('.sidebar-page').children('.widget-wrapper').length === 0) {
97            $('.sidebar-page')
98                .children('#page-header')
99                .css('margin-bottom', 200);
100        }
101
102        $('.ismobile').find('.blog-grid-2').on('click', '.post', function() {
103            $('.ismobile').find('.blog-grid-2 .post').removeClass('post-active');
104            $(this).addClass('post-active');
105        });
106    });
107
108    $(window).load(function() {
109        $('.preloader').fadeOut(1000);
110        imgCover();
111        piPlaceholder();
112
113        if ($('.grid-wrapper').length > 0) {
114            setTimeout(function() {
115                $('.grid-wrapper').masonry({
116                    columnWidth: '.grid-item.col-md-3',
117                    itemSelector: '.grid-item'
118                });
119            },1);
120            $('.grid-wrapper .grid-item:nth-of-type(1), .grid-wrapper .grid-item:nth-of-type(10n + 1)')
121                .removeClass('col-md-3')
122                .addClass('col-md-6');
123
124            $('.grid-wrapper .grid-item:nth-of-type(8), .grid-wrapper .grid-item:nth-of-type(10n + 8)')
125                .removeClass('col-md-3')
126                .addClass('col-md-6');
127        }
128    });
129    $(window).on('load resize', function() {
130        var containerpageWidth = $('.page-container').width(),
131            sidebarWidth = $('.sidebar-page').outerWidth(),
132            contentWidth = containerpageWidth - sidebarWidth - 15;
133        $('.blog-content').width(contentWidth);
134
135
136        var dataHeader = $('#page-header').data('header');
137        if (window.innerWidth <= 991) {
138            var headerHeight = $('#page-header .logo').height() + 60;
139            $('.blog-content').css('padding-top', headerHeight);
140            $('[data-header="header-top"]').removeClass(dataHeader);
141            $('#page-header').prependTo('#page-wrap');
142        } else {
143            $('.blog-content').css('padding-top', '0');
144            $('[data-header="header-top"]').addClass(dataHeader);
145            $('#page-header').prependTo('.sidebar-page');
146        }
147        var headerTop = $('#page-header.header-top'),
148            headerHeight = headerTop.find('.logo').height() + 60;
149        headerTop
150            .closest('#page-wrap')
151            .find('.page-container')
152                .css({
153                    'margin-top': headerHeight + 52,
154                });
155        if ($('#page-wrap').children('#page-header').length === 0) {
156            $('#page-header.header-top').prependTo('#page-wrap');
157        }
158        if (window.innerWidth <= 991 || $('#page-header').hasClass(dataHeader) == true) {
159            $('.navlist').height($(window).height());
160        }
161    });
162    $(window).load(function() {
163        if ($('.pi-navigation').length > 0) {
164            var nav = $('.pi-navigation');
165            $('.menu-item-has-children').each(function() {
166                var itemhaschilren = $(this).children('a');
167                itemhaschilren.on('click', function(evt) {
168                    evt.preventDefault();
169                    $(this)
170                        .next('.sub-menu')
171                            .stop()
172                            .slideToggle(300);
173                });
174            });
175        }
176        var containerOffset = $('.page-container').offset().left;
177        if (containerOffset < 210) {
178            var translate = 210 - containerOffset + 10;
179        }
180        $('.open-menu').on('click', function() {
181            $(this)
182                .toggleClass('toggle-active')
183                .css({
184                    '-webkit-transform': 'translateX(0px)',
185                });
186            $(document).find('.open-menu.toggle-active').css({
187                '-webkit-transform': 'translateX(' + translate + 'px)',
188            });
189            $('.navlist').toggleClass('navlist-active');
190        });
191        $('html').click(function() {
192            $('.open-menu')
193                .removeClass('toggle-active')
194                .css({
195                    '-webkit-transform': 'translateX(0px)',
196                });
197            $('.navlist').removeClass('navlist-active');
198        });
199        $('.open-menu, .navlist').click(function(evt) {
200            evt.stopPropagation();
201        });
202    });
203
204    $(window).load(function() {
205        var paginationSlider = ['<i class="fa fa-caret-left"></i>', '<i class="fa fa-caret-right"></i>'];
206        if ($(".twitter-slider").length > 0) {
207            $(".twitter-slider").owlCarousel({
208                autoPlay: false,
209                slideSpeed: 300,
210                navigation: true,
211                pagination: false,
212                singleItem: true,
213                autoHeight: true,
214                transitionStyle: 'fade',
215                navigationText: paginationSlider
216            });
217        }
218        
219        if ($(".post-slider").length > 0) {
220            $(".post-slider").owlCarousel({
221                autoPlay: false,
222                slideSpeed: 300,
223                navigation: true,
224                pagination: false,
225                singleItem: true,
226                autoHeight: true,
227                navigationText: paginationSlider
228            });
229        }
230        
231        if ($(".related-slider").length > 0) {
232            $(".related-slider").owlCarousel({
233                autoPlay: false,
234                slideSpeed: 300,
235                items: 3,
236                itemsCustom: [[0, 1], [600, 2], [870, 3]],
237                navigation: true,
238                pagination: false,
239                autoHeight: true,
240                itemsScaleUp: true,
241                navigationText: paginationSlider
242            });
243        }
244        setTimeout(function() {
245            $('.sidebar-page').theiaStickySidebar({
246                updateSidebarHeight: true
247            });
248        },1000);
249    });
250})(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.