Skip to content

Conversation

@bobicloudvision
Copy link

Screen Shot 2025-04-05 at 02 29 47
Screen Shot 2025-04-05 at 02 29 42
Screen Shot 2025-04-05 at 02 29 20
Screen Shot 2025-04-05 at 02 29 14
Screen Shot 2025-04-05 at 02 28 56
Screen Shot 2025-04-05 at 02 28 53
Screen Shot 2025-04-05 at 02 28 45
Screen Shot 2025-04-05 at 02 28 41

@DavidGoodwin
Copy link
Member

Thank you for taking the time to contribute this.

At first glance, it looks good!

@bobicloudvision
Copy link
Author

bobicloudvision commented Apr 5, 2025

Let me know if have some bugs that i need to fix..

@DavidGoodwin
Copy link
Member

i see :

Content-Security-Policy: The page’s settings blocked the loading of a resource (img-src) at data:image/svg+xml;charset=utf8,%3Csvg x… because it violates the following directive: “default-src 'self'”

<td colspan="2" style="padding-top: 10px;">
<button class="button theme-toggle" type="button" id="theme-toggle">
<span class="theme-icon-container"></span>
<span class="theme-text">Toggle Theme</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs translation key

}
} else {
if (themeText) {
themeText.textContent = 'Dark Mode';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs translating

const currentTheme = document.documentElement.getAttribute('data-theme');
if (currentTheme === 'dark') {
if (themeText) {
themeText.textContent = 'Light Mode';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs translating

darkThemeCss.disabled = true;
}
if (themeText) {
themeText.textContent = 'Dark Mode';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs translating

darkThemeCss.disabled = false;
}
if (themeText) {
themeText.textContent = 'Light Mode';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs translating

<li>
<a class="btn navbar-btn theme-toggle" type="button" href="#" id="theme-toggle">
<span class="theme-icon-container"></span>
<span class="theme-text">Toggle Theme</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs translating

@DavidGoodwin
Copy link
Member

image

for some reason the button seems to be left aligned here?

@DavidGoodwin
Copy link
Member

DavidGoodwin commented Apr 7, 2025

i see :

Content-Security-Policy: The page’s settings blocked the loading of a resource (img-src) at data:image/svg+xml;charset=utf8,%3Csvg x… because it violates the following directive: “default-src 'self'”

Adding this to header.php might suffice?

header("Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; object-src data: 'unsafe-eval';  img-src 'self' data:");

and this in header.tpl -

    <meta http-equiv='Content-Security-Policy' content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; object-src data: 'unsafe-eval';  img-src 'self' data:"/>

I'm not really sure why we have the meta variant and also set a header() from common.php.

@DavidGoodwin
Copy link
Member

(functionality appears to work fine to me - it detected i have a dark theme, and behaved as expected ... I could switch between light mode and dark mode).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants