(logPath, container)
| 395 | |
| 396 | // Log loading functionality |
| 397 | function loadLogContent(logPath, container) { |
| 398 | const placeholder = container.querySelector(".log-load-placeholder"); |
| 399 | const spinner = container.querySelector(".log-loading-spinner"); |
| 400 | const contentPre = container.querySelector(".log-content-scrollable"); |
| 401 | const contentCode = container.querySelector(".log-content"); |
| 402 | |
| 403 | // Hide placeholder, show spinner |
| 404 | placeholder.style.display = "none"; |
| 405 | spinner.style.display = "block"; |
| 406 | |
| 407 | // Fetch log content from server |
| 408 | fetch(`/load-log?path=${encodeURIComponent(logPath)}`) |
| 409 | .then((response) => response.json()) |
| 410 | .then((data) => { |
| 411 | spinner.style.display = "none"; |
| 412 | |
| 413 | if (data.success) { |
| 414 | // Display the content |
| 415 | contentCode.textContent = data.content; |
| 416 | contentPre.style.display = "block"; |
| 417 | } else { |
| 418 | // Show error message |
| 419 | contentCode.textContent = `Error loading log: ${data.error}`; |
| 420 | contentPre.style.display = "block"; |
| 421 | } |
| 422 | }) |
| 423 | .catch((error) => { |
| 424 | spinner.style.display = "none"; |
| 425 | contentCode.textContent = `Error loading log: ${error}`; |
| 426 | contentPre.style.display = "block"; |
| 427 | }); |
| 428 | } |
| 429 | |
| 430 | // Trajectory diffs loading functionality |
| 431 | function loadTrajectoryDiffs(playerName, roundNum, button) { |
no outgoing calls
no test coverage detected