+1 here, particularly in the second form (using data- attributes).
I've never worked with directly with Behaviour but have been learning
jQuery Mobile for a project at work. Definitely prefer it over
tangled solutions and possibly even over pure-javascript.
Cheers,
--
Scott Elcomb
@psema4 on Twitter / Identi.ca
Atomic OS: Self Contained Microsystems
http://code.google.com/p/atomos/
Member of the Pirate Party of Canada
http://www.pirateparty.ca/
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To post to this group, send email to jx...@googlegroups.com.
To unsubscribe from this group, send email to jxlib+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jxlib?hl=en.
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/Gbc-i9oRyE0J.
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/I79z9W4DqUoJ.
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/Zd4HflQelb4J.
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/GJLa5sUAEkIJ.
Paul
To unsubscribe from this group, send email to jxlib+unsubscribe@googlegroups.com.
Paul,I was just going to start working on this enhancement but wanted to hash out a few details...1) Do we still want to load all of the CSS via a single file? I'm currently leaning to using XHR to fetch individual style sheets and activate them using Jx.Styles. The reason being that if a theme doesn't provide styles for a specific widget then we would need to be able to access the base theme (or parent theme if you like) to get the styles we need...
2) What do you think about using something similar to LESS or SASS for this and then building the "compilation" of those into the build process?
3) I'm thinking the rendering phase of a widget is going to need to be decoupled from the initialization. Currently, we have init() calling render() for widgets. I'm thinking we would need to instead have init() call out to ThemeManager to get the theme related components. Then ThemeManager either fires an event or some kind of callback to pass everything back to the widget for it's use.
4) I'm also considering having each theme have a theme.js file that does a couple of things:
- Define a base, or parent, theme that it inherits from. If none is specified then we assume either crispin or delicious.
- A flag that indicates whether there are browser specific files available. The use case for this that I'm mainly thinking of is older IE as well as CSS3 techniques specific to certain browsers. This may indicate separate HTML and/or CSS files. We could also handle this through browser-scoped rules that are loaded regardless of browser but obviously not activated unless the body tag has the appropriate class.
5) The changing of themes.... The Theme Manager would have a method that could be called to start the theme change process. I envision it working similar to:
- First, ThemeManager should fire a preThemeChanging event that all widgets (and layouts possibly) will listen for. This will allow the individual widgets to do any necessary preparation on their part.
- Next, ThemeManager will fire off the necessary requests to gather the resources (CSS and HTML) for the new theme.
- ThemeManager then fires an event that the resources are available (perhaps ThemeResourcesReady or similar).
- The ThemeManager then deactivates all old style and activates the new ones
- Widgets then need to request and rebuild their DOM objects being sure they return to their current state (including data and other stateful information).
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/RCigfDvB8sMJ.
To unsubscribe from this group, send email to jxlib+un...@googlegroups.com.