Current

99°

Sunny

Tonight

77°

Mostly Clear Precip: 0%

Tomorrow

104°

Mostly Sunny Precip: 0%

Trending Stories

View All BestReviews Picks

Don’t Miss

–> p”); window.eleCount = document.querySelectorAll(“div.article-content > p”).length; window.promos = document.querySelectorAll(“div.article-content > div.nlp-ignore-block > aside.promo-link”); window.skipP = 5; // the number of paragraphs to skip. window.mobileOrDesktop = window.screen.width window.skipP) { // there needs to be more paragraphs than window.skipP // set the number of possible speedbumps window.maxLinks = Math.floor(window.childEles.length / window.skipP); } else { // the paragraph count is too low to inject a speedbump window.maxLinks = 0; } if (window.maxLinks > 0 ) { window.topStoriesJSON = “https://media.psg.nexstardigital.net/kxan/misc/news/speedbump/most_page_views.json?v=” + cacheBreak(); var request = new XMLHttpRequest(); request.open(‘GET’, window.topStoriesJSON, true); request.onload = function() { if (this.status >= 200 && this.status 0 ) { console.log(‘At least 1 promo link already exists’); let promoParent = promoEle[promoEle.length – 1].parentElement; let promoPos = whereIsPromo(promoParent); nthChild = nthChild + promoPos + 1; } // end check for existing promo link console.log(‘——–2————————————————-‘); console.log(`window.eleCount: ${window.eleCount}`); console.log(`nthChild: ${nthChild}`); console.log(`window.eleCount – nthChild: ${window.eleCount – nthChild}`); console.log(`window.skipP: ${window.skipP}`); // check for enough room at the bottom of the story // if ( window.eleCount – nthChild >= window.skipP ) { if ( window.eleCount – nthChild >= 2 ) { console.log(‘——–3————————————————-‘); for (var i = 0; i < window.topStoriesData.length; i++) { let link = window.topStoriesData[i].path; let feedPath = link.split("kxan.com")[1]; // check to see if link is the same as the user's current story; skip if the same if (thisPath.search(feedPath) < 0 && thisPath.search("/author/") p:nth-child(${nthChild})`); let bottomBread = document.querySelector(`div.article-content > p:nth-child(${nthChild + 1})`); // let plate = document.querySelector(`div.article-content > p:nth-child(${nthChild + 2})`); // console.log(`window.skipP + 1: ${window.skipP + 1}`); // console.log(`——————-`); // console.log(topBread); // console.log(bottomBread); // console.log(`———————`); // if (topBread !== null && topBread.tagName === ‘P’ && bottomBread.tagName === ‘P’ && plate.tagName === ‘P’) { if (topBread !== null && bottomBread !== null && topBread.tagName === ‘P’ && bottomBread.tagName === ‘P’) { bottomBread.before(promoDiv); nthChild += (window.skipP + 1); } else { nthChild++; } // console.log(`i: ${i}`); // console.log(`maxLinks: ${window.maxLinks}`); if (i + 1 > window.maxLinks) { // adding +1 at end of the loop stops orphan promo links at the bottom of the story, // and adding at the end of the loop allows at least one promo link in the story // console.log(“breaking promo link loop”); break; } // console.log(‘————————————————————————-‘); } } } } else { // We reached our target server, but it returned an error console.log(`error retrieving top stories JSON. Status: ${this.status}`); } }; request.onerror = function() { // There was a connection error of some sort console.log(‘unknown error retrieving top stories JSON’); }; request.send(); } function cacheBreak() { let now = new Date().getTime(); now = Math.floor(now / 1000 / 300); return “” + now; } function whereIsPromo(ele) { let parent = ele.parentNode; // console.log(`parent: ${parent}`); let children = parent.children; // console.log(`children: ${children}`); // console.log(`children.length: ${children.length}`); var i = children.length – 1; for (; i >= 0; i–) { if (ele == children[i]){ break; } } console.log(`whereIsPromo: ${i}`); return i; }; } // –> ]]>

–>= 1618072 && window.NXSTdata.content.primaryCategory !== ‘Investigations’ && window.NXSTdata.content.primaryCategory !== ‘Contests’) { const firstParagraph = document.querySelector(“#main > article > div.article-content.rich-text”); console.log(‘length: ‘ + firstParagraph.getElementsByClassName(“ns-block-embed-anvato”).length); if (firstParagraph.getElementsByClassName(“ns-block-embed-anvato”).length div > div > div > div.site-header__weather > a > span.site-header__weather-forecast > span”).innerHTML; const currentTemp = document.querySelector(“#masthead > div > div > div > div.site-header__widget > div.site-header__weather > a > span.site-header__weather-forecast > span”).innerHTML; const wwcContent = ` Austin: ${currentTemp}]]> Latest weather conditions from the KXAN First Warning Weather team
`; // const firstParagraph = document.querySelector(“#main > article > div.article-content.rich-text > p:nth-child(1)”); const firstParagraphHTML = firstParagraph.innerHTML; firstParagraph.innerHTML = wwcContent + firstParagraphHTML; } } } // –> { ele.style.maxWidth = “100%”; ele.style.margin = “0px auto”; }); const figcaptionEles = document.querySelectorAll(“figure > figcaption”); figcaptionEles.forEach((ele) => { ele.style.fontStyle = “italic”; // ele.style.color = “#666666”; ele.style.textAlign = “left”; }); const galleryCaptions = document.querySelectorAll(“figcaption.wp-block-jetpack-slideshow_caption.gallery-caption”); galleryCaptions.forEach((ele) => { ele.style.color = “#eeeeee”; }); console.log(“includes Investigations”); } else { console.log(“window bigger than 666 or categoryList does not include Investigations”) } if ( window.innerWidth div.top-stories”); tsEle.style.maxWidth = “100vw”; } // –> ]]> –> 650) { if (br_header.classList.contains(“is-scrolling–not-top”)) { logo_bg.setAttribute(“style”, “background-image: url(‘https://www.kxan.com/wp-content/uploads/sites/40/2020/06/KXAN-Generic_Whitesharp_1519662573983_35278855_ver1.0-1.png?quality=75’)” ); } if (br_header.classList.contains(“is-scrolling–top”)) { logo_bg.setAttribute(“style”, “background-image: url(‘https://www.kxan.com/wp-content/uploads/sites/40/2020/06/KXAN-Desktop-Main-Header_600x106.png?quality=75’)” ); } } } else if (window.NXSTdata.content.primaryCategory === “State of Texas”) { if (winW > 650) { let siteHeaderLogo = document.querySelector(“.site-header__logo”); if (br_header.classList.contains(“is-scrolling–not-top”)) { siteHeaderLogo.style.padding = “.6em”; logo_bg.setAttribute(“style”, “background-image: url(‘https://www.kxan.com/wp-content/uploads/sites/40/2022/02/State-of-Texas-masthead-thumbnail.png?quality=75’)” ); } if (br_header.classList.contains(“is-scrolling–top”)) { siteHeaderLogo.style.padding = “0”; logo_bg.setAttribute(“style”, “background-image: url(‘https://www.kxan.com/wp-content/uploads/sites/40/2022/02/SOT_masthead_logo.png?quality=75’)” ); } } } else if (window.NXSTdata.content.primaryCategory === “Local Sports” || window.NXSTdata.content.primaryCategory === “Sports” || window.NXSTdata.content.primaryCategory === “Tracking NIL”) { if (winW > 650) { let siteHeaderLogo = document.querySelector(“.site-header__logo”); if (br_header.classList.contains(“is-scrolling–not-top”)) { siteHeaderLogo.style.padding = “.6em”; logo_bg.setAttribute(“style”, “background-image: url(‘https://www.kxan.com/wp-content/uploads/sites/40/2020/06/KXAN-Generic_Whitesharp_1519662573983_35278855_ver1.0-1.png?quality=75’)” ); } if (br_header.classList.contains(“is-scrolling–top”)) { siteHeaderLogo.style.padding = “0”; logo_bg.setAttribute(“style”, “background-image: url(‘https://www.kxan.com/wp-content/uploads/sites/40/2023/06/kxan-sports-2.png?quality=75’)” ); } } } // –> } ); var whereAmI = window.location.href; console.log(‘whereAmI: ‘ + whereAmI); if (whereAmI.search(‘/save-our-students/’) > 0) { var moreSOS = document.querySelector( “#ns-article-bin-41 > section > div.article-list__read-more.article-list__read-more–w-arrow > a”); moreSOS.innerHTML = ‘More Save Our Students’; } if (whereAmI.search(‘/s-o-s/’) > 0) { var sosCategoryHeader = document.querySelector(“#content > section > div > h1.article-list__heading”); var autoflowHeader = document.querySelector(“#main > section > h2.article-list__heading”); sosCategoryHeader.innerHTML = “More Save Our Students”; autoflowHeader.innerHTML = “More Save Our Students Headlines”; } ]]> section > div.article-list__read-more > a”); // theLink.setAttribute(‘href’,’https://www.kxan.com/news/your-local-election-hq/’); // if (theLink) { // console.log(‘ ‘); // console.log(‘theLink exists’); // console.log(‘ ‘); // var theLink = document.querySelector(“#ns-article-bin-28 > section > div.article-list__read-more.article-list__read-more–w-arrow > a”); // theLink.setAttribute(‘href’,’https://www.kxan.com/investigations/’); // } ]]> ]]>

Source

Leave a Reply

Your email address will not be published. Required fields are marked *