forked from I2P_Developers/i2p.i2p
Console: onchange removal
This commit is contained in:
@ -69,7 +69,7 @@ public class StatsGenerator {
|
||||
buf.append("</p>");
|
||||
|
||||
buf.append("<form action=\"\"><b>");
|
||||
buf.append(_t("Jump to section")).append(":</b> <select name=\"go\" onChange='location.href=this.value'>");
|
||||
buf.append(_t("Jump to section")).append(":</b> <select class=\"onchange\">");
|
||||
out.write(buf.toString());
|
||||
buf.setLength(0);
|
||||
|
||||
@ -92,6 +92,7 @@ public class StatsGenerator {
|
||||
//out.write(buf.toString());
|
||||
//buf.setLength(0);
|
||||
}
|
||||
// TODO this is broken for non-js
|
||||
buf.append("</select> <input type=\"submit\" value=\"").append(_t("GO")).append("\" />");
|
||||
buf.append("</form>");
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
<%
|
||||
// Add this AFTER css.jsi if there's any onclick attributes in the page
|
||||
response.setHeader("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; form-action 'self'; frame-ancestors 'self'; object-src 'none'; media-src 'none'");
|
||||
%>
|
20
apps/routerconsole/jsp/js/stats.js
Normal file
20
apps/routerconsole/jsp/js/stats.js
Normal file
@ -0,0 +1,20 @@
|
||||
function init()
|
||||
{
|
||||
var buttons = document.getElementsByClassName("onchange");
|
||||
for(index = 0; index < buttons.length; index++)
|
||||
{
|
||||
var button = buttons[index];
|
||||
addChangeHandler(button);
|
||||
}
|
||||
}
|
||||
|
||||
function addChangeHandler(elem)
|
||||
{
|
||||
elem.addEventListener("change", function() {
|
||||
location.href=event.target.value;
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
init();
|
||||
}, true);
|
@ -4,9 +4,9 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html><head>
|
||||
<%@include file="css.jsi" %>
|
||||
<%@include file="csp-unsafe.jsi" %>
|
||||
<%=intl.title("statistics")%>
|
||||
<%@include file="summaryajax.jsi" %>
|
||||
<script src="/js/stats.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
|
||||
</head><body>
|
||||
<%@include file="summary.jsi" %>
|
||||
<jsp:useBean class="net.i2p.router.web.helpers.OldConsoleHelper" id="oldhelper" scope="request" />
|
||||
|
Reference in New Issue
Block a user