PageSourceSearch

https://www.starateli.ru/static/js/application.js

js starateli.ru collected 2026-10-04 21:11:23 UTC 3,349 bytes, 120 lines download raw bytes

1
2function fix_height() {
3    var sidenav_block   = $('.sidenav-block'),
4        content_wrapper = $('.page-content-wrapper');
5
6    if(sidenav_block.innerHeight() < content_wrapper.innerHeight()) {
7        sidenav_block.height(content_wrapper.innerHeight());
8    }
9}
10
11$(window).load(function () {
12  $(".print-page").click(function(){window.print();});
13
14//  setHeight = function() {
15////    $('body').each(function() {
16////        var i;
17////        for (i = 0; i <= 1; i++) {
18////          var maxH = 0;
19////          var blocks = $(this).find('.q' + i);
20////          blocks.each(function() {
21////              maxH = maxH > $(this).height() ? maxH : $(this).height();
22////          });
23////          blocks.css('height', maxH + 20);
24////          blocks.eq(1).css('height', maxH);
25////        }
26////    });
27//  }
28//
29//  setDymanicHeight = function() {
30////      var i;
31////      for (i = 0; i <= 1; i++) {
32////          var maxH = 0;
33////          var blocks = $('body').find('.q' + i);
34////          blocks.each(function() {
35////              $(this).removeAttr('style');
36////          });
37////      }
38////      setHeight()
39//  }
40
41  //
42
43});
44
45$(document).ready(function() {
46  //  css fixes for content
47  $('.product-characteristics-table table').addClass('table table-condensed');
48  $('.certificates ul').addClass('list-unstyled');
49
50  fix_height();
51
52  var sidebar_trigger = $('.hamburger');
53  sidebar_trigger.click(function () {
54    toggle_sidebar(
55      !sidebar_trigger.hasClass('is-closed')
56      );
57  });
58
59  $('[data-redirect-select]').change(function(ev) {
60    window.location.href = $('option:selected', this).attr('data-redirect-to');
61  });
62
63  function getCookie(name) {
64    var matches = document.cookie.match(new RegExp(
65      "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
66      ));
67    return matches ? decodeURIComponent(matches[1]) : undefined;
68  }
69
70  $.ajaxSetup({
71    headers: {
72      'X-XSRF-TOKEN': getCookie('csrftoken')
73    }
74  });
75
76  if ($('#qa-fileupload').length) {
77    $('#qa-fileupload').fileupload({
78      dataType: 'json',
79      done: function (e, data) {
80        $('.qa-fileupload-errors').html('');
81        $('.qa-fileupload-files').append(
82          '<li><a href="' + data.result.file + '" target="_blank">' + data.result.file + '</a></li>'
83          );
84
85        if ($('.qa-fileupload-value').val()) {
86          $('.qa-fileupload-value').val($('.qa-fileupload-value').val() + "," + data.result.id.toString());
87        } else {
88          $('.qa-fileupload-value').val(data.result.id.toString());
89        }
90      },
91
92      fail: function(e, data) {
93        try {
94          var errors = JSON.parse(data.jqXHR.responseText);
95          var errorsList = errors.file.map(function(error) {
96            return '<li>' + error + '</li>';
97          });
98
99          $('.qa-fileupload-errors').html(errorsList.join(', '));
100        } catch (e) {
101          alert("Неизвестная ошибка загрузки файла.")
102        }
103      }
104    });
105  }
106
107
108  $('.tags-all-button').click(function() {
109    $('.tags-children').show();
110    $(this).hide();
111    return false;
112  });
113
114  var scope = $('.product-show');
115  $('.toggler .toggler-header, .toggler .toggle-icon, scope').click(function() {
116    $(this).siblings('.togglable-content').toggle();
117    // setDymanicHeight();
118    fix_height();
119  });
120})

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.