mirror of https://github.com/zlatinb/muwire
link 'browsing' links to specific matching table entries
parent
68bc0bbf30
commit
a5fb824f71
|
@ -176,7 +176,7 @@ function refreshActive() {
|
|||
|
||||
if (currentBrowse != null) {
|
||||
var newBrowse = browsesByHost.get(currentHost)
|
||||
if (currentBrowse.revision < newBrowse.revision)
|
||||
if (newBrowse == null || currentBrowse.revision < newBrowse.revision)
|
||||
showResults(currentHost, currentBrowse.key, currentBrowse.descending)
|
||||
} else {
|
||||
document.getElementById("resultsTable").innerHTML = ""
|
||||
|
|
|
@ -88,7 +88,7 @@ class Sender {
|
|||
if (this.browse == "false")
|
||||
return ""
|
||||
if (this.browsing == "true")
|
||||
return "<a href='/MuWire/BrowseHost'>" + _t("Browsing") + "</a>"
|
||||
return "<a href='/MuWire/BrowseHost?currentHost=" + this.b64 + "'>" + _t("Browsing") + "</a>"
|
||||
var link = "<a href='#' onclick='window.browse(\"" + this.b64 + "\"); return false;'>" + _t("Browse") + "</a>"
|
||||
var block = "<span id='browse-link-" + this.b64 + "'>" + link + "</span>"
|
||||
return block
|
||||
|
@ -632,7 +632,7 @@ function browse(host) {
|
|||
xmlhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var linkSpan = document.getElementById("browse-link-"+host)
|
||||
linkSpan.innerHTML = "<a href='/MuWire/BrowseHost'>" + _t("Browsing") + "</a>"
|
||||
linkSpan.innerHTML = "<a href='/MuWire/BrowseHost?currentHost=" + host+ "'>" + _t("Browsing") + "</a>"
|
||||
}
|
||||
}
|
||||
xmlhttp.open("POST", "/MuWire/Browse", true)
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.muwire.webui.*" %>
|
||||
<%@ page import="com.muwire.core.*" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
<%@ page import="net.i2p.data.Base64" %>
|
||||
<%@include file="initcode.jsi"%>
|
||||
|
||||
<%
|
||||
|
||||
String pagetitle=Util._t("Browse Host");
|
||||
String pagetitle=Util._t("Browse Host");
|
||||
|
||||
String currentBrowse = null;
|
||||
if (request.getParameter("currentHost") != null) {
|
||||
Persona host = new Persona(new ByteArrayInputStream(Base64.decode(request.getParameter("currentHost"))));
|
||||
currentBrowse = host.getHumanReadableName();
|
||||
}
|
||||
|
||||
%>
|
||||
|
||||
|
@ -17,6 +26,12 @@ String pagetitle=Util._t("Browse Host");
|
|||
<script src="js/tables.js?<%=version%> type="text/javascript"></script>
|
||||
<script src="js/browse.js?<%=version%>" type="text/javascript"></script>
|
||||
|
||||
<% if (currentBrowse != null) { %>
|
||||
<script>
|
||||
currentHost="<%=currentBrowse%>"
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
</head>
|
||||
<body onload="initTranslate(jsTranslations); initConnectionsCount(); initBrowse(); initCertificates();">
|
||||
<%@ include file="header.jsi"%>
|
||||
|
|
Loading…
Reference in New Issue