forked from I2P_Developers/i2p.i2p
i2psnark: Remove onload
This commit is contained in:
@ -325,11 +325,9 @@ public class I2PSnarkServlet extends BasicServlet {
|
|||||||
"<script src=\"" + jsPfx + "/js/ajax.js\" type=\"text/javascript\"></script>\n" +
|
"<script src=\"" + jsPfx + "/js/ajax.js\" type=\"text/javascript\"></script>\n" +
|
||||||
"<script type=\"text/javascript\">\n" +
|
"<script type=\"text/javascript\">\n" +
|
||||||
"var failMessage = \"<div class=\\\"routerdown\\\"><b>" + downMsg + "<\\/b><\\/div>\";\n" +
|
"var failMessage = \"<div class=\\\"routerdown\\\"><b>" + downMsg + "<\\/b><\\/div>\";\n" +
|
||||||
"function requestAjax1() { ajax(\"" + _contextPath + "/.ajax/xhr1.html" +
|
"var ajaxDelay = " + (delay * 1000) + ";\n" +
|
||||||
peerString.replace("&", "&") + // don't html escape in js
|
"</script>\n" +
|
||||||
"\", \"mainsection\", " + (delay*1000) + "); }\n" +
|
"<script src=\".resources/js/initajax.js\" type=\"text/javascript\"></script>\n");
|
||||||
"function initAjax() { setTimeout(requestAjax1, " + (delay*1000) +"); }\n" +
|
|
||||||
"</script>\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.write(HEADER_A + _themePath + HEADER_B);
|
out.write(HEADER_A + _themePath + HEADER_B);
|
||||||
@ -338,13 +336,9 @@ public class I2PSnarkServlet extends BasicServlet {
|
|||||||
if (noCollapse || !collapsePanels) {
|
if (noCollapse || !collapsePanels) {
|
||||||
out.write(HEADER_A + _themePath + HEADER_C);
|
out.write(HEADER_A + _themePath + HEADER_C);
|
||||||
}
|
}
|
||||||
out.write("</head>\n");
|
out.write("</head>\n" +
|
||||||
|
"<body>" +
|
||||||
if (isConfigure || delay <= 0)
|
"<center>");
|
||||||
out.write("<body>");
|
|
||||||
else
|
|
||||||
out.write("<body onload=\"initAjax()\">");
|
|
||||||
out.write("<center>");
|
|
||||||
List<Tracker> sortedTrackers = null;
|
List<Tracker> sortedTrackers = null;
|
||||||
if (isConfigure) {
|
if (isConfigure) {
|
||||||
out.write("<div class=\"snarknavbar\"><a href=\"" + _contextPath + "/\" title=\"");
|
out.write("<div class=\"snarknavbar\"><a href=\"" + _contextPath + "/\" title=\"");
|
||||||
@ -3072,10 +3066,8 @@ public class I2PSnarkServlet extends BasicServlet {
|
|||||||
"<link rel=\"shortcut icon\" href=\"" + _themePath + "favicon.ico\">\n");
|
"<link rel=\"shortcut icon\" href=\"" + _themePath + "favicon.ico\">\n");
|
||||||
if (showPriority)
|
if (showPriority)
|
||||||
buf.append("<script src=\"").append(_contextPath).append(WARBASE + "js/folder.js\" type=\"text/javascript\"></script>\n");
|
buf.append("<script src=\"").append(_contextPath).append(WARBASE + "js/folder.js\" type=\"text/javascript\"></script>\n");
|
||||||
buf.append("</head><body");
|
buf.append("</head><body>\n" +
|
||||||
if (showPriority)
|
"<center><div class=\"snarknavbar\"><a href=\"").append(_contextPath).append("/\" title=\"Torrents\"" +
|
||||||
buf.append(" onload=\"setupbuttons()\"");
|
|
||||||
buf.append(">\n<center><div class=\"snarknavbar\"><a href=\"").append(_contextPath).append("/\" title=\"Torrents\"" +
|
|
||||||
" class=\"snarkNav nav_main\">");
|
" class=\"snarkNav nav_main\">");
|
||||||
if (_contextName.equals(DEFAULT_NAME))
|
if (_contextName.equals(DEFAULT_NAME))
|
||||||
buf.append(_t("I2PSnark"));
|
buf.append(_t("I2PSnark"));
|
||||||
|
@ -61,3 +61,7 @@ const setallskip=()=>{
|
|||||||
form.savepri.disabled = false;
|
form.savepri.disabled = false;
|
||||||
form.savepri.className = 'accept';
|
form.savepri.className = 'accept';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
setupbuttons();
|
||||||
|
}, true);
|
||||||
|
15
apps/i2psnark/resources/js/initajax.js
Normal file
15
apps/i2psnark/resources/js/initajax.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function requestAjax1() {
|
||||||
|
var url = ".ajax/xhr1.html";
|
||||||
|
var query = window.location.search;
|
||||||
|
if (query)
|
||||||
|
url += query;
|
||||||
|
ajax(url, "mainsection", ajaxDelay);
|
||||||
|
}
|
||||||
|
|
||||||
|
function initAjax() {
|
||||||
|
setTimeout(requestAjax1, ajaxDelay);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
initAjax();
|
||||||
|
}, true);
|
Reference in New Issue
Block a user