5 ms·
You can just include them from your app, those are shared style sheets. Everything in the /shared directory is accessible from third every app. This also includ
by padenot 14y ago
You can just include them from your app, those are shared style sheets. Everything in the /shared directory is accessible from third every app. This also includes js helpers.
Also, hi :-)
- ndesaulniers 14y agoHey buddy. How would name resolution work then if your app actually had styles or js in a 'shared' directory? I tried this quickly on Friday but had no luck. Still, I didn't look too much into it. Have you been able to import these into an app of yours?
- padenot 14y agoNot sure, I am merely a C++ dev :-). Surely people in #gaia on IRC will know how this is handled.
- padenot 14y agoAlso, yes, it works, see https://github.com/mozilla-b2g/gaia/blob/master/apps/music/index.html https://github.com/mozilla-b2g/gaia/blob/master/apps/music/i... for instance. This app imports a bunch of code from /shared. Great for code sharing.
- ndesaulniers 14y agoBut music is a built in Gaia app. I believe these styles to be shared across the "Certified apps" that ship with the phone: https://wiki.mozilla.org/Apps/Security#Certified_application https://wiki.mozilla.org/Apps/Security#Certified_application An example that was a third party app, not certified or made by Mozilla or partners, would be more definitive.
- padenot 14y agoSee https://wiki.mozilla.org/Gaia/Shared https://wiki.mozilla.org/Gaia/Shared for the details on how this works. Not having this mechanism would be pretty crappy. See https://github.com/taratatach/FFDoku/blob/erwan/index.html https://github.com/taratatach/FFDoku/blob/erwan/index.html for a third party app that reuses code from shared/ (a sudoku game).
- ndesaulniers 14y agoRE: the first link, it looks like you need a custom profile, therefore a custom build of Gaia, for it to "Probably" work. FFDoku just copies the assets, as I had originally recommended. That repo contains a 'shared' folder in the root dir, so it's not using the assets shared by Gaia, it's using a literal copy of them. So the same asset winds up on the device twice.
- padenot 14y agoI'll check tomorrow, there is a bunch of gaia folks at the office. You might be right, in which case we need to address that.
- padenot 14y agoNick, you were absolutely right, and I was wrong. This is a pain, though, but is understandable. I'll ask the right people if we can do something, because I like not copying stuff all over. Or maybe we can we can do a static analyzer to make the whole process easier.
- ndesaulniers 14y agoNo worries, we were both unsure. :fabrice verified this today with me.