Code Monkey home page Code Monkey logo

Comments (13)

manicmoose avatar manicmoose commented on August 28, 2024 1

Legendary - you fixed it. Nice work!
Thanks for your that - I'd almost forgotten about it... ;-)

from mindthedark.

MrReSc avatar MrReSc commented on August 28, 2024 1

Yes, that's right. I forgot about that. I have to fix that too.

from mindthedark.

MrReSc avatar MrReSc commented on August 28, 2024

Unfortunately, I cannot recreate the behaviour. What browser do you use? Do you have any plugins in your browser that automatically show websites in a dark theme?

from mindthedark.

manicmoose avatar manicmoose commented on August 28, 2024

Interesting - I'm using Firefox - and no plugins to impose dark mode.

I tried it in Chrome and it doesn't happen, so I disabled ALL my extensions and theme (dark theme) in FF and it still occurs.
Tested in a FF private window (ie. most things disabled) and again, it still happens.
Tested in Safari (no plugins whatsoever as I never use Safari) and it also happens.

Odd.

from mindthedark.

MrReSc avatar MrReSc commented on August 28, 2024

The plugin was actually only tested by me with Firefox.
I also only use Firefox. With me it works without problems.
What kind of OS do you use? I used Fedora 33.

from mindthedark.

manicmoose avatar manicmoose commented on August 28, 2024

Hmm...I'm using it on a Hackintosh.
Perhaps I'll boot up linux or Windoze and see what (if any) difference there is.

It's not a big deal as I can just disable the user choice option and the problem goes away.
To the naked eye, it looks like it's rendering the page in white first, then quickly re-renders it in the dark theme.

from mindthedark.

Gamemap avatar Gamemap commented on August 28, 2024

I have the same issue too.

OS: Windows 10 64-Bit
Firefox: Version 95.0 (64-Bit)

This also happens if you have selected the light mode and enabled autoDark.


Edit: I have found a workaround for this problem. You have to change the value below to "0", disable the userChoice setting and then everything works.

<?php if(tpl_getConf('userChoice') == '1'): ?>


2021-12-11_10-41-54.mp4

from mindthedark.

MrReSc avatar MrReSc commented on August 28, 2024

Here the problem seems to be that the server (PHP code) already generates and delivers the HMTL and only in the browser is decided which theme to use. Somehow the display of the website would have to wait until the JS code was executed. Any ideas?

from mindthedark.

vbrozik avatar vbrozik commented on August 28, 2024

Just to describe the behaviour on my system:
Client: Windows 10, Chrome 96.0 (happens with clean profile)

I see the bright flashes only when going back in the browsing history or saving DokuWiki configuration (that does not matter much). When I disable the user selection of the theme then the flashes do not happen. Even if the automatic detection stays enabled.

@MrReSc
So if I understand it correctly on a newly loaded page a JS code must be run to decide which theme to use? Before that the default theme is used? If so then probably the server should remember the user preference and use the theme according to that.

Suggesting a (probably) small change for a little better behaviour: The first displayed theme (before the JS) should be the one set in the settings. Then the flashes would happen only for users who override the default setting.

from mindthedark.

MrReSc avatar MrReSc commented on August 28, 2024

So if I understand it correctly on a newly loaded page a JS code must be run to decide which theme to use? Before that the default theme is used? If so then probably the server should remember the user preference and use the theme according to that.

Yes, exactly.

Suggesting a (probably) small change for a little better behaviour: The first displayed theme (before the JS) should be the one set in the settings. Then the flashes would happen only for users who override the default setting.

That's what I was thinking. Or you always use the automatic mode. This is probably even closer to what the user wants.

from mindthedark.

MrReSc avatar MrReSc commented on August 28, 2024

The problem is with the deferred loading that is turned on by default since the latest version. When this is turned off, it no longer flickers.

As an intermediate solution you can set defer_js = false.

grafik

from mindthedark.

MrReSc avatar MrReSc commented on August 28, 2024

I tried to solve the problem using cookies instead of localstorage. It looks quite good. @vbrozik @Gamemap @manicmoose Can you try the latest version?

https://github.com/MrReSc/MindTheDark/archive/refs/heads/master.zip

from mindthedark.

Gamemap avatar Gamemap commented on August 28, 2024

I think you fixed it (I will test it more detailed soon) but because you don't load the tpl_autocolor.php it isn't possible to change the Note Plugin to dark mode.

from mindthedark.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.