1function paginate(data, container, template, url, callback) { 2 $('.paginador').pagination({ 3 items: data.total, 4 itemsOnPage: data.itens, 5 cssStyle: 'light-theme', 6 prevText: 'Anterior', 7 nextText: 'Próximo', 8 onPageClick: function (page) { 9 $.get(url + $('#pesquisaForm').serialize() + '&page=' + page) 10 .done(function (d) { 11 $('#' + container).html(template(d)); 12 $('.paginador').pagination('updateItems', d.total); 13 if (callback) { 14 callback(); 15 } 16 }); 17 } 18 }); 19} 20 21 22$('.itensPagina').on("change", function () { 23 var itens = jQuery(this).val(); 24 jQuery('.itensPagina, #itens').val(itens); 25 jQuery('.paginador').pagination('updateItemsOnPage', itens); 26}); 27 28$('#pesquisaForm').submit(function (e) { 29 e.preventDefault(); 30 jQuery('.paginador').pagination('updateItemsOnPage', jQuery('#itens').val()); 31}); 32 33$("#optData a").each(function (index, value) { 34 var hoje = Date.now(); 35 if (index === 1) { 36 $(this).data("ini", helpers.formataData(hoje, "DD/MM/YYYY")); 37 } 38 39 if (index === 2) { 40 var semana = new Date(hoje - 7 * 24 * 60 * 60 * 1000); 41 $(this).data("ini", helpers.formataData(semana, "DD/MM/YYYY")); 42 } 43 44 if (index === 3) { 45 var mes = new Date(hoje - 30 * 24 * 60 * 60 * 1000); 46 $(this).data("ini", helpers.formataData(mes, "DD/MM/YYYY")); 47 } 48 49 if (index === 4) { 50 var ano = new Date(hoje - 365 * 24 * 60 * 60 * 1000); 51 $(this).data("ini", helpers.formataData(ano, "DD/MM/YYYY")); 52 } 53 if (index !== 0) { 54 $(this).data("fim", helpers.formataData(hoje, "DD/MM/YYYY")); 55 } 56}); 57 58$("#optData a").click(function () { 59 selectButton(this); 60 $("#dataIni").val($(this).data("ini")); 61 $("#dataFim").val($(this).data("fim")); 62 if ($(this).data("custom")) { 63 $("#inicio").val(""); 64 $("#final").val(""); 65 $("#datepicker").show(); 66 } else { 67 $("#datepicker").hide(); 68 $(this).parents("form").submit(); 69 } 70}); 71 72$('.input-daterange').datepicker({ 73 language: "pt-BR", 74 autoclose: true 75}); 76 77$('.input-daterange').change(function () { 78 $("#dataIni").val($("#inicio").val()); 79 $("#dataFim").val($("#final").val()); 80 $(this).parents("form").submit(); 81}); 82 83function selectButton(element) { 84 $(element).closest(".dropdown").find(".selecionado").text($(element).text()); 85 $(element).parents("ul:eq(0)").find("a").removeClass("ativo"); 86 $(element).addClass("ativo"); 87}
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.