Home page:

- Convert ajax to use shared script
  - CSS tweaks
  - Add missing icons
    Silk icons: See licenses/LICENSE-SilkIcons.txt
This commit is contained in:
zzz
2012-03-03 20:17:02 +00:00
parent b0a682f606
commit f010b27b14
11 changed files with 13 additions and 55 deletions

View File

@ -47,6 +47,7 @@ public class HomeHelper extends HelperBase {
_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 +
"Planet I2P" + S + _x("I2P News") + S + "http://planet.i2p/" + S + I + "itoopie_sm.png" + S +
//_x("Plugins") + S + _x("Add-on directory") + S + "http://*TBD*.i2p/" + S + I + "plugin.png" + S +
_x("Postman's Tracker") + S + _x("Bittorrent tracker") + S + "http://tracker2.postman.i2p/" + S + I + "itoopie_sm.png" + S +
_x("Project Website") + S + _x("I2P home page") + S + "http://www.i2p2.i2p/" + S + I + "help.png" + S +
"stats.i2p" + S + _x("I2P Netowrk Statistics") + S + "http://stats.i2p/cgi-bin/dashboard.cgi" + S + I + "itoopie_sm.png" + S +

View File

@ -1,59 +1,15 @@
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<%@include file="css.jsi" %>
<%=intl.title("home")%>
<script src="/js/ajax.js" type="text/javascript"></script>
<script type="text/javascript">
var page = "home";
function ajax(url,target) {
// native XMLHttpRequest object
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = function() {ajaxDone(target);};
req.open("GET", url, true);
req.send(null);
// IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLDOM");
if (req) {
req.onreadystatechange = function() {ajaxDone(target);};
req.open("GET", url, true);
req.send(null);
}
}
//setTimeout("ajax(page,'scriptoutput')", 5000);
}
function ajaxDone(target) {
// only if req is "loaded"
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
results = req.responseText;
document.getElementById(target).innerHTML = results;
document.getElementById("langbox").style.display="block";
document.getElementById("home").style.display="block";
} else {
document.getElementById(target).innerHTML="<b><%=intl._("Router is down")%></b>";
document.getElementById("home").style.display="none";
document.getElementById("langbox").style.display="none";
}
}
}
function requestAjax1() { ajax("/xhr1.jsp", "xhr"); }
function initAjax() { setInterval(requestAjax1, 15000); }
function requestAjax1() { ajax("/xhr1.jsp", "xhr", 15000); }
function initAjax() { setInterval(requestAjax1, 15000); }
</script>
</head><body onload="initAjax()">
<%
String consoleNonce = System.getProperty("router.consoleNonce");
if (consoleNonce == null) {
@ -61,7 +17,6 @@ function initAjax() { setInterval(requestAjax1, 15000); }
System.setProperty("router.consoleNonce", consoleNonce);
}
%>
<div class="routersummaryouter" id="appsummary">
<div class="routersummary">
<div style="height: 36px;">
@ -81,12 +36,13 @@ function initAjax() { setInterval(requestAjax1, 15000); }
<a href="/home?lang=en&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=us" title="English" alt="English"></a>
<a href="/home?lang=ar&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=lang_ar" title="عربية" alt="عربية"></a>
<a href="/home?lang=zh&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=cn" title="中文" alt="中文"></a>
<a href="/home?lang=cs&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=cz" title="Czech" alt="Czech"></a>
<a href="/home?lang=da&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=dk" title="Danish" alt="Danish"></a>
<a href="/home?lang=de&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=de" title="Deutsch" alt="Deutsch"></a>
<a href="/home?lang=ee&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=ee" title="Eesti" alt="Eesti"></a>
<a href="/home?lang=es&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=es" title="Español" alt="Español"></a>
<a href="/home?lang=fi&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=fi" title="Suomi" alt="Suomi"></a>
<a href="/home?lang=fr&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=fr" title="Français" alt="Français"></a><br>
<a href="/home?lang=fi&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=fi" title="Suomi" alt="Suomi"></a><br>
<a href="/home?lang=fr&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=fr" title="Français" alt="Français"></a>
<a href="/home?lang=it&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=it" title="Italiano" alt="Italiano"></a>
<a href="/home?lang=nl&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=nl" title="Nederlands" alt="Nederlands"></a>
<a href="/home?lang=pl&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=pl" title="Polski" alt="Polski"></a>
@ -122,7 +78,7 @@ function initAjax() { setInterval(requestAjax1, 15000); }
<div class="home" id="home">
<div class="search">
<form action="/search.jsp" method="POST">
<table><tr><td align="right">
<table class="search"><tr><td align="right">
<input size="50" type="text" class="search" name="query" />
</td><td align="left">
<button type="submit" value="search" class="search"><%=intl._("Search I2P")%></button>

View File

@ -23,10 +23,11 @@ function ajaxDone(url, target, refresh) {
if (req.status == 200) {
results = req.responseText;
document.getElementById(target).innerHTML = results;
document.getElementById("lowersection").style.display="block";
//document.getElementsbyClassName("hideifdown").style.display="block";
} else {
// TODO take from a translated variable
document.getElementById(target).innerHTML="<b>Router is down</b>";
document.getElementById("lowersection").style.display="none";
//document.getElementByClassName("hideifdown").style.display="none";
}
setTimeout(function() {ajax(url, target, refresh);}, refresh);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

View File

@ -630,12 +630,12 @@ div.appgroup {
}
div.search {
margin: 20px;
margin: 20px 20px 20px 240px;
padding: 8px;
width: auto;
}
div.search table {
table.search {
background: none;
margin: 20px;
padding: 8px;