- /confighome validation fixes

- AJAX fixes
  - Translate 'router is down' message
This commit is contained in:
zzz
2012-03-03 22:55:24 +00:00
parent 8cd9fb80ba
commit 140ffc5c5e
6 changed files with 10 additions and 9 deletions

View File

@ -230,6 +230,7 @@ public class I2PSnarkServlet extends Default {
//out.write("<meta http-equiv=\"refresh\" content=\"" + delay + ";/i2psnark/" + peerString + "\">\n"); //out.write("<meta http-equiv=\"refresh\" content=\"" + delay + ";/i2psnark/" + peerString + "\">\n");
out.write("<script src=\"/js/ajax.js\" type=\"text/javascript\"></script>\n" + out.write("<script src=\"/js/ajax.js\" type=\"text/javascript\"></script>\n" +
"<script type=\"text/javascript\">\n" + "<script type=\"text/javascript\">\n" +
"var failMessage = \"<b>" + _("Router is down") + "</b>\";\n" +
"function requestAjax1() { ajax(\"/i2psnark/.ajax/xhr1.html" + peerString + "\", \"mainsection\", " + (delay*1000) + "); }\n" + "function requestAjax1() { ajax(\"/i2psnark/.ajax/xhr1.html" + peerString + "\", \"mainsection\", " + (delay*1000) + "); }\n" +
"function initAjax(delayMs) { setTimeout(requestAjax1, " + (delay*1000) +"); }\n" + "function initAjax(delayMs) { setTimeout(requestAjax1, " + (delay*1000) +"); }\n" +
"</script>\n"); "</script>\n");

View File

@ -43,7 +43,7 @@ public class HomeHelper extends HelperBase {
_x("FAQ") + S + _x("Frequently Asked Questions") + S + "http://www.i2p2.i2p/faq" + S + I + "help.png" + S + _x("FAQ") + S + _x("Frequently Asked Questions") + S + "http://www.i2p2.i2p/faq" + S + I + "help.png" + S +
_x("Forum") + S + _x("Community forum") + S + "http://forum.i2p/" + S + I + "itoopie_sm.png" + S + _x("Forum") + S + _x("Community forum") + S + "http://forum.i2p/" + S + I + "itoopie_sm.png" + S +
//"ident.i2p" + S + _x("Short message service") + S + "http://ident.i2p/" + S + I + "itoopie_sm.png" + S + //"ident.i2p" + S + _x("Short message service") + S + "http://ident.i2p/" + S + I + "itoopie_sm.png" + S +
_x("Javadocs") + S + _x("Technical documentation") + S + "http://docs.i2p-projekt.i2p/javadoc/" + S + I + "book.png" + S + _x("Javadocs") + S + _x("Technical documentation") + S + "http://update.killyourtv.i2p/javadoc/" + S + I + "book.png" + S +
_x("Key Server") + S + _x("OpenPGP Keyserver") + S + "http://keys.i2p/" + S + I + "book.png" + S + _x("Key Server") + S + _x("OpenPGP Keyserver") + S + "http://keys.i2p/" + S + I + "book.png" + S +
_x("Pastebin") + S + _x("I2P Pastebin") + S + "http://pastethis.i2p/" + S + I + "itoopie_sm.png" + S + _x("Pastebin") + S + _x("I2P Pastebin") + S + "http://pastethis.i2p/" + S + I + "itoopie_sm.png" + S +
"Planet I2P" + S + _x("I2P News") + S + "http://planet.i2p/" + S + I + "itoopie_sm.png" + S + "Planet I2P" + S + _x("I2P News") + S + "http://planet.i2p/" + S + I + "itoopie_sm.png" + S +
@ -186,14 +186,14 @@ public class HomeHelper extends HelperBase {
.append(app.name) .append(app.name)
.append("\"></td><td align=\"center\">"); .append("\"></td><td align=\"center\">");
if (app.icon != null) { if (app.icon != null) {
buf.append("<img height=\"16\" src=\"").append(app.icon).append("\">"); buf.append("<img height=\"16\" alt=\"\" src=\"").append(app.icon).append("\">");
} }
buf.append("</td><td align=\"left\">") buf.append("</td><td align=\"left\">")
.append(app.name) .append(app.name)
.append("</td><td align=\"left\"><a href=\"") .append("</td><td align=\"left\"><a href=\"")
.append(app.url) .append(app.url.replace("&", "&amp;"))
.append("\">") .append("\">")
.append(app.url) .append(app.url.replace("&", "&amp;"))
.append("</a></td></tr>\n"); .append("</a></td></tr>\n");
} }
buf.append("<tr><td colspan=\"2\" align=\"center\"><b>") buf.append("<tr><td colspan=\"2\" align=\"center\"><b>")

View File

@ -81,4 +81,4 @@ input.default {
<input type="submit" name="action" class="add" value="<%=intl._("Add item")%>" > <input type="submit" name="action" class="add" value="<%=intl._("Add item")%>" >
</div> </div>
</form> </form>
</div></div></body></html> </div></body></html>

View File

@ -6,8 +6,9 @@
<%=intl.title("home")%> <%=intl.title("home")%>
<script src="/js/ajax.js" type="text/javascript"></script> <script src="/js/ajax.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
var failMessage = "<b><%=intl._("Router is down")%></b>";
function requestAjax1() { ajax("/xhr1.jsp", "xhr", 15000); } function requestAjax1() { ajax("/xhr1.jsp", "xhr", 15000); }
function initAjax() { setInterval(requestAjax1, 15000); } function initAjax() { setTimeout(requestAjax1, 15000); }
</script> </script>
</head><body onload="initAjax()"> </head><body onload="initAjax()">
<% <%

View File

@ -25,8 +25,7 @@ function ajaxDone(url, target, refresh) {
document.getElementById(target).innerHTML = results; document.getElementById(target).innerHTML = results;
//document.getElementsbyClassName("hideifdown").style.display="block"; //document.getElementsbyClassName("hideifdown").style.display="block";
} else { } else {
// TODO take from a translated variable document.getElementById(target).innerHTML = failMessage;
document.getElementById(target).innerHTML="<b>Router is down</b>";
//document.getElementByClassName("hideifdown").style.display="none"; //document.getElementByClassName("hideifdown").style.display="none";
} }
setTimeout(function() {ajax(url, target, refresh);}, refresh); setTimeout(function() {ajax(url, target, refresh);}, refresh);

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 2; public final static long BUILD = 3;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";