Skip to content

Commit 027ad48

Browse files
committed
fixes
1 parent 0f27603 commit 027ad48

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

public/_headers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
Strict-Transport-Security: max-age=31536000; includeSubDomains
1111
Referrer-Policy: strict-origin-when-cross-origin
1212
Access-Control-Allow-Methods: GET
13-
Content-Security-Policy: base-uri 'self'; font-src 'self' data:; form-action 'self'; frame-ancestors 'self'; img-src 'self' https://*.add-to-calendar-pro.com https://add-to-calendar-pro.com https://*.caldn.net data:; object-src 'none'; script-src-attr 'self'; script-src 'self' 'unsafe-inline' https://*.add-to-calendar-pro.com https://add-to-calendar-pro.com https://cdn.zapier.com; style-src 'self' 'unsafe-inline' https://*.add-to-calendar-pro.com https://add-to-calendar-pro.com https://cdn.jsdelivr.net https://cdn.zapier.com; frame-src 'self'; upgrade-insecure-requests;
13+
Content-Security-Policy: base-uri 'self'; font-src 'self' data:; form-action 'self'; frame-ancestors 'self'; img-src 'self' https://*.add-to-calendar-pro.com https://add-to-calendar-pro.com https://*.caldn.net https://zapier-images.imgix.net data:; object-src 'none'; script-src-attr 'self'; script-src 'self' 'unsafe-inline' https://*.add-to-calendar-pro.com https://add-to-calendar-pro.com https://cdn.zapier.com; style-src 'self' 'unsafe-inline' https://*.add-to-calendar-pro.com https://add-to-calendar-pro.com https://cdn.jsdelivr.net https://cdn.zapier.com; frame-src 'self'; upgrade-insecure-requests;
1414
Permissions-Policy: geolocation=(),midi=(),microphone=(),camera=(),gyroscope=(*),encrypted-media=(*),payment=()

src/automation-integration/zapier.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,24 @@ Simply create a new event at Add to Calendar PRO via our Zapier app whenever a n
144144
145145
<script>
146146
if (typeof document !== 'undefined') {
147-
document.addEventListener('DOMContentLoaded', function() {
147+
function updateZapierTheme() {
148148
const isDarkMode = document.documentElement.classList.contains('dark');
149149
const zapierWorkflow = document.getElementById('zapier-workflow');
150150
if (zapierWorkflow) {
151151
zapierWorkflow.setAttribute('theme', isDarkMode ? 'dark' : 'light');
152152
}
153-
});
153+
}
154+
155+
if (document.readyState === 'loading') {
156+
document.addEventListener('DOMContentLoaded', updateZapierTheme);
157+
} else {
158+
updateZapierTheme();
159+
}
154160

155-
// Listen for theme changes
156161
const observer = new MutationObserver(function(mutations) {
157162
mutations.forEach(function(mutation) {
158163
if (mutation.attributeName === 'class') {
159-
const isDarkMode = document.documentElement.classList.contains('dark');
160-
const zapierWorkflow = document.getElementById('zapier-workflow');
161-
if (zapierWorkflow) {
162-
zapierWorkflow.setAttribute('theme', isDarkMode ? 'dark' : 'light');
163-
}
164+
updateZapierTheme();
164165
}
165166
});
166167
});

src/de/automation-integration/zapier.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,24 @@ Erstelle einfach ein neues Event bei Add to Calendar PRO über unsere Zapier-App
144144
145145
<script>
146146
if (typeof document !== 'undefined') {
147-
document.addEventListener('DOMContentLoaded', function() {
147+
function updateZapierTheme() {
148148
const isDarkMode = document.documentElement.classList.contains('dark');
149149
const zapierWorkflow = document.getElementById('zapier-workflow');
150150
if (zapierWorkflow) {
151151
zapierWorkflow.setAttribute('theme', isDarkMode ? 'dark' : 'light');
152152
}
153-
});
153+
}
154+
155+
if (document.readyState === 'loading') {
156+
document.addEventListener('DOMContentLoaded', updateZapierTheme);
157+
} else {
158+
updateZapierTheme();
159+
}
154160

155-
// Listen for theme changes
156161
const observer = new MutationObserver(function(mutations) {
157162
mutations.forEach(function(mutation) {
158163
if (mutation.attributeName === 'class') {
159-
const isDarkMode = document.documentElement.classList.contains('dark');
160-
const zapierWorkflow = document.getElementById('zapier-workflow');
161-
if (zapierWorkflow) {
162-
zapierWorkflow.setAttribute('theme', isDarkMode ? 'dark' : 'light');
163-
}
164+
updateZapierTheme();
164165
}
165166
});
166167
});

0 commit comments

Comments
 (0)