(gameName)
| 19 | } |
| 20 | |
| 21 | function openGameInNewTab(gameName) { |
| 22 | // Open the viewer in a new tab with the selected game |
| 23 | // In static mode, use path-based URLs; in dynamic mode, use query parameters |
| 24 | const isStatic = document.body.hasAttribute("data-static-mode"); |
| 25 | if (isStatic) { |
| 26 | // For static mode, encode each path segment separately to preserve slashes |
| 27 | const pathSegments = gameName |
| 28 | .split("/") |
| 29 | .map((segment) => encodeURIComponent(segment)); |
| 30 | // Navigate to .html file directly |
| 31 | const url = `/game/${pathSegments.join("/")}.html`; |
| 32 | window.open(url, "_blank"); |
| 33 | } else { |
| 34 | const url = `/?folder=${encodeURIComponent(gameName)}`; |
| 35 | window.open(url, "_blank"); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | function handleGameClick(event, gameName) { |
| 40 | // Handle different types of clicks for Open button |
no outgoing calls
no test coverage detected