diff --git a/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java b/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java index 7ca48f318a..77bad1339b 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java +++ b/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java @@ -65,6 +65,7 @@ public class I2PSnarkUtil { private int _maxConnections; private final File _tmpDir; private int _startupDelay; + private boolean _collapsePanels; private boolean _shouldUseOT; private boolean _shouldUseDHT; private boolean _enableRatings, _enableComments; @@ -77,6 +78,7 @@ public class I2PSnarkUtil { private static final int EEPGET_CONNECT_TIMEOUT = 45*1000; private static final int EEPGET_CONNECT_TIMEOUT_SHORT = 5*1000; public static final int DEFAULT_STARTUP_DELAY = 3; + public static final boolean DEFAULT_COLLAPSE_PANELS = true; public static final boolean DEFAULT_USE_OPENTRACKERS = true; public static final int MAX_CONNECTIONS = 24; // per torrent public static final String PROP_MAX_BW = "i2cp.outboundBytesPerSecond"; @@ -106,6 +108,7 @@ public class I2PSnarkUtil { _shouldUseOT = DEFAULT_USE_OPENTRACKERS; _openTrackers = Collections.emptyList(); _shouldUseDHT = DEFAULT_USE_DHT; + _collapsePanels = DEFAULT_COLLAPSE_PANELS; _enableRatings = _enableComments = true; _commentsName = ""; // This is used for both announce replies and .torrent file downloads, @@ -687,6 +690,16 @@ public class I2PSnarkUtil { return _enableRatings || _enableComments; } + /** @since 0.9.32 */ + public boolean collapsePanels() { + return _collapsePanels; + } + + /** @since 0.9.32 */ + public void setCollapsePanels(boolean yes) { + _collapsePanels = yes; + } + /** * Like DataHelper.toHexString but ensures no loss of leading zero bytes * @since 0.8.4 diff --git a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java index aa35f90b42..b1a71d2017 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java +++ b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java @@ -131,6 +131,8 @@ public class SnarkManager implements CompleteListener, ClientApp { public static final String RC_PROP_UNIVERSAL_THEMING = "routerconsole.universal.theme"; public static final String PROP_THEME = "i2psnark.theme"; public static final String DEFAULT_THEME = "ubergine"; + /** @since 0.9.32 */ + public static final String PROP_COLLAPSE_PANELS = "i2psnark.collapsePanels"; private static final String PROP_USE_OPENTRACKERS = "i2psnark.useOpentrackers"; public static final String PROP_OPENTRACKERS = "i2psnark.opentrackers"; public static final String PROP_PRIVATETRACKERS = "i2psnark.privatetrackers"; @@ -454,6 +456,17 @@ public class SnarkManager implements CompleteListener, ClientApp { return Boolean.parseBoolean(val); } + /** + * @return default true + * @since 0.9.32 + */ + public boolean isCollapsePanelsEnabled() { + String val = _config.getProperty(PROP_COLLAPSE_PANELS); + if (val == null) + return I2PSnarkUtil.DEFAULT_COLLAPSE_PANELS; + return Boolean.parseBoolean(val); + } + /**** public String linkPrefix() { return _config.getProperty(PROP_LINK_PREFIX, DEFAULT_LINK_PREFIX + getDataDir().getAbsolutePath() + File.separatorChar); @@ -798,6 +811,9 @@ public class SnarkManager implements CompleteListener, ClientApp { _config.setProperty(PROP_COMMENTS, "true"); if (!_config.containsKey(PROP_COMMENTS_NAME)) _config.setProperty(PROP_COMMENTS_NAME, ""); + if (!_config.containsKey(PROP_COLLAPSE_PANELS)) + _config.setProperty(PROP_COLLAPSE_PANELS, + Boolean.toString(I2PSnarkUtil.DEFAULT_COLLAPSE_PANELS)); updateConfig(); } @@ -871,7 +887,7 @@ public class SnarkManager implements CompleteListener, ClientApp { _util.setMaxUpBW(limits[1]); } } - + private void updateConfig() { String i2cpHost = _config.getProperty(PROP_I2CP_HOST); int i2cpPort = getInt(PROP_I2CP_PORT, 7654); @@ -908,6 +924,8 @@ public class SnarkManager implements CompleteListener, ClientApp { _util.setRatingsEnabled(Boolean.parseBoolean(_config.getProperty(PROP_RATINGS, "true"))); _util.setCommentsEnabled(Boolean.parseBoolean(_config.getProperty(PROP_COMMENTS, "true"))); _util.setCommentsName(_config.getProperty(PROP_COMMENTS_NAME, "")); + _util.setCollapsePanels(Boolean.parseBoolean(_config.getProperty(PROP_COLLAPSE_PANELS, + Boolean.toString(I2PSnarkUtil.DEFAULT_COLLAPSE_PANELS)))); File dd = getDataDir(); if (dd.isDirectory()) { if (!dd.canWrite()) @@ -918,7 +936,7 @@ public class SnarkManager implements CompleteListener, ClientApp { } initTrackerMap(); } - + private int getInt(String prop, int defaultVal) { String p = _config.getProperty(prop); try { @@ -929,29 +947,29 @@ public class SnarkManager implements CompleteListener, ClientApp { } return defaultVal; } - + /** * all params may be null or need trimming */ public void updateConfig(String dataDir, boolean filesPublic, boolean autoStart, boolean smartSort, String refreshDelay, - String startDelay, String pageSize, String seedPct, String eepHost, + String startDelay, String pageSize, String seedPct, String eepHost, String eepPort, String i2cpHost, String i2cpPort, String i2cpOpts, String upLimit, String upBW, boolean useOpenTrackers, boolean useDHT, String theme, - String lang, boolean enableRatings, boolean enableComments, String commentName) { + String lang, boolean enableRatings, boolean enableComments, String commentName, boolean collapsePanels) { synchronized(_configLock) { - locked_updateConfig(dataDir, filesPublic, autoStart, smartSort,refreshDelay, - startDelay, pageSize, seedPct, eepHost, - eepPort, i2cpHost, i2cpPort, i2cpOpts, - upLimit, upBW, useOpenTrackers, useDHT, theme, - lang, enableRatings, enableComments, commentName); + locked_updateConfig(dataDir, filesPublic, autoStart, smartSort, refreshDelay, + startDelay, pageSize, seedPct, eepHost, + eepPort, i2cpHost, i2cpPort, i2cpOpts, + upLimit, upBW, useOpenTrackers, useDHT, theme, + lang, enableRatings, enableComments, commentName, collapsePanels); } } private void locked_updateConfig(String dataDir, boolean filesPublic, boolean autoStart, boolean smartSort, String refreshDelay, - String startDelay, String pageSize, String seedPct, String eepHost, + String startDelay, String pageSize, String seedPct, String eepHost, String eepPort, String i2cpHost, String i2cpPort, String i2cpOpts, String upLimit, String upBW, boolean useOpenTrackers, boolean useDHT, String theme, - String lang, boolean enableRatings, boolean enableComments, String commentName) { + String lang, boolean enableRatings, boolean enableComments, String commentName, boolean collapsePanels) { boolean changed = false; boolean interruptMonitor = false; //if (eepHost != null) { @@ -996,7 +1014,7 @@ public class SnarkManager implements CompleteListener, ClientApp { } } } - + if (startDelay != null && _context.isRouterContext()) { int minutes = _util.getStartupDelay(); try { minutes = Integer.parseInt(startDelay.trim()); } catch (NumberFormatException nfe) {} @@ -1115,7 +1133,7 @@ public class SnarkManager implements CompleteListener, ClientApp { if (split > 0) oldOpts.put(pair.substring(0, split), pair.substring(split+1)); } - + boolean reconnect = i2cpHost != null && i2cpHost.trim().length() > 0 && port > 0 && (port != _util.getI2CPPort() || !oldI2CPHost.equals(i2cpHost)); if (reconnect || !oldOpts.equals(opts)) { @@ -1262,6 +1280,15 @@ public class SnarkManager implements CompleteListener, ClientApp { changed = true; } } + if (_util.collapsePanels() != collapsePanels) { + _config.setProperty(PROP_COLLAPSE_PANELS, Boolean.toString(collapsePanels)); + if (collapsePanels) + addMessage(_t("Collapsible panels enabled.")); + else + addMessage(_t("Collapsible panels disabled.")); + _util.setCollapsePanels(collapsePanels); + changed = true; + } if (changed) { saveConfig(); if (interruptMonitor) @@ -1485,7 +1512,7 @@ public class SnarkManager implements CompleteListener, ClientApp { fis.close(); fis = null; } catch (IOException e) {} - + // This test may be a duplicate, but not if we were called // from the DirMonitor, which only checks for dup torrent file names. Snark snark = getTorrentByInfoHash(info.getInfoHash()); diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java index b21a8612de..a9fffb9107 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -268,6 +268,9 @@ public class I2PSnarkServlet extends BasicServlet { return; } + boolean noCollapse = noCollapsePanels(req); + boolean collapsePanels = _manager.util().collapsePanels(); + setHTMLHeaders(resp); PrintWriter out = resp.getWriter(); out.write(DOCTYPE + "\n" + @@ -295,7 +298,7 @@ public class I2PSnarkServlet extends BasicServlet { String jsPfx = _context.isRouterContext() ? "" : ".resources"; String downMsg = _context.isRouterContext() ? _t("Router is down") : _t("I2PSnark has stopped"); // fallback to metarefresh when javascript is disabled - out.write("\n"); + out.write("\n"); out.write("\n" + "\n"); } } - out.write(HEADER_A + _themePath + HEADER_B + "\n"); + out.write(HEADER_A + _themePath + HEADER_B); + + // ...and inject CSS to display panels uncollapsed + if (noCollapse || !collapsePanels) { + out.write(HEADER_A + _themePath + HEADER_C); + } + out.write("\n"); + if (isConfigure || delay <= 0) out.write(""); else @@ -381,9 +391,10 @@ public class I2PSnarkServlet extends BasicServlet { private static void setHTMLHeaders(HttpServletResponse resp) { resp.setCharacterEncoding("UTF-8"); resp.setContentType("text/html; charset=UTF-8"); - resp.setHeader("Cache-Control", "no-store, max-age=0, no-cache, must-revalidate"); + // "no-store, max-age=0" forces all our images to be reloaded on ajax refresh + resp.setHeader("Cache-Control", "max-age=86400, no-cache, must-revalidate"); resp.setHeader("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'"); - resp.setDateHeader("Expires", 0); + resp.setDateHeader("Expires", 86400); resp.setHeader("Pragma", "no-cache"); resp.setHeader("X-Frame-Options", "SAMEORIGIN"); resp.setHeader("X-XSS-Protection", "1; mode=block"); @@ -1190,10 +1201,11 @@ public class I2PSnarkServlet extends BasicServlet { boolean comments = req.getParameter("comments") != null; // commentsName is filtered in SnarkManager.updateConfig() String commentsName = req.getParameter("nofilter_commentsName"); + boolean collapsePanels = req.getParameter("collapsePanels") != null; _manager.updateConfig(dataDir, filesPublic, autoStart, smartSort, refreshDel, startupDel, pageSize, seedPct, eepHost, eepPort, i2cpHost, i2cpPort, i2cpOpts, upLimit, upBW, useOpenTrackers, useDHT, theme, - lang, ratings, comments, commentsName); + lang, ratings, comments, commentsName, collapsePanels); // update servlet try { setResourceBase(_manager.getDataDir()); @@ -2271,9 +2283,12 @@ public class I2PSnarkServlet extends BasicServlet { boolean useDHT = _manager.util().shouldUseDHT(); boolean useRatings = _manager.util().ratingsEnabled(); boolean useComments = _manager.util().commentsEnabled(); + boolean collapsePanels = _manager.util().collapsePanels(); //int seedPct = 0; - out.write("
\n" + + boolean noCollapse = noCollapsePanels(req); + + out.write("\n" + "
\n"); writeHiddenInputs(out, req, "Save"); out.write(""); @@ -2309,10 +2324,23 @@ public class I2PSnarkServlet extends BasicServlet { ""); + out.write("\" >" + + + ""); if (!_context.isRouterContext()) { try { @@ -2744,7 +2772,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("").append(display).append(""); return buf.toString(); } - + /** * This is for a full URL. For a path only, use encodePath(). * @since 0.8.13 @@ -2758,7 +2786,7 @@ public class I2PSnarkServlet extends BasicServlet { private static final String DOCTYPE = "\n"; private static final String HEADER_A = ""; - + private static final String HEADER_C = "nocollapse.css?" + CoreVersion.VERSION + "\" rel=\"stylesheet\" type=\"text/css\" >"; private static final String TABLE_HEADER = "\n" + "\n"; @@ -3851,6 +3879,14 @@ public class I2PSnarkServlet extends BasicServlet { _manager.setSavedCommentsEnabled(snark, yes); } + private static boolean noCollapsePanels(HttpServletRequest req) { + // check for user agents that can't toggle the collapsible panels... + String ua = req.getHeader("user-agent"); + return ua != null && (ua.contains("Konq") || ua.contains("konq") || + ua.contains("Qupzilla") || ua.contains("Dillo") || + ua.contains("Netsurf") || ua.contains("Midori")); + } + /** * Is "a" equal to "b", * or is "a" a directory and a parent of file or directory "b", diff --git a/history.txt b/history.txt index 2affe7baa9..ad78ef72a4 100644 --- a/history.txt +++ b/history.txt @@ -25,6 +25,18 @@ - /configui: Add option to embed Susimail and I2PSnark in console * I2PTunnel: Add hostname / destination (b32) information to server section on index page (for parity with client tunnels section) + * I2PSnark + - Fix broken collapsible panels issue for browsers that don't support the + feature by conditionally loading override CSS to expand panels by default + and disable hover/active states for panel headings (tickets #2002, #2026) + - Add UI option to configuration section to enable collapsible panels, and + disable the option if a non-compliant browser is detected + - Fix multiple instances of snark refreshing to the homepage (ticket #2028) + (patch supplied by mindless) + - Tentative fix for caching of images so ajax refresh doesn't reload all + image resources + - Standardize 'Save Configuration' action to return to top of the page + (so we can see message log entry) * SusiDNS: - Reinstate filter removal on addressbook navigation links (ticket #1996) - Reduce vertical padding for filter buttons section diff --git a/installer/resources/themes/snark/classic/nocollapse.css b/installer/resources/themes/snark/classic/nocollapse.css new file mode 100644 index 0000000000..71b4076b3f --- /dev/null +++ b/installer/resources/themes/snark/classic/nocollapse.css @@ -0,0 +1,51 @@ +/* disable snark's collapsible panels */ +/* fixes a browser engine bug present in Konqueror, Midori, Qupzilla et al */ + +input#toggle_addtorrent:not(checked) + label + hr + table, input#toggle_createtorrent:not(checked) + label + hr + table, +input#toggle_addtorrent:checked + label + hr + table, input#toggle_createtorrent:checked + label + hr + table { + display: table !important; +} + +label.toggleview, label.toggleview:hover, label.toggleview:active, .toggle_input:focus + label.toggleview { + box-shadow: inset 0 0 0 1px #fff; + background: linear-gradient(to bottom, #fff 0%, #ddd 100%) !important; + cursor: default !important; +} + +label.toggleview img, .toggle_input:focus + label.toggleview img, label.toggleview:hover img, label.toggleview img:active, label.toggleview:active img { + margin: 1px !important; + padding: 3px !important; + border-radius: 50%; + box-shadow: inset 0 0 0 2px #eee; + background: #020; + background: linear-gradient(to bottom, #999 50%, #fff 50%); + mix-blend-mode: normal !important; + transform: none !important; + filter: drop-shadow(0 1px 1px #999) !important; +} + +label.toggleview { + margin-bottom: -6px !important; + padding: 3px 0 !important; + min-width: 120px !important; + width: 120px !important; + font-size: 0 !important; +} + +.configsection .snarkConfigTitle a { + padding: 1px 0 !important; + margin: 0 auto !important; + text-align: center !important; + display: block; +} + +.configsection .snarkConfigTitle a img { + margin: -2px -2px 0 0 !important; + padding: 0 !important; +} + +.toggleview img, .configsection .snarkConfigTitle img { + margin: 0 !important; + padding: 0 !important; + text-align: center !important; +} diff --git a/installer/resources/themes/snark/classic/snark.css b/installer/resources/themes/snark/classic/snark.css index c4544fefa1..b4f1f63478 100644 --- a/installer/resources/themes/snark/classic/snark.css +++ b/installer/resources/themes/snark/classic/snark.css @@ -179,7 +179,6 @@ body.iframed { margin: 0; padding: 3px 5px; text-align: left; - color: #003; border-bottom: 1px solid #89f; background: url(images/hat.png) bottom right no-repeat #ddf; background: url(images/hat.png) bottom right no-repeat, linear-gradient(to bottom, #e3e3ff, #ddf); @@ -203,8 +202,7 @@ body.iframed { .snarkMessages li { margin-left: -15px; font: bold 8pt "Droid Sans Mono", "Andale Mono", "DejaVu Sans Mono", "Lucida Console", monospace; - color: #2c354f; - opacity: 0.95; + color: #4b4b76; } .snarkMessages li::before { @@ -2853,7 +2851,7 @@ th a img { overflow: hidden; } -#configs tr:nth-child(n+16) { +#configs tr:nth-child(n+17) { display: none; } diff --git a/installer/resources/themes/snark/dark/nocollapse.css b/installer/resources/themes/snark/dark/nocollapse.css new file mode 100644 index 0000000000..8ed63aa644 --- /dev/null +++ b/installer/resources/themes/snark/dark/nocollapse.css @@ -0,0 +1,51 @@ +/* disable snark's collapsible panels */ +/* fixes a browser engine bug present in Konqueror, Midori, Qupzilla et al */ + +input#toggle_addtorrent:not(checked) + label + hr + table, input#toggle_createtorrent:not(checked) + label + hr + table, +input#toggle_addtorrent:checked + label + hr + table, input#toggle_createtorrent:checked + label + hr + table { + display: table !important; +} + +label.toggleview, label.toggleview:hover, label.toggleview:active, .toggle_input:focus + label.toggleview { + background: #000 url(/themes/console/dark/images/header.png) repeat-x scroll center center !important; + background: linear-gradient(to bottom, #1a261a 0%, #223022 7%, #212f21 9%, #172317 21%, #091109 49%, #050d05 50%, #020602 51%, #010301 53%, #000 56%) !important; + box-shadow: inset 0 0 0 1px #000, 0 1px 1px #000 !important; + mix-blend-mode: normal !important; + cursor: default !important; +} + +label.toggleview img, .toggle_input:focus + label.toggleview img, label.toggleview:hover img, label.toggleview img:active, label.toggleview:active img { + margin: 1px !important; + padding: 3px !important; + border-radius: 50%; + background: #020; + background: linear-gradient(to bottom, #000 50%, #020 50%); + transform: none !important; + filter: sepia(1) hue-rotate(70deg) !important; +} + +.toggleview { + margin-bottom: -6px !important; + padding: 3px 0 !important; + min-width: 120px !important; + width: 120px !important; + font-size: 0 !important; +} + +.configsection .snarkConfigTitle a { + padding: 2px 0 !important; + margin: 0 auto !important; + text-align: center !important; + display: block; +} + +.configsection .snarkConfigTitle a img { + margin: -4px -2px 0 0 !important; + padding: 0 !important; +} + +.toggleview img, .configsection .snarkConfigTitle img { + margin: 0 !important; + padding: 0 !important; + text-align: center !important; +} diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index d242cbc146..3d5c60b9b2 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -2920,7 +2920,7 @@ th a img { font-size: 0 !important; } -#configs tr:nth-child(n+16) { +#configs tr:nth-child(n+17) { display: none; } diff --git a/installer/resources/themes/snark/light/nocollapse.css b/installer/resources/themes/snark/light/nocollapse.css new file mode 100644 index 0000000000..3d23a0d7d4 --- /dev/null +++ b/installer/resources/themes/snark/light/nocollapse.css @@ -0,0 +1,56 @@ +/* disable snark's collapsible panels */ +/* fixes a browser engine bug present in Konqueror, Midori, Qupzilla et al */ + +input#toggle_addtorrent:not(checked) + label + hr + table, input#toggle_createtorrent:not(checked) + label + hr + table, +input#toggle_addtorrent:checked + label + hr + table, input#toggle_createtorrent:checked + label + hr + table { + display: table !important; +} + +.toggleview, .snarkConfigTitle { + border-radius: 0 0 3px 3px !important; +} + +label.toggleview, label.toggleview:hover, label.toggleview:active, .toggle_input:focus + label.toggleview { + box-shadow: inset 0 0 0 1px #fff; + background: linear-gradient(to bottom, #fff 0%, #ddd 100%) !important; + background: linear-gradient(to bottom, #fff, #eef) !important; + cursor: default !important; +} + +label.toggleview img, .toggle_input:focus + label.toggleview img, label.toggleview:hover img, label.toggleview img:active, label.toggleview:active img { + margin: 0 !important; + padding: 3px !important; + border-radius: 50%; + box-shadow: inset 0 0 0 2px #eee; + background: #020; + background: linear-gradient(to bottom, #99f 50%, #fff 50%); + mix-blend-mode: normal !important; + transform: none !important; + filter: drop-shadow(0 1px 1px #77f) !important; +} + +label.toggleview { + margin-bottom: -6px !important; + padding: 3px 0 !important; + min-width: 120px !important; + width: 120px !important; + font-size: 0 !important; +} + +.configsection .snarkConfigTitle a { + padding: 1px 0 !important; + margin: 0 auto !important; + text-align: center !important; + display: block; +} + +.configsection .snarkConfigTitle a img { + margin: -2px -2px 0 0 !important; + padding: 0 !important; +} + +.toggleview img, .configsection .snarkConfigTitle img { + margin: 0 !important; + padding: 0 !important; + text-align: center !important; +} diff --git a/installer/resources/themes/snark/midnight/nocollapse.css b/installer/resources/themes/snark/midnight/nocollapse.css new file mode 100644 index 0000000000..e8727bf1c5 --- /dev/null +++ b/installer/resources/themes/snark/midnight/nocollapse.css @@ -0,0 +1,53 @@ +/* disable snark's collapsible panels */ +/* fixes a browser engine bug present in Konqueror, Midori, Qupzilla et al */ + +input#toggle_addtorrent:not(checked) + label + hr + table, input#toggle_createtorrent:not(checked) + label + hr + table, +input#toggle_addtorrent:checked + label + hr + table, input#toggle_createtorrent:checked + label + hr + table { + display: table !important; +} + +label.toggleview, label.toggleview:hover, label.toggleview:active, .toggle_input:focus + label.toggleview { + border: 1px solid #443da0 !important; + background: #003 !important; + background: linear-gradient(to bottom, #191729, #1f1e32 50%, #000 50%) !important; + box-shadow: inset 0 0 0 1px #000 !important; + text-shadow: 0 0 1px #000 !important; + cursor: default !important; +} + +label.toggleview img, .toggle_input:focus + label.toggleview img, label.toggleview:hover img, label.toggleview img:active, label.toggleview:active img { + margin: 1px !important; + padding: 3px !important; + border-radius: 50%; + background: #020; + background: linear-gradient(to bottom, #443da0 50%, #191729 50%); + mix-blend-mode: normal !important; + transform: none !important; + filter: drop-shadow(0 1px 1px #000) !important; +} + +label.toggleview { + margin-bottom: -6px !important; + padding: 3px 0 !important; + min-width: 120px !important; + width: 120px !important; + font-size: 0 !important; +} + +.configsection .snarkConfigTitle a { + padding: 1px 0 !important; + margin: 0 auto !important; + text-align: center !important; + display: block; +} + +.configsection .snarkConfigTitle a img { + margin: -2px -2px 0 0 !important; + padding: 0 !important; +} + +.toggleview img, .configsection .snarkConfigTitle img { + margin: 0 !important; + padding: 0 !important; + text-align: center !important; +} diff --git a/installer/resources/themes/snark/ubergine/nocollapse.css b/installer/resources/themes/snark/ubergine/nocollapse.css new file mode 100644 index 0000000000..f94fa02347 --- /dev/null +++ b/installer/resources/themes/snark/ubergine/nocollapse.css @@ -0,0 +1,72 @@ +/* disable snark's collapsible panels and make section headings inert */ + +input#toggle_addtorrent:not(checked) + label + hr + table, input#toggle_createtorrent:not(checked) + label + hr + table, +input#toggle_addtorrent:checked + label + hr + table, input#toggle_createtorrent:checked + label + hr + table { + display: table !important; +} + +label.toggleview:hover, label.toggleview:active, .toggle_input:focus + .toggleview { + border: 1px solid #101 !important; + border-top: none !important; + text-shadow: 0 0 1px #000 !important; + box-shadow: inset 0 0 1px 0 #313, 0 0 0 1px rgba(16, 0, 16, 0.4) !important; + cursor: default !important; +} + +label.toggleview, label.toggleview:hover, label.toggleview:active, .toggle_input:focus + .toggleview { + background: #101 url(images/snarknav.png) repeat-x scroll center center !important; + background: linear-gradient(to bottom, #5f475d 0%, #4f3b4f 50%, #1f001f 50%, #1f001f 100%) !important; + color: #d2baff !important; +} + +.toggle_input:focus + .toggleview img, .toggleview:hover img { + filter: drop-shadow(0 0 1px #000) !important; +} + +label.toggleview img:active, label.toggleview:active img { + transform: none !important; +} + +/* alternative iconified section tabs for iframed view */ + +.iframed label.toggleview, .iframed label.toggleview:hover, .iframed label.toggleview:focus, .iframed .toggle_input:focus + .toggleview, +.iframed .configsection .snarkConfigTitle { + min-width: 0; + width: 200px !important; + padding: 1px 5px !important; + font-size: 0; + border: 1px solid #878 !important; + border-bottom: 1px solid #767 !important; + border-top: none !important; + border-radius: 0 0 3px 3px; + background: linear-gradient(to bottom, #434, #656 48%, #434 52%, #212 54%, #101) !important; + filter: drop-shadow(0 1px 2px #101) !important; +} + +.iframed .configsection .snarkConfigTitle { + background: linear-gradient(to bottom, #4a3d49 0%, #3d303d 50%, #0d000d 50%, #0d000d 100%) !important; +} + +.iframed .configsection .snarkConfigTitle:hover { + background: linear-gradient(to bottom, #434, #656 48%, #434 52%, #212 54%, #101) !important; +} + +.iframed .configsection .snarkConfigTitle img, .iframed .newtorrentsection .toggleview img, .iframed label.toggleview img, +.iframed label.toggleview:hover img, .iframed .toggle_input:focus + .toggleview img, .iframed .addtorrentsection .toggleview img { + background: #323; + background: linear-gradient(to bottom, #878 50%, #434 50%); + border-radius: 50%; + padding: 3px !important; + margin: 0 !important; + border: 2px solid #101 !important; + box-shadow: none !important; + filter: none !important; + mix-blend-mode: normal !important; +} + +.iframed .configsection .snarkConfigTitle:hover img, .iframed .configsection .snarkConfigTitle:focus img { + filter: drop-shadow(0 0 3px #730) !important; + box-shadow: none !important; + mix-blend-mode: normal !important; +} + diff --git a/installer/resources/themes/snark/ubergine/snark.css b/installer/resources/themes/snark/ubergine/snark.css index 94eb901885..bbb3e15638 100644 --- a/installer/resources/themes/snark/ubergine/snark.css +++ b/installer/resources/themes/snark/ubergine/snark.css @@ -169,7 +169,6 @@ _:-ms-lang(x), .snarkNav:link, .snarkNav:visited { } .snarkNav:last-child[href="/i2psnark/"] { - border-radius: 2px; margin: -5px 0 !important; display: inline-block; } @@ -186,7 +185,7 @@ _:-ms-lang(x), .snarkNav:last-child[href="/i2psnark/"] { color: #d2baff !important; } -.nav_main:link:active { +.nav_main:link:active, .snarkNav:last-child[href="/i2psnark/"]:active { background: #f60 url(images/button_snark_active.png) 11px center no-repeat; background-size: 18px auto, 100% 100%; color: #fff !important; @@ -3163,7 +3162,7 @@ th a img { font-size: 0 !important; } -#configs tr:nth-child(n+16) { +#configs tr:nth-child(n+17) { display: none; } diff --git a/installer/resources/themes/snark/vanilla/nocollapse.css b/installer/resources/themes/snark/vanilla/nocollapse.css new file mode 100644 index 0000000000..381c93b1a4 --- /dev/null +++ b/installer/resources/themes/snark/vanilla/nocollapse.css @@ -0,0 +1,27 @@ +/* disable snark's collapsible panels */ +/* fixes a browser engine bug present in Konqueror, Midori, Qupzilla et al */ + +input#toggle_addtorrent:not(checked) + label + hr + table, input#toggle_createtorrent:not(checked) + label + hr + table, +input#toggle_addtorrent:checked + label + hr + table, input#toggle_createtorrent:checked + label + hr + table { + display: table !important; +} + +label.toggleview, label.toggleview:hover, label.toggleview:active, .toggle_input:focus + .toggleview { + background: linear-gradient(to bottom, #ffeadf 0%, #ffeadf 51%, #cfb6a8 52%, #cfb6a8 100%) !important; + color: #930 !important; + cursor: default !important; + box-shadow: 0 0 2px #4d453e, inset 0 0 0 1px #efe6e0 !important; + font-size: 0 !important; + min-width: 120px !important; + width: 120px !important; +} + +label.toggleview img, .toggle_input:focus + label.toggleview img, label.toggleview:hover img, label.toggleview img:active, label.toggleview:active img { + mix-blend-mode: luminosity !important; +} + +label.toggleview img:active, label.toggleview:active img { + transform: none !important; + mix-blend-mode: luminosity !important; +} + diff --git a/installer/resources/themes/snark/vanilla/snark.css b/installer/resources/themes/snark/vanilla/snark.css index 2790b4ef8e..d91d0e1840 100644 --- a/installer/resources/themes/snark/vanilla/snark.css +++ b/installer/resources/themes/snark/vanilla/snark.css @@ -1192,7 +1192,7 @@ thead img.disable, img.disable:hover { margin: 4px !important; } -#configs, input[type="submit"], .trackerconfig input[type="submit"], input[name="savepri"] { +input[type="submit"], .trackerconfig input[type="submit"], input[name="savepri"], select[name="theme"] { text-transform: capitalize; } @@ -2216,6 +2216,12 @@ input#toggle_debug:checked + label + #dhtDebugInner { border-bottom: 1px solid #4f3d36 !important; } +#configs input:disabled, #configs input:disabled:hover, #configs input:disabled:focus { + cursor: not-allowed; + filter: sepia(50%) invert(80%) hue-rotate(150deg) !important; + box-shadow: none; +} + td#bwHelp { background: url(images/infocircle.png) left 10px center no-repeat; background-size: 14px auto; @@ -3086,7 +3092,7 @@ th.snarkTorrentStatus a img, .snarkTorrentETA a img, .snarkTrackerDetails a img font-size: 0 !important; } -#configs tr:nth-child(n+16) { +#configs tr:nth-child(n+17) { display: none; }