1var load = function () { 2 var btn = jQuery('.load-more'); 3 if (btn.attr("data-site") != undefined) { 4 var posts = jQuery('.load-more-posts'); 5 var page = parseInt(btn.attr("data-page")); 6 var site = parseInt(btn.attr("data-site")); 7 var sesit = parseInt(btn.attr("data-sesit")); 8 var timestamp = parseInt(btn.attr("data-timestamp")); 9 10 btn.remove(); 11 posts.parent().append('<img src="/img/loading-page.gif" style="width:35px;height:35px" class="mx-auto mt-3 mb-3 load-gif">'); 12 jQuery.ajax({ 13 url: window.location.origin + "/webparts/" + site + "/" + sesit + "/?p=" + page + "&" + timestamp, 14 success: function (html) { 15 //Verificar o tamanho do HTML para poder definir quando remover o botão 16 jQuery('.load-gif').remove(); 17 if (html.length >= 1) { 18 btn = '<button type="button" onclick="load()" class="mx-auto mt-3 mb-3 btn btn-primary load-more" data-timestamp="' + timestamp + '" data-site="' + site + '" data-sesit="' + sesit + '" data-page="' + page + '">Carregar Mais</button>' 19 posts.parent().append(btn); 20 jQuery('.load-more').attr("data-page", parseInt(page) + 1); 21 posts.append(html); 22 } 23 } 24 }).fail(function () { 25 console.log("error"); 26 }); 27 } 28} 29jQuery(document).ready(function () { 30 var urlPortal = window.location.origin; 31 32 function safeText(value) { 33 return value == null ? '' : String(value); 34 } 35 36 function safeQuoted(value) { 37 return safeText(value).replace(/"/g, "'"); 38 } 39 40 function timeAjust() { 41 var today = new Date(); 42 if (jQuery(".time-ajust").length > 0) { 43 jQuery(".time-ajust").each(function () { 44 var date = new Date($(this).html()); 45 var diffMs = (today - date); 46 var diffMonths = (today.getFullYear() - date.getFullYear()) * 12 + (today.getMonth() - date.getMonth()); 47 var diffDays = Math.floor(diffMs / 86400000); 48 var diffHrs = Math.floor((diffMs % 86400000) / 3600000); 49 var diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); 50 if (diffDays > 30) { 51 date = diffMonths + " mes" + ((diffMonths == 1) ? "" : "es") + " atrás" 52 } else if (diffDays > 0) { 53 date = diffDays + " dia" + ((diffDays == 1) ? "" : "s") + " atrás" 54 } else if (diffHrs > 0) { 55 date = diffHrs + " hora" + ((diffHrs == 1) ? "" : "s") + " atrás" 56 } else { 57 date = diffMins + " minuto" + ((diffMins == 1) ? "" : "s") + " atrás"; 58 } 59 $(this).html(date) 60 }) 61 } 62 $.getJSON("/previsao.json", function (data) { 63 today.toLocaleDateString("pt-br", { day: ('2-digit') }) 64 var months = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro']; 65 var weekDay = ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado']; 66 today = '<span class="date"><strong>Sorocaba, </strong>' 67 + weekDay[today.getDay()] + ", " 68 + today.getDate() + " de " 69 + months[today.getMonth()] + " de " 70 + today.getFullYear() 71 + '</span>' 72 + '<span class="date">' 73 + ' <div>' 74 + ' <a href="https://www.facebook.com/jornalcruzeiro" target="_blank" title="Cruzeiro no Facebook" class="btn btn-lg btn-primary"><i class="fa-brands fa-facebook-f"></i></a>' 75 + ' <a href="https://www.instagram.com/jornalcruzeiro" target="_blank" title="Cruzeiro no Instagram" class="btn btn-lg btn-primary"><i class="fa-brands fa-instagram"></i></a>' 76 + ' <a href="https://www.youtube.com/@CruzeirodoSulCanal" target="_blank" title="Cruzeiro no Youtube" class="btn btn-lg btn-primary"><i class="fa-brands fa-youtube"></i></a>' 77 + ' </div>' 78 + ' </span>'; 79 //+ '</span><span class="weather"><!--<i class="wi wi-day-cloudy"></i><strong>' 80 //+ "" + '°C</strong>--> ↓' 81 //+ data.minima + '°C ↑' 82 //+ data.maxima + '°C</span></span>'; 83 jQuery(".today").html(today); 84 }) 85 } 86 timeAjust(); 87 88 function maislidas() { 89 if (jQuery(".json_top").length > 0) { 90 jQuery.ajax({ 91 url: urlPortal + jQuery(".json_top").attr("data-url"), 92 dataType: "json", 93 type: "get", 94 success: function (json) { 95 if (typeof json == "string") { 96 json = JSON.parse(json); 97 } 98 var html = '';
99 let cont = 0; 100 for (i in json["matia"]) { 101 var months = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro']; 102 dt = safeText(json["matia"][i]["dt_matia_publi"]); 103 dta = new Date(dt.replace(/-/g, "/")); 104 dthr= dta.getDate() + ' de ' + 105 months[dta.getMonth()] + ' de ' + 106 dta.getFullYear() + ' às ' + 107 dta.getHours().toLocaleString('pt-BR', { 108 minimumIntegerDigits: 2, 109 useGrouping: false}) + ':' + 110 dta.getMinutes().toLocaleString('pt-BR', { 111 minimumIntegerDigits: 2, 112 useGrouping: false}); 113 114 html += '<div class="col-sm-12 col-md-4 col-lg-3" style="margin-bottom: 20px;" data-hotzone-article=' + json["matia"][i]["cod"] + ' data-hotzone-section="0" data-hotzone-position=' + (++cont) + '>'; 115 html += ' <a href="' + safeText(json["matia"][i]["url"]) + '" title="' + safeQuoted(json["matia"][i]["title"]) + '" class="ghost-link">'; 116 html += ' <div class="card card-img no-img">'; 117 html += ' <div class="card-content">'; 118 html += ' <span class="card-subtitle">' + json["matia"][i]["subject"] + '</span>'; 119 html += ' <h4 class="card-title">' + json["matia"][i]["title"] + '</h4>'; 120 //html += ' <div class="timestamp">'; 121 //html += ' <span class="time-badge"></span>' + dthr; 122 //html += ' </div>'; 123 html += ' <div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-url="https://www.jornalcruzeiro.com.br' + json["matia"][i]["url"] + '" data-a2a-title="Compartilhe">'; 124 html += ' <a class="a2a_button_facebook"></a>'; 125 html += ' <a class="a2a_button_whatsapp"></a>'; 126 html += ' <a class="a2a_dd" href="https://www.addtoany.com/share"></a>'; 127 html += ' </div>';
128 html += ' </div>'; 129 html += ' </div>'; 130 html += ' </a>'; 131 html += '</div>'; 132 } 133 jQuery(".json_top").html( 134 html.replace("undefined", "").replace("null", "") 135 ); 136 137 var hashParams = new URL($('.json_top div[data-hotzone-article]').find('a[href]:not(.url)')[0].href).hash.substring(1).split(';'); 138 if (!hashParams[0]) { 139 // hotzone(".json_top div[data-hotzone-article]"); 140 } 141 }, 142 error: function () { 143 console.log('Erro Ajax'); 144 } 145 }); 146 } 147 } 148 maislidas(); 149 150 function menuEditoria() { 151 if (jQuery(".json_editoria").length > 0) { 152 jQuery(".json_editoria").each(function (index) { 153 jQuery.ajax({ 154 url: urlPortal + jQuery(this).attr("data-url"), 155 dataType: "json", 156 type: "get", 157 success: function (json) { 158 if (typeof json == "string") { 159 json = JSON.parse(json); 160 } 161 var html = ''; 162 163 if (json["matia"] != undefined) { 164 for (i in json["matia"]) { 165 html += '<a href="' + safeText(json["matia"][i]["url"]) + '" title="' + safeQuoted(json["matia"][i]["title"]) + '" class="ghost-link">'; 166 html += ' <div class="card card-minimal item">'; 167 if (json["matia"][i]["cd_tpmid"] == "5") { 168 html += ' <div class="card-picture">'; 169 html += ' <img src="' + json["matia"][i]["nm_midia_inter_thumb1"] + '" title="">'; 170 html += ' </div>'; 171 } 172 else if (json["matia"][i]["images"] != undefined && json["matia"][i]["images"]["295x120"] != undefined) { 173 html += ' <div class="card-picture">'; 174 html += ' <img src="' + json["matia"][i]["images"]["295x120"] + '" title="">'; 175 html += ' </div>'; 176 177 } else { 178 html += ' <div class="card-picture">'; 179 html += ' <img src="/img/logo-placeholder.png" title="">'; 180 html += ' </div>'; 181 } 182 html += ' <div class="card-content">'; 183 html += ' <h6 class="card-title">'; 184 html += ' ' + json["matia"][i]["title"]; 185 html += ' </h6>'; 186 html += ' </div>'; 187 html += ' </div>'; 188 html += '</a>'; 189 } 190 jQuery(jQuery(".json_editoria")[index]).html( 191 html.replace("undefined", "").replace("null", "") 192 ); 193 } else { 194 for (i in json) { 195 // window.alert(json[i]['pg']) 196 html += '<a href="' + safeText(json[i]["url"]) + '" title="' + safeQuoted(json[i]["dt"]) + '" class="ghost-link">'; 197 html += ' <div class="card card-minimal item" style="height: 320px">'; 198 html += ' <div class="card-picture">'; 199 html += ' <img src="' + json[i]["pg"] + '" title="" style="width: 195px; height: 265px;">'; 200 html += ' </div>'; 201 html += ' <div class="card-content">'; 202 html += ' <h6 class="card-title" style="line-height: 23.4em">'; 203 html += ' ' + json[i]["dt"]; 204 html += ' </h6>'; 205 html += ' </div>'; 206 html += ' </div>'; 207 html += '</a>'; 208 } 209 jQuery(jQuery(".json_editoria")[index]).html( 210 html.replace("undefined", "").replace("null", "") 211 ); 212 } 213 }, 214 error: function () { 215 console.log('Erro Ajax'); 216 } 217 }); 218 }); 219 } 220 } 221 menuEditoria(); 222})
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.