Add logic for a menu

This commit is contained in:
Adrian Vollmer 2024-04-21 17:26:16 +02:00
parent 1df42864cd
commit 2a8cbc75c8
2 changed files with 21 additions and 0 deletions

View File

@ -124,3 +124,12 @@ window.addEventListener("message", (evnt) => {
window.parent.postMessage({
action: "ready",
}, '*');
document.addEventListener('keyup', function (event) {
if (event.key == "Z" && event.ctrlKey){
window.parent.postMessage({
action: "showMenu",
}, '*');
}
});

View File

@ -181,6 +181,8 @@ window.onload = function() {
if (evnt.data.action == 'ready') {
hideLoadingIndicator();
} else if (evnt.data.action == 'showMenu') {
showMenu();
} else if (evnt.data.action == 'set_title') {
// iframe has finished loading and sent us its title
// parent sets the title and responds with the globalContext object
@ -232,3 +234,13 @@ var hideLoadingIndicator = function() {
var loading = document.getElementById('loading-indicator');
loading.style.display = 'none';
}
function showMenu() {
// TODO show the menu containing info and functions
}
document.addEventListener('keyup', function (event) {
if (event.key == "Z" && event.ctrlKey){
showMenu();
}
});