PageSourceSearch

https://softelegance.com/SoftEleganceTheme/js/scripts.js

js softelegance.com collected 2026-09-24 12:54:20 UTC 5,183 bytes, 190 lines download raw bytes

1(function($) {
2
3  var scrollDisabled = false;
4  var scrollTop;
5
6  function disablePageScroll(keepScrollPosition) {
7    scrollDisabled = true;
8    scrollTop = document.scrollingElement.scrollTop;
9    var scrollbarWidth = window.innerWidth - document.documentElement.offsetWidth;
10    document.documentElement.style.cssText = `height: 100%; overflow: hidden; position: fixed; width: calc(100% - ${scrollbarWidth}px);`;
11    document.body.style.cssText = `height: 100%; overflow: hidden;`;
12    document.querySelector('.wrapper').style.cssText = 'height: 100%; overflow: hidden;';
13    if (keepScrollPosition) {
14      document.querySelector('.wrapper').scrollTop = scrollTop;
15    }
16  }
17
18  function enableScroll() {
19    scrollDisabled = false;
20    document.documentElement.style.cssText = '';
21    document.body.style.cssText = '';
22    document.querySelector('.wrapper').style.cssText = '';
23    document.scrollingElement.scrollTop = scrollTop;
24  }
25
26  function initDropdown() {
27    $('.menu .drop').click(function() {
28      if ($(this).hasClass('expanded')) {
29        $(this).removeClass('expanded');
30      } else {
31        $(this).addClass('expanded');
32      }
33    })
34  }
35
36  function initSlider() {
37    $(".slider-article").slick({
38      prevArrow: "<button type='button' class='slick-prev'></button>",
39      nextArrow: "<button type='button' class='slick-next'></button>",
40      infinite: false,
41    });
42  }
43
44  function initTripleSlider() {
45    $(".slider-triple__inner").slick({
46      appendArrows: $('.slider-triple__controls'),
47      appendDots: $('.slider-triple__controls'),
48      arrows: true,
49      dots: true,
50      prevArrow: "<button type='button' class='slick-prev'></button>",
51      nextArrow: "<button type='button' class='slick-next'></button>",
52      slidesToShow: 3,
53      slidesToScroll: 3,
54      infinite: true,
55      responsive: [
56        {
57          breakpoint: 1024,
58          settings: {
59            slidesToShow: 2,
60            slidesToScroll: 2
61          }
62        },
63        {
64          breakpoint: 600,
65          settings: {
66            slidesToShow: 1,
67            slidesToScroll: 1
68          }
69        }
70      ]
71    });
72  }
73
74  function initPopup() {
75    $('.article').magnificPopup({
76      type:'image',
77      delegate: '.image-link',
78      removalDelay: 300,
79      tClose: 'Закрыть (Esc)',
80      tLoading: 'Загрузка...',
81      gallery:{
82        enabled:true,
83        tPrev: 'Назад',
84        tNext: 'Вперед',
85        tCounter: '%curr% из %total%'
86      }
87    });
88  }
89
90  function initSearch() {
91    $('.search').each(function() {
92      var $search = $(this);
93      var $input = $search.find('input');
94      var $icon = $search.find('.search__icon');
95
96      if ($input.val()) {
97        $icon.addClass('hidden');
98      }
99
100      $input.focus(function() {
101        $icon.addClass('hidden');
102      });
103
104      $input.blur(function() {
105        if ($input.val()) return;
106        $icon.removeClass('hidden');
107      });
108    });
109
110  }
111
112  function initMenu() {
113    var $wrapper = $('.wrapper');
114    var windowWidth = window.innerWidth;
115
116    $('.menu-btn').click(function (event) {
117      event.preventDefault();
118      $wrapper.toggleClass('menu-shown');
119      if ($wrapper.hasClass('menu-shown')) {
120        disablePageScroll(true);
121      } else {
122        enableScroll();
123      }
124    });
125
126    $('.menu-overlay').click(function () {
127      $wrapper.removeClass('menu-shown');
128      enableScroll();
129    });
130  }
131
132  function initClocks() {
133    if (!$('.offices').length) return;
134
135    var date = new Date();
136
137    $('.offices .clock').each(function () {
138      var utc = +$(this).attr('data-timezone'),
139          hours = (date.getUTCHours() + utc) % 12 || 12,
140          hourAngle = hours * 30,
141          minAngle = date.getMinutes() * 6;
142
143      $(this).find('.hour-hand').css('transform', 'rotate('+hourAngle+'deg)');
144      $(this).find('.minute-hand').css('transform', 'rotate('+minAngle+'deg)');
145    })
146  }
147
148    function replaceSearch() {
149        //debugger;
150        var $formLucene = $('div.main form[action="/Search/Search"]');
151        if ($formLucene.length) {
152            var $txtSearchLucene = $formLucene.find('input[name="q"]');
153            var $formSearchSE = $('header.header #formSearch');
154            var $txtSearchSE = $formSearchSE.find('#txtQuery');
155            $txtSearchSE.val($txtSearchLucene.val())
156            $formLucene.hide();
157        }
158    }
159
160  $(function() {
161    initDropdown();
162    // initSlider();
163    // initTripleSlider();
164    // initPopup();
165    initSearch();
166    initMenu();
167    initClocks();
168
169      replaceSearch();
170  });
171
172  //function showCookiesPopup(isShow) {
173  //    var $ctrlConfirmationPopup = $(".ctrlConfirmationPopup");
174  //    if (isShow) {
175  //        $ctrlConfirmationPopup.removeClass("d-none").addClass("d-flex");
176  //    }
177  //    else {
178  //        $ctrlConfirmationPopup.removeClass("d-flex").addClass("d-none");
179  //    }
180  //}
181  //(function () {
182  //    var $btnClose = $(".ctrlConfirmationPopup .btnClose");
183  //    $btnClose.on("click",
184  //        function() {
185  //            console.log('CookiesPopup: Close');
186  //            showCookiesPopup(false);
187  //        });
188  //}());
189
190})(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.