Switch back to using j69.ejs-beautify

- Reformat index.mjs
- Don't preload playlist.json to avoid Safari warning about
  unused preloaded resource
This commit is contained in:
Eddy G
2025-07-13 18:54:25 -04:00
parent 4b34ffabcb
commit d25a632f7d
2 changed files with 191 additions and 186 deletions

View File

@@ -15,28 +15,33 @@
<link rel="manifest" href="manifest.json" /> <link rel="manifest" href="manifest.json" />
<link rel="icon" href="images/logos/logo192.png" /> <link rel="icon" href="images/logos/logo192.png" />
<link rel="apple-touch-icon" sizes="180x180" href="images/logos/app-icon-180.png" /> <link rel="apple-touch-icon" sizes="180x180" href="images/logos/app-icon-180.png" />
<link rel="preload" href="playlist.json" as="fetch" crossorigin="anonymous"/> <meta property="og:image" content="https://weatherstar.netbymatt.com/images/social/1200x600.png">
<meta property="og:image" content="https://weatherstar.netbymatt.com/images/social/1200x600.png"> <meta property="og:image:width" content="1200">
<meta property="og:image:width" content="1200"> <meta property="og:image:height" content="627">
<meta property="og:image:height" content="627"> <link rel="prefetch" href="fonts/Star4000.woff" as="font" type="font/woff" crossorigin>
<link rel="prefetch" href="fonts/Star4000.woff" as="font" type="font/woff" crossorigin> <link rel="prefetch" href="fonts/Star4000 Extended.woff" as="font" type="font/woff" crossorigin>
<link rel="prefetch" href="fonts/Star4000 Extended.woff" as="font" type="font/woff" crossorigin> <link rel="prefetch" href="fonts/Star4000 Large.woff" as="font" type="font/woff" crossorigin>
<link rel="prefetch" href="fonts/Star4000 Large.woff" as="font" type="font/woff" crossorigin> <link rel="prefetch" href="fonts/Star4000 Small.woff" as="font" type="font/woff" crossorigin>
<link rel="prefetch" href="fonts/Star4000 Small.woff" as="font" type="font/woff" crossorigin> <% if (typeof serverAvailable !== 'undefined' && serverAvailable) { %>
<% if (typeof serverAvailable !== 'undefined' && serverAvailable) { %> <script>
<script>window.WS4KP_SERVER_AVAILABLE=true;</script> window.WS4KP_SERVER_AVAILABLE = true;
<% } %> </script>
<% } %>
<% if (production) { %> <% if (production) { %>
<link rel="stylesheet" type="text/css" href="resources/ws.min.css?_=<%=production%>" /> <link rel="stylesheet" type="text/css" href="resources/ws.min.css?_=<%=production%>" />
<script type="text/javascript" src="resources/vendor.min.js?_=<%=production%>"></script> <script type="text/javascript" src="resources/vendor.min.js?_=<%=production%>"></script>
<script type="text/javascript" src="resources/ws.min.js?_=<%=production%>"></script> <script type="text/javascript" src="resources/ws.min.js?_=<%=production%>"></script>
<script type="text/javascript">const OVERRIDES=<%-JSON.stringify(OVERRIDES)%>;</script> <script type="text/javascript">
const OVERRIDES = <%- JSON.stringify(OVERRIDES ?? {}) %>;
</script>
<% } else { %> <% } else { %>
<link rel="stylesheet" type="text/css" href="styles/main.css" /> <link rel="stylesheet" type="text/css" href="styles/main.css" />
<!--<script type="text/javascript">const OVERRIDES={};</script>--> <!--<script type="text/javascript">const OVERRIDES={};</script>-->
<script type="text/javascript">OVERRIDES=<%-JSON.stringify(OVERRIDES)%>;</script> <script type="text/javascript">
<script type="text/javascript" src="scripts/vendor/auto/nosleep.js"></script> OVERRIDES = <%- JSON.stringify(OVERRIDES ?? {}) %>;
</script>
<script type="text/javascript" src="scripts/vendor/auto/nosleep.js"></script>
<script type="text/javascript" src="scripts/vendor/auto/swiped-events.js"></script> <script type="text/javascript" src="scripts/vendor/auto/swiped-events.js"></script>
<script type="text/javascript" src="scripts/vendor/auto/suncalc.js"></script> <script type="text/javascript" src="scripts/vendor/auto/suncalc.js"></script>
<script type="module" src="scripts/modules/hazards.mjs"></script> <script type="module" src="scripts/modules/hazards.mjs"></script>
@@ -56,100 +61,99 @@
<script type="module" src="scripts/modules/progress.mjs"></script> <script type="module" src="scripts/modules/progress.mjs"></script>
<script type="module" src="scripts/modules/radar.mjs"></script> <script type="module" src="scripts/modules/radar.mjs"></script>
<script type="module" src="scripts/modules/settings.mjs"></script> <script type="module" src="scripts/modules/settings.mjs"></script>
<script type="module" src="scripts/modules/media.mjs"></script> <script type="module" src="scripts/modules/media.mjs"></script>
<script type="module" src="scripts/modules/custom-rss-feed.mjs"></script> <script type="module" src="scripts/modules/custom-rss-feed.mjs"></script>
<script type="module" src="scripts/index.mjs"></script> <script type="module" src="scripts/index.mjs"></script>
<% } %> <% } %>
</head> </head>
<body<% if (query && query['settings-kiosk-checkbox'] === 'true') { %> class="kiosk"<% } %>> <body <% if (query && query['settings-kiosk-checkbox'] === 'true' ) { %>class="kiosk" <% }%>>
<div id="divQuery"> <div id="divQuery">
<input id="txtLocation" type="text" value="" placeholder="ZIP Code or City, State" data-1p-ignore /> <input id="txtLocation" type="text" value="" placeholder="ZIP Code or City, State" data-1p-ignore />
<div class="buttons"> <div class="buttons">
<button id="btnGetGps" type="button" title="Get GPS Location"><img src="images/nav/ic_gps_fixed_black_18dp_1x.png" <button id="btnGetGps" type="button" title="Get GPS Location"><img src="images/nav/ic_gps_fixed_black_18dp_1x.png" class="light" />
class="light" /> <img src="images/nav/ic_gps_fixed_white_18dp_1x.png" class="dark" />
<img src="images/nav/ic_gps_fixed_white_18dp_1x.png" class="dark" /> </button>
</button> <button id="btnGetLatLng" type="submit">GO</button>
<button id="btnGetLatLng" type="submit">GO</button> <button id="btnClearQuery" type="reset">Reset</button>
<button id="btnClearQuery" type="reset">Reset</button> </div>
</div> </div>
</div> <div id="version" style="display:none">
<div id="version" style="display:none"> <%- version %>
<%- version %> </div>
</div>
<div id="divTwc"> <div id="divTwc">
<div id="divTwcMain"> <div id="divTwcMain">
<div id="container"> <div id="container">
<div id="loading" width="640" height="480"> <div id="loading" width="640" height="480">
<div> <div>
<div class="title">WeatherStar 4000+</div> <div class="title">WeatherStar 4000+</div>
<div class="version">v<%- version %></div> <div class="version">v<%- version %></div>
<div class="instructions">Enter your location above to continue</div> <div class="instructions">Enter your location above to continue</div>
</div> </div>
</div> </div>
<div id="progress-html" class="weather-display"> <div id="progress-html" class="weather-display">
<%- include('partials/progress.ejs') %> <%- include('partials/progress.ejs') %>
</div> </div>
<div id="hourly-html" class="weather-display"> <div id="hourly-html" class="weather-display">
<%- include('partials/hourly.ejs') %> <%- include('partials/hourly.ejs') %>
</div> </div>
<div id="hourly-graph-html" class="weather-display"> <div id="hourly-graph-html" class="weather-display">
<%- include('partials/hourly-graph.ejs') %> <%- include('partials/hourly-graph.ejs') %>
</div> </div>
<div id="travel-html" class="weather-display"> <div id="travel-html" class="weather-display">
<%- include('partials/travel.ejs') %> <%- include('partials/travel.ejs') %>
</div> </div>
<div id="current-weather-html" class="weather-display"> <div id="current-weather-html" class="weather-display">
<%- include('partials/current-weather.ejs') %> <%- include('partials/current-weather.ejs') %>
</div> </div>
<div id="local-forecast-html" class="weather-display"> <div id="local-forecast-html" class="weather-display">
<%- include('partials/local-forecast.ejs') %> <%- include('partials/local-forecast.ejs') %>
</div> </div>
<div id="latest-observations-html" class="weather-display"> <div id="latest-observations-html" class="weather-display">
<%- include('partials/latest-observations.ejs') %> <%- include('partials/latest-observations.ejs') %>
</div> </div>
<div id="regional-forecast-html" class="weather-display"> <div id="regional-forecast-html" class="weather-display">
<%- include('partials/regional-forecast.ejs') %> <%- include('partials/regional-forecast.ejs') %>
</div> </div>
<div id="almanac-html" class="weather-display"> <div id="almanac-html" class="weather-display">
<%- include('partials/almanac.ejs') %> <%- include('partials/almanac.ejs') %>
</div> </div>
<div id="spc-outlook-html" class="weather-display"> <div id="spc-outlook-html" class="weather-display">
<%- include('partials/spc-outlook.ejs') %> <%- include('partials/spc-outlook.ejs') %>
</div> </div>
<div id="extended-forecast-html" class="weather-display"> <div id="extended-forecast-html" class="weather-display">
<%- include('partials/extended-forecast.ejs') %> <%- include('partials/extended-forecast.ejs') %>
</div> </div>
<div id="radar-html" class="weather-display"> <div id="radar-html" class="weather-display">
<%- include('partials/radar.ejs') %> <%- include('partials/radar.ejs') %>
</div> </div>
<div id="hazards-html" class="weather-display"> <div id="hazards-html" class="weather-display">
<%- include('partials/hazards.ejs') %> <%- include('partials/hazards.ejs') %>
</div> </div>
</div> </div>
</div> </div>
<div id="divTwcBottom"> <div id="divTwcBottom">
<div id="divTwcBottomLeft"> <div id="divTwcBottomLeft">
<img id="NavigateMenu" class="navButton" src="images/nav/ic_menu_white_24dp_2x.png" title="Menu" /> <img id="NavigateMenu" class="navButton" src="images/nav/ic_menu_white_24dp_2x.png" title="Menu" />
<img id="NavigatePrevious" class="navButton" src="images/nav/ic_skip_previous_white_24dp_2x.png" title="Previous" /> <img id="NavigatePrevious" class="navButton" src="images/nav/ic_skip_previous_white_24dp_2x.png" title="Previous" />
<img id="NavigateNext" class="navButton" src="images/nav/ic_skip_next_white_24dp_2x.png" title="Next" /> <img id="NavigateNext" class="navButton" src="images/nav/ic_skip_next_white_24dp_2x.png" title="Next" />
<img id="NavigatePlay" class="navButton" src="images/nav/ic_play_arrow_white_24dp_2x.png" title="Play" /> <img id="NavigatePlay" class="navButton" src="images/nav/ic_play_arrow_white_24dp_2x.png" title="Play" />
</div> </div>
<div id="divTwcBottomMiddle"> <div id="divTwcBottomMiddle">
<img id="NavigateRefresh" class="navButton" src="images/nav/ic_refresh_white_24dp_2x.png" title="Refresh" /> <img id="NavigateRefresh" class="navButton" src="images/nav/ic_refresh_white_24dp_2x.png" title="Refresh" />
</div> </div>
<div id="divTwcBottomRight"> <div id="divTwcBottomRight">
<div id="ToggleMedia"> <div id="ToggleMedia">
<img class="navButton off" src="images/nav/ic_volume_off_white_24dp_2x.png" title="Unmute" /> <img class="navButton off" src="images/nav/ic_volume_off_white_24dp_2x.png" title="Unmute" />
<img class="navButton on" src="images/nav/ic_volume_on_white_24dp_2x.png" title="Mute" /> <img class="navButton on" src="images/nav/ic_volume_on_white_24dp_2x.png" title="Mute" />
</div> </div>
<div id="ToggleScanlines"> <div id="ToggleScanlines">
<img class="navButton off" src="images/nav/ic_scanlines_off_white_24dp_2x.png" title="Scan lines on" /> <img class="navButton off" src="images/nav/ic_scanlines_off_white_24dp_2x.png" title="Scan lines on" />
<img class="navButton on" src="images/nav/ic_scanlines_on_white_24dp_2x.png" title="Scan lines off" /> <img class="navButton on" src="images/nav/ic_scanlines_on_white_24dp_2x.png" title="Scan lines off" />
</div> </div>
<img id="ToggleFullScreen" class="navButton" src="images/nav/ic_fullscreen_white_24dp_2x.png" title="Enter Fullscreen" /> <img id="ToggleFullScreen" class="navButton" src="images/nav/ic_fullscreen_white_24dp_2x.png" title="Enter Fullscreen" />
</div> </div>
</div> </div>

View File

@@ -1,84 +1,85 @@
{ {
"folders": [ "folders": [
{ {
"path": "." "path": "."
} }
], ],
"settings": { "settings": {
"search.exclude": { "search.exclude": {
"**/*.code-search": true, "**/*.code-search": true,
"**/*.css": true, "**/*.css": true,
"**/*.min.js": true, "**/*.min.js": true,
"**/bower_components": true, "**/bower_components": true,
"**/node_modules": true, "**/node_modules": true,
"**/vendor": true, "**/vendor": true,
"dist/**": true "dist/**": true
}, },
"cSpell.enabledFileTypes": { "cSpell.enabledFileTypes": {
"markdown": true, "markdown": true,
"JavaScript": true "JavaScript": true
}, },
"cSpell.enabled": true, "cSpell.enabled": true,
"cSpell.ignoreWords": [ "cSpell.ignoreWords": [
"'storm", "'storm",
"arcgis", "arcgis",
"Battaglia", "Battaglia",
"devbridge", "devbridge",
"gifs", "gifs",
"ltrim", "ltrim",
"mbar", "mbar",
"Noaa", "Noaa",
"nosleep", "nosleep",
"Pngs", "Pngs",
"PRECIP", "PRECIP",
"rtrim", "rtrim",
"sonarjs", "sonarjs",
"T", "T",
"T'storm", "T'storm",
"uscomp", "uscomp",
"Visib", "Visib",
"Waukegan", "Waukegan",
"WSQS", "WSQS",
"Tucsan", "Tucsan",
"Malek", "Malek",
"mwood", "mwood",
"unmuted", "unmuted",
"dumpio", "dumpio",
"mesonet" "mesonet"
], ],
"cSpell.ignorePaths": [ "cSpell.ignorePaths": [
"**/package-lock.json", "**/package-lock.json",
"**/node_modules/**", "**/node_modules/**",
"**/vscode-extension/**", "**/vscode-extension/**",
"**/.git/objects/**", "**/.git/objects/**",
".vscode", ".vscode",
".vscode-insiders", ".vscode-insiders",
"**/vendor/auto/**", "**/vendor/auto/**",
], ],
"editor.tabSize": 2, "editor.tabSize": 2,
"editor.insertSpaces": false, // .eslintrc wants tabs instead of spaces "editor.insertSpaces": false, // .eslintrc wants tabs instead of spaces
"emmet.includeLanguages": { "emmet.includeLanguages": {
"ejs": "html", "ejs": "html",
}, },
"[html]": { "[ejs]": {
// Use built-in VS Code HTML formatter instead of third-party EJS extension "editor.occurrencesHighlight": "off",
"editor.defaultFormatter": "vscode.html-language-features" "editor.defaultFormatter": "j69.ejs-beautify"
}, },
"files.exclude": {}, "files.exclude": {},
"files.eol": "\n", "files.eol": "\n",
"files.associations": { "files.associations": {
"*.ejs": "ejs" "*.ejs": "ejs"
}, },
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit" "source.fixAll.eslint": "explicit"
} }
}, },
"extensions": { "extensions": {
"recommendations": [ "recommendations": [
"digitalbrainstem.javascript-ejs-support", // EJS (Embedded JavaScript) template language support "digitalbrainstem.javascript-ejs-support", // EJS (Embedded JavaScript) template language support
"dbaeumer.vscode-eslint", // ESLint JavaScript linting integration "dbaeumer.vscode-eslint", // ESLint JavaScript linting integration
"streetsidesoftware.code-spell-checker", "streetsidesoftware.code-spell-checker",
] "j69.ejs-beautify",
} ]
} }
}