From ef06fc758cce6aee0cdfd44d912da72c0fd40e8e Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 31 May 2012 09:30:30 +0000 Subject: [PATCH 001/104] Show news headings in the /home sidebar when the main news div is hidden Note: this now refreshes along with the rest of the sidebar, so the news.xml file is read once every 15s - it may be better to cache the headings somewhere, though it's debatable whether reading the cache file is better than reading the news.xml file... --- .../src/net/i2p/router/web/NewsHelper.java | 41 ++++++++++++++++++- apps/routerconsole/jsp/home.jsp | 16 +++----- apps/routerconsole/jsp/xhr1.jsi | 7 ++++ apps/routerconsole/jsp/xhr1.jsp | 7 ++++ .../resources/themes/console/dark/console.css | 9 ++++ 5 files changed, 68 insertions(+), 12 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java index 709c4505f..3e4bfc19f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java @@ -16,7 +16,46 @@ public class NewsHelper extends ContentHelper { if (!news.exists()) _page = (new File(_context.getBaseDir(), "docs/initialNews/initialNews.xml")).getAbsolutePath(); return super.getContent(); - } + } + + /** @since 0.9.1 */ + public String getNewsHeadings() { + StringBuilder buf = new StringBuilder(512); + String consoleNonce = System.getProperty("router.consoleNonce"); + if (consoleNonce != null) { + // Set up string containing to show news. + String newsUrl = ""; + // Set up title and pre-headings stuff. + buf.append("

").append(_("News & Updates")) + .append("


\n"); + // Get news content. + String newsContent = getContent(); + if (newsContent != "") { + buf.append("\n"); + buf.append(newsUrl).append(Messages.getString("Show news", _context)).append("\n"); + } else { + buf.append("
").append(_("none")).append("
"); + } + // Add post-headings stuff. + buf.append("
\n"); + } + return buf.toString(); + } /** @since 0.8.12 */ public boolean shouldShowNews() { diff --git a/apps/routerconsole/jsp/home.jsp b/apps/routerconsole/jsp/home.jsp index 21b4f6d3c..f4088cc03 100644 --- a/apps/routerconsole/jsp/home.jsp +++ b/apps/routerconsole/jsp/home.jsp @@ -20,6 +20,11 @@ %> " /> +<% + java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + + " /> @@ -33,14 +38,6 @@ <%@include file="xhr1.jsi" %> -<% - if (!newshelper.shouldShowNews()) { -%> -

<%=intl._("News")%>


- -<% - } // !shouldShowNews() -%> @@ -48,11 +45,8 @@ <% if (newshelper.shouldShowNews()) { - java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); %>
- -

diff --git a/apps/routerconsole/jsp/xhr1.jsi b/apps/routerconsole/jsp/xhr1.jsi index a171d0c85..c75ec3eac 100644 --- a/apps/routerconsole/jsp/xhr1.jsi +++ b/apps/routerconsole/jsp/xhr1.jsi @@ -17,6 +17,13 @@

"><%=intl._("Network")%>:


+<% + if (!newshelper.shouldShowNews()) { +%> +
+<% + } // !shouldShowNews() +%>
diff --git a/apps/routerconsole/jsp/xhr1.jsp b/apps/routerconsole/jsp/xhr1.jsp index 95c27683b..b48e82442 100644 --- a/apps/routerconsole/jsp/xhr1.jsp +++ b/apps/routerconsole/jsp/xhr1.jsp @@ -11,4 +11,11 @@ %> " /> + +" /> +<% + java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + + <%@include file="xhr1.jsi" %> diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index acc5d6b9b..2c32a68f3 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -170,6 +170,10 @@ div.routersummary h4 { line-height: 100%; } +div.routersummary ul { + text-align: left !important; +} + div.routersummary table { border: 0; text-align: center !important; @@ -227,6 +231,11 @@ div routersummary hr:last-child { margin-bottom: -5px !important; } +div.newsheadings { + text-align: right; + margin: 0 0 0 10px; +} + div.tunnels { padding-top: 3px !important; margin-left: -4px; From b23414eab1c17e9150541ad1a2b7f86d9482e52d Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 1 Jun 2012 01:21:57 +0000 Subject: [PATCH 002/104] Reordered /home summarybar, added
after update download button --- .../java/src/net/i2p/router/web/SummaryHelper.java | 2 +- apps/routerconsole/jsp/xhr1.jsi | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 4e7d2f23f..80456d604 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -651,7 +651,7 @@ public class SummaryHelper extends HelperBase { .append(_("Download Unsigned
Update {0}", getUnsignedUpdateVersion())) .append("
\n"); } - buf.append("\n"); + buf.append("
\n"); } } return buf.toString(); diff --git a/apps/routerconsole/jsp/xhr1.jsi b/apps/routerconsole/jsp/xhr1.jsi index c75ec3eac..4a646c759 100644 --- a/apps/routerconsole/jsp/xhr1.jsi +++ b/apps/routerconsole/jsp/xhr1.jsi @@ -14,9 +14,6 @@ reqURI = reqURI.replace("/xhr1.jsp", "/home"); helper.setRequestURI(reqURI); %> -

"><%=intl._("Network")%>: -

-
<% if (!newshelper.shouldShowNews()) { %> @@ -25,7 +22,10 @@ } // !shouldShowNews() %> - +

"><%=intl._("Network")%>: +


+
+ From 69d909d3eb2bf35f6e7fa314ce53f0de71840518 Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 3 Jun 2012 00:22:03 +0000 Subject: [PATCH 003/104] Added
s to separate the various logs on /logs --- apps/routerconsole/jsp/logs.jsp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/routerconsole/jsp/logs.jsp b/apps/routerconsole/jsp/logs.jsp index 373e386eb..0f470e7c9 100644 --- a/apps/routerconsole/jsp/logs.jsp +++ b/apps/routerconsole/jsp/logs.jsp @@ -33,8 +33,10 @@

<%=intl._("Note that system information, log timestamps, and log messages may provide clues to your location; please review everything you include in a bug report.")%>

<%=intl._("Critical Logs")%>

+

<%=intl._("Router Logs")%> (<%=intl._("configure")%>)

+

<%=intl._("Service (Wrapper) Logs")%>


From 910001e3a141dc9f9a33802f51b87c39a69b1e31 Mon Sep 17 00:00:00 2001 From: str4d Date: Mon, 4 Jun 2012 13:10:12 +0000 Subject: [PATCH 004/104] Split HTML rendering of summary bar into separate methods This solidifies the summary bar design pattern of modular sections separated by
s which in future could be reordered or hidden without affecting the theme. --- .../i2p/router/web/SummaryBarRenderer.java | 346 +++++++++++------- 1 file changed, 204 insertions(+), 142 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index a61e543cc..435388dca 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -39,13 +39,10 @@ public class SummaryBarRenderer { .append(_("I2P Router Console")) .append("\" title=\"") .append(_("I2P Router Console")) - .append("\">
") - - .append("

") - .append(_("Help & FAQ")) - .append("


"); + .append("\">\n") + .append("
\n") + .append(renderHelpAndFAQHTML()) + .append("
\n"); File lpath = new File(_context.getBaseDir(), "docs/toolbar.html"); // you better have target="_top" for the links in there... @@ -55,118 +52,172 @@ public class SummaryBarRenderer { linkhelper.setMaxLines("100"); buf.append(linkhelper.getContent()); } else { - buf.append("

") - .append(_("I2P Services")) - .append("

\n" + - - "
" + - - "") - .append(_("Email")) - .append("\n" + - - "") - .append(_("Torrents")) - .append("\n" + - - "") - .append(_("Website")) - .append("\n") - - .append(NavHelper.getClientAppLinks(_context)) - - .append("
\n" + - - "

") - .append(_("I2P Internals")) - .append("


\n" + - - "
\n" + - - "") - .append(_("Tunnels")) - .append("\n" + - - "") - .append(_("Peers")) - .append("\n" + - - "") - .append(_("Profiles")) - .append("\n" + - - "") - .append(_("NetDB")) - .append("\n" + - - "") - .append(_("Logs")) - .append("\n"); - - // "") - // .append(_("Jobs")) - // .append("\n" + - - if (!StatSummarizer.isDisabled()) { - buf.append("") - .append(_("Graphs")) - .append("\n"); - } - - buf.append("") - .append(_("Stats")) - .append("\n" + - - "") - .append(_("I2PTunnel")) - .append("\n" + - - "") - .append(_("Addressbook")) - .append("\n"); - - File javadoc = new File(_context.getBaseDir(), "docs/javadoc/index.html"); - if (javadoc.exists()) - buf.append("Javadoc\n"); - buf.append("
\n"); + buf.append(renderI2PServicesHTML()) + .append("
\n") + .append(renderI2PInternalsHTML()); out.write(buf.toString()); buf.setLength(0); } + buf.append("
\n") + .append(renderGeneralHTML()) + .append("
\n") + .append(renderNetworkReachabilityHTML()) + .append("
\n") + .append(_helper.getUpdateStatus()) + .append(_helper.getRestartStatus()) + .append("
\n") + .append(renderPeersHTML()) + .append("
\n"); + + out.write(buf.toString()); + buf.setLength(0); + + buf.append(_helper.getFirewallAndReseedStatus()); + + buf.append(renderBandwidthHTML()) + .append("
\n") + .append(renderTunnelsHTML()) + .append("
\n") + .append(renderCongestionHTML()) + .append("
\n") + .append(renderTunnelStatusHTML()) + .append("
\n") + .append(_helper.getDestinations()) + .append("
\n"); - buf.append("

") + .append(_("Help & FAQ")) + .append("

"); + return buf.toString(); + } + + public String renderI2PServicesHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append("

") + .append(_("I2P Services")) + .append("

\n" + + + "
" + + + "") + .append(_("Email")) + .append("\n" + + + "") + .append(_("Torrents")) + .append("\n" + + + "") + .append(_("Website")) + .append("\n") + + .append(NavHelper.getClientAppLinks(_context)) + + .append("
\n"); + return buf.toString(); + } + + public String renderI2PInternalsHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append("

") + .append(_("I2P Internals")) + .append("


\n" + + + "
\n" + + + "") + .append(_("Tunnels")) + .append("\n" + + + "") + .append(_("Peers")) + .append("\n" + + + "") + .append(_("Profiles")) + .append("\n" + + + "") + .append(_("NetDB")) + .append("\n" + + + "") + .append(_("Logs")) + .append("\n"); + + // "") + // .append(_("Jobs")) + // .append("\n" + + + if (!StatSummarizer.isDisabled()) { + buf.append("") + .append(_("Graphs")) + .append("\n"); + } + + buf.append("") + .append(_("Stats")) + .append("\n" + + + "") + .append(_("I2PTunnel")) + .append("\n" + + + "") + .append(_("Addressbook")) + .append("\n"); + + File javadoc = new File(_context.getBaseDir(), "docs/javadoc/index.html"); + if (javadoc.exists()) + buf.append("Javadoc\n"); + buf.append("
\n"); + return buf.toString(); + } + + public String renderGeneralHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append("

") .append(_("General")) @@ -202,24 +253,25 @@ public class SummaryBarRenderer { .append(":" + "") .append(_helper.getUptime()) - .append("\n" + + .append("\n"); + return buf.toString(); + } - "

") .append(_("Network")) .append(": ") .append(_helper.getReachability()) - .append("


\n") + .append("

\n"); + return buf.toString(); + } - - .append(_helper.getUpdateStatus()) - - - .append(_helper.getRestartStatus()) - - - .append("

") .append(_("Peers")) @@ -260,14 +312,12 @@ public class SummaryBarRenderer { .append(_helper.getAllPeers()) .append("\n" + - "
\n"); - - - out.write(buf.toString()); - buf.setLength(0); - - buf.append(_helper.getFirewallAndReseedStatus()); + "\n"); + return buf.toString(); + } + public String renderBandwidthHTML() { + StringBuilder buf = new StringBuilder(512); buf.append("

") @@ -303,9 +353,15 @@ public class SummaryBarRenderer { .append(_helper.getInboundTransferred()) .append(SummaryHelper.THINSP) .append(_helper.getOutboundTransferred()) - .append("\n" + + .append("\n" + - "

\n"); + return buf.toString(); + } + + public String renderTunnelsHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append("

") .append(_("Tunnels")) @@ -336,7 +392,13 @@ public class SummaryBarRenderer { .append(_helper.getShareRatio()) .append("\n" + - "

\n"); + return buf.toString(); + } + + public String renderCongestionHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append("

") .append(_("Congestion")) @@ -369,16 +431,16 @@ public class SummaryBarRenderer { .append(_helper.getInboundBacklog()) .append("\n" + - "

") + "\n"); + return buf.toString(); + } + + public String renderTunnelStatusHTML() { + StringBuilder buf = new StringBuilder(50); + buf.append("

") .append(_(_helper.getTunnelStatus())) - .append("


\n") - - .append(_helper.getDestinations()) - .append("
\n"); - - - - out.write(buf.toString()); + .append("

\n"); + return buf.toString(); } /** translate a string */ From 9333cd56f96e61d3fc870e62fa8ec920e872300f Mon Sep 17 00:00:00 2001 From: str4d Date: Mon, 4 Jun 2012 13:28:52 +0000 Subject: [PATCH 005/104] Moved calls to external renderers into separate methods to match the rest --- .../i2p/router/web/SummaryBarRenderer.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index 435388dca..86ad13141 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -65,8 +65,8 @@ public class SummaryBarRenderer { .append("
\n") .append(renderNetworkReachabilityHTML()) .append("
\n") - .append(_helper.getUpdateStatus()) - .append(_helper.getRestartStatus()) + .append(renderUpdateStatusHTML()) + .append(renderRestartStatusHTML()) .append("
\n") .append(renderPeersHTML()) .append("
\n"); @@ -74,9 +74,8 @@ public class SummaryBarRenderer { out.write(buf.toString()); buf.setLength(0); - buf.append(_helper.getFirewallAndReseedStatus()); - - buf.append(renderBandwidthHTML()) + buf.append(renderFirewallAndReseedStatusHTML()) + .append(renderBandwidthHTML()) .append("
\n") .append(renderTunnelsHTML()) .append("
\n") @@ -87,8 +86,6 @@ public class SummaryBarRenderer { .append(_helper.getDestinations()) .append("
\n"); - - out.write(buf.toString()); } @@ -269,6 +266,18 @@ public class SummaryBarRenderer { return buf.toString(); } + public String renderUpdateStatusHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append(_helper.getUpdateStatus()); + return buf.toString(); + } + + public String renderRestartStatusHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append(_helper.getRestartStatus()); + return buf.toString(); + } + public String renderPeersHTML() { StringBuilder buf = new StringBuilder(512); buf.append("

Date: Mon, 4 Jun 2012 23:46:03 +0000 Subject: [PATCH 006/104] Moved rendering of news headings into SummaryBarRenderer An instance of NewsHelper needs to be passed in to get output. --- .../src/net/i2p/router/web/NewsHelper.java | 37 +-------- .../i2p/router/web/SummaryBarRenderer.java | 77 ++++++++++++++++++- 2 files changed, 78 insertions(+), 36 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java index 3e4bfc19f..833e197a0 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java @@ -20,41 +20,8 @@ public class NewsHelper extends ContentHelper { /** @since 0.9.1 */ public String getNewsHeadings() { - StringBuilder buf = new StringBuilder(512); - String consoleNonce = System.getProperty("router.consoleNonce"); - if (consoleNonce != null) { - // Set up string containing to show news. - String newsUrl = ""; - // Set up title and pre-headings stuff. - buf.append("

").append(_("News & Updates")) - .append("


\n"); - // Get news content. - String newsContent = getContent(); - if (newsContent != "") { - buf.append("
    \n"); - // Parse news content for headings. - int start = newsContent.indexOf("

    "); - while (start >= 0) { - // Add offset to start: - // 4 - gets rid of

    - // 16 - gets rid of the date as well (assuming form "

    yyyy-mm-dd: Foobarbaz...") - newsContent = newsContent.substring(start+16, newsContent.length()); - int end = newsContent.indexOf("

    "); - if (end >= 0) { - String heading = newsContent.substring(0, end); - buf.append("
  • ").append(heading).append("
  • \n"); - } - start = newsContent.indexOf("

    "); - } - buf.append("

\n"); - buf.append(newsUrl).append(Messages.getString("Show news", _context)).append("\n"); - } else { - buf.append("
").append(_("none")).append("
"); - } - // Add post-headings stuff. - buf.append("
\n"); - } - return buf.toString(); + SummaryBarRenderer renderer = new SummaryBarRenderer(_context, this); + return renderer.renderNewsHeadingsHTML(); } /** @since 0.8.12 */ diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index 86ad13141..2fd6c8073 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -14,10 +14,20 @@ import net.i2p.router.RouterContext; public class SummaryBarRenderer { private final RouterContext _context; private final SummaryHelper _helper; + private final NewsHelper _newshelper; public SummaryBarRenderer(RouterContext context, SummaryHelper helper) { + this(context, helper, null); + } + + public SummaryBarRenderer(RouterContext context, NewsHelper newshelper) { + this(context, null, newshelper); + } + + public SummaryBarRenderer(RouterContext context, SummaryHelper helper, NewsHelper newshelper) { _context = context; _helper = helper; + _newshelper = newshelper; } /** @@ -83,7 +93,7 @@ public class SummaryBarRenderer { .append("
\n") .append(renderTunnelStatusHTML()) .append("
\n") - .append(_helper.getDestinations()) + .append(renderDestinationsHTML()) .append("
\n"); out.write(buf.toString()); @@ -213,6 +223,7 @@ public class SummaryBarRenderer { } public String renderGeneralHTML() { + if (_helper == null) return ""; StringBuilder buf = new StringBuilder(512); buf.append("

") .append(_(_helper.getTunnelStatus())) @@ -458,6 +478,61 @@ public class SummaryBarRenderer { return buf.toString(); } + public String renderDestinationsHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); + buf.append(_helper.getDestinations()); + return buf.toString(); + } + + /** @since 0.9.1 */ + public String renderNewsHeadingsHTML() { + if (_newshelper == null) return ""; + StringBuilder buf = new StringBuilder(512); + String consoleNonce = System.getProperty("router.consoleNonce"); + if (consoleNonce != null) { + // Set up title and pre-headings stuff. + buf.append("

") + .append(_("News & Updates")) + .append("


\n"); + // Get news content. + String newsContent = _newshelper.getContent(); + if (newsContent != "") { + buf.append("
    \n"); + // Parse news content for headings. + int start = newsContent.indexOf("

    "); + while (start >= 0) { + // Add offset to start: + // 4 - gets rid of

    + // 16 - gets rid of the date as well (assuming form "

    yyyy-mm-dd: Foobarbaz...") + newsContent = newsContent.substring(start+16, newsContent.length()); + int end = newsContent.indexOf("

    "); + if (end >= 0) { + String heading = newsContent.substring(0, end); + buf.append("
  • ") + .append(heading) + .append("
  • \n"); + } + start = newsContent.indexOf("

    "); + } + buf.append("

\n"); + // Set up string containing to show news. + buf.append("") + .append(_("Show news")) + .append("\n"); + } else { + buf.append("
") + .append(_("none")) + .append("
"); + } + // Add post-headings stuff. + buf.append("
\n"); + } + return buf.toString(); + } + /** translate a string */ private String _(String s) { return Messages.getString(s, _context); From 5699b4515b593b0b4fa33f01063f753d949008d1 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 5 Jun 2012 02:12:30 +0000 Subject: [PATCH 007/104] Preparations for making the summary bar customisable --- .../i2p/router/web/SummaryBarRenderer.java | 53 ++++++++++++++++++- .../src/net/i2p/router/web/SummaryHelper.java | 29 ++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index 2fd6c8073..fa04bccad 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -3,6 +3,9 @@ package net.i2p.router.web; import java.io.File; import java.io.IOException; import java.io.Writer; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import net.i2p.data.DataHelper; import net.i2p.router.RouterContext; @@ -12,6 +15,31 @@ import net.i2p.router.RouterContext; * */ public class SummaryBarRenderer { + static final Map sections; + static { + Map aMap = new HashMap();; + try { + aMap.put("HelpAndFAQ", SummaryBarRenderer.class.getMethod("renderHelpAndFAQHTML")); + aMap.put("I2PServices", SummaryBarRenderer.class.getMethod("renderI2PServicesHTML")); + aMap.put("I2PInternals", SummaryBarRenderer.class.getMethod("renderI2PInternalsHTML")); + aMap.put("General", SummaryBarRenderer.class.getMethod("renderGeneralHTML")); + aMap.put("ShortGeneral", SummaryBarRenderer.class.getMethod("renderShortGeneralHTML")); + aMap.put("NetworkReachability", SummaryBarRenderer.class.getMethod("renderNetworkReachabilityHTML")); + aMap.put("UpdateStatus", SummaryBarRenderer.class.getMethod("renderUpdateStatusHTML")); + aMap.put("RestartStatus", SummaryBarRenderer.class.getMethod("renderRestartStatusHTMLHTML")); + aMap.put("Peers", SummaryBarRenderer.class.getMethod("renderPeersHTML")); + aMap.put("FirewallAndReseedStatus", SummaryBarRenderer.class.getMethod("renderFirewallAndReseedStatusHTML")); + aMap.put("Bandwidth", SummaryBarRenderer.class.getMethod("renderBandwidthHTML")); + aMap.put("Tunnels", SummaryBarRenderer.class.getMethod("renderTunnelsHTML")); + aMap.put("Congestion", SummaryBarRenderer.class.getMethod("renderCongestionHTML")); + aMap.put("TunnelStatus", SummaryBarRenderer.class.getMethod("renderTunnelStatusHTML")); + aMap.put("Destinations", SummaryBarRenderer.class.getMethod("renderDestinationsHTML")); + aMap.put("NewsHeadings", SummaryBarRenderer.class.getMethod("renderNewsHeadingsHTML")); + } catch (java.lang.NoSuchMethodException e) { + } + sections = Collections.unmodifiableMap(aMap); + } + private final RouterContext _context; private final SummaryHelper _helper; private final NewsHelper _newshelper; @@ -265,6 +293,29 @@ public class SummaryBarRenderer { return buf.toString(); } + public String renderShortGeneralHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); + buf.append("" + + "" + + "\n" + + + "" + + "" + + "
") + .append(_("Version")) + .append(":") + .append(_helper.getVersion()) + .append("
") + .append(_("Uptime")) + .append(":") + .append(_helper.getUptime()) + .append("
\n"); + return buf.toString(); + } + public String renderNetworkReachabilityHTML() { if (_helper == null) return ""; StringBuilder buf = new StringBuilder(512); @@ -487,7 +538,7 @@ public class SummaryBarRenderer { /** @since 0.9.1 */ public String renderNewsHeadingsHTML() { - if (_newshelper == null) return ""; + if (_newshelper == null || _newshelper.shouldShowNews()) return ""; StringBuilder buf = new StringBuilder(512); String consoleNonce = System.getProperty("router.consoleNonce"); if (consoleNonce != null) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 80456d604..282c1be1e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -35,6 +35,35 @@ public class SummaryHelper extends HelperBase { // Opera 10.63 doesn't have the char, TODO check UA //static final String THINSP = " / "; static final String THINSP = " / "; + private static final char S = ','; + static final String PROP_SUMMARYBAR = "routerconsole.summarybar"; + + static final String PRESET_FULL = + "HelpAndFAQ" + S + + "I2PServices" + S + + "I2PInternals" + S + + "General" + S + + "NetworkReachability" + S + + "UpdateStatus" + S + + "RestartStatus" + S + + "Peers" + S + + "FirewallAndReseedStatus" + S + + "Bandwidth" + S + + "Tunnels" + S + + "Congestion" + S + + "TunnelStatus" + S + + "Destinations" + S + + ""; + + static final String PRESET_SHORT = + "ShortGeneral" + S + + "NewsHeadings" + S + + "UpdateStatus" + S + + "NetworkReachability" + S + + "FirewallAndReseedStatus" + S + + "Destinations" + S + + "RestartStatus" + S + + ""; /** * Retrieve the shortened 4 character ident for the router located within From 531c6c0f4c4e8cea259e42550da58a419345b951 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 5 Jun 2012 07:36:24 +0000 Subject: [PATCH 008/104] Implementation of customisable summary bar via routerconsole.summaryBar property The initial attempt using mapping of strings to methods is shorter and neater, but also doesn't work so is commented out. --- .../i2p/router/web/SummaryBarRenderer.java | 102 ++++++++++-------- .../src/net/i2p/router/web/SummaryHelper.java | 14 ++- apps/routerconsole/jsp/summaryframe.jsp | 2 +- 3 files changed, 69 insertions(+), 49 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index fa04bccad..756126895 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -15,7 +15,7 @@ import net.i2p.router.RouterContext; * */ public class SummaryBarRenderer { - static final Map sections; + /*static final Map ALL_SECTIONS; static { Map aMap = new HashMap();; try { @@ -37,8 +37,8 @@ public class SummaryBarRenderer { aMap.put("NewsHeadings", SummaryBarRenderer.class.getMethod("renderNewsHeadingsHTML")); } catch (java.lang.NoSuchMethodException e) { } - sections = Collections.unmodifiableMap(aMap); - } + ALL_SECTIONS = Collections.unmodifiableMap(aMap); + }*/ private final RouterContext _context; private final SummaryHelper _helper; @@ -77,54 +77,62 @@ public class SummaryBarRenderer { .append(_("I2P Router Console")) .append("\" title=\"") .append(_("I2P Router Console")) - .append("\">\n") - .append("
\n") - .append(renderHelpAndFAQHTML()) - .append("
\n"); + .append("\">\n"); - File lpath = new File(_context.getBaseDir(), "docs/toolbar.html"); - // you better have target="_top" for the links in there... - if (lpath.exists()) { - ContentHelper linkhelper = new ContentHelper(); - linkhelper.setPage(lpath.getAbsolutePath()); - linkhelper.setMaxLines("100"); - buf.append(linkhelper.getContent()); - } else { - buf.append(renderI2PServicesHTML()) - .append("
\n") - .append(renderI2PInternalsHTML()); + out.write(buf.toString()); - out.write(buf.toString()); + String[] sections = _helper.getSummaryBarSections(); + for (int i = 0; i < sections.length; i++) { + /*try { + String section = (String)ALL_SECTIONS.get(sections[i]).invoke(this); + if (section != null && section != "") { + out.write("
" + i + "
\n" + section); + } + } catch (Exception e) { + out.write("
" +i + " - Exception
\n" + e); + }*/ buf.setLength(0); + + String section = sections[i]; + + buf.append("
\n"); + if ("HelpAndFAQ".equals(section)) + buf.append(renderHelpAndFAQHTML()); + else if ("I2PServices".equals(section)) + buf.append(renderI2PServicesHTML()); + else if ("I2PInternals".equals(section)) + buf.append(renderI2PInternalsHTML()); + else if ("General".equals(section)) + buf.append(renderGeneralHTML()); + else if ("ShortGeneral".equals(section)) + buf.append(renderShortGeneralHTML()); + else if ("NetworkReachability".equals(section)) + buf.append(renderNetworkReachabilityHTML()); + else if ("UpdateStatus".equals(section)) + buf.append(renderUpdateStatusHTML()); + else if ("RestartStatus".equals(section)) + buf.append(renderRestartStatusHTML()); + else if ("Peers".equals(section)) + buf.append(renderPeersHTML()); + else if ("FirewallAndReseedStatus".equals(section)) + buf.append(renderFirewallAndReseedStatusHTML()); + else if ("Bandwidth".equals(section)) + buf.append(renderBandwidthHTML()); + else if ("Tunnels".equals(section)) + buf.append(renderTunnelsHTML()); + else if ("Congestion".equals(section)) + buf.append(renderCongestionHTML()); + else if ("TunnelStatus".equals(section)) + buf.append(renderTunnelStatusHTML()); + else if ("Destinations".equals(section)) + buf.append(renderDestinationsHTML()); + else if ("NewsHeadings".equals(section)) + buf.append(renderNewsHeadingsHTML()); + + // Only output section if there's more than the
to print + if (buf.length() > 5) + out.write(buf.toString()); } - - buf.append("
\n") - .append(renderGeneralHTML()) - .append("
\n") - .append(renderNetworkReachabilityHTML()) - .append("
\n") - .append(renderUpdateStatusHTML()) - .append(renderRestartStatusHTML()) - .append("
\n") - .append(renderPeersHTML()) - .append("
\n"); - - out.write(buf.toString()); - buf.setLength(0); - - buf.append(renderFirewallAndReseedStatusHTML()) - .append(renderBandwidthHTML()) - .append("
\n") - .append(renderTunnelsHTML()) - .append("
\n") - .append(renderCongestionHTML()) - .append("
\n") - .append(renderTunnelStatusHTML()) - .append("
\n") - .append(renderDestinationsHTML()) - .append("
\n"); - - out.write(buf.toString()); } public String renderHelpAndFAQHTML() { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 282c1be1e..46c6d58af 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -36,7 +36,7 @@ public class SummaryHelper extends HelperBase { //static final String THINSP = " / "; static final String THINSP = " / "; private static final char S = ','; - static final String PROP_SUMMARYBAR = "routerconsole.summarybar"; + static final String PROP_SUMMARYBAR = "routerconsole.summaryBar"; static final String PRESET_FULL = "HelpAndFAQ" + S + @@ -739,6 +739,18 @@ public class SummaryHelper extends HelperBase { return buf.toString(); } + public String[] getSummaryBarSections() { + String config = _context.getProperty(PROP_SUMMARYBAR, PRESET_FULL); + return config.split("" + S); + } + + public void saveSummaryBarSections(String[] sections) { + StringBuilder buf = new StringBuilder(512); + for(int i = 0; i < sections.length; i++) + buf.append(sections[i]).append(S); + _context.router().saveConfig(PROP_SUMMARYBAR, buf.toString()); + } + /** output the summary bar to _out */ public void renderSummaryBar() throws IOException { SummaryBarRenderer renderer = new SummaryBarRenderer(_context, this); diff --git a/apps/routerconsole/jsp/summaryframe.jsp b/apps/routerconsole/jsp/summaryframe.jsp index bdd4a8cbc..5822c9f64 100644 --- a/apps/routerconsole/jsp/summaryframe.jsp +++ b/apps/routerconsole/jsp/summaryframe.jsp @@ -56,7 +56,7 @@ <% // d and shutdownSoon defined above if (!shutdownSoon) { - out.print("
\n"); + out.print("
\n
\n"); if ("0".equals(d)) { out.print(""); out.print(intl._("Refresh (s)")); From 52a38607175b7ae22c3d5723f218d65cf843514b Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 5 Jun 2012 12:44:17 +0000 Subject: [PATCH 009/104] Rearrange summary bar code to consolidate Ajax and IFrame, and /home and /console Now, Ajax will be used first, and will fall back to IFrame if JS is disabled, and a separate page if on a text or mobile browser. Also, /home and /console (and everywhere) now all have the same summary bar content, which currently defaults to the original full listing. --- .../src/net/i2p/router/web/NewsHelper.java | 6 --- .../i2p/router/web/SummaryBarRenderer.java | 35 +++------------ .../src/net/i2p/router/web/SummaryHelper.java | 4 ++ apps/routerconsole/jsp/console.jsp | 17 ++++--- apps/routerconsole/jsp/home.jsp | 3 +- apps/routerconsole/jsp/summary.jsi | 15 +++++-- apps/routerconsole/jsp/summaryframe.jsp | 7 +++ apps/routerconsole/jsp/summarynoframe.jsi | 44 ++++++------------- apps/routerconsole/jsp/xhr1.jsi | 44 ++++++++++++------- 9 files changed, 79 insertions(+), 96 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java index 833e197a0..d5d702e8f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java @@ -18,12 +18,6 @@ public class NewsHelper extends ContentHelper { return super.getContent(); } - /** @since 0.9.1 */ - public String getNewsHeadings() { - SummaryBarRenderer renderer = new SummaryBarRenderer(_context, this); - return renderer.renderNewsHeadingsHTML(); - } - /** @since 0.8.12 */ public boolean shouldShowNews() { return NewsFetcher.getInstance(_context).shouldShowNews(); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index 756126895..84f140102 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -15,6 +15,7 @@ import net.i2p.router.RouterContext; * */ public class SummaryBarRenderer { + // Commented out because broken. Replaced by if-elseif blob below. /*static final Map ALL_SECTIONS; static { Map aMap = new HashMap();; @@ -42,20 +43,10 @@ public class SummaryBarRenderer { private final RouterContext _context; private final SummaryHelper _helper; - private final NewsHelper _newshelper; public SummaryBarRenderer(RouterContext context, SummaryHelper helper) { - this(context, helper, null); - } - - public SummaryBarRenderer(RouterContext context, NewsHelper newshelper) { - this(context, null, newshelper); - } - - public SummaryBarRenderer(RouterContext context, SummaryHelper helper, NewsHelper newshelper) { _context = context; _helper = helper; - _newshelper = newshelper; } /** @@ -64,25 +55,9 @@ public class SummaryBarRenderer { */ public void renderSummaryHTML(Writer out) throws IOException { StringBuilder buf = new StringBuilder(8*1024); - String theme = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME); - - // TODO - the bar would render more cleanly if we specified the img height and width here, - // but unfortunately the images in the different themes are different sizes. - // They range in height from 37 to 43 px. But there's a -2 bottom margin... - // So put it in a div. - buf.append("
\"")
\n"); - - out.write(buf.toString()); - String[] sections = _helper.getSummaryBarSections(); for (int i = 0; i < sections.length; i++) { + // Commented out because broken. Replaced by if-elseif blob below. /*try { String section = (String)ALL_SECTIONS.get(sections[i]).invoke(this); if (section != null && section != "") { @@ -546,7 +521,9 @@ public class SummaryBarRenderer { /** @since 0.9.1 */ public String renderNewsHeadingsHTML() { - if (_newshelper == null || _newshelper.shouldShowNews()) return ""; + if (_helper == null) return ""; + NewsHelper newshelper = _helper.getNewsHelper(); + if (newshelper == null || newshelper.shouldShowNews()) return ""; StringBuilder buf = new StringBuilder(512); String consoleNonce = System.getProperty("router.consoleNonce"); if (consoleNonce != null) { @@ -555,7 +532,7 @@ public class SummaryBarRenderer { .append(_("News & Updates")) .append("


\n"); // Get news content. - String newsContent = _newshelper.getContent(); + String newsContent = newshelper.getContent(); if (newsContent != "") { buf.append("
    \n"); // Parse news content for headings. diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 46c6d58af..32d3b2bbc 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -739,6 +739,10 @@ public class SummaryHelper extends HelperBase { return buf.toString(); } + private NewsHelper _newshelper; + public void storeNewsHelper(NewsHelper n) { _newshelper = n; } + public NewsHelper getNewsHelper() { return _newshelper; } + public String[] getSummaryBarSections() { String config = _context.getProperty(PROP_SUMMARYBAR, PRESET_FULL); return config.split("" + S); diff --git a/apps/routerconsole/jsp/console.jsp b/apps/routerconsole/jsp/console.jsp index c02b64b9a..7a080d2b9 100644 --- a/apps/routerconsole/jsp/console.jsp +++ b/apps/routerconsole/jsp/console.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("home")%> - + + + <% String consoleNonce = System.getProperty("router.consoleNonce"); if (consoleNonce == null) { @@ -15,16 +21,13 @@ } %> -<%@include file="summary.jsi" %>

    <%=intl._("I2P Router Console")%>

    +<%@include file="summary.jsi" %> + +

    <%=intl._("I2P Router Console")%>

    - - " /> <% if (newshelper.shouldShowNews()) { - java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); %> - -
    <% diff --git a/apps/routerconsole/jsp/home.jsp b/apps/routerconsole/jsp/home.jsp index f4088cc03..5183f64a8 100644 --- a/apps/routerconsole/jsp/home.jsp +++ b/apps/routerconsole/jsp/home.jsp @@ -6,7 +6,7 @@ <%=intl.title("home")%> @@ -33,7 +33,6 @@ -
    <%@include file="xhr1.jsi" %> diff --git a/apps/routerconsole/jsp/summary.jsi b/apps/routerconsole/jsp/summary.jsi index 847e42d52..0eb9d77b0 100644 --- a/apps/routerconsole/jsp/summary.jsi +++ b/apps/routerconsole/jsp/summary.jsi @@ -1,3 +1,10 @@ + +" /> +<% + java.io.File newspath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + +
    <% // The refresh delay, 0 to disable @@ -15,7 +22,7 @@ newDelay = "?refresh=" + d; } if (!"0".equals(d)) - out.print("\n"); + out.print("
    \n"); } else if (allowIFrame) { // since we don't have an iframe this will reload the base page, and // the new delay will be passed to the iframe above - out.print("
    \n" + + out.print("
    \n"); + "
    \n"); } else { out.print("
\n"); } diff --git a/apps/routerconsole/jsp/summaryframe.jsp b/apps/routerconsole/jsp/summaryframe.jsp index 5822c9f64..218e78ba6 100644 --- a/apps/routerconsole/jsp/summaryframe.jsp +++ b/apps/routerconsole/jsp/summaryframe.jsp @@ -52,6 +52,13 @@ } %>
+ +" /> +<% + java.io.File newspath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + + <%@include file="summarynoframe.jsi" %> <% // d and shutdownSoon defined above diff --git a/apps/routerconsole/jsp/summarynoframe.jsi b/apps/routerconsole/jsp/summarynoframe.jsi index 63c39e6e5..6fae7c901 100644 --- a/apps/routerconsole/jsp/summarynoframe.jsi +++ b/apps/routerconsole/jsp/summarynoframe.jsi @@ -1,35 +1,17 @@ -<%@page import="net.i2p.router.web.SummaryHelper" %> <% /* - * Note: - * This is included almost 30 times, so keep whitespace etc. to a minimum. + * TODO - the bar would render more cleanly if we specified the img height and width here, + * but unfortunately the images in the different themes are different sizes. + * They range in height from 37 to 43 px. But there's a -2 bottom margin... + * So put it in a div. */ %> - -" /> -" /> -" /> -" /> - -<% helper.storeWriter(out); %> -<% -/* - * The following is required for the reseed button to work, although we probably - * only need the reseedNonce property. - */ -%> - - -<% -/* - * The following is required for the update buttons to work, although we probably - * only need the updateNonce property. - */ -%> - - -" /> -<% - // moved to java for ease of translation and to avoid 30 copies - helper.renderSummaryBar(); -%> + +
+ +<%@include file="xhr1.jsi" %> +
diff --git a/apps/routerconsole/jsp/xhr1.jsi b/apps/routerconsole/jsp/xhr1.jsi index 4a646c759..1362cca1f 100644 --- a/apps/routerconsole/jsp/xhr1.jsi +++ b/apps/routerconsole/jsp/xhr1.jsi @@ -1,31 +1,41 @@ +<%@page import="net.i2p.router.web.SummaryHelper" %> +<% +/* + * Note: + * This is included on every refresh, so keep whitespace etc. to a minimum. + */ +%> " /> " /> -
<%=intl._("Version")%>: - -
<%=intl._("Uptime")%>: - -

" /> " /> <% String reqURI = request.getRequestURI(); if (reqURI != null) - reqURI = reqURI.replace("/xhr1.jsp", "/home"); + reqURI = reqURI.replace("/xhr1.jsp", "/"); helper.setRequestURI(reqURI); %> +<% helper.storeWriter(out); %> +<% helper.storeNewsHelper(newshelper); %> <% - if (!newshelper.shouldShowNews()) { +/* + * The following is required for the reseed button to work, although we probably + * only need the reseedNonce property. + */ %> -
+ + <% - } // !shouldShowNews() +/* + * The following is required for the update buttons to work, although we probably + * only need the updateNonce property. + */ +%> + + +" /> +<% + // moved to java for ease of translation + helper.renderSummaryBar(); %> - -

"><%=intl._("Network")%>: -

-
- - -
- From 83c82338127a8fd52e9176538813460d7999992b Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 5 Jun 2012 13:00:40 +0000 Subject: [PATCH 010/104] Insert routerconsole.summaryRefresh config value into Ajax script This way, both Ajax and IFrame get their refresh time from config (though IFrame one can still be modified live). --- apps/routerconsole/jsp/console.jsp | 4 ++-- apps/routerconsole/jsp/home.jsp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/routerconsole/jsp/console.jsp b/apps/routerconsole/jsp/console.jsp index 7a080d2b9..96c255fc9 100644 --- a/apps/routerconsole/jsp/console.jsp +++ b/apps/routerconsole/jsp/console.jsp @@ -9,8 +9,8 @@ <% diff --git a/apps/routerconsole/jsp/home.jsp b/apps/routerconsole/jsp/home.jsp index 5183f64a8..c9379fb3a 100644 --- a/apps/routerconsole/jsp/home.jsp +++ b/apps/routerconsole/jsp/home.jsp @@ -7,8 +7,8 @@ <% From 420bf851b536374989ab1ff75a38ae9f0d6e2a52 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 5 Jun 2012 13:37:10 +0000 Subject: [PATCH 011/104] Added Ajax script to every routerconsole page that includes summary.jsi --- apps/routerconsole/jsp/config.jsp | 8 +++++++- apps/routerconsole/jsp/configadvanced.jsp | 8 +++++++- apps/routerconsole/jsp/configclients.jsp | 9 ++++++++- apps/routerconsole/jsp/confighome.jsp | 8 +++++++- apps/routerconsole/jsp/configkeyring.jsp | 8 +++++++- apps/routerconsole/jsp/configlogging.jsp | 8 +++++++- apps/routerconsole/jsp/confignet.jsp | 8 +++++++- apps/routerconsole/jsp/configpeer.jsp | 8 +++++++- apps/routerconsole/jsp/configreseed.jsp | 8 +++++++- apps/routerconsole/jsp/configservice.jsp | 8 +++++++- apps/routerconsole/jsp/configstats.jsp | 7 +++++++ apps/routerconsole/jsp/configtunnels.jsp | 8 +++++++- apps/routerconsole/jsp/configui.jsp | 8 +++++++- apps/routerconsole/jsp/configupdate.jsp | 8 +++++++- apps/routerconsole/jsp/debug.jsp | 8 +++++++- apps/routerconsole/jsp/error.jsp | 8 +++++++- apps/routerconsole/jsp/graph.jsp | 8 +++++++- apps/routerconsole/jsp/graphs.jsp | 8 +++++++- apps/routerconsole/jsp/help.jsp | 8 +++++++- apps/routerconsole/jsp/help_ar.jsp | 8 +++++++- apps/routerconsole/jsp/help_fr.jsp | 8 +++++++- apps/routerconsole/jsp/help_nl.jsp | 8 +++++++- apps/routerconsole/jsp/help_ru.jsp | 8 +++++++- apps/routerconsole/jsp/jars.jsp | 8 +++++++- apps/routerconsole/jsp/jobs.jsp | 8 +++++++- apps/routerconsole/jsp/logs.jsp | 8 +++++++- apps/routerconsole/jsp/netdb.jsp | 8 +++++++- apps/routerconsole/jsp/nowebapp.jsp | 8 +++++++- apps/routerconsole/jsp/oldconsole.jsp | 8 +++++++- apps/routerconsole/jsp/peers.jsp | 8 +++++++- apps/routerconsole/jsp/profiles.jsp | 9 ++++++++- apps/routerconsole/jsp/stats.jsp | 8 +++++++- apps/routerconsole/jsp/tunnels.jsp | 8 +++++++- apps/routerconsole/jsp/viewprofile.jsp | 8 +++++++- 34 files changed, 240 insertions(+), 33 deletions(-) diff --git a/apps/routerconsole/jsp/config.jsp b/apps/routerconsole/jsp/config.jsp index 70c0e64f0..9cc6f81a4 100644 --- a/apps/routerconsole/jsp/config.jsp +++ b/apps/routerconsole/jsp/config.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("configure bandwidth")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configadvanced.jsp b/apps/routerconsole/jsp/configadvanced.jsp index 1dbf23e7d..27405c0c4 100644 --- a/apps/routerconsole/jsp/configadvanced.jsp +++ b/apps/routerconsole/jsp/configadvanced.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("config advanced")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configclients.jsp b/apps/routerconsole/jsp/configclients.jsp index c8575b490..0662afffe 100644 --- a/apps/routerconsole/jsp/configclients.jsp +++ b/apps/routerconsole/jsp/configclients.jsp @@ -10,7 +10,14 @@ button span.hide{ display:none; } input.default { width: 1px; height: 1px; visibility: hidden; } - + + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/confighome.jsp b/apps/routerconsole/jsp/confighome.jsp index ca0dbdc6c..5ddf6f200 100644 --- a/apps/routerconsole/jsp/confighome.jsp +++ b/apps/routerconsole/jsp/confighome.jsp @@ -12,7 +12,13 @@ input.default { visibility: hidden; } - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Home Page Configuration")%>

diff --git a/apps/routerconsole/jsp/configkeyring.jsp b/apps/routerconsole/jsp/configkeyring.jsp index 7acdf1126..2719fe333 100644 --- a/apps/routerconsole/jsp/configkeyring.jsp +++ b/apps/routerconsole/jsp/configkeyring.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config keyring")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Keyring Configuration")%>

diff --git a/apps/routerconsole/jsp/configlogging.jsp b/apps/routerconsole/jsp/configlogging.jsp index 8274fcb43..d00d34321 100644 --- a/apps/routerconsole/jsp/configlogging.jsp +++ b/apps/routerconsole/jsp/configlogging.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("config logging")%> - + + + " /> diff --git a/apps/routerconsole/jsp/confignet.jsp b/apps/routerconsole/jsp/confignet.jsp index 6e340a659..e85c9e6df 100644 --- a/apps/routerconsole/jsp/confignet.jsp +++ b/apps/routerconsole/jsp/confignet.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config networking")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configpeer.jsp b/apps/routerconsole/jsp/configpeer.jsp index b5968abed..0f9b98a21 100644 --- a/apps/routerconsole/jsp/configpeer.jsp +++ b/apps/routerconsole/jsp/configpeer.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config peers")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Peer Configuration")%>

diff --git a/apps/routerconsole/jsp/configreseed.jsp b/apps/routerconsole/jsp/configreseed.jsp index 67d2334c9..c0f3faaae 100644 --- a/apps/routerconsole/jsp/configreseed.jsp +++ b/apps/routerconsole/jsp/configreseed.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config reseeding")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index 3ee1ef796..21ae39a6b 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config service")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Service Configuration")%>

diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index d380d7783..6d75d673c 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -6,10 +6,17 @@ <%@include file="css.jsi" %> <%=intl.title("config stats")%> + + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 4a214c852..c5b8c4d81 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("config UI")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index e2bd49ab2..dafac8d45 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("config update")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Update Configuration")%>

diff --git a/apps/routerconsole/jsp/debug.jsp b/apps/routerconsole/jsp/debug.jsp index b9e66345f..191d73e18 100644 --- a/apps/routerconsole/jsp/debug.jsp +++ b/apps/routerconsole/jsp/debug.jsp @@ -9,7 +9,13 @@ %> I2P Router Console - Debug <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

Router SKM

diff --git a/apps/routerconsole/jsp/error.jsp b/apps/routerconsole/jsp/error.jsp index 69f9fbfa3..95218cc53 100644 --- a/apps/routerconsole/jsp/error.jsp +++ b/apps/routerconsole/jsp/error.jsp @@ -16,7 +16,13 @@ <%@include file="css.jsi" %> <%=intl.title("Page Not Found")%> - + + + <%@include file="summary.jsi" %>

<%=ERROR_CODE%> <%=ERROR_MESSAGE%>

diff --git a/apps/routerconsole/jsp/graph.jsp b/apps/routerconsole/jsp/graph.jsp index 6147fd96d..4be37b339 100644 --- a/apps/routerconsole/jsp/graph.jsp +++ b/apps/routerconsole/jsp/graph.jsp @@ -12,7 +12,13 @@ <% graphHelper.storeWriter(out); %> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Performance Graphs")%>

diff --git a/apps/routerconsole/jsp/graphs.jsp b/apps/routerconsole/jsp/graphs.jsp index 4b65cca75..e3287e98c 100644 --- a/apps/routerconsole/jsp/graphs.jsp +++ b/apps/routerconsole/jsp/graphs.jsp @@ -19,7 +19,13 @@ out.print(graphHelper.getRefreshMeta()); } %> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Performance Graphs")%>

diff --git a/apps/routerconsole/jsp/help.jsp b/apps/routerconsole/jsp/help.jsp index 265bbfb62..8c68cb5e9 100644 --- a/apps/routerconsole/jsp/help.jsp +++ b/apps/routerconsole/jsp/help.jsp @@ -9,7 +9,13 @@ %> I2P Router Console - help <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

I2P Router Help & Support

diff --git a/apps/routerconsole/jsp/help_ar.jsp b/apps/routerconsole/jsp/help_ar.jsp index 4b471f594..7e058678f 100644 --- a/apps/routerconsole/jsp/help_ar.jsp +++ b/apps/routerconsole/jsp/help_ar.jsp @@ -9,7 +9,13 @@ %> I2P مساعدة لوحة التحكم <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

I2P مساعدة لوحة التحكم

diff --git a/apps/routerconsole/jsp/help_fr.jsp b/apps/routerconsole/jsp/help_fr.jsp index fd0f8bc26..01b000ac9 100644 --- a/apps/routerconsole/jsp/help_fr.jsp +++ b/apps/routerconsole/jsp/help_fr.jsp @@ -9,7 +9,13 @@ %> Console du routeur I2P - Aide <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %> Traduction de mars 2011 (magma@mail.i2p)

Aide et assistance du routeur I2P

diff --git a/apps/routerconsole/jsp/help_nl.jsp b/apps/routerconsole/jsp/help_nl.jsp index 944e65e7b..20defacaa 100644 --- a/apps/routerconsole/jsp/help_nl.jsp +++ b/apps/routerconsole/jsp/help_nl.jsp @@ -9,7 +9,13 @@ %> I2P Router Console - help <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

I2P Router Help & Support

diff --git a/apps/routerconsole/jsp/help_ru.jsp b/apps/routerconsole/jsp/help_ru.jsp index d14da0138..55ea530c7 100644 --- a/apps/routerconsole/jsp/help_ru.jsp +++ b/apps/routerconsole/jsp/help_ru.jsp @@ -9,7 +9,13 @@ %> Консоль маршрутизатора I2P - справка <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

Справка маршрутизатора I2P

diff --git a/apps/routerconsole/jsp/jars.jsp b/apps/routerconsole/jsp/jars.jsp index 4fa200b70..dacd3d93f 100644 --- a/apps/routerconsole/jsp/jars.jsp +++ b/apps/routerconsole/jsp/jars.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("Jar File Dump")%> - + + + <%@include file="summary.jsi" %>

Jar File Dump

diff --git a/apps/routerconsole/jsp/jobs.jsp b/apps/routerconsole/jsp/jobs.jsp index 2e2e71248..247fa298e 100644 --- a/apps/routerconsole/jsp/jobs.jsp +++ b/apps/routerconsole/jsp/jobs.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("job queue")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Router Job Queue")%>

diff --git a/apps/routerconsole/jsp/logs.jsp b/apps/routerconsole/jsp/logs.jsp index 0f470e7c9..ed4b5c121 100644 --- a/apps/routerconsole/jsp/logs.jsp +++ b/apps/routerconsole/jsp/logs.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("logs")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Router Logs")%>

diff --git a/apps/routerconsole/jsp/netdb.jsp b/apps/routerconsole/jsp/netdb.jsp index cfbd3b2ac..52ccd1b0c 100644 --- a/apps/routerconsole/jsp/netdb.jsp +++ b/apps/routerconsole/jsp/netdb.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("network database summary")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Network Database Summary")%>

diff --git a/apps/routerconsole/jsp/nowebapp.jsp b/apps/routerconsole/jsp/nowebapp.jsp index 1bbec502d..03ad771b9 100644 --- a/apps/routerconsole/jsp/nowebapp.jsp +++ b/apps/routerconsole/jsp/nowebapp.jsp @@ -8,7 +8,13 @@ <%@include file="css.jsi" %> <%=intl.title("WebApp Not Found")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("Web Application Not Running")%>

diff --git a/apps/routerconsole/jsp/oldconsole.jsp b/apps/routerconsole/jsp/oldconsole.jsp index 7edb76240..cb0c18663 100644 --- a/apps/routerconsole/jsp/oldconsole.jsp +++ b/apps/routerconsole/jsp/oldconsole.jsp @@ -9,7 +9,13 @@ %> I2P Router Console - internals <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %> " /> diff --git a/apps/routerconsole/jsp/peers.jsp b/apps/routerconsole/jsp/peers.jsp index 6b0ed6b67..e23e4f73b 100644 --- a/apps/routerconsole/jsp/peers.jsp +++ b/apps/routerconsole/jsp/peers.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("peer connections")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Network Peers")%>

diff --git a/apps/routerconsole/jsp/profiles.jsp b/apps/routerconsole/jsp/profiles.jsp index 8441838e2..6f81b857b 100644 --- a/apps/routerconsole/jsp/profiles.jsp +++ b/apps/routerconsole/jsp/profiles.jsp @@ -6,7 +6,14 @@ <%@include file="css.jsi" %> <%=intl.title("peer profiles")%> -<%@include file="summary.jsi" %> + + + +<%@include file="summary.jsi" %>

<%=intl._("I2P Network Peer Profiles")%>

diff --git a/apps/routerconsole/jsp/stats.jsp b/apps/routerconsole/jsp/stats.jsp index c0596f796..5750fae1c 100644 --- a/apps/routerconsole/jsp/stats.jsp +++ b/apps/routerconsole/jsp/stats.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("statistics")%> - + + + <%@include file="summary.jsi" %> " /> diff --git a/apps/routerconsole/jsp/tunnels.jsp b/apps/routerconsole/jsp/tunnels.jsp index 32f86475a..332381a95 100644 --- a/apps/routerconsole/jsp/tunnels.jsp +++ b/apps/routerconsole/jsp/tunnels.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("tunnel summary")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Tunnel Summary")%>

diff --git a/apps/routerconsole/jsp/viewprofile.jsp b/apps/routerconsole/jsp/viewprofile.jsp index 8747a6d88..635aafb34 100644 --- a/apps/routerconsole/jsp/viewprofile.jsp +++ b/apps/routerconsole/jsp/viewprofile.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("Peer Profile")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("Peer Profile")%>

From b75d28fd0d75d264d6e6d8c25798887f6c932e22 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 5 Jun 2012 15:19:40 +0000 Subject: [PATCH 012/104] Added /i2ptunnelmanager which wraps /i2ptunnel/ in an IFrame /i2ptunnelmanager redirects to /i2ptunnel/ if the browser doesn't support IFrames. --- .../i2p/router/web/SummaryBarRenderer.java | 2 +- .../src/net/i2p/router/web/SummaryHelper.java | 2 +- apps/routerconsole/jsp/i2ptunnelmanager.jsp | 41 +++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 apps/routerconsole/jsp/i2ptunnelmanager.jsp diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index 84f140102..46a5185d1 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -214,7 +214,7 @@ public class SummaryBarRenderer { .append(_("Stats")) .append("\n" + - "") .append(_("I2PTunnel")) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 32d3b2bbc..799fc4346 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -404,7 +404,7 @@ public class SummaryHelper extends HelperBase { List clients = new ArrayList(_context.clientManager().listClients()); StringBuilder buf = new StringBuilder(512); - buf.append("

").append(_("Local Destinations")).append("


"); + buf.append("

").append(_("Local Destinations")).append("


"); if (!clients.isEmpty()) { Collections.sort(clients, new AlphaComparator()); buf.append(""); diff --git a/apps/routerconsole/jsp/i2ptunnelmanager.jsp b/apps/routerconsole/jsp/i2ptunnelmanager.jsp new file mode 100644 index 000000000..6ea41239a --- /dev/null +++ b/apps/routerconsole/jsp/i2ptunnelmanager.jsp @@ -0,0 +1,41 @@ +<%@page contentType="text/html"%> +<%@page trimDirectiveWhitespaces="true"%> +<%@page pageEncoding="UTF-8"%> + +" /> +<% + // CSSHelper is also pulled in by css.jsi below... + boolean testIFrame = tester.allowIFrame(request.getHeader("User-Agent")); + if (!testIFrame) { + response.setStatus(302, "Moved"); + response.setHeader("Location", "/i2ptunnel/"); + } else { +%> + + + +<%@include file="css.jsi" %> +<%=intl.title("home")%> + + + + +<%@include file="summary.jsi" %> + +

<%=intl._("I2P Tunnel Manager")%>

+
+ +
+<% + } +%> From 84344b678956491818c5d9356f2d153c95c8e440 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 7 Jun 2012 02:51:22 +0000 Subject: [PATCH 013/104] Added a config page for summary bar --- .../src/net/i2p/router/web/CSSHelper.java | 1 + .../net/i2p/router/web/ConfigNavHelper.java | 4 +- .../src/net/i2p/router/web/SummaryHelper.java | 39 +++++++++- apps/routerconsole/jsp/configsidebar.jsp | 74 +++++++++++++++++++ 4 files changed, 112 insertions(+), 6 deletions(-) create mode 100644 apps/routerconsole/jsp/configsidebar.jsp diff --git a/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java index 3dd724b08..1c2190970 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java @@ -19,6 +19,7 @@ public class CSSHelper extends HelperBase { private static final String FORCE = "classic"; public static final String PROP_REFRESH = "routerconsole.summaryRefresh"; public static final String DEFAULT_REFRESH = "60"; + public static final int MIN_REFRESH = 5; private static final String PROP_XFRAME = "routerconsole.disableXFrame"; public String getTheme(String userAgent) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNavHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNavHelper.java index eb8d504bb..7a6b032c1 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNavHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNavHelper.java @@ -11,12 +11,12 @@ public class ConfigNavHelper extends HelperBase { /** configX.jsp */ private static final String pages[] = - {"", "net", "ui", "home", "service", "update", "tunnels", + {"", "net", "ui", "sidebar", "home", "service", "update", "tunnels", "clients", "peer", "keyring", "logging", "stats", "reseed", "advanced" }; private static final String titles[] = - {_x("Bandwidth"), _x("Network"), _x("UI"), _x("Home Page"), + {_x("Bandwidth"), _x("Network"), _x("UI"), _x("Summary Bar"), _x("Home Page"), _x("Service"), _x("Update"), _x("Tunnels"), _x("Clients"), _x("Peers"), _x("Keyring"), _x("Logging"), _x("Stats"), _x("Reseeding"), _x("Advanced") }; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 799fc4346..713183247 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -8,6 +8,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; +import java.util.Map; import net.i2p.data.DataHelper; import net.i2p.data.Destination; @@ -17,6 +18,7 @@ import net.i2p.data.RouterAddress; import net.i2p.data.RouterInfo; import net.i2p.router.CommSystemFacade; import net.i2p.router.Router; +import net.i2p.router.RouterContext; import net.i2p.router.RouterVersion; import net.i2p.router.TunnelPoolSettings; import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade; @@ -748,11 +750,11 @@ public class SummaryHelper extends HelperBase { return config.split("" + S); } - public void saveSummaryBarSections(String[] sections) { + static void saveSummaryBarSections(RouterContext ctx, Map sections) { StringBuilder buf = new StringBuilder(512); - for(int i = 0; i < sections.length; i++) - buf.append(sections[i]).append(S); - _context.router().saveConfig(PROP_SUMMARYBAR, buf.toString()); + for(String section : sections.values()) + buf.append(section).append(S); + ctx.router().saveConfig(PROP_SUMMARYBAR, buf.toString()); } /** output the summary bar to _out */ @@ -778,4 +780,33 @@ public class SummaryHelper extends HelperBase { private String _requestURI; public void setRequestURI(String s) { _requestURI = s; } public String getRequestURI() { return _requestURI; } + + public String getConfigTable() { + String[] sections = getSummaryBarSections(); + StringBuilder buf = new StringBuilder(1024); + buf.append("
\n"); + for (int i = 0; i < sections.length; i++) { + buf.append("\n"); + } + buf.append("" + + ""); + buf.append("
") + .append(_("Remove")) + .append("") + .append(_("Order")) + .append("") + .append(_("Name")) + .append("
") + .append(sections[i]) + .append("
") + .append(_("Add")).append(":" + + "
\n"); + return buf.toString(); + } } diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp new file mode 100644 index 000000000..dcbf1fe1e --- /dev/null +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -0,0 +1,74 @@ +<%@page contentType="text/html"%> +<%@page pageEncoding="UTF-8"%> + + + +<%@include file="css.jsi" %> +<%=intl.title("config summary bar")%> + + + + + +<%@include file="summary.jsi" %> +

<%=intl._("I2P Summary Bar Configuration")%>

+
+<%@include file="confignav.jsi" %> + + +<% formhandler.storeMethod(request.getMethod()); %> + +" /> + + +<% + String pageNonce = formhandler.getNewNonce(); +%> + +" /> + +

<%=intl._("Refresh Interval")%>

+
+ + + " > + <%=intl._("seconds")%> + " > +
+ +

<%=intl._("Use preset layout")%>

+

<%=intl._("Several preset layouts for the summary bar are available.")%> + <%=intl._("Note that choosing one of the presets will cause the current summary bar configuration to be lost.")%>

+
+
+ + + " > + " > +
+
+ +

<%=intl._("Customise Summary Bar")%>

+
+ + + +
+ " > + " > + " > + " > + " > +
+ +
From 3a75f8d7d13e52f866223a90a2a000c2be985840 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 7 Jun 2012 04:42:52 +0000 Subject: [PATCH 014/104] Modifying section addition to show an option list Also adding form handler class that I forgot to commit earlier. --- .../i2p/router/web/ConfigSummaryHandler.java | 135 ++++++++++++++++++ .../i2p/router/web/SummaryBarRenderer.java | 11 +- .../src/net/i2p/router/web/SummaryHelper.java | 41 ++++-- 3 files changed, 174 insertions(+), 13 deletions(-) create mode 100644 apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java new file mode 100644 index 000000000..0df3f3f91 --- /dev/null +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java @@ -0,0 +1,135 @@ +package net.i2p.router.web; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import net.i2p.data.DataHelper; + +/** + * Simple summary bar configuration. + * + * @since 0.9.1 + */ +public class ConfigSummaryHandler extends FormHandler { + + private Map _settings; + + @Override + protected void processForm() { + if (_action == null) return; + String group = getJettyString("group"); + boolean deleting = _action.equals(_("Delete selected")); + boolean adding = _action.equals(_("Add item")); + boolean saving = _action.equals(_("Save order")); + if (_action.equals(_("Save")) && "0".equals(group)) { + try { + int refreshInterval = Integer.parseInt(getJettyString("refreshInterval")); + if (refreshInterval >= CSSHelper.MIN_REFRESH) { + _context.router().saveConfig(CSSHelper.PROP_REFRESH, "" + refreshInterval); + addFormNotice(_("Refresh interval changed")); + } else + addFormError(_("Refresh interval must be at least {0} seconds", CSSHelper.MIN_REFRESH)); + } catch (java.lang.NumberFormatException e) { + addFormError(_("Refresh interval must be a number")); + return; + } + } else if ("1".equals(group)) { + if (_action.equals(_("Use full preset"))) { + _context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR, SummaryHelper.PRESET_FULL); + addFormNotice(_("Full summary bar preset selected.") + + _("Summary bar will refresh shortly.")); + } else if (_action.equals(_("Use reduced preset"))) { + _context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR, SummaryHelper.PRESET_SHORT); + addFormNotice(_("Reduced summary bar preset selected.") + + _("Summary bar will refresh shortly.")); + } else { + addFormError(_("Unsupported")); + } + } else if (adding || deleting || saving) { + Map sections = new TreeMap(); + for (Object o : _settings.keySet()) { + if (!(o instanceof String)) + continue; + String k = (String) o; + if (!k.startsWith("order_")) + continue; + String v = getJettyString(k); + k = k.substring(6); + k = k.substring(k.indexOf('_') + 1); + try { + int order = Integer.parseInt(v); + sections.put(order, k); + } catch (java.lang.NumberFormatException e) { + addFormError(_("Order must be an integer")); + return; + } + } + if (adding) { + String name = getJettyString("name"); + if (name == null || name.length() <= 0) { + addFormError(_("No section selected")); + return; + } + String order = getJettyString("order"); + if (order == null || order.length() <= 0) { + addFormError(_("No order entered")); + return; + } + name = DataHelper.escapeHTML(name).replace(",", ","); + order = DataHelper.escapeHTML(order).replace(",", ","); + try { + int ki = Integer.parseInt(order); + sections.put(ki, name); + addFormNotice(_("Added") + ": " + name); + } catch (java.lang.NumberFormatException e) { + addFormError(_("Order must be an integer")); + return; + } + } else if (deleting) { + Set toDelete = new HashSet(); + for (Object o : _settings.keySet()) { + if (!(o instanceof String)) + continue; + String k = (String) o; + if (!k.startsWith("delete_")) + continue; + k = k.substring(7); + try { + int ki = Integer.parseInt(k); + toDelete.add(ki); + } catch (java.lang.NumberFormatException e) { + continue; + } + } + for (Iterator iter = sections.keySet().iterator(); iter.hasNext(); ) { + int i = iter.next(); + if (toDelete.contains(i)) { + String removedName = sections.get(i); + iter.remove(); + addFormNotice(_("Removed") + ": " + removedName); + } + } + } + SummaryHelper.saveSummaryBarSections(_context, sections); + addFormError(_("Saved order of sections.") + + _("Summary bar will refresh shortly.")); + } else { + addFormError(_("Unsupported")); + } + } + + public void setSettings(Map settings) { _settings = new HashMap(settings); } + + /** curses Jetty for returning arrays */ + private String getJettyString(String key) { + String[] arr = (String[]) _settings.get(key); + if (arr == null) + return null; + return arr[0].trim(); + } +} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index 46a5185d1..d96e7a4c6 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.Writer; import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import net.i2p.data.DataHelper; @@ -40,6 +41,10 @@ public class SummaryBarRenderer { } ALL_SECTIONS = Collections.unmodifiableMap(aMap); }*/ + static final String ALL_SECTIONS[] = + {"HelpAndFAQ", "I2PServices", "I2PInternals", "General", "ShortGeneral", "NetworkReachability", + "UpdateStatus", "RestartStatus", "Peers", "FirewallAndReseedStatus", "Bandwidth", "Tunnels", + "Congestion", "TunnelStatus", "Destinations", "NewsHeadings" }; private final RouterContext _context; private final SummaryHelper _helper; @@ -55,8 +60,8 @@ public class SummaryBarRenderer { */ public void renderSummaryHTML(Writer out) throws IOException { StringBuilder buf = new StringBuilder(8*1024); - String[] sections = _helper.getSummaryBarSections(); - for (int i = 0; i < sections.length; i++) { + List sections = _helper.getSummaryBarSections(); + for (String section : sections) { // Commented out because broken. Replaced by if-elseif blob below. /*try { String section = (String)ALL_SECTIONS.get(sections[i]).invoke(this); @@ -68,8 +73,6 @@ public class SummaryBarRenderer { }*/ buf.setLength(0); - String section = sections[i]; - buf.append("
\n"); if ("HelpAndFAQ".equals(section)) buf.append(renderHelpAndFAQHTML()); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 713183247..6932ec38e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -4,11 +4,13 @@ import java.io.IOException; import java.text.Collator; import java.text.DecimalFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.TreeSet; import net.i2p.data.DataHelper; import net.i2p.data.Destination; @@ -745,9 +747,9 @@ public class SummaryHelper extends HelperBase { public void storeNewsHelper(NewsHelper n) { _newshelper = n; } public NewsHelper getNewsHelper() { return _newshelper; } - public String[] getSummaryBarSections() { + public List getSummaryBarSections() { String config = _context.getProperty(PROP_SUMMARYBAR, PRESET_FULL); - return config.split("" + S); + return Arrays.asList(config.split("" + S)); } static void saveSummaryBarSections(RouterContext ctx, Map sections) { @@ -782,8 +784,17 @@ public class SummaryHelper extends HelperBase { public String getRequestURI() { return _requestURI; } public String getConfigTable() { - String[] sections = getSummaryBarSections(); - StringBuilder buf = new StringBuilder(1024); + String[] allSections = SummaryBarRenderer.ALL_SECTIONS; + List sections = getSummaryBarSections(); + TreeSet sortedSections = new TreeSet(); + + for (int i = 0; i < allSections.length; i++) { + String section = allSections[i]; + if (!sections.contains(section)) + sortedSections.add(section); + } + + StringBuilder buf = new StringBuilder(2048); buf.append("\n"); - for (int i = 0; i < sections.length; i++) { + for (String section : sections) { + int i = sections.indexOf(section); buf.append("\n"); } buf.append("" + - ""); - buf.append("
") .append(_("Remove")) .append("") @@ -791,22 +802,34 @@ public class SummaryHelper extends HelperBase { .append("") .append(_("Name")) .append("
") - .append(sections[i]) + .append(section) .append("
") .append(_("Add")).append(":" + "
\n"); + "" + + "") + .append("\n"); return buf.toString(); } } From b00fbfa23d7fe9ed341c2a1f2e6494e58dd162fb Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 7 Jun 2012 10:26:44 +0000 Subject: [PATCH 015/104] Centre box for order of new section, and add default value --- .../java/src/net/i2p/router/web/SummaryHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 6932ec38e..055abcf98 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -816,7 +816,9 @@ public class SummaryHelper extends HelperBase { } buf.append("") .append(_("Add")).append(":" + - "" + + "" + "" + "" + - "").append(name) - .append("").append(urlify(homeURL, 35)) - .append("").append(name) + .append("").append(urlify(homeURL, 35)) + .append("" + - "" + - "").append(urlify(announceURL, 35)) + "").append(urlify(announceURL, 35)) .append("\n"); } - buf.append("") + buf.append("") .append(_("Add")).append(":" + - "" + - "" + - "" + - "" + - "\n" + - "\n" + + "" + + "" + + "" + + "" + + "\n" + + "\n" + "\n" + "\n" + "\n" + diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index 524e994b5..46ce800bf 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -876,3 +876,18 @@ code {; padding: 1px 0 0px !important; vertical-align: top; } + +div.routerdown { +} + +table.trackerconfig { +} + +input.trackername { +} + +input.trackerhome { +} + +input.trackerannounce { +} From 08d86019e47161e8e05d2aeceac5b95e27dc6f2e Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 5 Jul 2012 02:50:01 +0000 Subject: [PATCH 044/104] Uncommented input.default CSS (to hide extra Add button) in dark snark theme --- installer/resources/themes/snark/dark/snark.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index 46ce800bf..9e5009c9b 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -589,9 +589,11 @@ input[type=radio] { thead input[type=submit], tfoot input[type=submit], .headerpriority { text-align: right !important; } +*/ input.default { width: 1px; height: 1px; visibility: hidden; } +/* input.accept, input.accept:selected { background: #000; padding: 2px 3px 2px 16px !important; From 52742ceeca5a50acae4447c33908f59dea23a0af Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 5 Jul 2012 02:55:28 +0000 Subject: [PATCH 045/104] Moved "View or change bandwidth" link inline to tidy up vertical alignment --- .../java/src/org/klomp/snark/web/I2PSnarkServlet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 996a720d1..63c4ba96a 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -1560,9 +1560,9 @@ public class I2PSnarkServlet extends DefaultServlet { out.write(": KBps "); out.write(_("Half available bandwidth recommended.")); - out.write("
"); + out.write(" ["); out.write(_("View or change router bandwidth")); - out.write("

\n" + + out.write("]
\n" + ""); out.write(_("Use open trackers also")); From 3cc447c5f26d5831f529f87e61475b39e3e1f2d8 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 5 Jul 2012 11:36:10 +0000 Subject: [PATCH 046/104] Put icon/thumbnail for snark filemanager in separate td --- .../org/klomp/snark/web/I2PSnarkServlet.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) 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 63c4ba96a..cd39438d1 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -2121,7 +2121,7 @@ public class I2PSnarkServlet extends DefaultServlet { } // second row - dir info - buf.append("") + buf.append("") .append("\"\" ") .append(_("Directory")).append(": ").append(directory).append("") .append("\"\" ") @@ -2134,7 +2134,7 @@ public class I2PSnarkServlet extends DefaultServlet { .append("\"\" ") .append(_("Priority")).append(""); buf.append("\n"); - buf.append("\"\" ") .append(_("Up to higher level directory")).append("\n"); @@ -2153,8 +2153,7 @@ public class I2PSnarkServlet extends DefaultServlet { Resource item = r.addPath(ls[i]); String rowClass = (i % 2 == 0 ? "snarkTorrentEven" : "snarkTorrentOdd"); - buf.append(""); + buf.append(""); // Get completeness and status string boolean complete = false; @@ -2206,6 +2205,8 @@ public class I2PSnarkServlet extends DefaultServlet { path=URIUtil.addPaths(path,"/"); String icon = toIcon(item); + buf.append(""); if (complete) { buf.append(""); // thumbnail ? @@ -2213,16 +2214,17 @@ public class I2PSnarkServlet extends DefaultServlet { if (plc.endsWith(".jpg") || plc.endsWith(".jpeg") || plc.endsWith(".png") || plc.endsWith(".gif") || plc.endsWith(".ico")) { buf.append("\"\" "); + .append(path).append("\">"); } else { - buf.append(toImg(icon, _("Open"))).append(" "); + buf.append(toImg(icon, _("Open"))).append(""); } - buf.append(""); } else { - buf.append(toImg(icon)).append(' '); + buf.append(toImg(icon)); } + buf.append(""); + if (complete) + buf.append(""); buf.append(ls[i]); if (complete) buf.append(""); From c695a51883f1726d0643f4f86e65cf7d84ddebd4 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 5 Jul 2012 11:47:41 +0000 Subject: [PATCH 047/104] Tidy up layout of rendered HTML for one row of snark filemanager --- .../org/klomp/snark/web/I2PSnarkServlet.java | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) 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 cd39438d1..3d6c14fad 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -2121,23 +2121,31 @@ public class I2PSnarkServlet extends DefaultServlet { } // second row - dir info - buf.append("") - .append("\"\" ") - .append(_("Directory")).append(": ").append(directory).append("") - .append("\"\" ") - .append(_("Size")); - buf.append("") - .append("\"\" ") - .append(_("Status")).append(""); + buf.append("\n") + .append("") + .append("\"\" ") + .append(_("Directory")) + .append(": ") + .append(directory) + .append("\n"); + buf.append("") + .append("\"\" ") + .append(_("Size")) + .append("\n"); + buf.append("") + .append("\"\" ") + .append(_("Status")) + .append("\n"); if (showPriority) buf.append("") - .append("\"\" ") - .append(_("Priority")).append(""); + .append("\"\" ") + .append(_("Priority")).append("\n"); buf.append("\n"); buf.append("\"\" ") - .append(_("Up to higher level directory")).append("\n"); + .append(_("Up to higher level directory")) + .append("\n"); //DateFormat dfmt=DateFormat.getDateTimeInstance(DateFormat.MEDIUM, From ebcc3046427ec125739a60d4a476d8ca464c8f21 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 5 Jul 2012 11:49:36 +0000 Subject: [PATCH 048/104] Fixed a few colspans that were missed when adding icon/thumbnail td --- .../java/src/org/klomp/snark/web/I2PSnarkServlet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 3d6c14fad..e5788d3a1 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -2053,7 +2053,7 @@ public class I2PSnarkServlet extends DefaultServlet { if (snark != null) { // first row - torrent info // FIXME center - buf.append("
") + buf.append("
") .append(_("Torrent")).append(": ").append(snark.getBaseName()); int pieces = snark.getPieces(); double completion = (pieces - snark.getNeeded()) / (double) pieces; @@ -2269,7 +2269,7 @@ public class I2PSnarkServlet extends DefaultServlet { buf.append("\n"); } if (showSaveButton) { - buf.append("  \n"); } From 4a0319389bb186846f9e134ecb488bf77ddcc39d Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 5 Jul 2012 12:22:56 +0000 Subject: [PATCH 049/104] A few more newlines to improve HTML readability --- .../java/src/org/klomp/snark/web/I2PSnarkServlet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 e5788d3a1..7efb364b6 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -2049,7 +2049,7 @@ public class I2PSnarkServlet extends DefaultServlet { boolean showPriority = ls != null && snark != null && snark.getStorage() != null && !snark.getStorage().complete(); if (showPriority) buf.append("
\n"); - buf.append(""); + buf.append("
\n"); if (snark != null) { // first row - torrent info // FIXME center @@ -2106,13 +2106,13 @@ public class I2PSnarkServlet extends DefaultServlet { //buf.append("
").append(_("Maggot link")).append(": ") // .append(MAGGOT).append(hex).append(':').append(hex).append(""); buf.append("
").append(_("Torrent file")).append(": ").append(snark.getName()); - buf.append(""); + buf.append("\n"); } else { // shouldn't happen buf.append(""); + .append("\"\n"); } if (ls == null) { // We are only showing the torrent info section @@ -2140,7 +2140,7 @@ public class I2PSnarkServlet extends DefaultServlet { buf.append("\n"); - buf.append("\n"); + buf.append("\n\n"); buf.append("
Not found
resource=\"").append(r.toString()) .append("\"
base=\"").append(base) .append("\"
torrent=\"").append(torrentName) - .append("\"
") .append("\"\" ") .append(_("Priority")).append("
\"\" ") From ec805019774c20abec004b814d19b383e48a95c1 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 5 Jul 2012 13:01:00 +0000 Subject: [PATCH 050/104] Remaining size in snark filemanager reads GB instead of Gbyte etc (consistency) --- apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7efb364b6..bb12d6e88 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -2197,7 +2197,7 @@ public class I2PSnarkServlet extends DefaultServlet { status = toImg("clock_red"); status += " " + (100 * (length - remaining) / length) + "% " + _("complete") + - " (" + DataHelper.formatSize2(remaining) + _("bytes remaining") + ")"; + " (" + DataHelper.formatSize2(remaining) + "B " + _("remaining") + ")"; } } else { status = "Not a file?"; From 319d217dc18245211c2fa39b20ada017be54e3c3 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 5 Jul 2012 13:04:45 +0000 Subject: [PATCH 051/104] Slight simplification of class injection for iframed app pages --- apps/routerconsole/jsp/i2ptunnelmgr.jsp | 2 +- apps/routerconsole/jsp/torrents.jsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/routerconsole/jsp/i2ptunnelmgr.jsp b/apps/routerconsole/jsp/i2ptunnelmgr.jsp index edf14a74a..414464576 100644 --- a/apps/routerconsole/jsp/i2ptunnelmgr.jsp +++ b/apps/routerconsole/jsp/i2ptunnelmgr.jsp @@ -26,7 +26,7 @@ html = f.contentWindow.document.documentElement; f.style.height = body.scrollHeight + "px"; } - function injectClass(f) { f.contentWindow.document.getElementsByTagName('body')[0].setAttribute('class', 'iframed'); } + function injectClass(f) { f.contentWindow.document.body.setAttribute('class', 'iframed'); } function setupFrame() { f = document.getElementById("i2ptunnelframe"); resizeFrame(f); diff --git a/apps/routerconsole/jsp/torrents.jsp b/apps/routerconsole/jsp/torrents.jsp index fd6538698..c5a8de0d8 100644 --- a/apps/routerconsole/jsp/torrents.jsp +++ b/apps/routerconsole/jsp/torrents.jsp @@ -22,7 +22,7 @@ function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); } function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); } function resizeFrame(f) { f.style.height = f.contentWindow.document.body.scrollHeight + "px"; } - function injectClass(f) { f.contentWindow.document.getElementsByTagName('body')[0].setAttribute('class', 'iframed'); } + function injectClass(f) { f.contentWindow.document.body.setAttribute('class', 'iframed'); } function setupFrame() { f = document.getElementById("i2psnarkframe"); resizeFrame(f); From f41fde84710e88d58edafb51868153904f3b5bce Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 8 Jul 2012 12:05:17 +0000 Subject: [PATCH 052/104] Updates to dark snark theme from dr|z3d --- .../resources/themes/snark/dark/snark.css | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index 9e5009c9b..eb032a108 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -438,7 +438,7 @@ td:first-child { box-shadow: 0 1px 3px #000; } -div.newtorrentsection .snarkConfigTitle, div.addtorrentsection .snarkConfigTitle { +div.newtorrentsection .snarkConfigTitle, div.addtorrentsection .snarkConfigTitle, div.configsectionpanel .snarkConfigTitle { padding-top: 0 !important; } @@ -450,8 +450,8 @@ div.newtorrentsection .snarkConfigTitle, div.addtorrentsection .snarkConfigTitle .snarkConfig { font-size: 10pt; width: 100%; -} - +} + .page { color: #310; min-width: 700px !important; @@ -540,7 +540,7 @@ input[type=submit] { border: 1px outset #191; padding: 2px; box-shadow: 0 1px 1px 0 #119911 inset; - font: bold 8pt "Lucida Sans Unicode","Bitstream Vra Sans",Verdana,Tahoma,Helvetica,sans-serif; + font: bold 8pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif; margin-top: 6px; } @@ -853,6 +853,7 @@ code {; .snarknavbar { margin: -10px 0 5px 0 !important; padding: 14px 10px 7px; +/* border: 1px solid #101; -moz-border-radius: 0 0 8px 8px; -khtml-border-radius: 0 0 8px 8px; @@ -861,6 +862,7 @@ code {; -khtml-box-shadow: inset 0px 0px 1px 0px #002; box-shadow: inset 0px 0px 1px 0px #002; background: #000 url('../../console/dark/images/header.png') repeat-x scroll center center !important; +*/ background: #000 !important; text-transform: uppercase !important; letter-spacing: 0em !important; @@ -872,24 +874,41 @@ code {; text-align: center; } - .snarknavbar img { +.snarknavbar img { border: 0; margin: 1px -8px -1px -2px; padding: 1px 0 0px !important; vertical-align: top; } -div.routerdown { +.routerdown { + color: #ee9; } -table.trackerconfig { +.trackerconfig { + text-align: left !important; +} + +.trackerconfig th:nth-child(n+4), .trackerconfig th:nth-child(n+5), .trackerconfig td:nth-child(n+4), .trackerconfig td:nth-child(n+5) { + text-align: center !important; +} + +.trackerconfig th, .trackerconfig td, .trackerconfig th:last-child, .trackerconfig td:last-child { + text-align: left !important; +} + +.trackerconfig td:first-child { + text-align: right !important; } input.trackername { + width: 100px; } input.trackerhome { + width: 200px; } input.trackerannounce { + width: 230px; } From 78691ba344f8c0f611a3d1cffc283c77a86be51e Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 8 Jul 2012 12:07:54 +0000 Subject: [PATCH 053/104] Updates to dark console theme from dr|z3d --- installer/resources/themes/console/dark/default.css | 3 ++- installer/resources/themes/console/dark/i2ptunnel.css | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/installer/resources/themes/console/dark/default.css b/installer/resources/themes/console/dark/default.css index 8347936ea..e7373d407 100644 --- a/installer/resources/themes/console/dark/default.css +++ b/installer/resources/themes/console/dark/default.css @@ -176,7 +176,8 @@ hr { .control:link { color: #494 !important; - text-decoration: none; + text-decoration: none; + background: #000 !important; } .control:hover { diff --git a/installer/resources/themes/console/dark/i2ptunnel.css b/installer/resources/themes/console/dark/i2ptunnel.css index 42873d6e1..73fbd14f6 100644 --- a/installer/resources/themes/console/dark/i2ptunnel.css +++ b/installer/resources/themes/console/dark/i2ptunnel.css @@ -92,7 +92,8 @@ #tunnelListPage .footer .control { margin-left: 2px; - color: #494 !important; + color: #494 !important; + background: #000 !important; } #tunnelListPage .footer .control:hover { @@ -110,7 +111,8 @@ float: left; margin-top: 6px; margin-right: 5px; -} +} + /* Use Leary and Langridge content replacement methods (LIR) ** to embed accessibility information into the document. ** Should allow the lists to be rendered nicely by From fb629404c69b0d0fb7666005037b9b7c205e7586 Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 8 Jul 2012 21:35:49 +0000 Subject: [PATCH 054/104] Split torrent info and dir info on snark filemanager into two separate tables --- .../org/klomp/snark/web/I2PSnarkServlet.java | 94 +++++++++++++------ 1 file changed, 66 insertions(+), 28 deletions(-) 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 bb12d6e88..da1274c6f 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -2049,40 +2049,68 @@ public class I2PSnarkServlet extends DefaultServlet { boolean showPriority = ls != null && snark != null && snark.getStorage() != null && !snark.getStorage().complete(); if (showPriority) buf.append("\n"); - buf.append("\n"); if (snark != null) { - // first row - torrent info - // FIXME center - buf.append("
") - .append(_("Torrent")).append(": ").append(snark.getBaseName()); + // first table - torrent info + buf.append("\n"); + buf.append("\n"); int pieces = snark.getPieces(); double completion = (pieces - snark.getNeeded()) / (double) pieces; if (completion < 1.0) - buf.append("
").append(_("Completion")).append(": ").append((new DecimalFormat("0.00%")).format(completion)); + buf.append("\n"); else - buf.append("
").append(_("Complete")); + buf.append("\n"); // else unknown long needed = snark.getNeededLength(); if (needed > 0) - buf.append("
").append(_("Remaining")).append(": ").append(formatSize(needed)); - buf.append("
").append(_("Size")).append(": ").append(formatSize(snark.getTotalLength())); + buf.append("\n"); + buf.append("\n"); MetaInfo meta = snark.getMetaInfo(); if (meta != null) { List files = meta.getFiles(); int fileCount = files != null ? files.size() : 1; - buf.append("
").append(_("Files")).append(": ").append(fileCount); + buf.append("\n"); } - buf.append("
").append(_("Pieces")).append(": ").append(pieces); - buf.append("
").append(_("Piece size")).append(": ").append(formatSize(snark.getPieceLength(0))); + buf.append("\n"); + buf.append("\n"); if (meta != null) { String announce = meta.getAnnounce(); if (announce != null) { - buf.append("
"); + buf.append(""); } } String hex = I2PSnarkUtil.toHex(snark.getInfoHash()); if (meta == null || !meta.isPrivate()) { - buf.append("
").append(toImg("magnet", _("Magnet link"))).append(" \n"); } else { - buf.append("
").append(_("Private torrent")); + buf.append("
\n"); } // We don't have the hash of the torrent file - //buf.append("
").append(_("Maggot link")).append(":
") - // .append(MAGGOT).append(hex).append(':').append(hex).append(""); - buf.append("
").append(_("Torrent file")).append(": ").append(snark.getName()); - buf.append("\n"); + //buf.append(""); + buf.append("\n"); } else { // shouldn't happen buf.append("\n"); } + buf.append("
") + .append(_("Torrent")) + .append(":") + .append(snark.getBaseName()) + .append("
") + .append(_("Completion")) + .append(":") + .append((new DecimalFormat("0.00%")).format(completion)) + .append("
") + .append(_("Complete")) + .append("
") + .append(_("Remaining")) + .append(":") + .append(formatSize(needed)) + .append("
") + .append(_("Size")) + .append(":") + .append(formatSize(snark.getTotalLength())) + .append("
") + .append(_("Files")) + .append(":") + .append(fileCount) + .append("
") + .append(_("Pieces")) + .append(":") + .append(pieces) + .append("
") + .append(_("Piece size")) + .append(":") + .append(formatSize(snark.getPieceLength(0))) + .append("
"); String trackerLink = getTrackerLink(announce, snark.getInfoHash()); if (trackerLink != null) buf.append(trackerLink).append(' '); - buf.append(_("Tracker")).append(": "); + buf.append(_("Tracker")).append(":"); if (announce.startsWith("http://")) announce = announce.substring(7); int slsh = announce.indexOf('/'); @@ -2090,23 +2118,31 @@ public class I2PSnarkServlet extends DefaultServlet { announce = announce.substring(0, slsh); if (announce.length() > 67) announce = announce.substring(0, 40) + "…" + announce.substring(announce.length() - 8); - buf.append(announce); + buf.append(announce).append("
") + .append(toImg("magnet", _("Magnet link"))) + .append("") - .append(MAGNET_FULL).append(hex).append(""); + .append(MAGNET_FULL).append(hex).append("") + .append("
") + .append(_("Private torrent")) + .append("
").append(_("Maggot link")).append(":") + // .append(MAGGOT).append(hex).append(':').append(hex).append("
") + .append(_("Torrent file")) + .append(":") + .append(snark.getName()) + .append("
Not found
resource=\"").append(r.toString()) @@ -2114,13 +2150,15 @@ public class I2PSnarkServlet extends DefaultServlet { .append("\"
torrent=\"").append(torrentName) .append("\"
\n"); if (ls == null) { // We are only showing the torrent info section - buf.append("
"); + buf.append(""); return buf.toString(); } - // second row - dir info + // second table - dir info + buf.append("\n"); buf.append("\n") .append("\n"); } - buf.append("
") .append("\"\" ") @@ -2273,11 +2311,11 @@ public class I2PSnarkServlet extends DefaultServlet { buf.append(_("Save priorities")); buf.append("\" name=\"foo\" >
\n"); + buf.append("
\n"); if (showPriority) - buf.append("
"); - buf.append("
\n"); - + buf.append(""); + buf.append("
\n"); + return buf.toString(); } From bb39d9ddcf83c9cbf76f0147d6d5db30827d7475 Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 8 Jul 2012 22:11:05 +0000 Subject: [PATCH 055/104] Integrated summary bar preset buttons into main edit form as restore buttons --- .../i2p/router/web/ConfigSummaryHandler.java | 20 ++++++++----------- .../src/net/i2p/router/web/SummaryHelper.java | 8 ++++---- apps/routerconsole/jsp/configsidebar.jsp | 14 ++----------- 3 files changed, 14 insertions(+), 28 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java index f66880016..7fbe10cbc 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java @@ -38,18 +38,14 @@ public class ConfigSummaryHandler extends FormHandler { addFormError(_("Refresh interval must be a number")); return; } - } else if ("1".equals(group)) { - if (_action.equals(_("Use full preset"))) { - _context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", SummaryHelper.PRESET_FULL); - addFormNotice(_("Full summary bar preset selected.") + " " + - _("Summary bar will refresh shortly.")); - } else if (_action.equals(_("Use reduced preset"))) { - _context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", SummaryHelper.PRESET_SHORT); - addFormNotice(_("Reduced summary bar preset selected.") + " " + - _("Summary bar will refresh shortly.")); - } else { - addFormError(_("Unsupported")); - } + } else if (_action.equals(_("Restore full default"))) { + _context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", SummaryHelper.DEFAULT_FULL); + addFormNotice(_("Full summary bar default restored.") + " " + + _("Summary bar will refresh shortly.")); + } else if (_action.equals(_("Restore minimal default"))) { + _context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", SummaryHelper.DEFAULT_MINIMAL); + addFormNotice(_("Minimal summary bar default restored.") + " " + + _("Summary bar will refresh shortly.")); } else if (adding || deleting || saving) { Map sections = new TreeMap(); for (Object o : _settings.keySet()) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 4d631dbc3..e2345e3bf 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -42,7 +42,7 @@ public class SummaryHelper extends HelperBase { private static final char S = ','; static final String PROP_SUMMARYBAR = "routerconsole.summaryBar."; - static final String PRESET_FULL = + static final String DEFAULT_FULL = "HelpAndFAQ" + S + "I2PServices" + S + "I2PInternals" + S + @@ -59,7 +59,7 @@ public class SummaryHelper extends HelperBase { "Destinations" + S + ""; - static final String PRESET_SHORT = + static final String DEFAULT_MINIMAL = "ShortGeneral" + S + "NewsHeadings" + S + "UpdateStatus" + S + @@ -749,11 +749,11 @@ public class SummaryHelper extends HelperBase { public List getSummaryBarSections(String page) { String config = ""; if ("home".equals(page)) - config = _context.getProperty(PROP_SUMMARYBAR + page, PRESET_SHORT); + config = _context.getProperty(PROP_SUMMARYBAR + page, DEFAULT_MINIMAL); else config = _context.getProperty(PROP_SUMMARYBAR + page, null); if (config == null) - config = _context.getProperty(PROP_SUMMARYBAR + "default", PRESET_FULL); + config = _context.getProperty(PROP_SUMMARYBAR + "default", DEFAULT_FULL); return Arrays.asList(config.split("" + S)); } diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp index 5fece0558..3f219fb40 100644 --- a/apps/routerconsole/jsp/configsidebar.jsp +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -46,18 +46,6 @@ input.default { " > -

<%=intl._("Use preset layout")%>

-

<%=intl._("Several preset layouts for the summary bar are available.")%> - <%=intl._("Note that choosing one of the presets will cause the current summary bar configuration to be lost.")%>

-
-
- - - " > - " > -
-
-

<%=intl._("Customise Summary Bar")%>

@@ -65,6 +53,8 @@ input.default {
" > + " > + " > " > " > " > From 75046d11fb803746542ba08d6955e736ecd96e55 Mon Sep 17 00:00:00 2001 From: str4d Date: Mon, 9 Jul 2012 00:39:52 +0000 Subject: [PATCH 056/104] Separated disabling of iframe refresh from the refresh time --- .../src/net/i2p/router/web/CSSHelper.java | 20 +++++++++++++++++++ apps/routerconsole/jsp/summary.jsi | 6 ++++-- apps/routerconsole/jsp/summaryframe.jsp | 5 +++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java index aa2315a72..130af3c9d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java @@ -20,6 +20,7 @@ public class CSSHelper extends HelperBase { public static final String PROP_REFRESH = "routerconsole.summaryRefresh"; public static final String DEFAULT_REFRESH = "60"; public static final int MIN_REFRESH = 3; + public static final String PROP_DISABLE_REFRESH = "routerconsole.summaryDisableRefresh"; private static final String PROP_XFRAME = "routerconsole.disableXFrame"; public String getTheme(String userAgent) { @@ -90,6 +91,25 @@ public class CSSHelper extends HelperBase { return r; } + /** + * change disable refresh boolean and save it + * @since 0.9.1 + */ + public void setDisableRefresh(String r) { + String disableRefresh = "false"; + if ("0".equals(r)) + disableRefresh = "true"; + _context.router().saveConfig(PROP_DISABLE_REFRESH, disableRefresh); + } + + /** + * @return true if refresh is disabled + * @since 0.9.1 + */ + public boolean getDisableRefresh() { + return _context.getBooleanProperty(PROP_DISABLE_REFRESH); + } + /** translate the title and display consistently */ public String title(String s) { StringBuilder buf = new StringBuilder(128); diff --git a/apps/routerconsole/jsp/summary.jsi b/apps/routerconsole/jsp/summary.jsi index 0eb9d77b0..6a388b817 100644 --- a/apps/routerconsole/jsp/summary.jsi +++ b/apps/routerconsole/jsp/summary.jsi @@ -20,8 +20,10 @@ d = net.i2p.data.DataHelper.stripHTML(d); // XSS // pass the new delay parameter to the iframe newDelay = "?refresh=" + d; + // update disable boolean + intl.setDisableRefresh(d); } - if (!"0".equals(d)) + if (!intl.getDisableRefresh()) out.print("\n"); } else if (allowIFrame) { // since we don't have an iframe this will reload the base page, and diff --git a/apps/routerconsole/jsp/summaryframe.jsp b/apps/routerconsole/jsp/summaryframe.jsp index 218e78ba6..4af6be78f 100644 --- a/apps/routerconsole/jsp/summaryframe.jsp +++ b/apps/routerconsole/jsp/summaryframe.jsp @@ -26,10 +26,11 @@ } else { d = net.i2p.data.DataHelper.stripHTML(d); // XSS intl.setRefresh(d); + intl.setDisableRefresh(d); } // we probably don't get here if d == "0" since caught in summary.jsi, but just // to be sure... - if (!"0".equals(d)) { + if (!intl.getDisableRefresh()) { // doesn't work for restart or shutdown with no expl. tunnels, // since the call to ConfigRestartBean.renderStatus() hasn't happened yet... // So we delay slightly @@ -64,7 +65,7 @@ // d and shutdownSoon defined above if (!shutdownSoon) { out.print("
\n
\n"); - if ("0".equals(d)) { + if (intl.getDisableRefresh()) { out.print(""); out.print(intl._("Refresh (s)")); out.print(": \n"); From c9fc3f11a67cb319b7678f892bc9de34aed430d4 Mon Sep 17 00:00:00 2001 From: str4d Date: Mon, 9 Jul 2012 07:59:41 +0000 Subject: [PATCH 057/104] Replaced text fields for ordering summary bar with movement buttons (CSS styling needed) --- .../i2p/router/web/ConfigSummaryHandler.java | 33 ++++++++++++++++++- .../src/net/i2p/router/web/SummaryHelper.java | 29 ++++++++++++++-- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java index 7fbe10cbc..3ad7c1c20 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java @@ -26,6 +26,10 @@ public class ConfigSummaryHandler extends FormHandler { boolean deleting = _action.equals(_("Delete selected")); boolean adding = _action.equals(_("Add item")); boolean saving = _action.equals(_("Save order")); + boolean movingTop = _action.substring(_action.indexOf(' ') + 1).equals(_("Top")); + boolean movingUp = _action.substring(_action.indexOf(' ') + 1).equals(_("Up")); + boolean movingDown = _action.substring(_action.indexOf(' ') + 1).equals(_("Down")); + boolean movingBottom = _action.substring(_action.indexOf(' ') + 1).equals(_("Bottom")); if (_action.equals(_("Save")) && "0".equals(group)) { try { int refreshInterval = Integer.parseInt(getJettyString("refreshInterval")); @@ -46,7 +50,8 @@ public class ConfigSummaryHandler extends FormHandler { _context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", SummaryHelper.DEFAULT_MINIMAL); addFormNotice(_("Minimal summary bar default restored.") + " " + _("Summary bar will refresh shortly.")); - } else if (adding || deleting || saving) { + } else if (adding || deleting || saving || + movingTop || movingUp || movingDown || movingBottom) { Map sections = new TreeMap(); for (Object o : _settings.keySet()) { if (!(o instanceof String)) @@ -110,6 +115,32 @@ public class ConfigSummaryHandler extends FormHandler { addFormNotice(_("Removed") + ": " + removedName); } } + } else if (movingTop || movingUp || movingDown || movingBottom) { + int start = _action.indexOf('['); + int end = _action.indexOf(']'); + String fromStr = _action.substring(start + 1, end - start); + try { + int from = Integer.parseInt(fromStr); + int to = 0; + if (movingUp) + to = from - 1; + if (movingDown) + to = from + 1; + if (movingBottom) + to = sections.size() - 1; + int n = -1; + if (movingDown || movingBottom) + n = 1; + for (int i = from; n * i < n * to; i += n) { + String temp = sections.get(i + n); + sections.put(i + n, sections.get(i)); + sections.put(i, temp); + } + addFormNotice(_("Moved") + ": " + sections.get(to)); + } catch (java.lang.NumberFormatException e) { + addFormError(_("Order must be an integer")); + return; + } } SummaryHelper.saveSummaryBarSections(_context, "default", sections); addFormError(_("Saved order of sections.") + " " + diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index e2345e3bf..08809cad4 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -811,11 +811,36 @@ public class SummaryHelper extends HelperBase { int i = sections.indexOf(section); buf.append("") + .append("\">"); + if (i > 0) { + buf.append(""); + buf.append(""); + } + if (i < sections.size() - 1) { + buf.append(""); + buf.append(""); + } + buf.append("") .append(section) .append("\n"); } From 9c7f9a935bbefc54e3002ea55f15ad9a86513e34 Mon Sep 17 00:00:00 2001 From: str4d Date: Mon, 9 Jul 2012 20:35:58 +0000 Subject: [PATCH 058/104] Only add new summary bar sections to the bottom --- .../java/src/net/i2p/router/web/SummaryHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 08809cad4..79d323350 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -846,7 +846,7 @@ public class SummaryHelper extends HelperBase { } buf.append("") .append(_("Add")).append(":" + - "" + "" + From 8d9909acfb82ee6d8d823ed040125a215aedb784 Mon Sep 17 00:00:00 2001 From: str4d Date: Mon, 9 Jul 2012 21:17:02 +0000 Subject: [PATCH 059/104] To improve themability, make torrent info table in snark filemanager a single column --- .../org/klomp/snark/web/I2PSnarkServlet.java | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) 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 da1274c6f..e369408f7 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -2054,63 +2054,63 @@ public class I2PSnarkServlet extends DefaultServlet { buf.append("\n"); buf.append("\n"); + .append("\n"); int pieces = snark.getPieces(); double completion = (pieces - snark.getNeeded()) / (double) pieces; if (completion < 1.0) - buf.append("\n"); else - buf.append("\n"); // else unknown long needed = snark.getNeededLength(); if (needed > 0) - buf.append("\n"); - buf.append("\n"); MetaInfo meta = snark.getMetaInfo(); if (meta != null) { List files = meta.getFiles(); int fileCount = files != null ? files.size() : 1; - buf.append("\n"); } - buf.append("\n"); - buf.append("\n"); if (meta != null) { String announce = meta.getAnnounce(); if (announce != null) { - buf.append("\n"); } else { - buf.append("\n"); } // We don't have the hash of the torrent file - //buf.append(""); - buf.append("\n"); } else { From 42565f19fc22a94aa93bd59dd058ec359b0b2328 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 11:42:20 +0000 Subject: [PATCH 060/104] Use image buttons for ordering summary bar sections (images courtesy of dr|z3d) --- .../i2p/router/web/ConfigSummaryHandler.java | 36 ++++++++++-------- .../src/net/i2p/router/web/SummaryHelper.java | 27 +++++++------ apps/routerconsole/jsp/configsidebar.jsp | 3 ++ .../console/classic/images/move_bottom.png | Bin 0 -> 326 bytes .../console/classic/images/move_down.png | Bin 0 -> 325 bytes .../console/classic/images/move_top.png | Bin 0 -> 325 bytes .../themes/console/classic/images/move_up.png | Bin 0 -> 290 bytes .../resources/themes/console/dark/console.css | 4 ++ .../console/dark/images/move_bottom.png | Bin 0 -> 497 bytes .../themes/console/dark/images/move_down.png | Bin 0 -> 498 bytes .../themes/console/dark/images/move_top.png | Bin 0 -> 519 bytes .../themes/console/dark/images/move_up.png | Bin 0 -> 452 bytes .../console/light/images/move_bottom.png | Bin 0 -> 326 bytes .../themes/console/light/images/move_down.png | Bin 0 -> 325 bytes .../themes/console/light/images/move_top.png | Bin 0 -> 325 bytes .../themes/console/light/images/move_up.png | Bin 0 -> 290 bytes .../console/midnight/images/move_bottom.png | Bin 0 -> 497 bytes .../console/midnight/images/move_down.png | Bin 0 -> 498 bytes .../console/midnight/images/move_top.png | Bin 0 -> 519 bytes .../console/midnight/images/move_up.png | Bin 0 -> 452 bytes 20 files changed, 43 insertions(+), 27 deletions(-) create mode 100644 installer/resources/themes/console/classic/images/move_bottom.png create mode 100644 installer/resources/themes/console/classic/images/move_down.png create mode 100644 installer/resources/themes/console/classic/images/move_top.png create mode 100644 installer/resources/themes/console/classic/images/move_up.png create mode 100644 installer/resources/themes/console/dark/images/move_bottom.png create mode 100644 installer/resources/themes/console/dark/images/move_down.png create mode 100644 installer/resources/themes/console/dark/images/move_top.png create mode 100644 installer/resources/themes/console/dark/images/move_up.png create mode 100644 installer/resources/themes/console/light/images/move_bottom.png create mode 100644 installer/resources/themes/console/light/images/move_down.png create mode 100644 installer/resources/themes/console/light/images/move_top.png create mode 100644 installer/resources/themes/console/light/images/move_up.png create mode 100644 installer/resources/themes/console/midnight/images/move_bottom.png create mode 100644 installer/resources/themes/console/midnight/images/move_down.png create mode 100644 installer/resources/themes/console/midnight/images/move_top.png create mode 100644 installer/resources/themes/console/midnight/images/move_up.png diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java index 3ad7c1c20..92228d4bf 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java @@ -26,10 +26,7 @@ public class ConfigSummaryHandler extends FormHandler { boolean deleting = _action.equals(_("Delete selected")); boolean adding = _action.equals(_("Add item")); boolean saving = _action.equals(_("Save order")); - boolean movingTop = _action.substring(_action.indexOf(' ') + 1).equals(_("Top")); - boolean movingUp = _action.substring(_action.indexOf(' ') + 1).equals(_("Up")); - boolean movingDown = _action.substring(_action.indexOf(' ') + 1).equals(_("Down")); - boolean movingBottom = _action.substring(_action.indexOf(' ') + 1).equals(_("Bottom")); + boolean moving = _action.startsWith("move_"); if (_action.equals(_("Save")) && "0".equals(group)) { try { int refreshInterval = Integer.parseInt(getJettyString("refreshInterval")); @@ -50,8 +47,7 @@ public class ConfigSummaryHandler extends FormHandler { _context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", SummaryHelper.DEFAULT_MINIMAL); addFormNotice(_("Minimal summary bar default restored.") + " " + _("Summary bar will refresh shortly.")); - } else if (adding || deleting || saving || - movingTop || movingUp || movingDown || movingBottom) { + } else if (adding || deleting || saving || moving) { Map sections = new TreeMap(); for (Object o : _settings.keySet()) { if (!(o instanceof String)) @@ -115,21 +111,19 @@ public class ConfigSummaryHandler extends FormHandler { addFormNotice(_("Removed") + ": " + removedName); } } - } else if (movingTop || movingUp || movingDown || movingBottom) { - int start = _action.indexOf('['); - int end = _action.indexOf(']'); - String fromStr = _action.substring(start + 1, end - start); + } else if (moving) { + String parts[] = _action.split("_"); try { - int from = Integer.parseInt(fromStr); + int from = Integer.parseInt(parts[1]); int to = 0; - if (movingUp) + if ("up".equals(parts[2])) to = from - 1; - if (movingDown) + if ("down".equals(parts[2])) to = from + 1; - if (movingBottom) + if ("bottom".equals(parts[2])) to = sections.size() - 1; int n = -1; - if (movingDown || movingBottom) + if ("down".equals(parts[2]) || "bottom".equals(parts[2])) n = 1; for (int i = from; n * i < n * to; i += n) { String temp = sections.get(i + n); @@ -159,4 +153,16 @@ public class ConfigSummaryHandler extends FormHandler { return null; return arr[0].trim(); } + + public void setMovingAction() { + for (Object o : _settings.keySet()) { + if (!(o instanceof String)) + continue; + String k = (String) o; + if (k.startsWith("move_") && k.endsWith(".x") && _settings.get(k) != null) { + _action = k.substring(0, k.length() - 2); + break; + } + } + } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 79d323350..3adcf38cd 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -799,6 +799,9 @@ public class SummaryHelper extends HelperBase { sortedSections.add(section); } + String theme = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME); + String imgPath = CSSHelper.BASE_THEME_PATH + theme + "/images/"; + StringBuilder buf = new StringBuilder(2048); buf.append("
") .append(_("Torrent")) - .append(":") + .append(": ") .append(snark.getBaseName()) - .append("
") + buf.append("
") .append(_("Completion")) - .append(":") + .append(": ") .append((new DecimalFormat("0.00%")).format(completion)) .append("
") + buf.append("
") .append(_("Complete")) .append("
") + buf.append("
") .append(_("Remaining")) - .append(":") + .append(": ") .append(formatSize(needed)) .append("
") + buf.append("
") .append(_("Size")) - .append(":") + .append(": ") .append(formatSize(snark.getTotalLength())) .append("
") + buf.append("
") .append(_("Files")) - .append(":") + .append(": ") .append(fileCount) .append("
") + buf.append("
") .append(_("Pieces")) - .append(":") + .append(": ") .append(pieces) .append("
") + buf.append("
") .append(_("Piece size")) - .append(":") + .append(": ") .append(formatSize(snark.getPieceLength(0))) .append("
"); + buf.append("
"); String trackerLink = getTrackerLink(announce, snark.getInfoHash()); if (trackerLink != null) buf.append(trackerLink).append(' '); - buf.append(_("Tracker")).append(":"); + buf.append(_("Tracker")).append(": "); if (announce.startsWith("http://")) announce = announce.substring(7); int slsh = announce.indexOf('/'); @@ -2124,23 +2124,23 @@ public class I2PSnarkServlet extends DefaultServlet { String hex = I2PSnarkUtil.toHex(snark.getInfoHash()); if (meta == null || !meta.isPrivate()) { - buf.append("
") + buf.append("
") .append(toImg("magnet", _("Magnet link"))) - .append("") .append(MAGNET_FULL).append(hex).append("") .append("
") + buf.append("
") .append(_("Private torrent")) .append("
").append(_("Maggot link")).append(":") + //buf.append("
").append(_("Maggot link")).append(": ") // .append(MAGGOT).append(hex).append(':').append(hex).append("
") + buf.append("
") .append(_("Torrent file")) - .append(":") + .append(": ") .append(snark.getName()) .append("
") .append(_("Remove")) @@ -817,28 +820,28 @@ public class SummaryHelper extends HelperBase { .append(i) .append("\">"); if (i > 0) { - buf.append(""); - buf.append(""); + buf.append(""); + .append("\" src=\"" + imgPath + "move_up.png\">"); } if (i < sections.size() - 1) { - buf.append(""); - buf.append(""); + buf.append(""); + .append("\" src=\"" + imgPath + "move_bottom.png\">"); } buf.append("") .append(section) diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp index 3f219fb40..cbb270d4f 100644 --- a/apps/routerconsole/jsp/configsidebar.jsp +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -30,6 +30,9 @@ input.default { " /> +<% + formhandler.setMovingAction(); +%> <% String pageNonce = formhandler.getNewNonce(); diff --git a/installer/resources/themes/console/classic/images/move_bottom.png b/installer/resources/themes/console/classic/images/move_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..577ae3352199ef87736c59ec1a137aa5165a4961 GIT binary patch literal 326 zcmV-M0lEH(P)pF_(?=TR5*=|(lJT{K@`UEp9*4OB?N?RJwWc^0R(T51EjUK@eUS( zot?d4k!u7YU>)2@Hfv&$5oX7?s~=4B=9~X~Z{9$IU9qP6H4Xd?JfST%K2ZgbD(&Uo zHZfda6M!BA&_e*)BnG$(TKvK|gN#$HZ0RpF_en%SR5*>D(>+Qo zNH?98-fx`4W_qbXX94Im0KJz*Pg*MV3P>*~IK_S)`KvO0U|e{{X|MF$qEp8{##4}L z7lR;8gYBSw>v*h^HMmQwsrD}-NY-J3)h*U7%?&ux8XoXceOR}2un3a1hvx;Ld%=Js zb#Q}8OPZZ!AXx*v2B6V@AX!(qHb3-@RX}~So11^?qg5bTBeQ!ovE+c;v}M*(|1aY& XgZ+fDxsXG{00000NkvXXu0mjf;#`J! literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/classic/images/move_top.png b/installer/resources/themes/console/classic/images/move_top.png new file mode 100644 index 0000000000000000000000000000000000000000..55192cf79bd3ce5bb58ab0323eed2d3f05b2bab7 GIT binary patch literal 325 zcmV-L0lNN)P)pF_en%SR5*>5(mhH8Q51&ZM+LD62!bFCSh;}gBMWd1E+DN7a1Vlo zU?JGq3RYP}8W99b5ho@?Of0;Co0&72_`zw;J>Sduxvc9DQ!G2;2gkW_w+7lzk!xkn zwWBM60w?I<5eF$h#Qs3o^hwFxJ8IR2ym!;~Hpz*A$By=p}g?xZe*M>*)KrJMXZ(KV~&1*e(|{>EJ}{%v}zFa8YfTR_ndE?Phjf{~UO29TA8L4EZL Xwg-;nhc4HW00000NkvXXu0mjf(6)lH literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/classic/images/move_up.png b/installer/resources/themes/console/classic/images/move_up.png new file mode 100644 index 0000000000000000000000000000000000000000..e512dbdc2d1682d38bd58edaa248aff3cbde7863 GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9Q!3HFy+4N(86lZ})WHAE+-(e7DJf6QI1t@sM z)5S5wqIc;eN3Ny>f!6)Z70e5bcku3UzhHaE?eq&7#|i9$Sr^waZxQ)EbJ^C6x*2uH zx72(PJNN&Y;bR+#V}2H#h95+Z1^4thDBJwc-o%n+8mPNp>lr! literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index a08bce064..827d3a6b7 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -923,6 +923,10 @@ input[type=text]:active, input[type=text]:hover { background: #000; } +input[type=image] { + min-width: 0; +} + fieldset { overflow: hidden; position: relative; diff --git a/installer/resources/themes/console/dark/images/move_bottom.png b/installer/resources/themes/console/dark/images/move_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..349fe2d5046056bb6e6f3082b2ef063268bcfeb9 GIT binary patch literal 497 zcmVpGqe(biab;B2Uo+?b?ulHJgdbXrwakwU7fDkPmIkWSLMx%&)&5))?jCIy+Rv9EQGMw0ZGc5rujxPNXoV{fY?8W zZGAuBnCJQ3?V_$b^yaa&J9kMFNt2{0Bpna8y|;q8uD<}d2jFJv^=D1;Yo6!#cjlE= zNqP$4;4csWIB@spskjFUAzYCB2w*h=SpoPELb&)Z2mrdSJHg1c0npuFj(sxpGq)9|UR5*==P(N!FK^%Q=_6!jug~f&0-Dw2-d;&j$r67_Ikj}<~ z0|f~oV6;;S*xA_HSjA2(t*w>a->L{UiYB@2Jexb2o9x9`&Ai`l-k)LDb*GXpVHuOE zsvctiW_Az2LCTTrU5xPvK%WjI?KVwQ>0$IroTU zPS5(jzw5mB9|61saGVU+N#1JPc56YjZM#MCHh}fC63Iyj!5jd@7#{!_E#-~zjO1bR z=rG23mZkaZy?>6hl9?R<*a2`Q)g!qrsR!^1fJ`T&{x~^|7-v4t5A^ae@58zMYN=ciNHd9kcCz5v3j%iekMx$qveggQN{LLE4 zwX~9RZW=pGxk*GpR5*=|Q$34QQ52jxcZo49q}}-P)JCurZM4xJkOd1XYeCpv z(JIA)ji6ZQKkx_G_#3Pgn^Y2;eK(j0HVQ7AyfZd0*_)f};(^mkbFa~Z7Y&fl2as}kp#(iqtU3f0Tg3=Ea{4*kOBdC+PoEzq#)^1 zx7&TR0tbNEY__{tEGkLebS08silVsF5Pgz#ljKST$=`KdUoFe>mjS?hJ|DV!XKiP* z9Z3fX@PV1F9k9E%&FnbH`7YqQ$06r8&@h}~XF}?@z0H@yu0BU!?ZUA0o z2163u{Ry&g_h-`josxu^y)*##GlM~Lxa}L1Wf@5hGtxkE{~tq%zBfM=p>hBK002ov JPDHLkV1kir+j0N^ literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/dark/images/move_up.png b/installer/resources/themes/console/dark/images/move_up.png new file mode 100644 index 0000000000000000000000000000000000000000..937e4266fea11848e0ea610f4f9a686e29d3626d GIT binary patch literal 452 zcmV;#0XzPQP)pGc1c7*R5*=|ld)^20ReKmWPs=llZ~RE+UB#&~=Y zPurS(-#@Ya1whi%$z<|%6E|!Vvi$)VfWh|1ZQPAQec!(X9*mp-+#j*EwRW}ne11Kp z^b@#Uw0_rhz1K9&*`*vU7K_)mcT3#%?sB<&dnre=*{lsA`~a@58?c>h-|f0CZgo^u z)e%sw69JHpF_(?=TR5*=|(lJT{K@`UEp9*4OB?N?RJwWc^0R(T51EjUK@eUS( zot?d4k!u7YU>)2@Hfv&$5oX7?s~=4B=9~X~Z{9$IU9qP6H4Xd?JfST%K2ZgbD(&Uo zHZfda6M!BA&_e*)BnG$(TKvK|gN#$HZ0RpF_en%SR5*>D(>+Qo zNH?98-fx`4W_qbXX94Im0KJz*Pg*MV3P>*~IK_S)`KvO0U|e{{X|MF$qEp8{##4}L z7lR;8gYBSw>v*h^HMmQwsrD}-NY-J3)h*U7%?&ux8XoXceOR}2un3a1hvx;Ld%=Js zb#Q}8OPZZ!AXx*v2B6V@AX!(qHb3-@RX}~So11^?qg5bTBeQ!ovE+c;v}M*(|1aY& XgZ+fDxsXG{00000NkvXXu0mjf;#`J! literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/light/images/move_top.png b/installer/resources/themes/console/light/images/move_top.png new file mode 100644 index 0000000000000000000000000000000000000000..55192cf79bd3ce5bb58ab0323eed2d3f05b2bab7 GIT binary patch literal 325 zcmV-L0lNN)P)pF_en%SR5*>5(mhH8Q51&ZM+LD62!bFCSh;}gBMWd1E+DN7a1Vlo zU?JGq3RYP}8W99b5ho@?Of0;Co0&72_`zw;J>Sduxvc9DQ!G2;2gkW_w+7lzk!xkn zwWBM60w?I<5eF$h#Qs3o^hwFxJ8IR2ym!;~Hpz*A$By=p}g?xZe*M>*)KrJMXZ(KV~&1*e(|{>EJ}{%v}zFa8YfTR_ndE?Phjf{~UO29TA8L4EZL Xwg-;nhc4HW00000NkvXXu0mjf(6)lH literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/light/images/move_up.png b/installer/resources/themes/console/light/images/move_up.png new file mode 100644 index 0000000000000000000000000000000000000000..e512dbdc2d1682d38bd58edaa248aff3cbde7863 GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9Q!3HFy+4N(86lZ})WHAE+-(e7DJf6QI1t@sM z)5S5wqIc;eN3Ny>f!6)Z70e5bcku3UzhHaE?eq&7#|i9$Sr^waZxQ)EbJ^C6x*2uH zx72(PJNN&Y;bR+#V}2H#h95+Z1^4thDBJwc-o%n+8mPNp>lr! literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/midnight/images/move_bottom.png b/installer/resources/themes/console/midnight/images/move_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..349fe2d5046056bb6e6f3082b2ef063268bcfeb9 GIT binary patch literal 497 zcmVpGqe(biab;B2Uo+?b?ulHJgdbXrwakwU7fDkPmIkWSLMx%&)&5))?jCIy+Rv9EQGMw0ZGc5rujxPNXoV{fY?8W zZGAuBnCJQ3?V_$b^yaa&J9kMFNt2{0Bpna8y|;q8uD<}d2jFJv^=D1;Yo6!#cjlE= zNqP$4;4csWIB@spskjFUAzYCB2w*h=SpoPELb&)Z2mrdSJHg1c0npuFj(sxpGq)9|UR5*==P(N!FK^%Q=_6!jug~f&0-Dw2-d;&j$r67_Ikj}<~ z0|f~oV6;;S*xA_HSjA2(t*w>a->L{UiYB@2Jexb2o9x9`&Ai`l-k)LDb*GXpVHuOE zsvctiW_Az2LCTTrU5xPvK%WjI?KVwQ>0$IroTU zPS5(jzw5mB9|61saGVU+N#1JPc56YjZM#MCHh}fC63Iyj!5jd@7#{!_E#-~zjO1bR z=rG23mZkaZy?>6hl9?R<*a2`Q)g!qrsR!^1fJ`T&{x~^|7-v4t5A^ae@58zMYN=ciNHd9kcCz5v3j%iekMx$qveggQN{LLE4 zwX~9RZW=pGxk*GpR5*=|Q$34QQ52jxcZo49q}}-P)JCurZM4xJkOd1XYeCpv z(JIA)ji6ZQKkx_G_#3Pgn^Y2;eK(j0HVQ7AyfZd0*_)f};(^mkbFa~Z7Y&fl2as}kp#(iqtU3f0Tg3=Ea{4*kOBdC+PoEzq#)^1 zx7&TR0tbNEY__{tEGkLebS08silVsF5Pgz#ljKST$=`KdUoFe>mjS?hJ|DV!XKiP* z9Z3fX@PV1F9k9E%&FnbH`7YqQ$06r8&@h}~XF}?@z0H@yu0BU!?ZUA0o z2163u{Ry&g_h-`josxu^y)*##GlM~Lxa}L1Wf@5hGtxkE{~tq%zBfM=p>hBK002ov JPDHLkV1kir+j0N^ literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/midnight/images/move_up.png b/installer/resources/themes/console/midnight/images/move_up.png new file mode 100644 index 0000000000000000000000000000000000000000..937e4266fea11848e0ea610f4f9a686e29d3626d GIT binary patch literal 452 zcmV;#0XzPQP)pGc1c7*R5*=|ld)^20ReKmWPs=llZ~RE+UB#&~=Y zPurS(-#@Ya1whi%$z<|%6E|!Vvi$)VfWh|1ZQPAQec!(X9*mp-+#j*EwRW}ne11Kp z^b@#Uw0_rhz1K9&*`*vU7K_)mcT3#%?sB<&dnre=*{lsA`~a@58?c>h-|f0CZgo^u z)e%sw69JH Date: Tue, 10 Jul 2012 11:57:40 +0000 Subject: [PATCH 061/104] Added extra column to keep ordering buttons in line --- .../java/src/net/i2p/router/web/SummaryHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 3adcf38cd..ba7b59525 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -805,7 +805,7 @@ public class SummaryHelper extends HelperBase { StringBuilder buf = new StringBuilder(2048); buf.append("" + "
") .append(_("Remove")) - .append("") + .append("") .append(_("Order")) .append("") .append(_("Name")) @@ -814,7 +814,7 @@ public class SummaryHelper extends HelperBase { int i = sections.indexOf(section); buf.append("
"); } + buf.append(""); if (i < sections.size() - 1) { buf.append("") .append(_("Add")).append(":" + - "" + From ebc4d53fa9f91d1dee0c5bcf7cabadad277e9045 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 12:05:07 +0000 Subject: [PATCH 062/104] Corrected output of message to notice instead of error on summary bar config page --- .../java/src/net/i2p/router/web/ConfigSummaryHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java index 92228d4bf..7d5c26776 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigSummaryHandler.java @@ -137,8 +137,8 @@ public class ConfigSummaryHandler extends FormHandler { } } SummaryHelper.saveSummaryBarSections(_context, "default", sections); - addFormError(_("Saved order of sections.") + " " + - _("Summary bar will refresh shortly.")); + addFormNotice(_("Saved order of sections.") + " " + + _("Summary bar will refresh shortly.")); } else { addFormError(_("Unsupported")); } From 709c75c51712b9e6edf145179e693ae0203c3de3 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 19:03:48 +0000 Subject: [PATCH 063/104] Reordered torrent info section in snark filemanager - reduced to 4 info lines --- .../org/klomp/snark/web/I2PSnarkServlet.java | 98 +++++++++---------- 1 file changed, 48 insertions(+), 50 deletions(-) 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 e369408f7..3907b9587 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -2052,57 +2052,20 @@ public class I2PSnarkServlet extends DefaultServlet { if (snark != null) { // first table - torrent info buf.append("\n"); - buf.append("\n"); - int pieces = snark.getPieces(); - double completion = (pieces - snark.getNeeded()) / (double) pieces; - if (completion < 1.0) - buf.append("\n"); - else - buf.append("\n"); - // else unknown - long needed = snark.getNeededLength(); - if (needed > 0) - buf.append("\n"); + buf.append("\n"); - MetaInfo meta = snark.getMetaInfo(); - if (meta != null) { - List files = meta.getFiles(); - int fileCount = files != null ? files.size() : 1; - buf.append("\n"); - } - buf.append("\n"); - buf.append("\n"); + MetaInfo meta = snark.getMetaInfo(); if (meta != null) { String announce = meta.getAnnounce(); if (announce != null) { @@ -2110,7 +2073,7 @@ public class I2PSnarkServlet extends DefaultServlet { String trackerLink = getTrackerLink(announce, snark.getInfoHash()); if (trackerLink != null) buf.append(trackerLink).append(' '); - buf.append(_("Tracker")).append(": "); + buf.append("").append(_("Tracker")).append(": "); if (announce.startsWith("http://")) announce = announce.substring(7); int slsh = announce.indexOf('/'); @@ -2126,7 +2089,7 @@ public class I2PSnarkServlet extends DefaultServlet { if (meta == null || !meta.isPrivate()) { buf.append("\n"); @@ -2138,10 +2101,45 @@ public class I2PSnarkServlet extends DefaultServlet { // We don't have the hash of the torrent file //buf.append(""); + buf.append("\n"); } else { // shouldn't happen From 7e5edc2f6e7d55ab818fa9a6966018502968944a Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 19:30:42 +0000 Subject: [PATCH 064/104] Changes to snark themes from dr|z3d to work with new layouts (and a tweak to dark console theme) --- .../resources/themes/console/dark/default.css | 9 +- .../resources/themes/snark/dark/snark.css | 44 +++++- .../resources/themes/snark/ubergine/snark.css | 125 ++++++++++++++---- .../resources/themes/snark/vanilla/snark.css | 123 ++++++++++++++--- 4 files changed, 248 insertions(+), 53 deletions(-) diff --git a/installer/resources/themes/console/dark/default.css b/installer/resources/themes/console/dark/default.css index e7373d407..53a53cf58 100644 --- a/installer/resources/themes/console/dark/default.css +++ b/installer/resources/themes/console/dark/default.css @@ -82,7 +82,10 @@ button { } textarea { - border: 1px solid #494; + border: 1px solid #494; + background: #000; + margin-left: 4px; + width: 458px; } br { @@ -144,7 +147,7 @@ hr { border: 1px solid #494; padding: 2px; margin: 4px 0 2px 4px; - background-color: #020; + background-color: #000; font-size: 8.5pt; } @@ -157,7 +160,7 @@ hr { font-size: 8pt; font-weight: bold; background-color: #000; - color: #9f9 !important; + color: #494 !important; border: 1px outset #ddddc0; text-align: center; white-space: nowrap; diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index eb032a108..a7698899c 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -261,6 +261,46 @@ tfoot tr:nth-child(n+1) { .SnarkTorrents td:nth-child(3), .SnarkTorrents td:nth-child(4) { width: 20px !important; } + +.snarkTorrentInfo img { + max-height: 16px !important; + margin: 1px 0 1px 2px !important; +} + +.snarkTorrentInfo td { + text-align: left !important; + padding: 0 1px !important; +} + +table.SnarkTorrentInfo { + margin-bottom: 3 !important; + background: url("../../console/dark/images/camotile.png") repeat scroll center bottom #001100; +/* background-image: url('/themes/snark/dark/images/hat.png'), url("../../console/dark/images/camotile.png");*/ + background-origin: padding-box; + background-position: bottom right, center center; + background-repeat: no-repeat, repeat; +} + +table.SnarkDirInfo { + margin-top: -2px !important; +} + +.snarkDirInfo thead img { + margin: 0 -1px 0 0 !important; +} + +.SnarkDirInfo td { + min-width: 0px !important; +} + +.SnarkDirInfo td:nth-child(n+1) { +} + +.SnarkDirInfo .headerpriority { + text-align: center !important; + vertical-align: middle; +} + td { padding: 1px; @@ -863,12 +903,12 @@ code {; box-shadow: inset 0px 0px 1px 0px #002; background: #000 url('../../console/dark/images/header.png') repeat-x scroll center center !important; */ - background: #000 !important; + background: none !important; text-transform: uppercase !important; letter-spacing: 0em !important; font-weight: bold; font-size: 11.5pt; - color: #001; + color: #000; min-width: 600px; width: 70%; text-align: center; diff --git a/installer/resources/themes/snark/ubergine/snark.css b/installer/resources/themes/snark/ubergine/snark.css index 7336b97c9..6bd30035e 100644 --- a/installer/resources/themes/snark/ubergine/snark.css +++ b/installer/resources/themes/snark/ubergine/snark.css @@ -4,8 +4,13 @@ body { background: #101 url('/themes/snark/ubergine/images/graytile.png'); color: #001; - font: 8pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif; + font: 7.5pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif; } + +body.iframed { + background: transparent url('../../console/dark/images/transparent.gif') !important; + margin: 6px 0 !important; +} .snarkTitle { font-size: 12pt; @@ -18,16 +23,16 @@ body { text-transform: uppercase !important; padding: 4px 16px 5px !important; margin: -5px -8px -5px 0 !important; - letter-spacing: 0.05em; + letter-spacing: 0.03em; font-weight: bold; - font-size: 11pt; + font-size: 9pt; color: #f70; text-shadow: 1px 1px #420; background: url('/themes/snark/ubergine/images/snarknav_lowlight.png') no-repeat scroll center bottom; background: #310 url('/themes/snark/ubergine/images/snarknav_on.png') repeat-x scroll center center; -moz-border-radius: 0px; -khtml-border-radius: 3px; - border-radius: 0px; + border-radius: 0px;; -moz-box-shadow: inset 0 0 1px 0 #f90; -khtml-box-shadow: inset 0 0 1px 0 #f90; box-shadow: 0 0 1px 0 #f90; @@ -38,9 +43,7 @@ body { text-decoration: none !important; text-transform: uppercase !important; padding: 1px 16px; - letter-spacing: 0.05em; font-weight: bold; - font-size: 11pt; color: #f50; background: #310 url('/themes/snark/ubergine/images/snarknav_on.png') repeat-x scroll center center; background: #310 url('/themes/snark/ubergine/images/snarknav_lowlight.png') repeat-x scroll center center; @@ -56,9 +59,7 @@ body { text-decoration: none !important; text-transform: uppercase !important; padding: 0 16px; - letter-spacing: 0.05em; font-weight: bold; - font-size: 11pt; color: #fb0; background: #310 url('/themes/snark/ubergine/images/snarknav_on.png') repeat-x scroll center center; } @@ -130,7 +131,7 @@ body { pre { width: 100%; - font: 8pt "Lucida Console","DejaVu Sans Mono",Courier,mono !important; + font: 7.5pt "Lucida Console","DejaVu Sans Mono",Courier,mono !important; padding: 0; text-align: left !important; height: 8px; @@ -162,13 +163,13 @@ thead a, tfoot a { text-shadow:1px 1px #550000; } -thead { +thead {; border-bottom: 1px solid #101; } th { padding: 4px 2px 4px 4px; - font-size: 9pt; + font-size: 8pt; border-top: 1px outset #001; border-bottom: 1px inset #101; color: #ddd; @@ -220,7 +221,7 @@ tfoot tr:nth-child(n+1) { .ParentDir { background: #656; background: #351933; - font-size: 8pt; + font-size: 7.5pt; border: 0px inset #101 !important; border-left: 0 !important; border-right: 0 !important; @@ -243,7 +244,7 @@ td { padding: 1px; color: #ddd !important; opacity: 1; - font-size: 9.5pt; + font-size: 8pt; } .mainsection td { @@ -252,7 +253,7 @@ td { td:first-child { text-align: right; - font-size: 9.5pt; + font-size: 8pt; } .center { @@ -289,7 +290,7 @@ td:first-child { } .snarkTorrentEven { - font-size: 8pt; + font-size: 7.5pt; background: #202; } @@ -311,7 +312,7 @@ td:first-child { min-width: 48px; font-weight: bold; color: #dd9 !important; - font-size: 8pt; + font-size: 7.5pt; padding: 1px !important; } @@ -321,7 +322,7 @@ td:first-child { } .snarkTorrentRateUp, .snarkTorrentRateDown, .snarkTorrentDownloaded, .snarkTorrentUploaded { - font-size: 8pt; + font-size: 7.5pt; font-weight: bold; padding: 0 3px; } @@ -344,7 +345,7 @@ td:first-child { .snarkTorrentOdd { background: #351933; - font-size: 8pt; + font-size: 7.5pt; border: 0px inset #101 !important; border-left: 0 !important; border-right: 0 !important; @@ -356,7 +357,7 @@ td:first-child { .snarkFileName { padding: 4px 0px !important; text-align: left !important; - font-size: 8pt !important; + font-size: 7.5pt !important; } .snarkFileSize { @@ -369,7 +370,7 @@ td:first-child { padding: 4px 5px 4px 15px; text-align: center; font-style: italic; - font-size: 8pt; + font-size: 7.5pt; text-align: left; } @@ -378,6 +379,41 @@ td:first-child { font-style: italic; color: #dd7 !important; } + +.snarkTorrentInfo img { + max-height: 16px !important; + margin: 1px 0 1px 2px !important; +} + +.snarkTorrentInfo td { + text-align: left !important; + padding: 0 1px !important; +} + +table.SnarkTorrentInfo { + margin-bottom: 3 !important; + background: #000; +} + +table.SnarkDirInfo { + margin-top: -2px !important; +} + +.snarkDirInfo thead img { + margin: 0 -1px 0 0 !important; +} + +.SnarkDirInfo td { + min-width: 0px !important; +} + +.SnarkDirInfo td:nth-child(n+1) { +} + +.SnarkDirInfo .headerpriority { + text-align: center !important; + vertical-align: middle; +} .choked { color: #f00000 !important; @@ -393,11 +429,11 @@ td:first-child { } .snarkNewTorrent { - font-size: 9pt; + font-size: 8pt; } .snarkAddInfo { - font-size: 9pt; + font-size: 8pt; line-height: 130% !important; } @@ -406,7 +442,7 @@ td:first-child { font-weight: bold; padding: 0 25px 3px 25px; margin: 5px 0 10px 0 !important; - letter-spacing: 0.25em; + letter-spacing: 0.05em; border: 1px solid #111; -moz-border-radius: 0 0 5px 5px; -khtml-border-radius: 0 0 5px 5px; @@ -432,7 +468,7 @@ td:first-child { -khtml-border-radius: 4px; border-radius: 4px; border: 1px solid #101; - font-size: 9pt !important; + font-size: 8pt !important; line-height: 160% !important; -moz-box-shadow: inset 0px 0px 1px 0px #212; -khtml-box-shadow: inset 0px 0px 1px 0px #002; @@ -478,7 +514,7 @@ a:hover { } input { - font-size: 9pt; + font-size: 8.5pt; font-weight: bold; text-align: left; padding: 3px 4px !important; @@ -591,7 +627,7 @@ select { background: #333; background: url('/themes/snark/ubergine/images/graytile.png') !important; color: #f60; - font: 9pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif; + font: 8pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif; font-weight: bold; padding: 2px 2px 2px 3px; -moz-border-radius: 4px 0 0 4px; @@ -613,7 +649,8 @@ textarea { -moz-border-radius: 4px; -khtml-border-radius: 4px; border-radius: 4px; - border: 1px inset #000; + border: 1px inset #000; + font-size: 8pt; } img { @@ -750,7 +787,7 @@ div.configsection a:hover { } code { - font-size: 9.5pt; + font-size: 9pt; color: #b8b; padding: 0 2px; font-weight: bold; @@ -783,3 +820,35 @@ code { padding: 1px 0 0px !important; vertical-align: top; } + +.routerdown { + color: #ee9; +} + +.trackerconfig { + text-align: left !important; +} + +.trackerconfig th:nth-child(n+4), .trackerconfig th:nth-child(n+5), .trackerconfig td:nth-child(n+4), .trackerconfig td:nth-child(n+5) { + text-align: center !important; +} + +.trackerconfig th, .trackerconfig td, .trackerconfig th:last-child, .trackerconfig td:last-child { + text-align: left !important; +} + +.trackerconfig td:first-child { + text-align: right !important; +} + +input.trackername { + width: 100px; +} + +input.trackerhome { + width: 200px; +} + +input.trackerannounce { + width: 230px; +} \ No newline at end of file diff --git a/installer/resources/themes/snark/vanilla/snark.css b/installer/resources/themes/snark/vanilla/snark.css index 8a711f182..6d3d6ea16 100644 --- a/installer/resources/themes/snark/vanilla/snark.css +++ b/installer/resources/themes/snark/vanilla/snark.css @@ -6,6 +6,11 @@ body { color: #001; font: 8pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif; } + +body.iframed { + background: transparent url('../../console/dark/images/transparent.gif') !important; + margin: 6px 0 !important; +} .snarkTitle { font-size: 12pt; @@ -79,7 +84,10 @@ body { -khtml-box-shadow: inset 0 0 1px 0 #330; box-shadow: 0 0 1px 0 #330; } - + +.snarkRefresh img { + margin-right: -10px !important; +} .snarkMessages { font: bold 8pt "Lucida Console","DejaVu Sans Mono",Courier,mono !important; text-align: left; @@ -91,7 +99,7 @@ body { border-radius: 4px 0 0 0; border: 1px solid #000; overflow: auto; - color: #26f; + color: #500; max-height: 76px; min-height: 45px; width: auto; @@ -149,8 +157,8 @@ table { border-collapse: collapse; color: #323; width: 100%; - opacity: 1 !important; - font-weight: bold; + opacity: 1 !important; + font-size: 8.5pt !important; } tr { @@ -175,11 +183,10 @@ thead { th { padding: 4px 2px 4px 4px; - font-size: 9pt; + font-size: 8pt; border-top: 1px outset #604; border-bottom: 1px inset #604; whitespace: nowrap; - letter-spacing: 0.05em; } th:first-child { @@ -249,7 +256,7 @@ td { padding: 2px 1px; color: #501 !important; opacity: 1; - font-size: 9.5pt; + font-size: 8pt; } .mainsection td { @@ -258,7 +265,7 @@ td { td:first-child { text-align: right; - font-size: 9.5pt; + font-size: 8pt; } .center { @@ -267,7 +274,8 @@ td:first-child { .snarkTorrentName { /* text-shadow:1px 1px #540;*/ - padding: 3px 0 0; + padding: 3px 0 0; + line-height: 100%; } .snarkTorrentName img { @@ -306,7 +314,9 @@ td:first-child { .snarkTorrentStatus { padding: -1px 0 2px; font-size: 8pt !important; - letter-spacing: -0.05em; + letter-spacing: -0.05em; + font-weight: bold; + line-height: 100%; } .snarkTorrentStatus:first-child { @@ -383,6 +393,40 @@ td:first-child { font-style: italic; color: #505 !important; } + +.snarkTorrentInfo img { + max-height: 16px !important; + margin: 1px 0 1px 2px !important; +} + +.snarkTorrentInfo td { + text-align: left !important; + padding: 0 1px !important; +} + +table.SnarkTorrentInfo { + margin-bottom: 3 !important; +} + +table.SnarkDirInfo { + margin-top: -2px !important; +} + +.snarkDirInfo thead img { + margin: 0 -1px 0 0 !important; +} + +.SnarkDirInfo td { + min-width: 0px !important; +} + +.SnarkDirInfo td:nth-child(n+1) { +} + +.SnarkDirInfo .headerpriority { + text-align: center !important; + vertical-align: middle; +} .choked { color: #a00000 !important; @@ -402,7 +446,7 @@ td:first-child { } .snarkAddInfo { - font-size: 9pt; + font-size: 8pt; line-height: 130% !important; } @@ -411,20 +455,23 @@ td:first-child { font-weight: bold; padding: 0 25px 3px 25px; margin: 5px 0 10px 0 !important; - letter-spacing: 0.25em; + letter-spacing: 0.05em; border: 1px solid #111; -moz-border-radius: 0 0 5px 5px; -khtml-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; border-top: 0; - text-shadow: 0px 1px 1px #300; + text-shadow: 0px 1px 1px #fff; background: #ffb url('images/bling.png') repeat-x scroll center center !important; font-variant: small-caps !important; color: #503; } - + +.snarkConfigTitle img { + margin-right: -3px; +} .snarkConfig { - font-size: 10pt; + font-size: 8pt; width: 100%; } @@ -577,7 +624,7 @@ input.accept { } input.add { - background: #f3efc7 url('../../console/images/add.png') no-repeat 2px center; + background: #f3efc7 url('../../console/images/add.png') no-repeat 2px center !important; padding: 2px 3px 2px 20px !important; min-height: 22px; } @@ -610,13 +657,14 @@ select { background: #fff; /* background: url('/themes/snark/ubergine/images/graytile.png') !important;*/ color: #101; - font: 9pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif; + font: 8pt "Lucida Sans Unicode","Bitstream Vera Sans",Verdana,Tahoma,Helvetica,sans-serif; font-weight: bold; padding: 2px 2px 2px 3px; -moz-border-radius: 4px 0 0 4px; -khtml-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; - border: 1px solid #000; + border: 1px solid #000; + margin-left: 5px; } select:hover, textarea:hover { @@ -632,7 +680,9 @@ textarea { -moz-border-radius: 4px; -khtml-border-radius: 4px; border-radius: 4px; - border: 1px inset #000; + border: 1px inset #000; + font-size: 8pt; + margin-left: 5px; } img { @@ -760,7 +810,7 @@ div.configsection table{ div.configsection a { color: #f30; - text-shadow: 1px 1px #500; + text-shadow: 1px 1px #fff; } div.configsection a:hover { @@ -802,3 +852,36 @@ code { padding: 1px 0 0px !important; vertical-align: top; } + + +.routerdown { + color: #900; +} + +.trackerconfig { + text-align: left !important; +} + +.trackerconfig th:nth-child(n+4), .trackerconfig th:nth-child(n+5), .trackerconfig td:nth-child(n+4), .trackerconfig td:nth-child(n+5) { + text-align: center !important; +} + +.trackerconfig th, .trackerconfig td, .trackerconfig th:last-child, .trackerconfig td:last-child { + text-align: left !important; +} + +.trackerconfig td:first-child { + text-align: right !important; +} + +input.trackername { + width: 100px; +} + +input.trackerhome { + width: 200px; +} + +input.trackerannounce { + width: 230px; +} From d6572fd0273c146febe9f304bb28243954dabc89 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 21:07:36 +0000 Subject: [PATCH 065/104] Give update status section a heading to draw attention to it, display total size --- .../src/net/i2p/router/web/SummaryBarRenderer.java | 9 ++++++++- .../java/src/net/i2p/router/web/UpdateHandler.java | 11 +++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index 4fe774d0a..fb4ad5a64 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -328,8 +328,15 @@ public class SummaryBarRenderer { public String renderUpdateStatusHTML() { if (_helper == null) return ""; + String updateStatus = _helper.getUpdateStatus(); + if ("".equals(updateStatus)) return ""; StringBuilder buf = new StringBuilder(512); - buf.append(_helper.getUpdateStatus()); + buf.append("

") + .append(_("I2P Update")) + .append("


\n"); + buf.append(updateStatus); return buf.toString(); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java index c7a1f695f..bc2cb2c16 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java @@ -237,14 +237,17 @@ public class UpdateHandler { if (_isPartial) return; StringBuilder buf = new StringBuilder(64); - buf.append("").append(_("Updating")).append(" "); + buf.append("").append(_("Updating")).append(":
\n"); double pct = ((double)alreadyTransferred + (double)currentWrite) / ((double)alreadyTransferred + (double)currentWrite + bytesRemaining); synchronized (_pct) { - buf.append(_pct.format(pct)); + buf.append(_("{0} downloaded", _pct.format(pct))); } - buf.append(":
\n"); - buf.append(_("{0}B transferred", DataHelper.formatSize2(currentWrite + alreadyTransferred))); + buf.append("
\n"); + buf.append(DataHelper.formatSize2(currentWrite + alreadyTransferred)) + .append("B / ") + .append(DataHelper.formatSize2(currentWrite + alreadyTransferred + bytesRemaining)) + .append("B"); updateStatus(buf.toString()); } public void transferComplete(long alreadyTransferred, long bytesTransferred, long bytesRemaining, String url, String outputFile, boolean notModified) { From f1881352c823533a9149f7513b3597906c5f353e Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 21:10:58 +0000 Subject: [PATCH 066/104] Further tweaks to ubergine and vanilla themes by dr|z3d for new layouts --- .../resources/themes/snark/ubergine/snark.css | 15 ++++---- .../resources/themes/snark/vanilla/snark.css | 36 ++++++------------- 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/installer/resources/themes/snark/ubergine/snark.css b/installer/resources/themes/snark/ubergine/snark.css index 6bd30035e..b3d599b6c 100644 --- a/installer/resources/themes/snark/ubergine/snark.css +++ b/installer/resources/themes/snark/ubergine/snark.css @@ -174,7 +174,7 @@ th { border-bottom: 1px inset #101; color: #ddd; whitespace: nowrap; - letter-spacing: 0.05em; + letter-spacing: 0em; } th:first-child { @@ -260,7 +260,8 @@ td:first-child { text-align: center !important; } -.snarkTorrentName { +.snarkTorrentName { + line-height: 100%; text-shadow:1px 1px #550000; padding: 2px 0 0; } @@ -303,7 +304,8 @@ td:first-child { } .snarkTorrentStatus { - padding: 2px 2px 2px 0; + padding: 2px 2px 2px 0; + line-height: 100%; } .snarkTorrentStatus:first-child { @@ -324,7 +326,8 @@ td:first-child { .snarkTorrentRateUp, .snarkTorrentRateDown, .snarkTorrentDownloaded, .snarkTorrentUploaded { font-size: 7.5pt; font-weight: bold; - padding: 0 3px; + padding: 0 3px; + line-height: 100%; } .snarkTorrentDownloaded { @@ -403,7 +406,7 @@ table.SnarkDirInfo { margin: 0 -1px 0 0 !important; } -.SnarkDirInfo td { +.SnarkDirInfo td, .SnarkDirInfo th { min-width: 0px !important; } @@ -461,7 +464,7 @@ table.SnarkDirInfo { .page { background: #323 url('/themes/snark/ubergine/images/tile2.png'); color: #310; - min-width: 970px !important; + min-width: 800px !important; margin: 5px 0 0 0; padding: 10px 10px 0px 10px; -moz-border-radius: 4px; diff --git a/installer/resources/themes/snark/vanilla/snark.css b/installer/resources/themes/snark/vanilla/snark.css index 6d3d6ea16..7f87b38d9 100644 --- a/installer/resources/themes/snark/vanilla/snark.css +++ b/installer/resources/themes/snark/vanilla/snark.css @@ -186,7 +186,8 @@ th { font-size: 8pt; border-top: 1px outset #604; border-bottom: 1px inset #604; - whitespace: nowrap; + whitespace: nowrap; + color: #511; } th:first-child { @@ -406,10 +407,12 @@ td:first-child { table.SnarkTorrentInfo { margin-bottom: 3 !important; + border: 1px solid #604; } table.SnarkDirInfo { - margin-top: -2px !important; + margin-top: -3px !important; + margin-bottom: 0; } .snarkDirInfo thead img { @@ -453,7 +456,7 @@ table.SnarkDirInfo { .snarkConfigTitle { font-size: 11pt; font-weight: bold; - padding: 0 25px 3px 25px; + padding: 0 15px 3px 12px; margin: 5px 0 10px 0 !important; letter-spacing: 0.05em; border: 1px solid #111; @@ -461,10 +464,11 @@ table.SnarkDirInfo { -khtml-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; border-top: 0; - text-shadow: 0px 1px 1px #fff; + text-shadow: 0px 1px 1px #777; background: #ffb url('images/bling.png') repeat-x scroll center center !important; font-variant: small-caps !important; - color: #503; + color: #503; + box-shadow: 0 1px 1px #777; } .snarkConfigTitle img { @@ -478,7 +482,7 @@ table.SnarkDirInfo { .page { background: #fff url('images/tile2.png'); color: #310; - min-width: 970px !important; + min-width: 800px !important; margin: 5px 0 0 0; padding: 10px 10px 0px 10px; -moz-border-radius: 4px; @@ -512,24 +516,6 @@ hr { text-align: center; } -a:link { - color: #742; - text-decoration: none; - font-weight: bold; - word-wrap: break-word; -} - -a:visited { - color: #962; - text-decoration: none; - font-weight: bold; -} - -a:hover { - color: #f30; - font-weight: bold; -} - a:link { color: #d30; text-decoration: none; @@ -810,7 +796,7 @@ div.configsection table{ div.configsection a { color: #f30; - text-shadow: 1px 1px #fff; + text-shadow: 1px 1px #777; } div.configsection a:hover { From b48014f8e6808bbcf895a509e3b29c76d92d6744 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 21:29:49 +0000 Subject: [PATCH 067/104] Use favicon from theme in I2PTunnel if it exists --- apps/i2ptunnel/jsp/editClient.jsp | 3 ++- apps/i2ptunnel/jsp/editServer.jsp | 3 ++- apps/i2ptunnel/jsp/index.jsp | 3 ++- apps/i2ptunnel/jsp/wizard.jsp | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/i2ptunnel/jsp/editClient.jsp b/apps/i2ptunnel/jsp/editClient.jsp index 7aef0ab31..2fcf487f5 100644 --- a/apps/i2ptunnel/jsp/editClient.jsp +++ b/apps/i2ptunnel/jsp/editClient.jsp @@ -19,9 +19,10 @@ <%=intl._("I2P Tunnel Manager - Edit Client Tunnel")%> + <% if (editBean.allowCSS()) { - %> + %> <% } diff --git a/apps/i2ptunnel/jsp/editServer.jsp b/apps/i2ptunnel/jsp/editServer.jsp index eb9e7a1b3..3b7e7b943 100644 --- a/apps/i2ptunnel/jsp/editServer.jsp +++ b/apps/i2ptunnel/jsp/editServer.jsp @@ -19,9 +19,10 @@ <%=intl._("I2P Tunnel Manager - Edit Server Tunnel")%> + <% if (editBean.allowCSS()) { - %> + %> <% } diff --git a/apps/i2ptunnel/jsp/index.jsp b/apps/i2ptunnel/jsp/index.jsp index 41adffc7a..a35826a5c 100644 --- a/apps/i2ptunnel/jsp/index.jsp +++ b/apps/i2ptunnel/jsp/index.jsp @@ -24,7 +24,8 @@ <% if (indexBean.allowCSS()) { - %> + %> + <% } %> diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index d9aeb3873..3adac32ea 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -57,7 +57,8 @@ <% if (editBean.allowCSS()) { - %> + %> + <% } %> From 177b6e2d48ffcab0f9cfbaea2ecf8f5eb9790914 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 22:48:07 +0000 Subject: [PATCH 068/104] Link both icon and text for tracker and magnet entries in snark torrent info --- .../org/klomp/snark/web/I2PSnarkServlet.java | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) 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 3907b9587..0b1322fd3 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -1325,7 +1325,7 @@ public class I2PSnarkServlet extends DefaultServlet { * @return string or null * @since 0.8.4 */ - private String getTrackerLink(String announce, byte[] infohash) { + private String getTrackerLinkUrl(String announce, byte[] infohash) { // temporarily hardcoded for postman* and anonymity, requires bytemonsoon patch for lookup by info_hash if (announce != null && (announce.startsWith("http://YRgrgTLG") || announce.startsWith("http://8EoJZIKr") || announce.startsWith("http://lnQ6yoBT") || announce.startsWith("http://tracker2.postman.i2p/") || @@ -1341,15 +1341,29 @@ public class I2PSnarkServlet extends DefaultServlet { StringBuilder buf = new StringBuilder(128); buf.append("" + - "\"").append(_("Info")).append("\""); + .append("\" title=\"").append(_("Details at {0} tracker", name)).append("\" target=\"_blank\">"); return buf.toString(); } } return null; } + /** + * @return string or null + * @since 0.8.4 + */ + private String getTrackerLink(String announce, byte[] infohash) { + String linkUrl = getTrackerLinkUrl(announce, infohash); + if (linkUrl != null) { + StringBuilder buf = new StringBuilder(128); + buf.append(linkUrl) + .append("\"").append(_("Info")).append("\""); + return buf.toString(); + } + return null; + } + private void writeAddForm(PrintWriter out, HttpServletRequest req) throws IOException { // display incoming parameter if a GET so links will work String newURL = req.getParameter("newURL"); @@ -2074,6 +2088,9 @@ public class I2PSnarkServlet extends DefaultServlet { if (trackerLink != null) buf.append(trackerLink).append(' '); buf.append("").append(_("Tracker")).append(": "); + String trackerLinkUrl = getTrackerLinkUrl(announce, snark.getInfoHash()); + if (trackerLinkUrl != null) + buf.append(trackerLinkUrl); if (announce.startsWith("http://")) announce = announce.substring(7); int slsh = announce.indexOf('/'); @@ -2081,15 +2098,19 @@ public class I2PSnarkServlet extends DefaultServlet { announce = announce.substring(0, slsh); if (announce.length() > 67) announce = announce.substring(0, 40) + "…" + announce.substring(announce.length() - 8); - buf.append(announce).append(""); + buf.append(announce); + if (trackerLinkUrl != null) + buf.append(""); + buf.append(""); } } String hex = I2PSnarkUtil.toHex(snark.getInfoHash()); if (meta == null || !meta.isPrivate()) { - buf.append("
\n"); From ac9bdab78e45222bee23666b1474aeb6877363a6 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 22:48:59 +0000 Subject: [PATCH 069/104] Added class to summary bar config table --- .../java/src/net/i2p/router/web/SummaryHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index ba7b59525..c23a72ede 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -803,7 +803,7 @@ public class SummaryHelper extends HelperBase { String imgPath = CSSHelper.BASE_THEME_PATH + theme + "/images/"; StringBuilder buf = new StringBuilder(2048); - buf.append("
") + buf.append("
") .append(_("Torrent")) - .append(": ") + .append(": ") .append(snark.getBaseName()) .append("
") - .append(_("Completion")) - .append(": ") - .append((new DecimalFormat("0.00%")).format(completion)) - .append("
") - .append(_("Complete")) - .append("
") - .append(_("Remaining")) - .append(": ") - .append(formatSize(needed)) - .append("
") - .append(_("Size")) - .append(": ") - .append(formatSize(snark.getTotalLength())) - .append("
") - .append(_("Files")) - .append(": ") - .append(fileCount) - .append("
") - .append(_("Pieces")) - .append(": ") - .append(pieces) - .append("
") - .append(_("Piece size")) - .append(": ") - .append(formatSize(snark.getPieceLength(0))) + .append("\"\" ") + .append(_("Torrent file")) + .append(": ") + .append(snark.getName()) .append("
") .append(toImg("magnet", _("Magnet link"))) - .append(" Magnet: ") .append(MAGNET_FULL).append(hex).append("") .append("
").append(_("Maggot link")).append(": ") // .append(MAGGOT).append(hex).append(':').append(hex).append("
") - .append(_("Torrent file")) - .append(": ") - .append(snark.getName()) + .append("\"\" ") + .append(_("Size")) + .append(": ") + .append(formatSize(snark.getTotalLength())); + int pieces = snark.getPieces(); + double completion = (pieces - snark.getNeeded()) / (double) pieces; + if (completion < 1.0) + buf.append(" \"\" ") + .append(_("Completion")) + .append(": ") + .append((new DecimalFormat("0.00%")).format(completion)); + else + buf.append(" \"\" ") + .append(_("Complete")); + // else unknown + long needed = snark.getNeededLength(); + if (needed > 0) + buf.append(" \"\" ") + .append(_("Remaining")) + .append(": ") + .append(formatSize(needed)); + if (meta != null) { + List files = meta.getFiles(); + int fileCount = files != null ? files.size() : 1; + buf.append(" \"\" ") + .append(_("Files")) + .append(": ") + .append(fileCount); + } + buf.append(" \"\" ") + .append(_("Pieces")) + .append(": ") + .append(pieces); + buf.append(" \"\" ") + .append(_("Piece size")) + .append(": ") + .append(formatSize(snark.getPieceLength(0))) .append("
") + buf.append("
") .append(toImg("magnet", _("Magnet link"))) - .append(" Magnet: Magnet: ") .append(MAGNET_FULL).append(hex).append("") .append("
\n"; /** @@ -314,6 +317,7 @@ public class WebMail extends HttpServlet public String sentMail; public ArrayList attachments; public boolean reallyDelete; + String themePath, imgPath; SessionObject() @@ -357,9 +361,9 @@ public class WebMail extends HttpServlet * @param label * @return */ - private static String sortHeader( String name, String label ) + private static String sortHeader( String name, String label, String imgPath ) { - return "" + label + " \"^\"\"v\""; + return "" + label + " \"^\"\"v\""; } /** * check, if a given button "was pressed" in the received http request @@ -1202,6 +1206,8 @@ public class WebMail extends HttpServlet sessionObject.info = ""; sessionObject.pageChanged = false; sessionObject.showAttachment = null; + sessionObject.themePath = "/themes/susimail/" + Config.getProperty(CONFIG_THEME, DEFAULT_THEME) + '/'; + sessionObject.imgPath = sessionObject.themePath + "images/"; processStateChangeButtons( sessionObject, request ); @@ -1260,9 +1266,9 @@ public class WebMail extends HttpServlet "\n" + "\n" + "susimail - " + subtitle + "\n" + - "\n" + + "\n" + "\n\n" + - "

\"Susimail\"
 

\n" + + "

\"Susimail\"
 

\n" + "
" ); if( sessionObject.error != null && sessionObject.error.length() > 0 ) { @@ -1607,10 +1613,10 @@ public class WebMail extends HttpServlet button( RELOAD, _("Reload Config") ) + spacer + button( LOGOUT, _("Logout") ) + "
") + buf.append("\n"); } - buf.append("" + - "" + + "") .append("
") .append(_("Remove")) .append("") .append(_("Order")) From b1a4b8bfedcfbe6667cc1626fe56823e9ef25188 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 10 Jul 2012 23:35:54 +0000 Subject: [PATCH 070/104] Rearanged columns of summary bar config table --- .../src/net/i2p/router/web/SummaryHelper.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index c23a72ede..800073b6e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -805,16 +805,18 @@ public class SummaryHelper extends HelperBase { StringBuilder buf = new StringBuilder(2048); buf.append("\n"); for (String section : sections) { int i = sections.indexOf(section); buf.append("\n"); + buf.append("\n"); } buf.append("" + - "") + buf.append("" + + "") .append("
") .append(_("Remove")) - .append("") - .append(_("Order")) .append("") .append(_("Name")) + .append("") + .append(_("Order")) .append("
") + .append(section) + .append(""); } - buf.append("") - .append(section) - .append("
") .append(_("Add")).append(":" + - "" + + "" + "
\n"); return buf.toString(); } From dd86515d2e55a778085f51744ec91d6554e0c98a Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 11 Jul 2012 12:02:58 +0000 Subject: [PATCH 071/104] Tweaks to dark snark theme from dr|z3d --- installer/resources/themes/snark/dark/snark.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index a7698899c..937e98ff8 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -275,10 +275,10 @@ tfoot tr:nth-child(n+1) { table.SnarkTorrentInfo { margin-bottom: 3 !important; background: url("../../console/dark/images/camotile.png") repeat scroll center bottom #001100; -/* background-image: url('/themes/snark/dark/images/hat.png'), url("../../console/dark/images/camotile.png");*/ +/* background-image: url('/themes/snark/dark/images/hat.png'), url("../../console/dark/images/camotile.png"); background-origin: padding-box; background-position: bottom right, center center; - background-repeat: no-repeat, repeat; + background-repeat: no-repeat, repeat;*/ } table.SnarkDirInfo { @@ -464,7 +464,7 @@ td:first-child { .snarkConfigTitle { font-size: 10.5pt; font-weight: bold; - padding: 1px 25px 4px 25px; + padding: 1px 25px 4px 22px; margin: 5px 0 10px 0 !important; letter-spacing: 0.02em; border: 1px solid #494; @@ -839,7 +839,7 @@ div.configsection { } div.configsectionpanel { - margin: -2px 0 10px 0; + margin: -2px 0 0 0; padding: 0 10px; border: 1px solid #494; color: #ee9; From 7d175678ab57b66627182fc743f5ac1c98ec96ed Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 11 Jul 2012 12:06:59 +0000 Subject: [PATCH 072/104] CSS for the sidebar config table from dr|z3d --- .../themes/console/classic/console.css | 39 ++++++++++++++++ .../resources/themes/console/dark/console.css | 45 +++++++++++++++++-- .../themes/console/light/console.css | 39 ++++++++++++++++ .../themes/console/midnight/console.css | 39 ++++++++++++++++ 4 files changed, 159 insertions(+), 3 deletions(-) diff --git a/installer/resources/themes/console/classic/console.css b/installer/resources/themes/console/classic/console.css index e32371cf1..df14c8aba 100644 --- a/installer/resources/themes/console/classic/console.css +++ b/installer/resources/themes/console/classic/console.css @@ -510,6 +510,45 @@ div.configure h2:first-child { margin-top: 15px; } +.sidebarconf input[type="image"] { + margin: 2px; + padding: 1px; +} + +.sidebarconf th:nth-child(1) { + text-align: center; +} + +.sidebarconf th:nth-child(2) { + text-align: left; +} + +.sidebarconf td:first-child { + width: 60px; + text-align: right; + padding-right: 50px; +} + +.sidebarconf td { + font-weight: bold; + font-size: 9pt; +} + +.sidebarconf td:nth-child(3), .sidebarconf td:nth-child(4) { + width: 70px; + padding: 0; +} + +.sidebarconf td:nth-child(3) { + text-align: right; + padding-left: 50px; +} + +.sidebarconf td:nth-child(4) { + text-align: left; + padding-right: 50px; +} + .topshimten { margin-top: 15px; margin-bottom: 15px; diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index 827d3a6b7..7e52bfa12 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -450,6 +450,44 @@ div.configure { background: none;/* url(images/camotile2.png);*/ } +.sidebarconf input[type="image"] { + margin: 2px; + padding: 1px; +} + +.sidebarconf th:nth-child(1) { + text-align: center; +} + +.sidebarconf th:nth-child(2) { + text-align: left; +} + +.sidebarconf td:first-child { + width: 60px; + text-align: right; + padding-right: 50px; +} + +.sidebarconf td:nth-child(2) { + font-weight: bold; +} + +.sidebarconf td:nth-child(3), .sidebarconf td:nth-child(4) { + width: 70px; + padding: 0; +} + +.sidebarconf td:nth-child(3) { + text-align: right; + padding-left: 50px; +} + +.sidebarconf td:nth-child(4) { + text-align: left; + padding-right: 50px; +} + div.messages { padding: 10px; margin: 10px 0 15px 0; @@ -550,7 +588,6 @@ th { color: #EE9; text-align: center; font-size: 9pt; - background: #000; /*url('images/tabletitledark.png') repeat-x;*/ background: #000 url('images/header.png') center center repeat-x ; border-top: 1px solid #494; border-bottom: 1px solid #494 !important; @@ -562,14 +599,15 @@ tr { } tr:nth-child(even) { - background: #010;/* url('images/darkerbluetile.png') !important;*/ + background: #010; vertical-align: middle; } tr:nth-child(odd) { - background: #000800;/* url('images/darkbluetile.png') !important;*/ + background: #000800; vertical-align: middle; } + /* tr:last-child { background: #004 url('images/lightbluetile.png') !important; @@ -577,6 +615,7 @@ tr:last-child { border: 1px solid #494 !important; } */ + td { padding: 4px 6px; color: #EE9; diff --git a/installer/resources/themes/console/light/console.css b/installer/resources/themes/console/light/console.css index 19e1493f0..69dfb504e 100644 --- a/installer/resources/themes/console/light/console.css +++ b/installer/resources/themes/console/light/console.css @@ -504,6 +504,45 @@ div.configure h3, div.graphspanel h3 { text-align: left; } +.sidebarconf input[type="image"] { + margin: 2px; + padding: 1px; +} + +.sidebarconf th:nth-child(1) { + text-align: center; +} + +.sidebarconf th:nth-child(2) { + text-align: left; +} + +.sidebarconf td:first-child { + width: 60px; + text-align: right; + padding-right: 50px; +} + +.sidebarconf td { + font-weight: bold; + font-size: 9pt; +} + +.sidebarconf td:nth-child(3), .sidebarconf td:nth-child(4) { + width: 70px; + padding: 0; +} + +.sidebarconf td:nth-child(3) { + text-align: right; + padding-left: 50px; +} + +.sidebarconf td:nth-child(4) { + text-align: left; + padding-right: 50px; +} + div.graphspanel { text-align: center !important; margin: 15px 0px -15px; diff --git a/installer/resources/themes/console/midnight/console.css b/installer/resources/themes/console/midnight/console.css index 19a7f33e9..b3598d645 100644 --- a/installer/resources/themes/console/midnight/console.css +++ b/installer/resources/themes/console/midnight/console.css @@ -520,6 +520,45 @@ div.configure h2:first-child { margin-top: 15px; } +.sidebarconf input[type="image"] { + margin: 2px; + padding: 1px; +} + +.sidebarconf th:nth-child(1) { + text-align: center; +} + +.sidebarconf th:nth-child(2) { + text-align: left; +} + +.sidebarconf td:first-child { + width: 60px; + text-align: right; + padding-right: 50px; +} + +.sidebarconf td { + font-weight: bold; + font-size: 9pt; +} + +.sidebarconf td:nth-child(3), .sidebarconf td:nth-child(4) { + width: 70px; + padding: 0; +} + +.sidebarconf td:nth-child(3) { + text-align: right; + padding-left: 50px; +} + +.sidebarconf td:nth-child(4) { + text-align: left; + padding-right: 50px; +} + .topshimten { margin-top: 15px; margin-bottom: 15px; From c45dc0c838a74cc13508ceffdff391cab681c65a Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 11 Jul 2012 21:20:35 +0000 Subject: [PATCH 073/104] Moved add and delete buttons into sidebar config table, and removed unnecessary ones --- .../src/net/i2p/router/web/SummaryHelper.java | 16 +++++++++++----- apps/routerconsole/jsp/configsidebar.jsp | 5 ----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 800073b6e..b5d796041 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -848,9 +848,11 @@ public class SummaryHelper extends HelperBase { } buf.append("
") - .append(_("Add")).append(":" + - "" + + buf.append("
" + + "") + .append(_("Add")).append(": " + "\n" + + "" + + "
\n"); return buf.toString(); diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp index cbb270d4f..4fe7ef3ec 100644 --- a/apps/routerconsole/jsp/configsidebar.jsp +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -55,13 +55,8 @@ input.default {
- " > " > " > - " > - " > - " > - " >
From 182409ce3a5e466fbac1f9828a3ee942a7cee4e0 Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 11 Jul 2012 21:44:02 +0000 Subject: [PATCH 074/104] Corrected titles of iframed pages --- apps/routerconsole/jsp/i2ptunnelmgr.jsp | 2 +- apps/routerconsole/jsp/torrents.jsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/routerconsole/jsp/i2ptunnelmgr.jsp b/apps/routerconsole/jsp/i2ptunnelmgr.jsp index 414464576..b8ada141f 100644 --- a/apps/routerconsole/jsp/i2ptunnelmgr.jsp +++ b/apps/routerconsole/jsp/i2ptunnelmgr.jsp @@ -15,7 +15,7 @@ <%@include file="css.jsi" %> -<%=intl.title("home")%> +<%=intl.title("i2p tunnel manager")%> diff --git a/apps/routerconsole/jsp/torrents.jsp b/apps/routerconsole/jsp/torrents.jsp index 690be49a5..ed052ace0 100644 --- a/apps/routerconsole/jsp/torrents.jsp +++ b/apps/routerconsole/jsp/torrents.jsp @@ -21,12 +21,19 @@ var failMessage = "
<%=intl._("Router is down")%><\/b>"; function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); } function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); } - function resizeFrame(f) { f.style.height = f.contentWindow.document.body.scrollHeight + "px"; } - function injectClass(f) { f.contentWindow.document.body.setAttribute('class', 'iframed'); } + function injectClass(f) { + f.className += ' iframed'; + var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document; + doc.body.className += ' iframed'; + } + function resizeFrame(f) { + var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document; + f.style.height = doc.body.offsetHeight + "px"; + } function setupFrame() { f = document.getElementById("i2psnarkframe"); - resizeFrame(f); injectClass(f); + resizeFrame(f); } From 46ca3ab51de2974c084cdb7ed8368aa72643eb88 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 12 Jul 2012 13:34:19 +0000 Subject: [PATCH 078/104] Used JS changes to fix iframed i2ptunnel scrollbar issue in CSS Also added comments to the JS to point out that the issue is that offsetHeight doesn't include the very top or bottom margins. --- apps/routerconsole/jsp/i2ptunnelmgr.jsp | 4 ++++ apps/routerconsole/jsp/torrents.jsp | 4 ++++ installer/resources/themes/console/dark/console.css | 4 ++++ installer/resources/themes/console/dark/default.css | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/apps/routerconsole/jsp/i2ptunnelmgr.jsp b/apps/routerconsole/jsp/i2ptunnelmgr.jsp index 5db19465f..75607b663 100644 --- a/apps/routerconsole/jsp/i2ptunnelmgr.jsp +++ b/apps/routerconsole/jsp/i2ptunnelmgr.jsp @@ -28,6 +28,10 @@ doc.getElementsByClassName('panel')[0].className += ' iframed'; } function resizeFrame(f) { + // offsetHeight returns the height of the visible area for an object, in pixels. + // The value contains the height with the padding, scrollBar, and the border, + // but does not include the margin. Therefore, any content within the iframe + // should have no margins at the very top or very bottom to avoid a scrollbar. var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document; f.style.height = doc.body.offsetHeight + "px"; } diff --git a/apps/routerconsole/jsp/torrents.jsp b/apps/routerconsole/jsp/torrents.jsp index ed052ace0..e029a48cd 100644 --- a/apps/routerconsole/jsp/torrents.jsp +++ b/apps/routerconsole/jsp/torrents.jsp @@ -27,6 +27,10 @@ doc.body.className += ' iframed'; } function resizeFrame(f) { + // offsetHeight returns the height of the visible area for an object, in pixels. + // The value contains the height with the padding, scrollBar, and the border, + // but does not include the margin. Therefore, any content within the iframe + // should have no margins at the very top or very bottom to avoid a scrollbar. var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document; f.style.height = doc.body.offsetHeight + "px"; } diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index 4b63b0a98..8dbb10cd2 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -1321,3 +1321,7 @@ div.applabel { } /* end home page */ + +iframe.iframed { + margin: 15px 0 0; +} diff --git a/installer/resources/themes/console/dark/default.css b/installer/resources/themes/console/dark/default.css index 53a53cf58..49461071f 100644 --- a/installer/resources/themes/console/dark/default.css +++ b/installer/resources/themes/console/dark/default.css @@ -225,6 +225,10 @@ hr { margin: 16px auto -8px auto !important; } +.iframed .panel.iframed { + margin: 0 auto -8px auto !important; +} + .panel td:first-child { font-weight: bold; } From b36a418dff00fe182f552b45bda67ea7730351dc Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 12 Jul 2012 13:37:51 +0000 Subject: [PATCH 079/104] More changes to dark snark theme from dr|z3d - close to RTM --- .../resources/themes/snark/dark/snark.css | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index 028cd8761..7c1726a6f 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -269,12 +269,16 @@ table.SnarkTorrents { } .SnarkTorrents td:nth-child(3), .SnarkTorrents td:nth-child(4) { - width: 20px !important; + width: 20px !important; } .snarkTorrentInfo img { max-height: 16px !important; - margin: 1px 0 1px 2px !important; + margin: 1px 0 1px 2px !important; +} + +.snarkTorrentInfo th { + padding: 4px !important; } .snarkTorrentInfo td { @@ -283,16 +287,15 @@ table.SnarkTorrents { } table.SnarkTorrentInfo { - margin-bottom: 3 !important; + margin-bottom: 1px !important; background: url("../../console/dark/images/camotile2.png") repeat scroll center bottom #001100; -/* background-image: url('/themes/snark/dark/images/hat.png'), url("../../console/dark/images/camotile.png"); - background-origin: padding-box; - background-position: bottom right, center center; - background-repeat: no-repeat, repeat;*/ + border-bottom: 1px solid #494; } table.SnarkDirInfo { - margin-top: -2px !important; + margin-top: -2px !important; + margin-bottom: 0; + border-bottom: 1px solid #494; } .snarkDirInfo thead img { @@ -300,7 +303,7 @@ table.SnarkDirInfo { } .SnarkDirInfo td { - min-width: 0px !important; + min-width: 0px !important; } .SnarkDirInfo td:nth-child(n+1) { @@ -308,7 +311,7 @@ table.SnarkDirInfo { .SnarkDirInfo .headerpriority { text-align: center !important; - vertical-align: middle; + vertical-align: middle; } @@ -946,11 +949,11 @@ code {; } .trackerconfig th, .trackerconfig td, .trackerconfig th:last-child, .trackerconfig td:last-child { - text-align: left !important; + text-align: left !important; } .trackerconfig td:first-child { - text-align: right !important; + text-align: right !important; } input.trackername { From eaa64cb02fafbd6b2f6090d4f243427207183426 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 12 Jul 2012 13:39:32 +0000 Subject: [PATCH 080/104] Removed superfluous "Updating:" from update status (section has a heading now) --- .../routerconsole/java/src/net/i2p/router/web/UpdateHandler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java index bc2cb2c16..1492f3bb1 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java @@ -237,7 +237,6 @@ public class UpdateHandler { if (_isPartial) return; StringBuilder buf = new StringBuilder(64); - buf.append("").append(_("Updating")).append(":
\n"); double pct = ((double)alreadyTransferred + (double)currentWrite) / ((double)alreadyTransferred + (double)currentWrite + bytesRemaining); synchronized (_pct) { From ffdac3ce2ce080e437c4d77c87a6b3ae71cf6fde Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 12 Jul 2012 13:40:54 +0000 Subject: [PATCH 081/104] Added some non-breaking spaces to error.jsp where JSP was eating the spaces --- apps/routerconsole/jsp/error.jsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/routerconsole/jsp/error.jsp b/apps/routerconsole/jsp/error.jsp index 2c1913080..630da0851 100644 --- a/apps/routerconsole/jsp/error.jsp +++ b/apps/routerconsole/jsp/error.jsp @@ -24,8 +24,8 @@ <%@include file="summary.jsi" %> -

<%=ERROR_CODE%> <%=ERROR_MESSAGE%>

+

<%=ERROR_CODE%> <%=ERROR_MESSAGE%>

<%=intl._("Sorry! You appear to be requesting a non-existent Router Console page or resource.")%>
-<%=intl._("Error 404")%>: <%=ERROR_URI%> <%=intl._("not found")%>. +<%=intl._("Error 404")%>: <%=ERROR_URI%> <%=intl._("not found")%>.
From cbd61e2fce430366f5cde97131ff0cf42144914e Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 12 Jul 2012 14:21:37 +0000 Subject: [PATCH 082/104] Tweak to get rid of iframe scrollbars in dark snark theme --- installer/resources/themes/snark/dark/snark.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index 7c1726a6f..389f55867 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -11,7 +11,7 @@ body { body.iframed { background: transparent url('../../console/dark/images/transparent.gif') !important; - margin: 6px 0 !important; + margin: 1px 0 !important; } .snarkTitle { From 7e7cabfdc20611a4c4c020aa98749bdae54a8151 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 12 Jul 2012 21:47:09 +0000 Subject: [PATCH 083/104] Added getElementsByClassName shim for IE --- apps/routerconsole/jsp/i2ptunnelmgr.jsp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/routerconsole/jsp/i2ptunnelmgr.jsp b/apps/routerconsole/jsp/i2ptunnelmgr.jsp index 75607b663..f47f41147 100644 --- a/apps/routerconsole/jsp/i2ptunnelmgr.jsp +++ b/apps/routerconsole/jsp/i2ptunnelmgr.jsp @@ -24,6 +24,23 @@ function injectClass(f) { f.className += ' iframed'; var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document; + if (doc.getElementsByClassName == undefined) { + doc.getElementsByClassName = function(className) + { + var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)"); + var allElements = document.getElementsByTagName("*"); + var results = []; + + var element; + for (var i = 0; (element = allElements[i]) != null; i++) { + var elementClass = element.className; + if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass)) + results.push(element); + } + + return results; + } + } doc.body.className += ' iframed'; doc.getElementsByClassName('panel')[0].className += ' iframed'; } From f782afef8d6b6f8d4735999c99bdf5af07ef6ebd Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Jul 2012 00:13:33 +0000 Subject: [PATCH 084/104] Add scrollbar width to iframe height, so vertical scrollbar doesn't appear FIXME: add horizontal scrollbar detection so only adding the extra height when it is actually needed. --- apps/routerconsole/jsp/i2ptunnelmgr.jsp | 26 ++++++++++++++++++++++++- apps/routerconsole/jsp/torrents.jsp | 26 ++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/apps/routerconsole/jsp/i2ptunnelmgr.jsp b/apps/routerconsole/jsp/i2ptunnelmgr.jsp index f47f41147..b45947633 100644 --- a/apps/routerconsole/jsp/i2ptunnelmgr.jsp +++ b/apps/routerconsole/jsp/i2ptunnelmgr.jsp @@ -50,7 +50,31 @@ // but does not include the margin. Therefore, any content within the iframe // should have no margins at the very top or very bottom to avoid a scrollbar. var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document; - f.style.height = doc.body.offsetHeight + "px"; + var totalHeight = doc.body.offsetHeight; + + // Detect if horizontal scrollbar is present, and add its width to height if so. + // This prevents a vertical scrollbar appearing when the min-width is passed. + // FIXME: How to detect horizontal scrollbar in iframe? Always apply for now. + if (true) { + // Create the measurement node + var scrollDiv = document.createElement("div"); + scrollDiv.className = "scrollbar-measure"; + scrollDiv.style.width = "100px"; + scrollDiv.style.height = "100px"; + scrollDiv.style.overflow = "scroll"; + scrollDiv.style.position = "absolute"; + scrollDiv.style.top = "-9999px"; + document.body.appendChild(scrollDiv); + + // Get the scrollbar width + var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; + totalHeight += scrollbarWidth; + + // Delete the div + document.body.removeChild(scrollDiv); + } + + f.style.height = totalHeight + "px"; } function setupFrame() { f = document.getElementById("i2ptunnelframe"); diff --git a/apps/routerconsole/jsp/torrents.jsp b/apps/routerconsole/jsp/torrents.jsp index e029a48cd..665f03985 100644 --- a/apps/routerconsole/jsp/torrents.jsp +++ b/apps/routerconsole/jsp/torrents.jsp @@ -32,7 +32,31 @@ // but does not include the margin. Therefore, any content within the iframe // should have no margins at the very top or very bottom to avoid a scrollbar. var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document; - f.style.height = doc.body.offsetHeight + "px"; + var totalHeight = doc.body.offsetHeight; + + // Detect if horizontal scrollbar is present, and add its width to height if so. + // This prevents a vertical scrollbar appearing when the min-width is passed. + // FIXME: How to detect horizontal scrollbar in iframe? Always apply for now. + if (true) { + // Create the measurement node + var scrollDiv = document.createElement("div"); + scrollDiv.className = "scrollbar-measure"; + scrollDiv.style.width = "100px"; + scrollDiv.style.height = "100px"; + scrollDiv.style.overflow = "scroll"; + scrollDiv.style.position = "absolute"; + scrollDiv.style.top = "-9999px"; + document.body.appendChild(scrollDiv); + + // Get the scrollbar width + var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; + totalHeight += scrollbarWidth; + + // Delete the div + document.body.removeChild(scrollDiv); + } + + f.style.height = totalHeight + "px"; } function setupFrame() { f = document.getElementById("i2psnarkframe"); From 2c0de05e9d557f24ce278099b0ed86b2a5a7d684 Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Jul 2012 00:18:16 +0000 Subject: [PATCH 085/104] Updates to dark console and snark themes from dr|z3d --- .../resources/themes/console/dark/console.css | 2 +- .../resources/themes/console/dark/default.css | 3 +- .../resources/themes/snark/dark/snark.css | 45 ++++++------------- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index 8dbb10cd2..62eab671e 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -1323,5 +1323,5 @@ div.applabel { /* end home page */ iframe.iframed { - margin: 15px 0 0; + margin: 10px 0 0; } diff --git a/installer/resources/themes/console/dark/default.css b/installer/resources/themes/console/dark/default.css index 49461071f..78371c13a 100644 --- a/installer/resources/themes/console/dark/default.css +++ b/installer/resources/themes/console/dark/default.css @@ -19,7 +19,8 @@ body { } body.iframed { - background: transparent url('images/transparent.gif') !important; + background: transparent url('images/transparent.gif') !important; + padding-top: 5px; } div { diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index 389f55867..083d2fbc7 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -12,6 +12,7 @@ body { body.iframed { background: transparent url('../../console/dark/images/transparent.gif') !important; margin: 1px 0 !important; + margin: 1px 0 !important; } .snarkTitle { @@ -20,11 +21,11 @@ body.iframed { text-align: center; } -.snarkRefresh:link,.snarkRefresh:visited { +.snarkRefresh:link, .snarkRefresh:visited { text-decoration: none !important; text-transform: uppercase !important; padding: 4px 16px 5px !important; - margin: -5px -8px -5px 0 !important; + margin: 0 -8px 0 0 !important; letter-spacing: 0em; font-weight: bold; font-size: 9pt; @@ -34,59 +35,41 @@ body.iframed { -moz-border-radius: 0px; -khtml-border-radius: 3px; border-radius: 0px; -/* -moz-box-shadow: inset 0 0 1px 0 #f90; - -khtml-box-shadow: inset 0 0 1px 0 #f90; - box-shadow: 0 0 1px 0 #f90; */ border: 1px outset #494; } .snarkRefresh:hover { text-decoration: none !important; text-transform: uppercase !important; - padding: 1px 16px; font-weight: bold; font-size: 9pt; color: #f50; - background: #310 url('/themes/snark/ubergine/images/snarknav_on.png') repeat-x scroll center center; background: #000 !important; -moz-border-radius: 0; -khtml-border-radius: 0; border-radius: 0; -/* -moz-box-shadow: inset 0 0 1px 0 #f90; - -khtml-box-shadow: inset 0 0 1px 0 #f90; - box-shadow: 0 0 1px #f90; */ } .snarkRefresh:active { text-decoration: none !important; - text-transform: uppercase !important; - padding: 0 16px; - font-weight: bold; - font-size: 9pt; color: #fb0; - background: #310 url('/themes/snark/ubergine/images/snarknav_on.png') repeat-x scroll center center; + background: #000 !important; } + + +.snarkRefresh:first-child { + -moz-border-radius: 3px 0 0 3px; + -khtml-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} .snarkRefresh:last-child { -moz-border-radius: 0 3px 3px 0px; -khtml-border-radius: 0 3px 3px 0; - border-radius: 0 3px 3px 0; -/* -moz-box-shadow: inset 0 0 1px 0 #f90; - -khtml-box-shadow: inset 0 0 1px 0 #f90; - box-shadow: 0 0 1px 0 #f90;*/ - border: 1px outset #494; + border-radius: 0 3px 3px 0; + margin-top: -5px !important; } - -.snarkRefresh:first-child { - -moz-border-radius: 3px 0 0 3px; - -khtml-border-radius: 3px 0 0 3px; - border-radius: 3px 0 0 3px; -/* -moz-box-shadow: inset 0 0 1px 0 #f90; - -khtml-box-shadow: inset 0 0 1px 0 #f90; - box-shadow: 0 0 1px 0 #f90; */ - border: 1px outset #494; -} - + .snarkMessages { font: normal 8pt "Lucida Console","DejaVu Sans Mono",Courier,mono !important; text-align: left; From cec58386499a2b3b8517ed4499d03d9ff6059a9a Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Jul 2012 00:48:28 +0000 Subject: [PATCH 086/104] Added newsbullets from dr|z3d to the other themes --- .../resources/themes/console/classic/console.css | 5 +++++ .../console/classic/images/newsbullet_mini.png | Bin 0 -> 270 bytes .../resources/themes/console/light/console.css | 5 +++++ .../console/light/images/newsbullet_mini.png | Bin 0 -> 270 bytes .../resources/themes/console/midnight/console.css | 5 +++++ .../console/midnight/images/newsbullet_mini.png | Bin 0 -> 354 bytes 6 files changed, 15 insertions(+) create mode 100644 installer/resources/themes/console/classic/images/newsbullet_mini.png create mode 100644 installer/resources/themes/console/light/images/newsbullet_mini.png create mode 100644 installer/resources/themes/console/midnight/images/newsbullet_mini.png diff --git a/installer/resources/themes/console/classic/console.css b/installer/resources/themes/console/classic/console.css index 6f9591417..f6b8627c5 100644 --- a/installer/resources/themes/console/classic/console.css +++ b/installer/resources/themes/console/classic/console.css @@ -243,6 +243,11 @@ div.newsheadings { margin: 0 0 0 10px; } +div.newsheadings li { + list-style: none outside url('images/newsbullet_mini.png'); + margin: 0 -4px 2px 8px; +} + div.tunnels table { margin: 0 -7px !important; width: 193px; diff --git a/installer/resources/themes/console/classic/images/newsbullet_mini.png b/installer/resources/themes/console/classic/images/newsbullet_mini.png new file mode 100644 index 0000000000000000000000000000000000000000..18154ebfce0a22c60e0fa54e25224a36e6788c0f GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!3HE-Zss2cQk(@Ik;Opq!ywFfJby(BQ1F1K zi(`n!#MTQNy_yn5j(v<5THB-`(scd86%`hz3p#5}pT$~~^4@b?J-InJJYb8ND2E>J zMTK~Y4!!4xuQxwvJp8-h-<;xk-#5scx9;aXi=3%&AQ`sZZ#Mfbj_My~D3U7aF& zEb#T5C7tpX+pW*J9<-8Zo%eM0yu=38Wu03;Nc>Va=ldx1OL3$9p4PY=#^-O0m#NJ; RmjUz(gQu&X%Q~loCIB!Ob9Mj# literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/light/console.css b/installer/resources/themes/console/light/console.css index 85e4a40dd..71be69d33 100644 --- a/installer/resources/themes/console/light/console.css +++ b/installer/resources/themes/console/light/console.css @@ -248,6 +248,11 @@ div.newsheadings { margin: 0 0 0 10px; } +div.newsheadings li { + list-style: none outside url('images/newsbullet_mini.png'); + margin: 0 -4px 2px 8px; +} + div.tunnels { margin-top: 6px !important; margin-left: -2px !important; diff --git a/installer/resources/themes/console/light/images/newsbullet_mini.png b/installer/resources/themes/console/light/images/newsbullet_mini.png new file mode 100644 index 0000000000000000000000000000000000000000..18154ebfce0a22c60e0fa54e25224a36e6788c0f GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!3HE-Zss2cQk(@Ik;Opq!ywFfJby(BQ1F1K zi(`n!#MTQNy_yn5j(v<5THB-`(scd86%`hz3p#5}pT$~~^4@b?J-InJJYb8ND2E>J zMTK~Y4!!4xuQxwvJp8-h-<;xk-#5scx9;aXi=3%&AQ`sZZ#Mfbj_My~D3U7aF& zEb#T5C7tpX+pW*J9<-8Zo%eM0yu=38Wu03;Nc>Va=ldx1OL3$9p4PY=#^-O0m#NJ; RmjUz(gQu&X%Q~loCIB!Ob9Mj# literal 0 HcmV?d00001 diff --git a/installer/resources/themes/console/midnight/console.css b/installer/resources/themes/console/midnight/console.css index db8322fe0..e47b4b056 100644 --- a/installer/resources/themes/console/midnight/console.css +++ b/installer/resources/themes/console/midnight/console.css @@ -274,6 +274,11 @@ div.newsheadings { margin: 0 0 0 10px; } +div.newsheadings li { + list-style: none outside url('images/newsbullet_mini.png'); + margin: 0 -4px 2px 8px; +} + div.tunnels table{ margin: -2px 0px -4px 2px !important; text-align: center !important; diff --git a/installer/resources/themes/console/midnight/images/newsbullet_mini.png b/installer/resources/themes/console/midnight/images/newsbullet_mini.png new file mode 100644 index 0000000000000000000000000000000000000000..534df54fde669cd804379a9aad564068a98dec27 GIT binary patch literal 354 zcmV-o0iFJdP)pG6iGxuR49>^kg-YwK@>&LdxU^sB`7W%`~WLK@DGG^f>@^#{R=C9 z!qyK+B`64@l}*wc5CYkmDFq=A4D4Q;T^Q4On>TQ{ciy{@DaLr(y;DlVoP`jMVvLg* z<0PeY+vBh9LI{_VmXhv)y$-nhwxnYKNwZDk+TF*J)fU2ra-2DOA&3`eoZ!S*VA?JB3&HM=EvJ3gkpKVy07*qoM6N<$f~c>W AWB>pF literal 0 HcmV?d00001 From f13a1b2aed4ae03226a471a859ca3e0220374707 Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Jul 2012 00:54:05 +0000 Subject: [PATCH 087/104] Tweak to snark dark theme from dr|z3d --- installer/resources/themes/snark/dark/snark.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index 083d2fbc7..085c191af 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -890,7 +890,7 @@ code {; .snarknavbar { margin: -10px 0 5px 0 !important; - padding: 14px 10px 7px; + padding: 12px 10px 10px; /* border: 1px solid #101; -moz-border-radius: 0 0 8px 8px; From 8360a2f4e7552f7a6dff5748c91e97fbdc0ec30b Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Jul 2012 01:29:04 +0000 Subject: [PATCH 088/104] Console theme hacks from dr|z3d to target specific Opera oddity --- installer/resources/themes/console/classic/console.css | 4 ++++ installer/resources/themes/console/dark/console.css | 7 ++++++- installer/resources/themes/console/dark/console_ar.css | 7 +++++++ installer/resources/themes/console/light/console.css | 5 +++++ installer/resources/themes/console/midnight/console.css | 5 +++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/installer/resources/themes/console/classic/console.css b/installer/resources/themes/console/classic/console.css index f6b8627c5..93eb6bf69 100644 --- a/installer/resources/themes/console/classic/console.css +++ b/installer/resources/themes/console/classic/console.css @@ -609,6 +609,10 @@ span.newtab { float: right; letter-spacing: 0; } +/* opera targetted hack */ +x:-o-prefocus, span.newtab { + margin-top: -25px; +} h2 { font-size: 14pt; diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index 62eab671e..67b868d6f 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -38,7 +38,7 @@ div.logo { float: left; padding: 10px; text-align: center; - font-color: #EE9; + color: #EE9; margin: 0 20px 0 20px; border: 1px solid #494; -moz-border-radius: 4px; @@ -775,6 +775,11 @@ span.newtab { letter-spacing: 0; } +/* opera targetted hack */ +x:-o-prefocus, span.newtab { + margin-top: -25px; +} + h2 { font-size: 12pt; color: #EE9; diff --git a/installer/resources/themes/console/dark/console_ar.css b/installer/resources/themes/console/dark/console_ar.css index aafc5e2a4..222553434 100644 --- a/installer/resources/themes/console/dark/console_ar.css +++ b/installer/resources/themes/console/dark/console_ar.css @@ -82,3 +82,10 @@ div.joblog li, div.newsheadings li { text-align: left; direction: ltr; } + +span.newtab { + text-align: left; + font-size: 8pt; + float: left; + letter-spacing: 0; +} diff --git a/installer/resources/themes/console/light/console.css b/installer/resources/themes/console/light/console.css index 71be69d33..d196d4441 100644 --- a/installer/resources/themes/console/light/console.css +++ b/installer/resources/themes/console/light/console.css @@ -904,6 +904,11 @@ span.newtab { letter-spacing: 0; } +/* opera targetted hack */ +x:-o-prefocus, span.newtab { + margin-top: -25px; +} + h2 { font-size: 13pt; color: #115; diff --git a/installer/resources/themes/console/midnight/console.css b/installer/resources/themes/console/midnight/console.css index e47b4b056..f6bda3df9 100644 --- a/installer/resources/themes/console/midnight/console.css +++ b/installer/resources/themes/console/midnight/console.css @@ -624,6 +624,11 @@ span.newtab { letter-spacing: 0; } +/* opera targetted hack */ +x:-o-prefocus, span.newtab { + margin-top: -25px; +} + h2 { font-size: 13pt; padding: 10px 10px 10px 10px; From a123def967f05ca94aaa5dfe8a1e990fa1182d16 Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Jul 2012 01:38:14 +0000 Subject: [PATCH 089/104] Inter-browser fixes for dark snark theme from dr|z3d --- .../resources/themes/snark/dark/snark.css | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index 085c191af..8ace8e7c3 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -352,7 +352,9 @@ td:first-child { font-size: 8.5pt; font-weight: bold; text-align: center !important; - color: #bbb !important; + color: #4f2 !important; + padding: 5px; + border-bottom: 1px solid #494; } .snarkTorrentStatus { @@ -570,7 +572,7 @@ input.r { border: 1px solid #494; } -input[type=submit] { +input[type=submit], input[type=submit]:visited, input[type=submit]:focus { text-shadow: 0px 0px #410; color: #494; background: #000; @@ -589,8 +591,9 @@ input[type=submit]:hover { } input[type=submit]:active { - background: #000 !important; - color: #f60 !important; + border: 1px inset #f60; + background: #f60; + color: #EE9; text-shadow: 0 !important; } @@ -614,6 +617,10 @@ input[type=text]:active, input[type=text]:hover, input.r:hover { border: 1px solid #494; box-shadow: none !important; } + +input[type=text], input.r { + min-width: 60px; +} input[type=radio] { padding: 2px; @@ -684,7 +691,8 @@ select { -khtml-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; border: 1px solid #494; - margin: 2px 4px 2px 0; + margin: 2px 4px 2px 0; + min-width: 90px; } select:hover, textarea:hover { @@ -889,7 +897,7 @@ code {; } .snarknavbar { - margin: -10px 0 5px 0 !important; + margin: -9px 0 6px 0 !important; padding: 12px 10px 10px; /* border: 1px solid #101; @@ -911,6 +919,11 @@ code {; width: 70%; text-align: center; } + +/* opera targetted hack */ +x:-o-prefocus, .snarknavbar { + margin: -7px 0 5px 0 !important; +} .snarknavbar img { border: 0; From e0ff0c63c8ef45073cb0182140b1f338b6141e4d Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Jul 2012 03:46:23 +0000 Subject: [PATCH 090/104] Moved susimail CSS into themes dir --- .../src/src/i2p/susi/webmail/WebMail.java | 22 +++++++++++------- .../themes/susimail/light/images}/3down.png | Bin .../themes/susimail/light/images}/3up.png | Bin .../susimail/light/images}/susimail.png | Bin .../themes/susimail/light/susimail.css | 0 5 files changed, 14 insertions(+), 8 deletions(-) rename {apps/susimail/src => installer/resources/themes/susimail/light/images}/3down.png (100%) rename {apps/susimail/src => installer/resources/themes/susimail/light/images}/3up.png (100%) rename {apps/susimail/src => installer/resources/themes/susimail/light/images}/susimail.png (100%) rename apps/susimail/src/css.css => installer/resources/themes/susimail/light/susimail.css (100%) diff --git a/apps/susimail/src/src/i2p/susi/webmail/WebMail.java b/apps/susimail/src/src/i2p/susi/webmail/WebMail.java index 3f73b6533..65cb6404a 100644 --- a/apps/susimail/src/src/i2p/susi/webmail/WebMail.java +++ b/apps/susimail/src/src/i2p/susi/webmail/WebMail.java @@ -164,6 +164,9 @@ public class WebMail extends HttpServlet private static final String CONFIG_BCC_TO_SELF = "composer.bcc.to.self"; + private static final String CONFIG_THEME = "theme"; + private static final String DEFAULT_THEME = "light"; + private static final String spacer = "   "; private static final String thSpacer = "
 
\n" + "\n" + - thSpacer + "" + - thSpacer + "" + - thSpacer + "" + - thSpacer + "" ); + thSpacer + "" + + thSpacer + "" + + thSpacer + "" + + thSpacer + "" ); int bg = 0; int i = 0; for( Iterator it = sessionObject.folder.currentPageIterator(); it != null && it.hasNext(); ) { diff --git a/apps/susimail/src/3down.png b/installer/resources/themes/susimail/light/images/3down.png similarity index 100% rename from apps/susimail/src/3down.png rename to installer/resources/themes/susimail/light/images/3down.png diff --git a/apps/susimail/src/3up.png b/installer/resources/themes/susimail/light/images/3up.png similarity index 100% rename from apps/susimail/src/3up.png rename to installer/resources/themes/susimail/light/images/3up.png diff --git a/apps/susimail/src/susimail.png b/installer/resources/themes/susimail/light/images/susimail.png similarity index 100% rename from apps/susimail/src/susimail.png rename to installer/resources/themes/susimail/light/images/susimail.png diff --git a/apps/susimail/src/css.css b/installer/resources/themes/susimail/light/susimail.css similarity index 100% rename from apps/susimail/src/css.css rename to installer/resources/themes/susimail/light/susimail.css From 50cfd52c233ec74adb25202cc7608dc8f0c7fec0 Mon Sep 17 00:00:00 2001 From: str4d Date: Sat, 14 Jul 2012 06:27:23 +0000 Subject: [PATCH 091/104] Moved susidns CSS into themes dir (required moving loadConfig into BaseBean.java) --- .../src/i2p/susi/dns/AddressbookBean.java | 34 +--------- .../src/java/src/i2p/susi/dns/BaseBean.java | 64 ++++++++++++++++++ .../src/i2p/susi/dns/SubscriptionsBean.java | 30 +------- apps/susidns/src/jsp/addressbook.jsp | 4 +- apps/susidns/src/jsp/config.jsp | 5 +- apps/susidns/src/jsp/details.jsp | 4 +- apps/susidns/src/jsp/index.jsp | 7 +- apps/susidns/src/jsp/subscriptions.jsp | 4 +- .../themes/susidns/light}/images/how.png | Bin .../themes/susidns/light}/images/how_fr.png | Bin .../themes/susidns/light}/images/logo.png | Bin .../themes/susidns/light/susidns.css | 0 12 files changed, 80 insertions(+), 72 deletions(-) create mode 100644 apps/susidns/src/java/src/i2p/susi/dns/BaseBean.java rename {apps/susidns/src => installer/resources/themes/susidns/light}/images/how.png (100%) rename {apps/susidns/src => installer/resources/themes/susidns/light}/images/how_fr.png (100%) rename {apps/susidns/src => installer/resources/themes/susidns/light}/images/logo.png (100%) rename apps/susidns/src/css.css => installer/resources/themes/susidns/light/susidns.css (100%) diff --git a/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java b/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java index 93729cad1..883184ee1 100644 --- a/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java +++ b/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java @@ -40,11 +40,10 @@ import net.i2p.data.DataHelper; import net.i2p.data.Destination; import net.i2p.util.SecureFileOutputStream; -public class AddressbookBean +public class AddressbookBean extends BaseBean { protected String book, action, serial, lastSerial, filter, search, hostname, destination; protected int beginIndex, endIndex; - protected final Properties properties; private Properties addressbook; private int trClass; protected final LinkedList deletionMarks; @@ -82,41 +81,12 @@ public class AddressbookBean public AddressbookBean() { - properties = new Properties(); + super(); deletionMarks = new LinkedList(); beginIndex = 0; endIndex = DISPLAY_SIZE - 1; } - private long configLastLoaded = 0; - private static final String PRIVATE_BOOK = "private_addressbook"; - private static final String DEFAULT_PRIVATE_BOOK = "../privatehosts.txt"; - - protected void loadConfig() - { - long currentTime = System.currentTimeMillis(); - - if( !properties.isEmpty() && currentTime - configLastLoaded < 10000 ) - return; - - FileInputStream fis = null; - try { - properties.clear(); - fis = new FileInputStream( ConfigBean.configFileName ); - properties.load( fis ); - // added in 0.5, for compatibility with 0.4 config.txt - if( properties.getProperty(PRIVATE_BOOK) == null) - properties.setProperty(PRIVATE_BOOK, DEFAULT_PRIVATE_BOOK); - configLastLoaded = currentTime; - } - catch (Exception e) { - Debug.debug( e.getClass().getName() + ": " + e.getMessage() ); - } finally { - if (fis != null) - try { fis.close(); } catch (IOException ioe) {} - } - } - public String getFileName() { loadConfig(); diff --git a/apps/susidns/src/java/src/i2p/susi/dns/BaseBean.java b/apps/susidns/src/java/src/i2p/susi/dns/BaseBean.java new file mode 100644 index 000000000..a5cc49e2d --- /dev/null +++ b/apps/susidns/src/java/src/i2p/susi/dns/BaseBean.java @@ -0,0 +1,64 @@ +package i2p.susi.dns; + +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Properties; + +/** + * Holds methods common to several Beans. + * @since 0.9.1 + */ +public class BaseBean +{ + protected final Properties properties; + + private long configLastLoaded = 0; + private static final String PRIVATE_BOOK = "private_addressbook"; + private static final String DEFAULT_PRIVATE_BOOK = "../privatehosts.txt"; + + public static final String PROP_THEME_NAME = "theme"; + public static final String DEFAULT_THEME = "light"; + public static final String BASE_THEME_PATH = "/themes/susidns/"; + + public BaseBean() + { + properties = new Properties(); + } + + protected void loadConfig() + { + long currentTime = System.currentTimeMillis(); + + if( !properties.isEmpty() && currentTime - configLastLoaded < 10000 ) + return; + + FileInputStream fis = null; + try { + properties.clear(); + fis = new FileInputStream( ConfigBean.configFileName ); + properties.load( fis ); + // added in 0.5, for compatibility with 0.4 config.txt + if( properties.getProperty(PRIVATE_BOOK) == null) + properties.setProperty(PRIVATE_BOOK, DEFAULT_PRIVATE_BOOK); + configLastLoaded = currentTime; + } + catch (Exception e) { + Debug.debug( e.getClass().getName() + ": " + e.getMessage() ); + } finally { + if (fis != null) + try { fis.close(); } catch (IOException ioe) {} + } + } + + /** + * Returns the theme path + * @since 0.9.1 + */ + public String getTheme() { + loadConfig(); + String url = BASE_THEME_PATH; + String theme = properties.getProperty(PROP_THEME_NAME, DEFAULT_THEME); + url += theme + "/"; + return url; + } +} diff --git a/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java b/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java index 69597f270..8675613c5 100644 --- a/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java +++ b/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java @@ -36,38 +36,10 @@ import java.util.Properties; import net.i2p.I2PAppContext; import net.i2p.util.SecureFileOutputStream; -public class SubscriptionsBean +public class SubscriptionsBean extends BaseBean { private String action, fileName, content, serial, lastSerial; - Properties properties; - - public SubscriptionsBean() - { - properties = new Properties(); - } - private long configLastLoaded = 0; - private void loadConfig() - { - long currentTime = System.currentTimeMillis(); - - if( !properties.isEmpty() && currentTime - configLastLoaded < 10000 ) - return; - - FileInputStream fis = null; - try { - properties.clear(); - fis = new FileInputStream( ConfigBean.configFileName ); - properties.load( fis ); - configLastLoaded = currentTime; - } - catch (Exception e) { - Debug.debug( e.getClass().getName() + ": " + e.getMessage() ); - } finally { - if (fis != null) - try { fis.close(); } catch (IOException ioe) {} - } - } public String getAction() { return action; } diff --git a/apps/susidns/src/jsp/addressbook.jsp b/apps/susidns/src/jsp/addressbook.jsp index fe9666473..61487f811 100644 --- a/apps/susidns/src/jsp/addressbook.jsp +++ b/apps/susidns/src/jsp/addressbook.jsp @@ -47,12 +47,12 @@ ${book.book} <%=intl._("address book")%> - susidns - +


" + sortHeader( SORT_SENDER, _("Sender") ) + "" + sortHeader( SORT_SUBJECT, _("Subject") ) + "" + sortHeader( SORT_DATE, _("Date") ) + sortHeader( SORT_ID, "" ) + "" + sortHeader( SORT_SIZE, _("Size") ) + "
" + sortHeader( SORT_SENDER, _("Sender"), sessionObject.imgPath ) + "" + sortHeader( SORT_SUBJECT, _("Subject"), sessionObject.imgPath ) + "" + sortHeader( SORT_DATE, _("Date"), sessionObject.imgPath ) + sortHeader( SORT_ID, "", sessionObject.imgPath ) + "" + sortHeader( SORT_SIZE, _("Size"), sessionObject.imgPath ) + "
" + - "") .append(_("Email")) @@ -225,7 +225,7 @@ public class SummaryBarRenderer { .append(_("I2PTunnel")) .append("\n" + - "") .append(_("Addressbook")) diff --git a/apps/routerconsole/jsp/dns.jsp b/apps/routerconsole/jsp/dns.jsp new file mode 100644 index 000000000..ab29f4008 --- /dev/null +++ b/apps/routerconsole/jsp/dns.jsp @@ -0,0 +1,78 @@ +<%@page contentType="text/html"%> +<%@page trimDirectiveWhitespaces="true"%> +<%@page pageEncoding="UTF-8"%> + +" /> +<% + // CSSHelper is also pulled in by css.jsi below... + boolean testIFrame = tester.allowIFrame(request.getHeader("User-Agent")); + if (!testIFrame) { + response.setStatus(302, "Moved"); + response.setHeader("Location", "/susidns/index"); + } else { +%> + + + +<%@include file="css.jsi" %> +<%=intl.title("addressbook")%> + + + + +<%@include file="summary.jsi" %> + +

<%=intl._("I2P Addressbook")%> ">images/newtab.png" />

+
+ +
+<% + } +%> diff --git a/apps/routerconsole/jsp/webmail.jsp b/apps/routerconsole/jsp/webmail.jsp new file mode 100644 index 000000000..1d9ae1cd6 --- /dev/null +++ b/apps/routerconsole/jsp/webmail.jsp @@ -0,0 +1,78 @@ +<%@page contentType="text/html"%> +<%@page trimDirectiveWhitespaces="true"%> +<%@page pageEncoding="UTF-8"%> + +" /> +<% + // CSSHelper is also pulled in by css.jsi below... + boolean testIFrame = tester.allowIFrame(request.getHeader("User-Agent")); + if (!testIFrame) { + response.setStatus(302, "Moved"); + response.setHeader("Location", "/susimail/susimail"); + } else { +%> + + + +<%@include file="css.jsi" %> +<%=intl.title("webmail")%> + + + + +<%@include file="summary.jsi" %> + +

<%=intl._("I2P Webmail")%> ">images/newtab.png" />

+
+ +
+<% + } +%> diff --git a/installer/resources/readme/readme.html b/installer/resources/readme/readme.html index 3834b3d79..0e3405d14 100644 --- a/installer/resources/readme/readme.html +++ b/installer/resources/readme/readme.html @@ -9,7 +9,7 @@
  • Invisible Internet & Public Web Browsing
    On I2P you can access anonymous websites (eepsites) and other services (e.g. ssh over I2P, IRC, Jabber etc.) in addition to being able to host your own services. You can also access the normal web anonymously via I2P's built-in web proxy (outproxy). Configure your browser to use the HTTP proxy at 127.0.0.1 port 4444, then browse to an eepsite or a normal, unencrypted http:// address. If you wish to disable or change outproxy access to the normal internet, remove or modify the outproxy entry for false.i2p under the Outproxies option in the I2P HTTP Proxy Tunnel Editor. In the "Sites of Interest" section below, we list a few of the sites hosted on I2P.
  • -
  • Anonymous E-Mail
    Postman's I2P-based mail system can be accessed either via I2P's built-in mail client +
  • Anonymous E-Mail
    Postman's I2P-based mail system can be accessed either via I2P's built-in mail client (susimail) or using any mail client that supports smtp and pop3. Accounts can send and receive mail from the normal internet. For an account, visit hq.postman.i2p. Additionally, I2P-Bote is a new I2P-internal serverless, secure (end-to-end encrypted) e-mail system with an integrated anonymous/pseudonymous remailer, providing a web interface and a built-in addressbook. It is developed by HungryHobo, and can be installed as a plugin.
  • diff --git a/installer/resources/readme/readme_de.html b/installer/resources/readme/readme_de.html index d72cb2f63..6dc9e9053 100644 --- a/installer/resources/readme/readme_de.html +++ b/installer/resources/readme/readme_de.html @@ -25,7 +25,7 @@ kompatibel zu normalen Email-Klienten (POP3/SMTP) ist, und welches es erlaubt, Emails innerhalb von I2P sowie Emails von und ins normale Internet zu schicken. Hole Dir Dein Emailkonto auf hq.postman.i2p. - Im Verbund damit gibt es susimail, einen + Im Verbund damit gibt es susimail, einen browserbasierten anonymen POP3/SMTP-Klienten, fertig eingerichtet für Postmans Email-Service.
    Oder probier unser neues serverloses und Ende-zu-Ende-verschlüsseltes Emailsystem I2P-Bote (mit Webinterface) aus, welches als Plugin erhältlich ist! diff --git a/installer/resources/readme/readme_es.html b/installer/resources/readme/readme_es.html index 97467779a..0d5e07bea 100644 --- a/installer/resources/readme/readme_es.html +++ b/installer/resources/readme/readme_es.html @@ -17,7 +17,7 @@
  • navegar en internet - I2P cuenta con un HTTP-"Outproxy". Para poder usarlo, puedes también utilizar el proxy HTTP en el puerto 4444 - Si configuras tu navegador web para usar este proxy, puedes visitar las páginas web de forma anónima. El tráfico será enrutado através de la red I2P.
  • intercambiar datos - Hay una adaptación para I2P de la aplicación BitTorrent Snark.
  • -
  • correo electrónico anónimo - Postman creó un sistema de correo electrónico que es compatible con las aplicaciones de correo comunes (POP3/SMTP), el cual permite enviar correos electrónicos tanto dentro de I2P como recibir y mandar correos de/a internet. Puedes registrar tu cuenta en hq.postman.i2p. Junto a esto tenemos susimail, un cliente anónimo de correo que se abre en el navegador web. Ya está configurado para el servicio de Postman.
    También te recomendamos nuestro nuevo sistema de correo electrónico sin servidor I2P-Bote, que existe en forma de plugin. Viene con una interfaz web y cifra todos los mensajes de fin a fin.
  • +
  • correo electrónico anónimo - Postman creó un sistema de correo electrónico que es compatible con las aplicaciones de correo comunes (POP3/SMTP), el cual permite enviar correos electrónicos tanto dentro de I2P como recibir y mandar correos de/a internet. Puedes registrar tu cuenta en hq.postman.i2p. Junto a esto tenemos susimail, un cliente anónimo de correo que se abre en el navegador web. Ya está configurado para el servicio de Postman.
    También te recomendamos nuestro nuevo sistema de correo electrónico sin servidor I2P-Bote, que existe en forma de plugin. Viene con una interfaz web y cifra todos los mensajes de fin a fin.
  • chat anónimo - Lanza tu cliente IRC preferido y conéctate con el servidor anónimo en 127.0.0.1 puerto 6668. Esto te llevará a uno de dos servidores anónimos de IRC - y ni tu ni los demás usuarios sabrán quien es el otro, ni siquiera el administrador del servidor.
  • diff --git a/installer/resources/readme/readme_fr.html b/installer/resources/readme/readme_fr.html index 73fa6ec62..e3346af47 100644 --- a/installer/resources/readme/readme_fr.html +++ b/installer/resources/readme/readme_fr.html @@ -34,7 +34,7 @@ mandataire 127.0.0.1 sur le port 4444, puis promenez-vous sur les s ci-dessous, vous trouverez notre petite sélection de sites hébergés sur I2P.
  • Messagerie anonyme
    Le système de messagerie basé sur I2P de Postman est utilisable soit -par le client de messagerie I2P intégré dans la console du routeur (susimail), soit en +par le client de messagerie I2P intégré dans la console du routeur (susimail), soit en configurant n'importe quel logiciel client de messagerie compatible SMTP et POP3. Les comptes peuvent recevoir et envoyer du courrier de/vers l'Internet normal. Créez au moins votre compte sur hq.postman.i2p. En complément, diff --git a/installer/resources/readme/readme_nl.html b/installer/resources/readme/readme_nl.html index c0d37721e..3a3a9cf19 100644 --- a/installer/resources/readme/readme_nl.html +++ b/installer/resources/readme/readme_nl.html @@ -9,7 +9,7 @@
  • Invisible Internet & Public Web Browsing
    Op I2P kan je toegang verkrijgen tot anonieme websites (eepsites) en andere diensten (zoals; SSH over I2P, IRC, Jabber etc.), daarnaast heb je ook de mogelijkheid om je eigen dienst aan te bieden. Je kan ook anoniem toegang krijgen tot het normale Internet via de ingebouwde web proxy (outproxy). Configureer je browser voor het gebruik van de HTTP proxy op 127.0.0.1 poort 4444, waarna je naar zowel eepsites als normale, onversleutelde http:// websites kan surfen. Als je een aanpassing wilt maken aan de outproxy of deze wilt uitschakelen kan je de 'client tunnel' voor false.i2p onder het Outproxies gedeelte in de I2P HTTP Proxy Tunnel Editor. In het "Interessante websites" gedeelte hier onder staat een lijst met een paar van de bekende sites die op I2P gehost worden.
  • -
  • Anonieme E-Mail
    Postman's I2P email systeem kan worden benaderd via de ingebouwde email client +
  • Anonieme E-Mail
    Postman's I2P email systeem kan worden benaderd via de ingebouwde email client (susimail) of door het gebruik van elke andere normale email client die ondersteuning biedt voor SMTP en POP3. Deze accounts kunnen tevens email versturen en ontvangen naar en van het normale Internet. Voor een account, bezoek hq.postman.i2p. Daarnaast is er I2P-Bote, dit is een nieuw end-to-end versleuteld email systeem zonder centrale servers welke een webinterface en geïntegreerd adressen boek bied. Het is ontwikkeld door HungryHobo en kan worden geïnstalleerd als plugin.
  • diff --git a/installer/resources/readme/readme_pt.html b/installer/resources/readme/readme_pt.html index 2b6768420..42de32742 100644 --- a/installer/resources/readme/readme_pt.html +++ b/installer/resources/readme/readme_pt.html @@ -17,7 +17,7 @@
  • navegar na internet - I2P dispõe de um "outproxy" http - para usâ-lo, também pode empregar o proxy http no porto 4444 - Se configurar o seu navegador web para usar este proxy, pode visitar as páginas web de maneira anônima e o trânsito será roteado atravez da rede I2P.
  • trocar dados - Ha uma adaptação para I2P da aplicação BitTorrent Snark.
  • -
  • correio eletrônico anônimo - O Postman fez um sistema de correio eletrônico que é compatível com as aplicações de correio eletrônico comunes (POP3/SMTP), o qual permite de enviar correios eletrônicos tanto dentro de I2P como também receber e mandar correios desde a / para a internet. Pode registrar a sua conta aqui: hq.postman.i2p. Junto com isso temos susimail, um cliente anônimo de correio que se abre com o navegador web. Já está configurado para o servício de Postman.
    Também lhe recomendamos o nosso novo sistema de correio eletrônico sem servidor I2P-Bote, que existe em forma de um plugin. Vem com uma interface web e criptografa todas as mensagens de final a final.
  • +
  • correio eletrônico anônimo - O Postman fez um sistema de correio eletrônico que é compatível com as aplicações de correio eletrônico comunes (POP3/SMTP), o qual permite de enviar correios eletrônicos tanto dentro de I2P como também receber e mandar correios desde a / para a internet. Pode registrar a sua conta aqui: hq.postman.i2p. Junto com isso temos susimail, um cliente anônimo de correio que se abre com o navegador web. Já está configurado para o servício de Postman.
    Também lhe recomendamos o nosso novo sistema de correio eletrônico sem servidor I2P-Bote, que existe em forma de um plugin. Vem com uma interface web e criptografa todas as mensagens de final a final.
  • bate-papo anônimo - Lance o seu cliente IRC preferido e conécte-se com o servidor anônimamente en 127.0.0.1 porto 6668. Isto lhe levará a um dos dois servidores anônimos de IRC oficiales em I2P - e nem você nem os outros usuários sabrão quem é o outro, nem mesmo o administrador do servidor!
  • diff --git a/installer/resources/readme/readme_sv.html b/installer/resources/readme/readme_sv.html index 55d07efa5..c7277ff5e 100644 --- a/installer/resources/readme/readme_sv.html +++ b/installer/resources/readme/readme_sv.html @@ -43,7 +43,7 @@ fungerar med vanliga email-klienter och från det vanliga Internet! skaffa dig ett konto hos hq.postman.i2p. - Vi skickar med susimail, + Vi skickar med susimail, som är en webb-baserad anonymt inriktad pop3/smtp-klient, inställd till att ansluta till postmans email-tjänst.
  • chatta anonymt - starta din IRC-klient och anslut till diff --git a/installer/resources/readme/readme_zh.html b/installer/resources/readme/readme_zh.html index 7ba9c528c..f928843f7 100644 --- a/installer/resources/readme/readme_zh.html +++ b/installer/resources/readme/readme_zh.html @@ -15,7 +15,7 @@ I2P网络中还有很多其他站点 - 访问上面的网站你会找到更多,别忘了收藏你喜爱的 I2P 网站方便访问。
  • 浏览 Web 网页 - 目前 IP2 网络中的出口代理("Outproxy")只有一个,它的HTTP代理映射在本机的4444端口上。- 将浏览器的代理设置指向为上述地址(127.0.0.1:4444)后,访问任何普通链接即可 - 您的HTTP请求将在 I2P 网络内部传递。
  • 文件交换 - I2P的其中一个本地 端口 用于内置的 Snark BitTorrent 客户端。
  • -
  • 匿名电邮 - 由POSTMAN维护的邮件系统支持普通邮件客户端(POP3 / SMTP),这个系统可以在 I2P 网络内部收发 Email 也可以收发来自外部 Internet 的邮件!建立I2P邮件帐户请到 hq.postman.i2p 申请。I2P中集成有Web界面的pop3/stmp邮件客户端 SUSIMail,并配置为使用POSTMAN 的邮件服务。
  • +
  • 匿名电邮 - 由POSTMAN维护的邮件系统支持普通邮件客户端(POP3 / SMTP),这个系统可以在 I2P 网络内部收发 Email 也可以收发来自外部 Internet 的邮件!建立I2P邮件帐户请到 hq.postman.i2p 申请。I2P中集成有Web界面的pop3/stmp邮件客户端 SUSIMail,并配置为使用POSTMAN 的邮件服务。
  • 匿名聊天 - 打开你的 IRC 聊天程序,连接至 127.0.0.1:6668 即可访问I2P的匿名聊天室,如果您的聊天客户端配置错误泄露IP(DDC,MSG)我们的匿名服务器会自动过滤掉这些数据不让对方发现你,如果您的IRC设置正确无论服务器还是其他聊天的人都不知道您在哪里。
  • 匿名博客 - 参见 Syndie
  • 以及其他服务。
  • diff --git a/installer/resources/themes/susidns/light/susidns.css b/installer/resources/themes/susidns/light/susidns.css index e39060eaf..5df442434 100644 --- a/installer/resources/themes/susidns/light/susidns.css +++ b/installer/resources/themes/susidns/light/susidns.css @@ -4,6 +4,11 @@ body { color:#001; } +body.iframed { + background: transparent !important; + margin: 0; +} + p { color:black; line-height:12pt; @@ -121,6 +126,10 @@ p.footer { -moz-box-shadow: inset 0px 0px 1px 0px #002; } +.iframed .page { + margin: 0 20px; +} + input[type=submit] { border: 1px outset #999; background: #ddf; diff --git a/installer/resources/themes/susimail/light/susimail.css b/installer/resources/themes/susimail/light/susimail.css index 8af8b1ae0..f91537572 100644 --- a/installer/resources/themes/susimail/light/susimail.css +++ b/installer/resources/themes/susimail/light/susimail.css @@ -4,6 +4,11 @@ body { font-family:"Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif; } +body.iframed { + background: transparent !important; + margin: 0; +} + li { color:#001; @@ -112,6 +117,10 @@ pre { text-align: center; } +.iframed .page { + margin: 0 20px; +} + table { text-align: justify; width: 100%; From a419347eba4baa6862a21b20f04a5134c4af8d75 Mon Sep 17 00:00:00 2001 From: str4d Date: Sun, 15 Jul 2012 11:03:51 +0000 Subject: [PATCH 093/104] Added preliminary dark susimail and susidns themes Add "theme=dark" to susidns config page, or "susimail.theme=dark" to susimail.config file, to enable the dark themes. --- apps/susidns/src/jsp/index.jsp | 2 +- .../resources/themes/susidns/dark/susidns.css | 299 ++++++++++++++++++ .../themes/susidns/{light => }/images/how.png | Bin .../susidns/{light => }/images/how_fr.png | Bin .../themes/susimail/dark/images/3down.png | Bin 0 -> 232 bytes .../themes/susimail/dark/images/3up.png | Bin 0 -> 243 bytes .../themes/susimail/dark/susimail.css | 255 +++++++++++++++ 7 files changed, 555 insertions(+), 1 deletion(-) create mode 100644 installer/resources/themes/susidns/dark/susidns.css rename installer/resources/themes/susidns/{light => }/images/how.png (100%) rename installer/resources/themes/susidns/{light => }/images/how_fr.png (100%) create mode 100644 installer/resources/themes/susimail/dark/images/3down.png create mode 100644 installer/resources/themes/susimail/dark/images/3up.png create mode 100644 installer/resources/themes/susimail/dark/susimail.css diff --git a/apps/susidns/src/jsp/index.jsp b/apps/susidns/src/jsp/index.jsp index 10cb8be67..d90a4d763 100644 --- a/apps/susidns/src/jsp/index.jsp +++ b/apps/susidns/src/jsp/index.jsp @@ -86,7 +86,7 @@ <%=intl._("Hosts in the private address book can be accessed by you but their addresses are never distributed to others.")%> <%=intl._("The private address book can also be used for aliases of hosts in your other address books.")%>

    -
    address book working scheme
    +
    address book working scheme