forked from I2P_Developers/i2p.i2p
Switch Snark dark and light themes to using images embedded in the .war, and remove the images substitutions from the filesystem and css
This commit is contained in:
@ -881,6 +881,28 @@ public class SnarkManager implements CompleteListener, ClientApp {
|
||||
}
|
||||
return theme;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to the preferred embedded icons for toImg, "solid/" for
|
||||
* dark and light, "" for everything else.
|
||||
*
|
||||
* If you add a theme with a new icon set, then you need to add a
|
||||
* corresponding condition here.
|
||||
*
|
||||
* @return String "solid/" or ""
|
||||
* @since 0.9.48
|
||||
*/
|
||||
public String getThemeIconSet() {
|
||||
String iconset = "";
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Theme was: " + this.getTheme());
|
||||
if (this.getTheme().equals("dark") || this.getTheme().equals("light")) {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Using solid iconset.");
|
||||
iconset = "solid/";
|
||||
}
|
||||
return iconset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all themes
|
||||
|
@ -4206,7 +4206,7 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
* @since 0.8.2
|
||||
*/
|
||||
private String toImg(String icon, String altText) {
|
||||
return "<img alt=\"" + altText + "\" height=\"16\" width=\"16\" src=\"" + _contextPath + WARBASE + "icons/" + icon + ".png\">";
|
||||
return "<img alt=\"" + altText + "\" height=\"16\" width=\"16\" src=\"" + _contextPath + WARBASE + "icons/" + _manager.getThemeIconSet() + icon + ".png\">";
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user