PageSourceSearch

https://www.oum.ru/render/js/sidebar.js

js oum.ru collected 2026-10-02 07:35:57 UTC 1,361 bytes, 45 lines download raw bytes

1(function() {
2
3  let sidebar;
4
5  const init = () => {
6    sidebar.find('.accordion').children('ul').first().children('li').each(function() {
7      const link = $(this).find('div > a').get(0);
8      link && checkCurrentLink.call(link);
9    });
10  };
11
12  const load = (e) => {
13    if (e.target.tagName !== 'ASIDE') return;
14    document.removeEventListener('lazybeforeunveil', load);
15
16    const sections = e.target.getElementsByClassName('widget-sections')[0];
17    if (!sections) return;
18    const ib = sections.dataset.iblock;
19    if (!ib) return;
20    const placeholder = sections.getElementsByClassName('widget-placeholder')[0];
21    if (!placeholder) return;
22
23    fetch('/render/cache/sidebar_'+ib+'.html').then(function(response) {
24      if (!response.ok) throw new Error('Failed to load sidebar: ' + response.statusText);
25      return response.text();
26    }).then(function(html) {
27      const el = document.createElement('div');
28      sections.replaceChild(el, placeholder);
29      el.outerHTML = html;
30      init();
31    });
32  };
33
34  onDocumentReady(function() {
35    sidebar = $('#main-container').find('aside');
36    if (sidebar.hasClassAny([ 'lazyloading', 'lazyloaded' ])) {
37      load({ target: sidebar[0] });
38    } else if (sidebar.hasClass('lazyload')) {
39      document.addEventListener('lazybeforeunveil', load);
40    } else {
41      init();
42    }
43  });
44
45})();

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.