Skip to content

Commit

Permalink
Allow time changes from infobox
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowm committed May 3, 2024
1 parent f5c609e commit 2231385
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/modules/CesiumController.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,5 +530,17 @@ export class CesiumController {
style.appendChild(node);
head.appendChild(style);
}, false);

// Allow js in infobox
frame.setAttribute("sandbox", "allow-same-origin allow-popups allow-forms allow-scripts");
frame.src = "about:blank";

// Allow time changes from infobox
window.addEventListener("message", (e) => {
const pass = e.data;
if ("start" in pass) {
this.setTime(pass.start)

Check failure on line 542 in src/modules/CesiumController.js

View workflow job for this annotation

GitHub Actions / build (16)

Missing semicolon

Check failure on line 542 in src/modules/CesiumController.js

View workflow job for this annotation

GitHub Actions / build (18)

Missing semicolon
}
});
}
}
2 changes: 1 addition & 1 deletion src/modules/util/DescriptionHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class DescriptionHelper {
<tr>
${htmlName}
<td>${countdown}</td>
<td>${dayjs(pass.start).format("DD.MM HH:mm:ss")}</td>
<td><a onclick='parent.postMessage(${JSON.stringify(pass)}, "*")'>${dayjs(pass.start).format("DD.MM HH:mm:ss")}</td>
<td>${dayjs(pass.end).format("HH:mm:ss")}</td>
<td class="ibt-right">${pass.maxElevation.toFixed(0)}&deg</td>
<td class="ibt-right">${pass.azimuthApex.toFixed(2)}&deg</td>
Expand Down

0 comments on commit 2231385

Please sign in to comment.