aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/googlecalendar
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-10-05 16:46:55 +0200
committerLibravatar GitHub <noreply@github.com>2021-10-05 16:46:55 +0200
commit2484c63d77e05fff384cc08b6ea46a29a22a62ec (patch)
tree21b8b74f1788407a4cfb13052160398f13424ac6 /recipes/googlecalendar
parentAdd check to ensure that generated file 'user.js' is not present in default p... (diff)
downloadferdium-recipes-2484c63d77e05fff384cc08b6ea46a29a22a62ec.tar.gz
ferdium-recipes-2484c63d77e05fff384cc08b6ea46a29a22a62ec.tar.zst
ferdium-recipes-2484c63d77e05fff384cc08b6ea46a29a22a62ec.zip
chore: repo maintenance (#732)
Diffstat (limited to 'recipes/googlecalendar')
-rw-r--r--recipes/googlecalendar/webview-unsafe.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/recipes/googlecalendar/webview-unsafe.js b/recipes/googlecalendar/webview-unsafe.js
index c47f572..54a7338 100644
--- a/recipes/googlecalendar/webview-unsafe.js
+++ b/recipes/googlecalendar/webview-unsafe.js
@@ -26,7 +26,8 @@ const hideModal = () => {
26const createModal = () => { 26const createModal = () => {
27 const modalDialog = document.createElement('div'); 27 const modalDialog = document.createElement('div');
28 modalDialog.setAttribute('id', 'franz-modal'); 28 modalDialog.setAttribute('id', 'franz-modal');
29 modalDialog.innerHTML = '<div class="modal-content"><span class="close">&times;</span><p></p></div>'; 29 modalDialog.innerHTML =
30 '<div class="modal-content"><span class="close">&times;</span><p></p></div>';
30 modalDialog.querySelector('.close').addEventListener('click', hideModal); 31 modalDialog.querySelector('.close').addEventListener('click', hideModal);
31 32
32 return modalDialog; 33 return modalDialog;
@@ -35,5 +36,11 @@ const createModal = () => {
35window.alert = showModal; 36window.alert = showModal;
36 37
37modal = createModal(); 38modal = createModal();
38waitFor(() => document.body, () => document.body.appendChild(modal)); 39waitFor(
39document.addEventListener('keydown', event => event.keyCode === 27 && hideModal()); 40 () => document.body,
41 () => document.body.appendChild(modal),
42);
43document.addEventListener(
44 'keydown',
45 event => event.key === 'Escape' && hideModal(),
46);