Author: zothar
Date: 2006-12-18 23:18:38 +0000 (Mon, 18 Dec 2006)
New Revision: 11476
Modified:
trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java
trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java
Log:
Reduce precision of positioning of peer marks on Peer Location Distribution
circle (do we even need hundreths of a pixel?). Clean a few XHTML validation
issues.
Modified: trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
2006-12-18 22:47:56 UTC (rev 11475)
+++ trunk/freenet/src/freenet/clients/http/StatisticsToadlet.java
2006-12-18 23:18:38 UTC (rev 11476)
@@ -506,11 +506,11 @@
loadStatsInfobox.addChild("div", "class",
"infobox-header", "Load limiting");
HTMLNode loadStatsContent =
loadStatsInfobox.addChild("div", "class", "infobox-content");
HTMLNode loadStatsList =
loadStatsContent.addChild("ul");
- loadStatsList.addChild("ul", "Global window:
"+window);
- loadStatsList.addChild("ul",
starters.statsPageLine(false, false));
- loadStatsList.addChild("ul",
starters.statsPageLine(true, false));
- loadStatsList.addChild("ul",
starters.statsPageLine(false, true));
- loadStatsList.addChild("ul",
starters.statsPageLine(true, true));
+ loadStatsList.addChild("li", "Global window:
"+window);
+ loadStatsList.addChild("li",
starters.statsPageLine(false, false));
+ loadStatsList.addChild("li",
starters.statsPageLine(true, false));
+ loadStatsList.addChild("li",
starters.statsPageLine(false, true));
+ loadStatsList.addChild("li",
starters.statsPageLine(true, true));
nextTableCell = overviewTableRow.addChild("td");
// node version information box
@@ -539,6 +539,7 @@
}
private final static int PEER_CIRCLE_RADIUS = 100;
+ private final DecimalFormat fix4p2 = new DecimalFormat("###0.0#");
private void addPeerCircle (HTMLNode htmlNode) {
HTMLNode peerCircleInfoboxContentDiv = htmlNode.addChild("div",
new String[] { "style", "class" }, new String[] {"position: relative; height: "
+ (PEER_CIRCLE_RADIUS * 2 + 10) + "px", "peercircle" });
@@ -570,6 +571,6 @@
double x = PEER_CIRCLE_RADIUS + Math.sin(peerLocation) *
(PEER_CIRCLE_RADIUS - offset);
double y = PEER_CIRCLE_RADIUS - Math.cos(peerLocation) *
(PEER_CIRCLE_RADIUS - offset);
//
- return "position: absolute; top: " + y + "px; left: " + x +
"px";
+ return "position: absolute; top: " + fix4p2.format(y) + "px;
left: " + fix4p2.format(x) + "px";
}
}
Modified: trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java 2006-12-18
22:47:56 UTC (rev 11475)
+++ trunk/freenet/src/freenet/clients/http/WelcomeToadlet.java 2006-12-18
23:18:38 UTC (rev 11476)
@@ -546,11 +546,11 @@
versionContent.addChild("#", "Freenet-ext Build #" +
NodeStarter.extBuildNumber + " r" + NodeStarter.extRevisionNumber);
}
versionContent.addChild("br");
- HTMLNode shutdownForm = versionContent.addChild("form", new
String[] { "action", "method" }, new String[] { ".", "GET" });
+ HTMLNode shutdownForm = versionContent.addChild("form", new
String[] { "action", "method" }, new String[] { ".", "get" });
shutdownForm.addChild("input", new String[] { "type", "name" },
new String[] { "hidden", "exit" });
shutdownForm.addChild("input", new String[] { "type", "value"
}, new String[] { "submit", "Shutdown the node" });
if(node.isUsingWrapper()){
- HTMLNode restartForm = versionContent.addChild("form",
new String[] { "action", "method" }, new String[] { ".", "GET" });
+ HTMLNode restartForm = versionContent.addChild("form",
new String[] { "action", "method" }, new String[] { ".", "get" });
restartForm.addChild("input", new String[] { "type",
"name" }, new String[] { "hidden", "restart" });
restartForm.addChild("input", new String[] { "type",
"name", "value" }, new String[] { "submit", "restart2", "Restart the node" });
}
Modified: trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java
2006-12-18 22:47:56 UTC (rev 11475)
+++ trunk/freenet/src/freenet/node/useralerts/UserAlertManager.java
2006-12-18 23:18:38 UTC (rev 11476)
@@ -56,11 +56,12 @@
public HTMLNode createAlerts() {
HTMLNode alertsNode = new HTMLNode("div");
UserAlert[] alerts = getAlerts();
+ int totalNumber = 0;
for (int i = 0; i < alerts.length; i++) {
UserAlert alert = alerts[i];
if (!alert.isValid())
continue;
-
+ totalNumber++;
HTMLNode alertNode = null;
short level = alert.getPriorityClass();
if (level <= UserAlert.CRITICAL_ERROR)
@@ -83,6 +84,9 @@
dismissFormNode.addChild("input", new String[]
{ "type", "value" }, new String[] { "submit", alert.dismissButtonText() });
}
}
+ if (totalNumber == 0) {
+ return new HTMLNode("#", "");
+ }
return alertsNode;
}