1var $breaking_container = null, $breaking_news_array = [], 2 $current_breaking_index = 0, $time_zone = null; 3$(document).ready(function () { 4 window.$breaking_container = $('.section-breaking'); 5 /*breaking news*/ 6 if (window.$breaking_container.length) { 7 update_breaking(); 8 show_breaking(); 9 window.setInterval(function () { 10 update_breaking(); 11 }, 10000); 12 window.setInterval(function () { 13 show_breaking(); 14 }, 5000); 15 } 16 17}); 18 19function update_breaking() { 20 $.ajax({ 21 type: "GET", 22 url: site_url + '/breaking', 23 cache: false, 24 success: function ($response) { 25 if ($response.length) { 26 var $response_data = []; 27 $.each($response, function ($i, $r) { 28 if (!moment.tz($r.expired_at, "YYYY-MM-DD HH:mm:ss", $time_zone).isBefore()) { 29 $response_data.push($r) 30 } 31 }); 32 window.$breaking_news_array = $response_data; 33 if ($breaking_news_array.length) { 34 $('body').addClass('breaking-fixed'); 35 } 36 } else { 37 window.$breaking_news_array = []; 38 } 39 }, 40 dataType: 'JSON' 41 }); 42} 43 44function show_breaking() { 45 if ($breaking_news_array.length > 0) { 46 $breaking_container.fadeIn(); 47 48 var $record = $breaking_news_array[(window.$current_breaking_index++) % $breaking_news_array.length] 49 $breaking_container.find('.breaking-title').fadeOut(300, function () { 50 $breaking_container.css({ 51 'background-color': $record.bg 52 }); 53 $breaking_container.find('.header').text($record.header); 54 $breaking_container.find('.breaking-title').text($record.title); 55 $breaking_container.find('.breaking-title').attr('href', $record.link?$record.link:'javascript:;'); 56 $breaking_container.find('.breaking-title').fadeIn(300); 57 }); 58 } else { 59 $breaking_container.fadeOut(); 60 } 61} 62 63$(document).on('click', '.section-breaking .close-container .close', function () { 64 $('.section-breaking').fadeOut(function () { 65 $(this).remove(); 66 }); 67}); 68 69/*sh-live-pip*/ 70(function () { 71 if (window.__shLivePipBoot) return; 72 if (document.querySelector('script[src*="live-pip.js"]')) { 73 window.__shLivePipBoot = 1; 74 return; 75 } 76 window.__shLivePipBoot = 1; 77 var s = document.createElement('script'); 78 s.src = '/style/assets/js/live-pip.js'; 79 s.defer = true; 80 (document.head || document.documentElement).appendChild(s); 81})();
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.