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:
hankhill19580
2020-10-07 04:47:27 +00:00
parent 2e34969bbc
commit ca1e2ba91e
46 changed files with 23 additions and 161 deletions

View File

@ -882,6 +882,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
* @return String[] -- Array of all the themes found, non-null, unsorted

View File

@ -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\">";
}
/**

View File

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 368 B

View File

Before

Width:  |  Height:  |  Size: 513 B

After

Width:  |  Height:  |  Size: 513 B

View File

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 599 B

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

View File

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 339 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 407 B

View File

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 249 B

View File

Before

Width:  |  Height:  |  Size: 429 B

After

Width:  |  Height:  |  Size: 429 B

View File

Before

Width:  |  Height:  |  Size: 514 B

After

Width:  |  Height:  |  Size: 514 B

View File

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 661 B

View File

Before

Width:  |  Height:  |  Size: 559 B

After

Width:  |  Height:  |  Size: 559 B

View File

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 325 B

View File

Before

Width:  |  Height:  |  Size: 385 B

After

Width:  |  Height:  |  Size: 385 B

View File

Before

Width:  |  Height:  |  Size: 459 B

After

Width:  |  Height:  |  Size: 459 B

View File

Before

Width:  |  Height:  |  Size: 459 B

After

Width:  |  Height:  |  Size: 459 B

View File

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 324 B

View File

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

View File

Before

Width:  |  Height:  |  Size: 548 B

After

Width:  |  Height:  |  Size: 548 B

View File

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 525 B

View File

@ -3272,83 +3272,3 @@ th a img {
background-size: 14px auto !important;
}
.snarkTorrentDetails img {
height: 0px !important;
width: 0px !important;
padding: 16px !important;
}
.snarkDirInfo img {
height: 0px !important;
width: 0px !important;
padding: 16px !important;
}
img[src*="i2psnark/.resources/icons/application.png"]{
background: url("/themes/snark/dark/images/icons/") center no-repeat
}
img[src*="i2psnark/.resources/icons/basket_put.png"]{
background: url("/themes/snark/dark/images/icons/basket_put.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/cancel.png"]{
background: url("/themes/snark/dark/images/icons/cancel.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/cd.png"]{
background: url("/themes/snark/dark/images/icons/cd.pmg") center no-repeat
}
img[src*="i2psnark/.resources/icons/clock.png"]{
background: url("/themes/snark/dark/images/icons/clock.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/clock_red.png"]{
background: url("/themes/snark/dark/images/icons/clock_red.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/compress.png"]{
background: url("/themes/snark/dark/images/icons/compress.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/ebook.png"]{
background: url("/themes/snark/dark/images/icons/ebook.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/film.png"]{
background: url("/themes/snark/dark/images/icons/film.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/folder.png"]{
background: url("/themes/snark/dark/images/icons/folder.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/html.png"]{
background: url("/themes/snark/dark/images/icons/html.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/itoopie_xxsm.png"]{
background: url("/themes/snark/dark/images/icons/itoopie_xxsm.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/magnet.png"]{
background: url("/themes/snark/dark/images/icons/magnet.png") center no-repeat;
height: 0px;
width: 0px;
padding: 16px;
margin: -4px !important;
}
img[src*="i2psnark/.resources/icons/music.png"]{
background: url("/themes/snark/dark/images/icons/music.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/package.png"]{
background: url("/themes/snark/dark/images/icons/package.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/page.png"]{
background: url("/themes/snark/dark/images/icons/page.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/page_white.png"]{
background: url("/themes/snark/dark/images/icons/page_white.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/page_white_acrobat.png"]{
background: url("/themes/snark/dark/images/icons/page_white_acrobat.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/photo.png"]{
background: url("/themes/snark/dark/images/icons/photo.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/plugin.png"]{
background: url("/themes/snark/dark/images/icons/plugin.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/tick.png"]{
background: url("/themes/snark/dark/images/icons/tick.png") center no-repeat
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 B

View File

@ -2709,83 +2709,3 @@ a, a:link, th, td, button, input, select, textarea {
background-size: 14px auto !important;
}
.snarkTorrentDetails img {
height: 0px !important;
width: 0px !important;
padding: 16px !important;
}
.snarkDirInfo img {
height: 0px !important;
width: 0px !important;
padding: 16px !important;
}
img[src*="i2psnark/.resources/icons/application.png"]{
background: url("/themes/snark/light/images/icons/application") center no-repeat
}
img[src*="i2psnark/.resources/icons/basket_put.png"]{
background: url("/themes/snark/light/images/icons/basket_put.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/cancel.png"]{
background: url("/themes/snark/light/images/icons/cancel.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/cd.png"]{
background: url("/themes/snark/light/images/icons/cd.pmg") center no-repeat
}
img[src*="i2psnark/.resources/icons/clock.png"]{
background: url("/themes/snark/light/images/icons/clock.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/clock_red.png"]{
background: url("/themes/snark/light/images/icons/clock_red.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/compress.png"]{
background: url("/themes/snark/light/images/icons/compress.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/ebook.png"]{
background: url("/themes/snark/light/images/icons/ebook.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/film.png"]{
background: url("/themes/snark/light/images/icons/film.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/folder.png"]{
background: url("/themes/snark/light/images/icons/folder.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/html.png"]{
background: url("/themes/snark/light/images/icons/html.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/itoopie_xxsm.png"]{
background: url("/themes/snark/light/images/icons/itoopie_xxsm.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/magnet.png"]{
background: url("/themes/snark/light/images/icons/magnet.png") center no-repeat;
height: 0px;
width: 0px;
padding: 16px;
margin: -4px !important;
}
img[src*="i2psnark/.resources/icons/music.png"]{
background: url("/themes/snark/light/images/icons/music.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/package.png"]{
background: url("/themes/snark/light/images/icons/package.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/page.png"]{
background: url("/themes/snark/light/images/icons/page.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/page_white.png"]{
background: url("/themes/snark/light/images/icons/page_white.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/page_white_acrobat.png"]{
background: url("/themes/snark/light/images/icons/page_white_acrobat.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/photo.png"]{
background: url("/themes/snark/light/images/icons/photo.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/plugin.png"]{
background: url("/themes/snark/light/images/icons/plugin.png") center no-repeat
}
img[src*="i2psnark/.resources/icons/tick.png"]{
background: url("/themes/snark/light/images/icons/tick.png") center no-repeat
}