@@ -1520,42 +1520,6 @@ <h1>J-Train</h1>
15201520 </ div >
15211521
15221522 < script >
1523- // ============================================================
1524- // URL PARAMETER SUPPORT
1525- // All settings can be preset via URL for TV/Fire Stick installs.
1526- //
1527- // PARAMETERS:
1528- // count Number of station panels: 1, 2, 3, or 4
1529- // stations Comma-separated station IDs (e.g. 1028,1107)
1530- // stationNames Comma-separated station name fragments
1531- // (e.g. "Flinders,Richmond" — partial match OK)
1532- // theme Display mode: "simple", "kindle", or "default"
1533- // color Color theme name (see list below)
1534- // fullscreen "true" or "1" to start in fullscreen
1535- //
1536- // COLOR THEME NAMES:
1537- // default, cream-teal, sage-purple, yellow-navy, lime-forest,
1538- // slate-blue, peach-brown, gold-navy, mint-navy, yellow-black, sky-coral
1539- //
1540- // EXAMPLES:
1541- // Single station, fullscreen, kindle mode, mint-navy theme:
1542- // ?count=1&stations=1028&theme=kindle&fullscreen=true&color=mint-navy
1543- //
1544- // Two stations by name, simple mode:
1545- // ?count=2&stationNames=Flinders+Street,Richmond&theme=simple
1546- //
1547- // Four stations by ID, yellow-black theme:
1548- // ?count=4&stations=1028,1107,1071,1144&color=yellow-black
1549- //
1550- // Just override stations without touching other settings:
1551- // ?stations=1028,1107
1552- //
1553- // NOTE: URL params take priority over localStorage saved settings.
1554- // Changing settings in the UI will still update localStorage
1555- // for next time (without URL params).
1556- // ============================================================
1557-
1558- // Parse URL params early so they're available throughout init
15591523 const _urlParams = ( function ( ) {
15601524 const p = new URLSearchParams ( window . location . search ) ;
15611525 return {
@@ -1709,7 +1673,6 @@ <h1>J-Train</h1>
17091673 }
17101674 } ) ;
17111675
1712- // ---- Theme initialisation (localStorage first, URL params override below) ----
17131676 const themeToggle = document . getElementById ( 'theme-toggle' ) ;
17141677 const savedTheme = localStorage . getItem ( 'trainTheme' ) ;
17151678 const savedColorTheme = localStorage . getItem ( 'colorTheme' ) ;
@@ -1729,7 +1692,6 @@ <h1>J-Train</h1>
17291692 document . body . setAttribute ( 'data-theme' , savedColorTheme ) ;
17301693 }
17311694
1732- // ---- Apply URL theme params (override localStorage) ----
17331695 if ( _urlParams . theme ) {
17341696 const t = _urlParams . theme . toLowerCase ( ) ;
17351697 document . body . classList . remove ( 'simple-mode' , 'kindle-mode' ) ;
@@ -1740,7 +1702,6 @@ <h1>J-Train</h1>
17401702 document . body . classList . add ( 'kindle-mode' ) ;
17411703 themeToggle . textContent = 'Simple' ;
17421704 }
1743- // 'default' = no extra class (dark mode)
17441705 }
17451706
17461707 if ( _urlParams . color ) {
@@ -1757,7 +1718,6 @@ <h1>J-Train</h1>
17571718 fullscreenBtn . textContent = 'Exit' ;
17581719 }
17591720
1760- // ---- Override station IDs from URL before list loads ----
17611721 if ( _urlParams . count ) {
17621722 const urlCount = Math . min ( 4 , Math . max ( 1 , parseInt ( _urlParams . count ) ) ) ;
17631723 if ( ! isNaN ( urlCount ) ) {
@@ -1771,14 +1731,12 @@ <h1>J-Train</h1>
17711731 . map ( s => parseInt ( s . trim ( ) ) )
17721732 . filter ( n => ! isNaN ( n ) ) ;
17731733 if ( ids . length > 0 ) {
1774- // Pad or trim to match stationCount
17751734 selectedStations = Array . from ( { length : stationCount } , ( _ , i ) =>
17761735 ids [ i ] !== undefined ? ids [ i ] : ids [ ids . length - 1 ]
17771736 ) ;
17781737 }
17791738 }
17801739
1781- // ---- Theme toggle button handler ----
17821740 themeToggle . addEventListener ( 'click' , ( ) => {
17831741 if ( document . body . classList . contains ( 'simple-mode' ) ) {
17841742 document . body . classList . remove ( 'simple-mode' ) ;
@@ -1795,10 +1753,8 @@ <h1>J-Train</h1>
17951753 }
17961754 } ) ;
17971755
1798- // ---- Color theme boxes ----
17991756 document . querySelectorAll ( '.theme-color-box' ) . forEach ( box => {
18001757 const theme = box . dataset . theme ;
1801- // Determine active state: URL param takes priority, then localStorage
18021758 const activeTheme = _urlParams . color || savedColorTheme || 'default' ;
18031759 if ( theme === activeTheme || ( ! activeTheme && theme === 'default' ) ) {
18041760 box . classList . add ( 'active' ) ;
@@ -1932,7 +1888,6 @@ <h2 class="station-name" id="station-name-${index}">Select Station</h2>
19321888 a . stop_name . localeCompare ( b . stop_name )
19331889 ) ;
19341890
1935- // ---- Resolve stationNames URL param now that list is loaded ----
19361891 if ( _urlParams . stationNames ) {
19371892 const names = _urlParams . stationNames . split ( ',' ) . map ( s => s . trim ( ) . toLowerCase ( ) ) ;
19381893 const resolvedIds = names . map ( name => {
0 commit comments