‘}const div=createElementWithHtml(‘div’,linkElement);div.classList.add(‘promo-link’);element.parentNode.insertBefore(div,element.nextSibling)}function insertElementHtml(element,id){if(!element){console.error(‘insertElementHtml: element is not a DOM node’);return}if(document.getElementById(id)){const div=createElementWithHtml(‘div’,document.getElementById(id).innerHTML);element.parentNode.insertBefore(div,element.nextSibling)}}function createElementWithHtml(tag,html){const element=document.createElement(tag);element.innerHTML=html;return element}function checkSlideStart(){if(!slide_started)check_slide()}function removeEmbeddedTitles(){const embTIs=document.querySelectorAll(‘#v_article .embTI’);embTIs.forEach(element=>element.remove());work_editor()}function processMobilePromoLink(){if(!mobile_device||(xuaInfo.device!==’mobile’&&xuaInfo.device!==”))return;const promoLink=document.querySelector(‘.promo-link’);const newsletterSignup=document.getElementById(‘newsletterSignupHorizontal’);if(!promoLink){return}if(!newsletterSignup){return}if(!promoLink.parentNode){return}promoLink.parentNode.insertBefore(newsletterSignup,promoLink.nextSibling)}function addReadMoreComponent(element){if(document.querySelectorAll(‘.read-more-embedded’).length===0&&document.getElementById(‘readMoreTopics’)){fetch(‘https://d.newsweek.com/json/read-more-articles?article_id=2023268&article_link=sports/mlb/red-sox-predicted-swing-massive-trade-underrated-85-million-outfielder-2023268&article_category=MLB&source=by_parsely&article_keyword_related=17801&article_written=1738244436&size=4&days_old=4d&return=html&topic_label=Boston Red Sox&topic_link=sports/mlb/sox’).then(response=>response.json()).then(data=>{if(data&&data.html&&data.html.length>0){var readMoreTopicsElement=document.getElementById(‘readMoreTopics’);readMoreTopicsElement.innerHTML=data.html;insertElementHtml(element,’readMoreTopics’);readMoreTopicsElement.remove();let readmoreContainer=document.querySelector(‘.read-more-topics’);let categoryGtm=document.querySelector(‘body’).getAttribute(‘data-gtm-category’);let actionGtm=readmoreContainer.getAttribute(‘data-gtm-action’);let readmoreLinks=readmoreContainer.querySelectorAll(‘a’);setGtmEventLinks(readmoreLinks,categoryGtm,actionGtm)}else{if(document.getElementById(‘readMoreTopics’)){document.getElementById(‘readMoreTopics’).remove()}}}).catch(error=>{console.error(‘Error fetching read more articles:’,error)})}}function addLatestArticlesRightRail(elementId){if(document.getElementById(elementId)){fetch(‘https://d.newsweek.com/json/get-latest-articles?gtm_source=Latest_Updates_Right_Trail&return=html’).then(response=>response.json()).then(data=>{if(data!==undefined&&data.json.length>0){const element=document.getElementById(elementId);element.innerHTML=data.html;element.style.display=”;let latestArticlesContainer=document.querySelector(‘.articles-single-column-container’);let categoryGtm=document.querySelector(‘body’).getAttribute(‘data-gtm-category’);let actionGtm=latestArticlesContainer.getAttribute(‘data-gtm-action’);let latestArticlesLinks=latestArticlesContainer.querySelectorAll(‘a’);setGtmEventLinks(latestArticlesLinks,categoryGtm,actionGtm)}}).catch(error=>{console.error(‘Error fetching latest articles:’,error)})}}function getTrendingCommentsCount(data){const articles=data.json;Object.values(articles).forEach(({a_id})=>{if(typeof getMessageCount===’function’){getMessageCount(a_id,`article-${a_id}`,”comments”)}})}function addTrendingArticlesRightRail(elementId){if(document.getElementById(elementId)){fetch(‘https://d.newsweek.com/json/get-trending-articles?return=html&limit=5’).then(response=>response.json()).then(data=>{if(data!==undefined&&data.json.length>0){const element=document.getElementById(elementId);element.innerHTML=data.html;element.style.display=”;let trendingArticlesContainer=document.querySelector(‘.numbered-list-container’);let categoryGtm=document.querySelector(‘body’).getAttribute(‘data-gtm-category’);let actionGtm=trendingArticlesContainer.getAttribute(‘data-gtm-action’);let trendingArticlesLinks=trendingArticlesContainer.querySelectorAll(‘a’);setGtmEventLinks(trendingArticlesLinks,categoryGtm,actionGtm);getTrendingCommentsCount(data)}}).catch(error=>{console.error(‘Error fetching trending articles:’,error)})}}
Related Posts
🚨 GAME CHANGER: Milwaukee Brewers vs Chicago White Sox at American Family Field – You Won’t Believe the New Kickoff Time!
🚨 GAME CHANGER: Milwaukee Brewers vs Chicago White Sox at American Family Field – You Won’t Believe the New Kickoff Time! The Major League Baseball schedule for…
🚨 GAME CHANGER: Atlanta Braves vs Kansas City Royals at Truist Park – You Won’t Believe the New Kickoff Time!
🚨 GAME CHANGER: Atlanta Braves vs Kansas City Royals at Truist Park – You Won’t Believe the New Kickoff Time! The Major League Baseball calendar for late…
🚨 GAME CHANGER: Cincinnati Reds vs Boston Red Sox at Great American Ball Park – You Won’t Believe the New Kickoff Time!
🚨 GAME CHANGER: Cincinnati Reds vs Boston Red Sox at Great American Ball Park – You Won’t Believe the New Kickoff Time! The upcoming interleague clash between…
🚨 GAME CHANGER: San Francisco Giants vs New York Yankees at Oracle Park – You Won’t Believe the New Kickoff Time!
🚨 GAME CHANGER: San Francisco Giants vs New York Yankees at Oracle Park – You Won’t Believe the New Kickoff Time! The highly anticipated interleague showdown between…
🚨 GAME CHANGER: Chicago Cubs vs Washington Nationals at Wrigley Field – You Won’t Believe the New Kickoff Time!
🚨 GAME CHANGER: Chicago Cubs vs Washington Nationals at Wrigley Field – You Won’t Believe the New Kickoff Time! The upcoming matchup between the Chicago Cubs and…
Giants Predicted To Land Huge Offseason Trade For $15 Million Ace
The San Francisco Giants need to have a huge offseason if they want to chase down the Los Angeles Dodgers in the National League West. The Dodgers…