1/* js/nfl/scheduleNFL.js */ 2 3import { initSchedule } from "../common/scheduleCore.js"; 4import * as NFLMappings from "./teamMappingsNFL.js"; 5 6/** 7 * Current NFL week, injected into the shell by nfl/routes.py _nfl_spa 8 * (derived from the season-scoped NFLSchedule: a week stays current until 9 * 3am ET the day after its last game). Read synchronously â initSchedule 10 * also registers route visibility and SPA listeners, so it must never be 11 * gated behind a network round trip. The previous version hardcoded the 12 * 2025 calendar and returned "Week 22" forever once that season ended. 13 */ 14function getCurrentNFLWeek() { 15 const w = window.NFL_CURRENT_WEEK; 16 return (typeof w === "string" && w) ? w : "Week 1"; 17} 18 19document.addEventListener("DOMContentLoaded", () => { 20 // /nfl/best-price owns the whole screen (doc-write pre-hide + its own 21 // module); never boot the schedule loader + live-games poller under it. 22 if (window.IS_BEST_PRICE_PAGE) return; 23 24 // ensure we are actually on an NFL page using the URL 25 if (!/^\/nfl(\/|$)/i.test(location.pathname)) return; 26 27 initSchedule({ 28 endpoint : "/nfl/get_schedule", 29 teamNameToCode : NFLMappings.teamNameToCode, 30 getShortTeamName: NFLMappings.getShortTeamName, 31 formatTime : NFLMappings.formatTime, 32 getTeamGradient : NFLMappings.getTeamGradient, 33 getTeamColor : NFLMappings.getTeamColor, 34 35 /* NFL uses week labels instead of dates */ 36 paramKey : "week", 37 initialParam : getCurrentNFLWeek(), 38 allowNext : false, 39 40 showDate : true, 41 formatDate : NFLMappings.formatDate, 42 43 /* MLB's card design, without MLB's dashboard. `dashboard` proper is not an 44 option here -- its date nav and "Today" mean nothing against a week-keyed 45 schedule -- but the card itself (odds column labels, "Preview âº" in place 46 of the matchup title) is sport-agnostic, so the two are opted into 47 separately. */ 48 dashCards : true, 49 }); 50});
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.