1// pretraga tabela 2$(document).ready(function () { 3 let table = '#vesti' 4 5 $('.pagination').html(' ') 6 var trnum = 0 7 var maxRows = 9 8 var totalRows = $(table+' .vesti').length 9 console.log(totalRows); 10 $(table+' .vesti').each(function(){ 11 trnum++ 12 if(trnum > maxRows){ 13 $(this).hide() 14 } 15 if(trnum <= maxRows){ 16 $(this).show() 17 } 18 }) 19 if(totalRows > maxRows){ 20 var pagenum = Math.ceil(totalRows/maxRows) 21 for(var i = 1; i <= pagenum;){ 22 23 $('.pagination').append('<li class="page-link"data-page="'+i+'">\<span>'+ i++ + 24 '<span class="sr-only">(current)</span></span>\</li>').show() 25 26 27 } 28 }else{ 29 $('.pagination-container').css('display','none'); 30 } 31 $('.pagination li:first-child').addClass('active') 32 $('.pagination li').on('click',function(){ 33 var pageNum = $(this).attr('data-page') 34 var trIndex = 0; 35 $('.pagination li').removeClass('active') 36 $(this).addClass('active') 37 $(table+' .vesti').each(function(){ 38 trIndex++ 39 if(trIndex > (maxRows*pageNum) || trIndex <= ((maxRows*pageNum) - maxRows)){ 40 $(this).hide() 41 }else{ 42 $(this).show() 43 } 44 }) 45 }) 46 47 /** Search ****/ 48 $(document).ready(function(){ 49 $("#pretraga").on("keyup", function() { 50 var value = $(this).val().toLowerCase(); 51 $("#vesti .vesti").filter(function() { 52 $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) 53 }); 54 55 }); 56 }); 57 58 59 60 //Pagniation previous and next buttons 61 62 $(".nex").click(function () { 63 if ($(".pagination li").next().length != 0) { 64 $(".page-link.active").next().addClass("active").prev().removeClass("active"); 65 $(".page-link.active").trigger("click"); 66 } else { 67 $(".pagination li").removeClass("active"); 68 $(".pagination li:first").addClass("active"); 69 } 70 return false; 71 }); 72 73 $(".pre").click(function () { 74 if ($(".pagination li").prev().length != 0) { 75 $(".page-link.active").prev().addClass("active").next().removeClass("active"); 76 $(".page-link.active").trigger("click"); 77 } else { 78 $(".pagination li").removeClass("active"); 79 $(".pagination li:last").addClass("active"); 80 } 81 return false; 82 }); 83 84 $(".page-link").click(function () { 85 //Pagniation previous and next buttons disable Condition 86 if ($(".page-link.active").is(":last-child")) { 87 $(".pre").removeClass("pag-disable"); 88 $(".nex").addClass("pag-disable"); 89 } else if ($(".page-link.active").is(":first-child")) { 90 $(".nex").removeClass("pag-disable"); 91 $(".pre").addClass("pag-disable"); 92 } else { 93 $(".pre").removeClass("pag-disable"); 94 $(".nex").removeClass("pag-disable"); 95 } 96 }); 97 }); 98
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.