1'use strict'; 2/* 3var placeholder = { 4 replace : function() { 5 var images = document.getElementsByTagName('img'); 6 for(var i = 0; i < images.length; i++) { 7 if (images[i].hasAttribute("data-placeholder")) { 8 images[i].src = 'https://via.placeholder.com/' + images[i].dataset.placeholder; 9 } 10 } 11 console.log(i + ' images was represented via Placeholder.com'); 12 } 13} 14 15placeholder.replace(); 16*/ 17$('#mostDownloadedSwitch>a').on('click', function(){ 18 if (!$(this).hasClass("active")) { 19 $('#mostDownloadedSwitch>a').removeClass('active'); 20 $('.mostDownloaded').slideUp(); 21 var el = $(this).attr('id'); 22 $('#mostDownloaded #' + el).slideDown(); 23 //alert('.mostDownloaded#'+el); 24 $(this).addClass('active'); 25 } 26}); 27 28 29 30/*comments component need this for referent comment*/ 31$('.btReactCommentRef').on('click', function(){ 32 $('input[name=refId]').val($(this).data('id')); 33 $('#formReference').text($(this).attr('title')); 34 $(location).attr('href', '#diskuze') 35}); 36 37$('.review-stars').click(function(){ 38 $('input[name=reviewStars]').val($(this).data('value')); 39}); 40 41$.nette.ext('rating', { 42 load: function () { 43 if ($('#rating').length) { 44 $('#rating input[type=radio].ajax').on('click', function () { 45 $('#rating').submit(); 46 }); 47 } 48 } 49}); 50$(function(){ 51 $.nette.init(); 52}); 53 54$('.searchPhrase').on("input", function () { 55 var val = $(this).val(); 56 57 if (val.length > 1) { 58 $.nette.ajax({ 59 'url': handleOptionSelectedUrl, 60 'data': {phrase: val}, 61 success: function (payload) { 62 var html = ''; 63 payload.searchResponses.hits.hits.sort(function(a, b) { 64 return a._source.downloaded > b._source.downloaded ? -1 : 1; 65 }); 66 payload.searchResponses.hits.hits.forEach(function(element) { 67 if (element._type === 'categories') { 68 html += '<div><a href="/' + element._source.url + '"><img class="appImg" height="25px" width="25px" src="/data/mujsoubor.cz/category/0.png">' + element._source.name + '<small></small></a></div>'; 69 } else { 70 html += '<div><a href="/' + element._source.url + '"><img class="appImg" height="25px" width="25px" src="' + element._source.imgPath + '">' + element._source.title + '<small>' + element._source.downloaded + 'x staženo</small></a></div>'; 71 } 72 }); 73 if (payload.searchResponses.hits.total < 1) { 74 html += '<div class="noResult">Žádná shoda</div>' 75 } 76 $('.whisperer').html(html); 77 $('.whisperer').removeClass("zeroHeight"); 78 } 79 }); 80 } else { 81 $('.whisperer').html(''); 82 } 83 return false; 84}); 85/* Hiding and showing whisperer */ 86 var mouse_is_inside = false;
87 $('.searchPhrase').focusin(function() { 88 $('.whisperer').removeClass("zeroHeight"); 89 mouse_is_inside=true; 90 }); 91 $('.whisperer').hover(function(){ 92 mouse_is_inside=true; 93 }, function(){ 94 mouse_is_inside=false; 95 }); 96 $("body").mouseup(function(){ 97 if(! mouse_is_inside) $('.whisperer').addClass("zeroHeight"); 98 }); 99/* Back to top link */ 100if ($('#back-to-top').length) { 101 var scrollTrigger = 100, // px 102 backToTop = function () { 103 var scrollTop = $(window).scrollTop(); 104 if (scrollTop > scrollTrigger) { 105 $('#back-to-top').addClass('show'); 106 } else { 107 $('#back-to-top').removeClass('show'); 108 } 109 }; 110 backToTop(); 111 $(window).on('scroll', function () { 112 backToTop(); 113 }); 114 $('#back-to-top').on('click', function (e) { 115 e.preventDefault(); 116 $('html,body').animate({ 117 scrollTop: 0 118 }, 700); 119 }); 120} 121/* Remembering stars in rating */ 122$('fieldset.rating').hover(function(){ 123 $(this).find('span.checked').toggleClass('checkedHide'); 124}); 125$(document).ready(function() { 126 $('#li-prehled').removeClass('activeFirst'); 127}); 128
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.