From c5f98a04fa3ac32909eb9efb4a6037b5beb3a58f Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sun, 4 Dec 2011 18:52:17 +0000
Subject: [PATCH]   * Console:     - Less icons on configclients.jsp     - Fix
 some browsers breaking line on negative numbers     - Tab CSS tweaks

---
 .../net/i2p/router/web/ConfigClientsHelper.java  | 14 ++++++++------
 core/java/src/net/i2p/data/DataHelper.java       | 15 +++++++++++----
 .../resources/themes/console/light/console.css   | 16 ++++++++++------
 3 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java
index bbd38806db..0f2c768593 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java
@@ -256,19 +256,21 @@ public class ConfigClientsHelper extends HelperBase {
                 buf.append("disabled=\"true\" ");
         }
         buf.append("></td><td align=\"center\" width=\"15%\">");
+        // The icons were way too much, so there's an X in each button class,
+        // remove if you wnat to put them back
         if (showStartButton && (!ro) && !edit) {
-            buf.append("<button type=\"submit\" class=\"accept\" name=\"action\" value=\"Start ").append(index).append("\" >" + _("Start") + "<span class=hide> ").append(index).append("</span></button>");
+            buf.append("<button type=\"submit\" class=\"Xaccept\" name=\"action\" value=\"Start ").append(index).append("\" >" + _("Start") + "<span class=hide> ").append(index).append("</span></button>");
         }
         if (showEditButton && (!edit) && !ro)
-            buf.append("<button type=\"submit\" class=\"add\" name=\"edit\" value=\"Edit ").append(index).append("\" >" + _("Edit") + "<span class=hide> ").append(index).append("</span></button>");
+            buf.append("<button type=\"submit\" class=\"Xadd\" name=\"edit\" value=\"Edit ").append(index).append("\" >" + _("Edit") + "<span class=hide> ").append(index).append("</span></button>");
         if (showStopButton && (!edit))
-            buf.append("<button type=\"submit\" class=\"stop\" name=\"action\" value=\"Stop ").append(index).append("\" >" + _("Stop") + "<span class=hide> ").append(index).append("</span></button>");
+            buf.append("<button type=\"submit\" class=\"Xstop\" name=\"action\" value=\"Stop ").append(index).append("\" >" + _("Stop") + "<span class=hide> ").append(index).append("</span></button>");
         if (showUpdateButton && (!edit) && !ro) {
-            buf.append("<button type=\"submit\" class=\"check\" name=\"action\" value=\"Check ").append(index).append("\" >" + _("Check for updates") + "<span class=hide> ").append(index).append("</span></button>");
-            buf.append("<button type=\"submit\" class=\"download\" name=\"action\" value=\"Update ").append(index).append("\" >" + _("Update") + "<span class=hide> ").append(index).append("</span></button>");
+            buf.append("<button type=\"submit\" class=\"Xcheck\" name=\"action\" value=\"Check ").append(index).append("\" >" + _("Check for updates") + "<span class=hide> ").append(index).append("</span></button>");
+            buf.append("<button type=\"submit\" class=\"Xdownload\" name=\"action\" value=\"Update ").append(index).append("\" >" + _("Update") + "<span class=hide> ").append(index).append("</span></button>");
         }
         if (showDeleteButton && (!edit) && !ro) {
-            buf.append("<button type=\"submit\" class=\"delete\" name=\"action\" value=\"Delete ").append(index)
+            buf.append("<button type=\"submit\" class=\"Xdelete\" name=\"action\" value=\"Delete ").append(index)
                .append("\" onclick=\"if (!confirm('")
                .append(_("Are you sure you want to delete {0}?", _(name)))
                .append("')) { return false; }\">")
diff --git a/core/java/src/net/i2p/data/DataHelper.java b/core/java/src/net/i2p/data/DataHelper.java
index 0202fcf608..8b0a1155d1 100644
--- a/core/java/src/net/i2p/data/DataHelper.java
+++ b/core/java/src/net/i2p/data/DataHelper.java
@@ -1239,6 +1239,9 @@ public class DataHelper {
      * Use only in HTML.
      * Thresholds are a little lower than in formatDuration() also,
      * as precision is less important in the GUI than in logging.
+     *
+     * Negative numbers handled correctly.
+     *
      * @since 0.8.2
      */
     public static String formatDuration2(long ms) {
@@ -1258,26 +1261,30 @@ public class DataHelper {
             t = ngettext("1 ms", "{0,number,####} ms", (int) ms);
         } else if (ams < 2 * 60 * 1000) {
             // seconds
-            // Note to translators: quantity will always be greater than one.
             // alternates: secs, sec. 'seconds' is probably too long.
             t = ngettext("1 sec", "{0} sec", (int) (ms / 1000));
         } else if (ams < 120 * 60 * 1000) {
             // minutes
-            // Note to translators: quantity will always be greater than one.
             // alternates: mins, min. 'minutes' is probably too long.
             t = ngettext("1 min", "{0} min", (int) (ms / (60 * 1000)));
         } else if (ams < 2 * 24 * 60 * 60 * 1000) {
             // hours
-            // Note to translators: quantity will always be greater than one.
             // alternates: hrs, hr., hrs.
             t = ngettext("1 hour", "{0} hours", (int) (ms / (60 * 60 * 1000)));
         } else if (ams > 1000l * 24l * 60l * 60l * 1000l) {
             return _("n/a");
         } else {
             // days
-            // Note to translators: quantity will always be greater than one.
             t = ngettext("1 day", "{0} days", (int) (ms / (24 * 60 * 60 * 1000)));
         }
+        // Replace minus sign to work around
+        // bug in Chrome (and IE?), line breaks at the minus sign
+        // http://code.google.com/p/chromium/issues/detail?id=46683
+        // &minus; seems to work on text browsers OK
+        // Although it's longer than a standard '-' on graphical browsers
+        // http://www.cs.tut.fi/~jkorpela/dashes.html
+        if (ms < 0)
+            t = t.replace("-", "&minus;");
         // do it here to keep &nbsp; out of the tags for translator sanity
         return t.replace(" ", "&nbsp;");
     }
diff --git a/installer/resources/themes/console/light/console.css b/installer/resources/themes/console/light/console.css
index feba9b4bdf..2716ef8524 100644
--- a/installer/resources/themes/console/light/console.css
+++ b/installer/resources/themes/console/light/console.css
@@ -433,7 +433,7 @@ div.news h4 {
 
 div.confignav {
      padding: 16px 10px !important;
-     margin: 10px 0 0 0;
+     margin: 10px 0 0 -10px;
      font-size: 9.5pt !important;
      font-weight: bold !important;
      line-height: 160% !important;
@@ -443,13 +443,14 @@ div.confignav {
 
 span.tab {
      padding: 2px 18px 4px 6px;
-     margin: -5px -3px 0 0;
+     margin: -5px -7px 0 0;
      background: #d8d8ff;
      -moz-border-radius: 6px 32px 2px 0;
      -khtml-border-radius: 6px 32px 2px 0;
      border-radius: 6px 32px 2px 0;
-     border: 1px solid #111;
-     border-left: 2px solid #115;
+     border: 1px outset #00f;
+     border-width: 2px 1px 1px 2px;
+     border-bottom-style: dashed;
      min-width: 40px;
      display: inline-block;
      word-wrap: break-word;
@@ -457,13 +458,16 @@ span.tab {
 }
 
 span.tab2 {
-     padding: 6px 18px 6px 6px;
+     color: #008;
+     padding: 7px 18px 6px 6px;
      margin: -11px -3px 0 0;
      background: #e8e8ff;
      -moz-border-radius: 6px 32px 2px 0;
      -khtml-border-radius: 6px 32px 2px 0;
      border-radius: 6px 32px 2px 0;
-     border: 2px solid #111;
+     border: outset #00f;
+     border-width: 3px 1px 0 4px;
+     border-bottom-style: none;
      min-width: 40px;
      display: inline-block;
      word-wrap: break-word;
-- 
GitLab