1window.addEventListener("load", (event) => { 2 tp.push(["init", function() { 3 var user = tp.pianoId.getUser(); 4 5 if (user && user.uid !== '0') { 6 var settings = { 7 method: 'POST', 8 headers: { 'Content-Type': 'application/json' }, 9 body: JSON.stringify({ uid: user.uid }) 10 }; 11 12 fetch('https://foservices.prensalibre.com/usuario/access/list', settings) 13 .then(response => response.json()) 14 .then(response => { 15 // Verifica si response es un array antes de usar length 16 if (Array.isArray(response) && response.length > 0) { 17 document.querySelectorAll('.suscriptor').forEach(el => el.remove()); 18 document.querySelectorAll('.no_suscriptor').forEach(el => el.remove()); 19 } 20 21 // Verifica que response.object y accesses existan 22 var lengthAccess = response?.object?.accesses; 23 if (Array.isArray(lengthAccess) && lengthAccess.length > 0) { 24 document.querySelectorAll('.suscriptor').forEach(el => el.style.display = ''); 25 document.querySelectorAll('.no_suscriptor').forEach(el => el.remove()); 26 } else { 27 document.querySelectorAll('.suscriptor').forEach(el => el.remove()); 28 document.querySelectorAll('.no_suscriptor').forEach(el => el.style.display = ''); 29 } 30 }) 31 .catch(err => { 32 console.error('Error al consultar los accesos:', err); 33 document.querySelectorAll('.suscriptor').forEach(el => el.remove()); 34 document.querySelectorAll('.no_suscriptor').forEach(el => el.style.display = ''); 35 }); 36 37 } else { 38 document.querySelectorAll('.suscriptor').forEach(el => el.remove()); 39 document.querySelectorAll('.no_suscriptor').forEach(el => el.style.display = ''); 40 } 41 }]); 42}); 43; 44jQuery(document).ready(function($) { 45 // Obtener los IDs de las publicaciones ya cargadas inicialmente 46 let post_ids = $('.cargar-mas-cstudio').map(function() { 47 return $(this).data('post-ids'); 48 }).get(); 49 50 let isLoading = false; 51 52 $('.cargar-mas-cstudio button').on('click', function() { 53 if (isLoading) return; 54 isLoading = true; 55 56 var button = $(this); 57 var nonce = button.data('nonce'); 58 59 $.ajax({ 60 url: `${location.protocol}//${location.hostname}/wp-admin/admin-ajax.php`, 61 type: 'post', 62 data: { 63 action: 'bloque_pl_stream_cstudio_load_more_posts', 64 nonce: nonce, 65 post_ids: post_ids 66 }, 67 success: function(response) { 68 if (response) { 69 $('.cargar-mas-cstudio').before(response.data.html); 70 post_ids = post_ids.concat(response.data.post_ids); 71 console.log("IDs cargados hasta ahora:", post_ids); 72 isLoading = false; 73 } else { 74 button.text('No hay más publicaciones').prop('disabled', true); 75 } 76 }, 77 error: function() { 78 isLoading = false; 79 alert("Error al cargar más publicaciones. Intente de nuevo."); 80 } 81 }); 82 }); 83}); 84; 85// jQuery(document).ready(function($) { 86// console.log('Entra al log ajax'); 87// // Obtener los IDs de las publicaciones ya cargadas inicialmente 88// let post_ids = jQuery('.cargar-mas-stream-normal').map(function() { 89// return jQuery(this).data('post-ids'); 90// }).get(); 91// 92// let isLoading = false; 93// 94// jQuery('.cargar-mas-stream-normal button').on('click', function() { 95// if (isLoading) return; 96// isLoading = true; 97// 98// var button = jQuery(this); 99// var nonce = button.data('nonce'); 100// var class_style_block = jQuery('.cargar-mas-stream-normal').data('class-style-block'); 101// var tag_suscriptores = jQuery('.cargar-mas-stream-normal').data('tag-suscriptores'); 102// var type_form = jQuery('.cargar-mas-stream-normal').data('type-form'); 103// 104// console.log(class_style_block, tag_suscriptores, type_form, 'info'); 105// 106// jQuery.ajax({ 107// url: `${location.protocol}//${location.hostname}/wp-admin/admin-ajax.php`, 108// type: 'post', 109// data: { 110// action: 'bloque_pl_stream_normal_load_more_posts', 111// nonce: nonce, 112// post_ids: post_ids, 113// class_style_block: class_style_block, 114// tag_suscriptores: tag_suscriptores, 115// type_form: type_form 116// }, 117// success: function(response) { 118// if (response) { 119// console.log(response); 120// jQuery('.cargar-mas-stream-normal').before(response.data.html); 121// post_ids = post_ids.concat(response.data.post_ids); 122// console.log("IDs cargados hasta ahora:", post_ids); 123// isLoading = false;
124// } else { 125// button.text('No hay más publicaciones').prop('disabled', true); 126// } 127// }, 128// error: function() { 129// isLoading = false; 130// console.log("Error al cargar más publicaciones."); 131// } 132// }); 133// }); 134// }); 135;
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.