Comments (10)
I will try to create this but I need some help.
Because this detection must happen in the client side, I created new CoffeeScript file that is included in wrapper.html
. It correctly detects theme and theme changes but I have some problems.
To update the theme, three things need to be updated. First is background-color
of the main page and the second is theme-*
class in its body. This two things works. But theme-*
also have to be updated in the site in an iframe. I also tried to do this, but the problem is that I get cross-origin when I want to change the class of body in the iframe.
@HelloZeroNet How can I do this? Is there some function in ZeroFrame to inject script (that would change the body's class) into iframe page? Any other alternative?
from zerohello.
Probably the cleanest solution would be let the sites handle it.
Other possibility: At the load of the wrapper it checks if the system preference is different from zeronet setting. If it is, then change it and reload the page.
from zerohello.
Probably the cleanest solution would be let the sites handle it.
But the problem is that all sites would need to be updated to do this.
Other possibility: At the load of the wrapper it checks if the system preference is different from zeronet setting. If it is, then change it and reload the page.
How could then wrapper detect if the user wants automatic theme changes? If this option would be overwritten every time there is an update, wrapper won't be able to detect if the user wants automatic theme changes.
This may be fixed by settings another user setting (maybe called use_system_theme
) that would be independent of the current theme setting. So wrapper would only check for the system preference if that setting would be true.
Some problem with this may be if the user changes its system theme when the site is already opened. If the site would then be reloaded, the user could lose all their unsaved work. If it would not be reloaded, the theme would not be updated.
But this is probably not so important problem because users probably won't change system theme when they have sites opened. And if they would, they will just have to reload site manually.
If this is OK, I can develop support for this.
from zerohello.
Yeah adding a new, separate use_system_theme setting to the user sounds like a good solution. I think lack of real-time theme changing is not a big problem.
from zerohello.
@HelloZeroNet I created PR HelloZeroNet/ZeroNet#1999.
When you merge it, please let me know which revision and version will it have, so I can implement version check and configuration in ZeroHello.
from zerohello.
The rev got bumped to 4085, so you can use that as a minimal version requirement
from zerohello.
@HelloZeroNet Thank you. And which version will it be?
from zerohello.
0.7.0, but the version does not matter, it's safe to use Page.site_info.rev > 4085
from zerohello.
I wanted version to display it to user (You need at least x.y.z to use this feature).
from zerohello.
@HelloZeroNet I created #119.
from zerohello.
Related Issues (20)
- SUGGESTION: Improve the format of "Version 0.6.5 (rev3863): Up to date!" on the left pane 3-dot click menu
- Zites sorted in the wrong order HOT 1
- A JavaScript error occurred while not subscribing to the site. HOT 1
- Configuration in IntelliJ IDEA
- [Feature request] Do not show link to "Configuration" in menu if the plugin "UiConfig" is disabled HOT 1
- [Feature request] Show link to "Shut down ZeroNet" only if you have an admin permission HOT 1
- Update in Brazilian portuguese HOT 1
- Collapsible categories in site list to allow faster navigation HOT 2
- light and dark translation was reversed HOT 1
- Monkey-patching browser APIs with ZeroFrame HOT 2
- The recent update that allows sites to use Name YO without breakage for non-users of Name YO
- Add a Select All button to the left of OPTIONAL FILE text HOT 1
- Recommend a ZeroTalk forum based on the selected language.
- Group together same-thread notifications to reduce newsfeed clutter.
- Make "Edit optional files limit" always visible without having to click "Used:"
- SUBSCRIBED tab for newsfeed. HOT 1
- Preferred merger site to populate the newsfeed.
- Prevent trackers drop-down list from growing font size in landscape. HOT 2
- Notify of changed site files on ZeroHello.
- Sequential size limit increases lead to errors without refreshing ZeroHello between each time.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zerohello.