I2P logo in routerconsole sidebar is now themed.

This commit is contained in:
duck
2010-06-27 17:04:51 +00:00
parent ada39a970e
commit 110f01a55b
2 changed files with 8 additions and 4 deletions

View File

@ -9,13 +9,13 @@ public class CSSHelper extends HelperBase {
public static final String PROP_THEME_NAME = "routerconsole.theme";
public static final String DEFAULT_THEME = "light";
private static final String BASE = "/themes/console/";
public static final String BASE_THEME_PATH = "/themes/console/";
private static final String FORCE = "classic";
public static final String PROP_REFRESH = "routerconsole.summaryRefresh";
public static final String DEFAULT_REFRESH = "60";
public String getTheme(String userAgent) {
String url = BASE;
String url = BASE_THEME_PATH;
if (userAgent != null && userAgent.contains("MSIE")) {
url += FORCE + "/";
} else {

View File

@ -25,8 +25,12 @@ public class SummaryBarRenderer {
*/
public void renderSummaryHTML(Writer out) throws IOException {
StringBuilder buf = new StringBuilder(8*1024);
buf.append("<a href=\"/index.jsp\" target=\"_top\"><img src=\"/themes/console/images/i2plogo.png\" alt=\"")
String theme = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME);
buf.append("<a href=\"/index.jsp\" target=\"_top\"><img src=\"")
.append(CSSHelper.BASE_THEME_PATH)
.append(theme)
.append("/images/i2plogo.png\" alt=\"")
.append(_("I2P Router Console"))
.append("\" title=\"")
.append(_("I2P Router Console"))