PageSourceSearch

https://alumni.vse.cz/wp-content/themes/vse-redesigned/js/template.js?ver=20260923

js vse.cz collected 2026-09-24 08:29:14 UTC 7,124 bytes, 200 lines download raw bytes

1"use strict";
2
3(function ($, root) {
4  $(function () {
5    //region detekce IE
6    if (document.documentMode || /MSIE|Trident/.test(navigator.userAgent)){
7      var ieWarning = $('#ieWarning');
8      var ieWarningContainer = $('<div class="container" style="font-size:1rem"></div>');
9      ieWarningContainer.append($('<div class="font-weight-bold"></div>').html(ieWarning.data('heading')));
10
11      var ieWarningText = $('<div class="container" style="font-size: 0.95rem;margin-top:5px;"></div>');
12      ieWarningText.append(ieWarning.data('text'));
13      if (ieWarning.data('text-vse')){
14        ieWarningText.append(' ',ieWarning.data('text-vse'));
15      }
16
17      ieWarning.data('heading','');
18      ieWarning.data('text','');
19
20      ieWarning.html(ieWarningContainer);
21      ieWarning.removeClass('d-none');
22      ieWarning.addClass('alert alert-danger py-1 mb-0 border-0');
23
24      $('body').prepend(ieWarning.clone().append(ieWarningText));
25
26      ieWarning.css({'position':'fixed','top':0,'left':0,'width':'100%','z-index':10000});
27    }
28    //endregion detekce IE
29
30    //region menu
31    /**
32     * Metoda pro rozbalení top položky menu
33     * @param menuItemId
34     */
35    function showMenuItem(menuItemId){
36      var modalMenuToogleButton=$('#modal-menu-toogle-button');
37      if (modalMenuToogleButton.is(':visible')){
38        //jde o mobilní menu
39        var modalMenu = $('#modal-mainmenu');
40        if (!modalMenu.hasClass('show')){
41          modalMenuToogleButton.click();
42        }
43        var modalMenuItem=modalMenu.find('#modal-menu-item-'+menuItemId);
44        if (!modalMenuItem.closest('li').hasClass('show')){
45          modalMenuItem.click();
46        }
47      }else{
48        //jde o desktopové menu
49        var mainMenuItem=$('#main-menu-item-'+menuItemId);
50        if (!mainMenuItem.closest('li').hasClass('show')){
51          mainMenuItem.click();
52        }
53      }
54    }
55
56    //přiřazení akcí pro drobečkovou navigaci
57    $('#breadcrumb').find('a.breadcrumb-main-menu').click(function(e){
58      e.preventDefault();
59      e.stopPropagation();
60      showMenuItem($(this).attr('data-menu-item'));
61    });
62
63    //odebrání nadbytečných položek menu
64    $('ul.nav li.remove').remove();
65    //endregion menu
66
67    //region nastylování tabulek
68    $('main table').each(function(){
69      var table=$(this);
70      if (table.hasClass('styled')){
71        //tabulku nemáme nijak upravovat
72        return;
73      }
74
75      //region přesunutí tabulky do table-responsive-lg kontejneru
76      var parentElement=table.parent();
77      if (!(parentElement.hasClass('table-responsive')||parentElement.hasClass('table-responsive-xl')||parentElement.hasClass('table-responsive-lg')||parentElement.hasClass('table-responsive-sm')||parentElement.hasClass('table-responsive-md'))){
78        var tableContainer=$('<div class="table-responsive-lg"></div>');
79        table.before(tableContainer);
80        tableContainer.html(table);
81      }
82      //endregion přesunutí tabulky do table-responsive-lg kontejneru
83
84      //region styly pro tabulku
85      if (!table.hasClass('table')){
86        table.addClass('table');
87        //region pořešení rámečků
88        if (table.attr('border')>0){
89          table.addClass('table-bordered');
90        }
91        //endregion pořešení rámečků
92
93        if (!table.children('thead').length){
94          //tabulka nemá záhlaví
95          var thead=$('<thead></thead>');
96          var firstRow=true;
97          var isHead=true;
98          var prependThead=false;
99          table.find('tr').each(function(){
100            //procházíme jednotlivé řádky
101            var tr=$(this);
102            if (firstRow){
103              if (tr.children('th').length===0){
104                //tabulka nemá určené žádné buňky záhlaví
105                var trHtml=tr.html();
106                trHtml=trHtml.replace(/<td/g,'<th').replace(/<\/td/g,'</th');
107                tr.html(trHtml);
108                table.prepend(thead);
109                thead.append(tr);
110                isHead=false;
111              }else if(tr.children('td').length>0){
112                isHead=false;
113              }else {
114                table.prepend(thead);
115                thead.append(tr);
116              }
117              firstRow=false;
118              return;
119            }
120            if (isHead){
121              if (tr.children('td').length===0 && tr.children('th').length>0){
122                thead.append(tr);
123              }else {
124                isHead=false;
125              }
126            }
127          });
128        }
129      }
130      //endregion styly pro tabulku
131    });
132    //endregion nastylování tabulek
133
134    //region modální okno vyhledávání
135    $('#modal-search').on('shown.bs.modal', function(){
136      var searchInput=$('#modal-search-input');
137      searchInput.select();
138      searchInput.focus();
139    });
140    //endregion modální okno vyhledávání
141
142    //region collapsable
143    $('.collapse-more').each(function(){
144      var content = $(this);
145      var contentId=content.attr('id');
146      if (!contentId){
147        contentId='collapse-more-rand-'.Math.random().toString(36);
148        content.attr('id',contentId);
149      }
150      
151      var btn = $('<button type="button" role="button" aria-expanded="false"></button>');
152      btn.attr('class',(content.data('button-class')?content.data('button-class'):'btn btn-primary'));
153      btn.attr('aria-controls',contentId);
154      btn.attr('id',contentId+'-expand-button');
155      btn.text((content.data('button')?content.data('button'):'...'));
156
157      var btnDiv = $('<div class="my-2 text-center border-1 border-primary"></div>');
158      btnDiv.append(btn);
159
160      btn.click(function(e){
161        e.preventDefault();
162        e.stopPropagation();
163        content.collapse('show');
164        btnDiv.remove();
165        if (content.attr('data-linkable-id')){
166          location.hash='#'+contentId;
167        }
168      });
169
170      content.removeClass('collapse-more');
171      content.addClass('collapse');
172      content.attr('aria-expanded',false);
173      content.attr('aria-controls',contentId);
174      content.after(btnDiv);
175    });
176    //endregion collapse
177    //region rozbalení sekce podle jejího ID
178    var expandSectionByHash = function(){
179      if (location.hash){
180        var element = $(location.hash);
181        if (element.hasClass('collapse-section')){
182          if (element.hasClass('collapse')){
183            element.parent().find('button#' + element.attr('id') + '-expand-button').click();
184          }
185        }else if(element.hasClass('collapse-card')){
186          var collapseCardExpandLink = element.find('a.collapse-card-expand-link');
187          if (collapseCardExpandLink.hasClass('collapsed')){
188            collapseCardExpandLink.click();
189          }
190        }
191      }
192    };
193
194    $(window).on('hashchange',function(e){
195      expandSectionByHash();
196    });
197    expandSectionByHash();
198    //endregion rozbalení sekce podle jejího ID
199  });
200})(jQuery, this);

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.