forked from I2P_Developers/i2p.i2p
I2PSnark fallbacks when JS is unavailable:
- Use meta-refresh - Hide JavaScript-dependent buttons
This commit is contained in:
@ -291,7 +291,8 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
if (delay > 0) {
|
||||
String jsPfx = _context.isRouterContext() ? "" : ".resources";
|
||||
String downMsg = _context.isRouterContext() ? _t("Router is down") : _t("I2PSnark has stopped");
|
||||
//out.write("<meta http-equiv=\"refresh\" content=\"" + delay + ";/i2psnark/" + peerString + "\">\n");
|
||||
// fallback to metarefresh when javascript is disabled
|
||||
out.write("<noscript><meta http-equiv=\"refresh\" content=\"" + delay + ";/i2psnark/" + peerString + "\"></noscript>\n");
|
||||
out.write("<script src=\"" + jsPfx + "/js/ajax.js\" type=\"text/javascript\"></script>\n" +
|
||||
"<script type=\"text/javascript\">\n" +
|
||||
"var failMessage = \"<div class=\\\"routerdown\\\"><b>" + downMsg + "<\\/b><\\/div>\";\n" +
|
||||
@ -2752,7 +2753,9 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
title = _t("Torrent") + ": " + DataHelper.escapeHTML(title);
|
||||
buf.append(title);
|
||||
buf.append("</TITLE>\n").append(HEADER_A).append(_themePath).append(HEADER_B)
|
||||
.append("<link rel=\"shortcut icon\" href=\"" + _themePath + "favicon.ico\">\n");
|
||||
// hide javascript-dependent buttons when js is unavailable
|
||||
.append("<noscript><style>.script {display: none;}</style></noscript>")
|
||||
.append("<link rel=\"shortcut icon\" href=\"" + _themePath + "favicon.ico\">\n");
|
||||
if (showPriority)
|
||||
buf.append("<script src=\"").append(_contextPath).append(WARBASE + "js/folder.js\" type=\"text/javascript\"></script>\n");
|
||||
buf.append("</HEAD><BODY");
|
||||
|
Reference in New Issue
Block a user