PageSourceSearch

https://spadchina.by/tpl/js/scripts.js

js spadchina.by collected 2026-10-02 22:25:07 UTC 6,387 bytes, 155 lines download raw bytes

1$(document).ready(function() {
2    //custom selects init
3    $('.selectpicker').selectpicker({
4    });
5
6    $('#navbar-header-mobile-toggler')
7        .on('click tap', function () {
8            $(this).toggleClass('active');
9        });
10
11   /* $('.main-menu--head .dropdown--main-menu .dropdown-toggle').on('mouseenter mouseleave click tap', function() {
12        $(this).parent().toggleClass("open");
13        $(this).toggleClass("open");
14    });*/
15
16
17
18    var tableOptionsPharm = {
19        "responsive": true,
20        "paging":   false,
21        "bPaginate": false,
22        "ordering": false,
23        "info":     false,
24        "language": {
25            "searchPlaceholder": "Поиск по аптекам",
26            "processing": "Подождите...",
27            "search": "",
28            "lengthMenu": "Показать _MENU_ записей",
29            "info": "Записи с _START_ до _END_ из _TOTAL_ записей",
30            "infoEmpty": "Записи с 0 до 0 из 0 записей",
31            "infoFiltered": "(отфильтровано из _MAX_ записей)",
32            "infoPostFix": "",
33            "loadingRecords": "Загрузка записей...",
34            "zeroRecords": "Записи отсутствуют.",
35            "emptyTable": "В таблице отсутствуют данные",
36            "paginate": {
37                "first": "Первая",
38                "previous": "Предыдущая",
39                "next": "Следующая",
40                "last": "Последняя"
41            },
42            "aria": {
43                "sortAscending": ": активировать для сортировки столбца по возрастанию",
44                "sortDescending": ": активировать для сортировки столбца по убыванию"
45            }
46        },
47        "dom": '<"top"<"search-icon xl-basic-search">>rt<"bottom"><"clear">'
48    };
49
50    $('.page table').addClass('table table-striped table-condensed table-bordered table-hover').wrap(function(){
51        return '<div class="table-responsive"></div>';
52    });
53    var tables = $('.page table').DataTable(tableOptionsPharm);
54    tables.draw( false )
55        .columns.adjust()
56        .responsive.recalc();
57
58/*
59    $('.preview-list').each(function (index, element) {
60/!*        $(element).addClass(''+index+'');*!/
61
62        var showButton = $(this).find('.preview-list__more .more-link');
63        showButton/!*.addClass(''+index+'')*!/.hide();
64
65        $(this).find('.article-preview').each(function (indexInner, elementInner) {
66   /!*         console.log(''+elementInner+'', indexInner);*!/
67            if (indexInner > 3){
68                $(elementInner).hide();
69                showButton.show().on('click', function () {
70                    /!*console.log(''+element+'');*!/
71                    $(element).find('.article-preview').show('slow');
72                });
73            }
74        });
75    });*/
76
77    var galleryContainer = $('.object-gallery');
78    var imgFirst = galleryContainer.find('a:first-of-type');
79
80    var imgRest = galleryContainer.find('a:not(:first-of-type)');
81    imgRest.wrapAll('<div class="object-gallery__img-rest" />');
82    imgFirst.wrapAll('<div class="object-gallery__img-first" />');
83    console.log(imgRest.length);
84    /*imgFirst.appendTo(galleryContainer);
85    imgRest.appendTo(galleryContainer);*/
86
87    var contentImages = $('.page--inner .page__content--inner > p img, .page--inner .page__content--inner > div > img');
88    contentImages.each(function (i, e) {
89        var imgBigSrc = $(this).attr('src');
90        if ( !$(this).parent('a').attr('data-fancybox')){
91            $(this).wrap('<a href="'+imgBigSrc+'" data-fancybox\=\"gallery-1\"></a>');
92        }
93        if ( !$(this).hasClass('img-responsive')){
94            $(this).addClass('img-responsive');
95        }
96    });
97
98  /*  galleryContainer.children().each(function(i){
99        if(i % 1 == 0 && i != 0){
100            // We get the elements we need to wrap, but they're going to be in reverse order (thanks to .prevAll())
101            var elementsToWrap = $(this).prevAll().not('.wrap2');
102            var temp = [];
103            for(var j=0; j < elementsToWrap.length; j++){
104                // Reverse the objects selected by placing them in a temporary array.
105                temp[(elementsToWrap.length-1) - j] = elementsToWrap.eq(j)[0];
106            }
107            // Wrap the array back into a jQuery object, then use .wrapAll() to add a div around them
108            $(temp).wrapAll('<div class="wrap2" />');
109        }
110    });*/
111
112    /*var galleryContainer = $('.object-gallery');
113    var imgFirst = $('.object-gallery:first-child');
114    imgFirst.detach().wrap('<div class="object-gallery__img--first"></div>');
115    var imgRest = $('.object-gallery:not(:first-child)');
116    imgRest.detach().wrap('<div class="object-gallery__img-rest"></div>');
117    console.log(imgRest);
118    galleryContainer.find('a:first-child').prepend(imgFirst).append(imgRest);*/
119
120
121    $('#navbar-footer-mobile')
122        .on('shown.bs.collapse', function () {
123            $('#navbar-footer-mobile-toggler').addClass('active')
124        })
125        .on('hidden.bs.collapse', function () {
126            $('#navbar-footer-mobile-toggler').removeClass('active')
127    });
128    $('#navbar-header-mobile')
129        .on('shown.bs.collapse', function () {
130            $('#navbar-header-mobile-toggler').addClass('active')
131        })
132        .on('hidden.bs.collapse', function () {
133            $('#navbar-header-mobile-toggler').removeClass('active')
134    });
135
136    $("#navbar-footer").on("shown.bs.collapse", function () {
137        $('html, body').animate({
138            scrollTop: $('#smooth-open-anchor').offset().top + $('#smooth-open-anchor').outerHeight(true) - $(window).height()
139        }, 1800);
140    });
141
142    $(function(){
143        $(".dropdown.active").toggleClass("open",true);
144        $(".dropdown.active").on("hide.bs.dropdown",function(e) {
145            e.preventDefault();
146            return false;
147        });
148    });
149
150    $('.preview-list__more > a').on('click', function () {
151        $(this).parents('.preview-list').find('.article-preview.hidden-xs').removeClass('hidden-xs');
152    });
153
154});
155

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.