1jQuery(document).ready(function($) { 2 $('.developing-story-block-container').each(function() { 3 const container = $(this); 4 const postId = container.data('post-id'); 5 6 if (!postId) return; 7 8 $.ajax({ 9 url: hbiStory.ajaxurl, 10 type: 'POST', 11 data: { 12 action: 'get_cached_story', 13 post_id: postId, 14 nonce: hbiStory.nonce 15 }, 16 success: function(response) { 17 if (response.success) { 18 const data = response.data; 19 let html = '<div class="hbi-news-block-container developing-story-block">'; 20 html += '<div class="alert-label"><h4>Developing Story</h4></div>'; 21 html += '<div class="developing-story-info">'; 22 html += '<h3 class="h5 post-headline"><a href="' + data.permalink + '" class="text-decoration-none text-dark">' + data.title + '</a></h3>'; 23 24 25 if (data.timeline && data.timeline.length > 0) { 26 const reversedTimeline = data.timeline.slice().reverse(); 27 const displayTimeline = reversedTimeline.slice(0, 3); 28 const hasMore = data.timeline.length > 3; 29 30 html += '<div class="developing-story-timeline"><ul>'; 31 displayTimeline.forEach(function(update) { 32 const timestamp = new Date(update.timestamp); 33 const today = new Date(); 34 const isToday = timestamp.toDateString() === today.toDateString(); 35 36 const timeStr = isToday ? 37 timestamp.toLocaleTimeString('en-US', {hour: 'numeric', minute: '2-digit'}) : 38 timestamp.toLocaleDateString('en-US', {month: 'short', day: 'numeric', year: 'numeric'}) + ' ' + timestamp.toLocaleTimeString('en-US', {hour: 'numeric', minute: '2-digit'}); 39 40 html += '<li><span>' + timeStr + ' - '; 41 if (update.link) { 42 html += '<a href="' + update.link + '" target="_blank">' + update.text + '</a>'; 43 } else { 44 html += update.text; 45 } 46 html += '</span></li>'; 47 }); 48 html += '</ul>'; 49 if (hasMore) { 50 html += '<div class="readmore"><a href="' + data.permalink + '" class="text-decoration-none text-dark">Read More</a></div>'; 51 } 52 html += '</div>'; 53 } 54 55 html += '</div>'; 56 html += '</div>'; 57 container.html(html); 58 } else { 59 container.html('<p>Developing story not found.</p>'); 60 } 61 }, 62 error: function() { 63 container.html('<p>Error loading developing story.</p>'); 64 } 65 }); 66 }); 67});
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.