Commit a4aaa152c359026484f645ceb36236d7383dea9f

  • avatar
  • egaudet
  • Mon Feb 01 04:06:13 CET 2010
Add patch that allows theme css overrides in scope of developing theme api structure.  Will find a better name and fix the naming convention once it's all ready.
  
1diff --git a/usr/palm/frameworks/mojo/builtins/palmInitFramework200_72.js b/usr/palm/frameworks/mojo/builtins/palmInitFramework200_72.js
2index ac3129f..2690732 100644
3--- a/usr/palm/frameworks/mojo/builtins/palmInitFramework200_72.js
4+++ b/usr/palm/frameworks/mojo/builtins/palmInitFramework200_72.js
5@@ -31,6 +31,8 @@ Mojo.Config.ACCOUNT_IMAGES_HOME=Mojo.Config.IMAGES_HOME+'/accounts';
6 Mojo.Config.CSS_HOME=Mojo.Config.MOJO_HOME+Mojo.generateFrameworkHome()+'/stylesheets';
7 Mojo.Config.JS_HOME=Mojo.Config.MOJO_HOME+Mojo.generateFrameworkHome()+'/javascripts';
8
9+Mojo.Config.THEME_HOME="/media/internal/org.webosinternals.thmapi/.theme";
10+
11 Mojo.Config.debuggingEnabled=false;
12 Mojo.Config.loadStylesWithLink=true;
13
14@@ -399,6 +401,18 @@ Mojo.generateFrameworkComponentPaths(cssFileName,"stylesheet",localized,cssVersi
15 Mojo.loadStylesheet(targetDocument,Mojo.hostingPrefix+path);
16 });
17 });
18+var themeConfig = Mojo.loadJSONFile(Mojo.Config.THEME_HOME+'/theme_config.json');
19+var appId = Mojo.appInfo.id;
20+
21+if (themeConfig) {
22+ if (themeConfig.global && themeConfig.global.cssFileName) {
23+ Mojo.loadStylesheet(targetDocument, Mojo.hostingPrefix+Mojo.Config.THEME_HOME+'/'+themeConfig.global.cssFileName);
24+ }
25+
26+ if (themeConfig.app && themeConfig.app[appId] && themeConfig.app[appId].cssFileName) {
27+ Mojo.loadStylesheet(targetDocument, Mojo.hostingPrefix+Mojo.Config.THEME_HOME+'/'+themeConfig.app[appId].cssFileName);
28+ }
29+}
30 };
31
32