mirror of https://github.com/zlatinb/muwire
move connection count into a separate js file, thanks zzz
parent
06bd9c80e8
commit
d46fbd66f0
|
@ -17,11 +17,14 @@ war {
|
|||
from ('src/main/images', {
|
||||
into "images"
|
||||
})
|
||||
from ('src/main/js', {
|
||||
into "js"
|
||||
})
|
||||
webInf {
|
||||
from "$buildDir/compiledJsps"
|
||||
into "classes"
|
||||
}
|
||||
excludes = new HashSet(['**/*.jsp'])
|
||||
excludes = new HashSet(['**/*.jsp', '**/*.jsi'])
|
||||
webXml = file("$buildDir/tmp_jsp/web.xml")
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
function refreshConnectionsCount() {
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var connections = this.responseXML.getElementsByTagName("Connections");
|
||||
var count = connections[0].childNodes[0].nodeValue
|
||||
var connectionCountSpan = document.getElementById("connectionsCount");
|
||||
var countString = "Connections: "+count;
|
||||
connectionCountSpan.innerHTML = countString;
|
||||
}
|
||||
}
|
||||
xmlhttp.open("GET", "/MuWire/Search?section=connectionsCount", true);
|
||||
xmlhttp.send();
|
||||
}
|
||||
|
||||
function initConnectionsCount() {
|
||||
setInterval(refreshConnectionsCount, 3000);
|
||||
setTimeout(refreshConnectionsCount, 1);
|
||||
}
|
|
@ -16,7 +16,7 @@
|
|||
<head>
|
||||
<%@include file="css.jsi"%>
|
||||
</head>
|
||||
<body>
|
||||
<body onload="initConnectionsCount()">
|
||||
<%@include file="header.jsi"%>
|
||||
<p>Downloads:</p>
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<head>
|
||||
<%@include file="css.jsi"%>
|
||||
</head>
|
||||
<body>
|
||||
<body onload="initConnectionsCount()">
|
||||
<%@include file="header.jsi"%>
|
||||
<% if (groupBy.equals("sender")) { %>
|
||||
<center><a href="/MuWire/Home.jsp?groupBy=file">Group By File</a></center>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<title>MuWire ${version}</title>
|
||||
<link href="i2pbote.css?${version}" rel="stylesheet" type="text/css">
|
||||
<link href="muwire.css?${version}" rel="stylesheet" type="text/css">
|
||||
<script src="js/conncount.js" type="text/javascript"></script>
|
||||
|
|
|
@ -8,25 +8,6 @@
|
|||
<br>
|
||||
<span id="connectionsCount">Connections : 0</span>
|
||||
<br>
|
||||
<script>
|
||||
function refreshConnectionsCount() {
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var connections = this.responseXML.getElementsByTagName("Connections");
|
||||
var count = connections[0].childNodes[0].nodeValue
|
||||
var connectionCountSpan = document.getElementById("connectionsCount");
|
||||
var countString = "Connections: "+count;
|
||||
connectionCountSpan.innerHTML = countString;
|
||||
}
|
||||
}
|
||||
xmlhttp.open("GET", "/MuWire/Search?section=connectionsCount", true);
|
||||
xmlhttp.send();
|
||||
}
|
||||
|
||||
setInterval(refreshConnectionsCount, 3000);
|
||||
setTimeout(refreshConnectionsCount, 1);
|
||||
</script>
|
||||
<% if ("Home".equals(pagetitle)) { %>
|
||||
<form action="/MuWire/Search" method="post">
|
||||
<input type="text" name="search" />
|
||||
|
|
Loading…
Reference in New Issue