diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index 48bb984b6..53ed82749 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -84,6 +84,7 @@ public class IndexBean { static final String CLIENT_NICKNAME = "shared clients"; public static final String PROP_THEME_NAME = "routerconsole.theme"; + public static final String DEFAULT_THEME = "light"; public static final String PROP_CSS_DISABLED = "routerconsole.css.disabled"; public static final String PROP_JS_DISABLED = "routerconsole.javascript.disabled"; @@ -319,11 +320,8 @@ public class IndexBean { //// public String getTheme() { - String theme = _context.getProperty(PROP_THEME_NAME); - if (theme != null) - return "/themes/console/" + theme + "/"; - else - return "/themes/console/"; + String theme = _context.getProperty(PROP_THEME_NAME, DEFAULT_THEME); + return "/themes/console/" + theme + "/"; } public boolean allowCSS() { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java index 6b3916883..a2f3341f9 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java @@ -8,6 +8,7 @@ public class CSSHelper extends HelperBase { public CSSHelper() {} public static final String PROP_THEME_NAME = "routerconsole.theme"; + public static final String DEFAULT_THEME = "light"; private static final String BASE = "/themes/console/"; private static final String FORCE = "classic"; @@ -16,9 +17,8 @@ public class CSSHelper extends HelperBase { if (userAgent != null && userAgent.contains("MSIE")) { url += FORCE + "/"; } else { - String theme = _context.getProperty(PROP_THEME_NAME); - if (theme != null) - url += theme + "/"; + String theme = _context.getProperty(PROP_THEME_NAME, DEFAULT_THEME); + url += theme + "/"; } return url; } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java index 0e0b36a28..9bfd22077 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java @@ -3,12 +3,11 @@ package net.i2p.router.web; public class ConfigUIHelper extends HelperBase { public ConfigUIHelper() {} - public static final String PROP_THEME = "routerconsole.theme"; private static final String themes[] = {"classic", "dark", "light"}; public String getSettings() { StringBuilder buf = new StringBuilder(512); - String current = _context.getProperty(PROP_THEME, "default"); + String current = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME); for (String theme : themes) { buf.append("