I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 8fa3e45e authored by idk's avatar idk
Browse files

Add tags for librejs compatibility on application/console pages and in embedded javascript

parent c4a5d111
No related branches found
No related tags found
No related merge requests found
Showing
with 117 additions and 1 deletion
/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
function initDelete() function initDelete()
{ {
var main = document.getElementById("mainsection"); var main = document.getElementById("mainsection");
...@@ -21,3 +23,5 @@ function initDelete() ...@@ -21,3 +23,5 @@ function initDelete()
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
initDelete(); initDelete();
}, true); }, true);
/* @license-end */
/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
const setupbuttons=()=>{ const setupbuttons=()=>{
let sp = document.forms[0].savepri; let sp = document.forms[0].savepri;
if ( sp ) updatesetallbuttons(), sp.disabled = true, sp.className = 'disabled'; if ( sp ) updatesetallbuttons(), sp.disabled = true, sp.className = 'disabled';
...@@ -115,3 +117,5 @@ function addClickHandler(elem) ...@@ -115,3 +117,5 @@ function addClickHandler(elem)
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
setupbuttons(); setupbuttons();
}, true); }, true);
/* @license-end */
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
// This component is dedicated to the public domain. It uses the CC0
// as a formal dedication to the public domain and in circumstances where
// a public domain is not usable.
function requestAjax1() { function requestAjax1() {
var url = ".ajax/xhr1.html"; var url = ".ajax/xhr1.html";
var query = window.location.search; var query = window.location.search;
...@@ -13,3 +19,5 @@ function initAjax() { ...@@ -13,3 +19,5 @@ function initAjax() {
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
initAjax(); initAjax();
}, true); }, true);
/* #license-end */
/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
function initDelete() function initDelete()
{ {
var buttons = document.getElementsByClassName("delete"); var buttons = document.getElementsByClassName("delete");
...@@ -21,3 +23,5 @@ function addClickHandler(elem) ...@@ -21,3 +23,5 @@ function addClickHandler(elem)
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
initDelete(); initDelete();
}, true); }, true);
/* @license-end */
/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
function initTables() { function initTables() {
var hideableTables = document.querySelectorAll("table.tunnelConfig th"); var hideableTables = document.querySelectorAll("table.tunnelConfig th");
...@@ -75,3 +77,5 @@ hideableTables.forEach(function(configTable) { ...@@ -75,3 +77,5 @@ hideableTables.forEach(function(configTable) {
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
initTables(); initTables();
}, true); }, true);
/* @license-end */
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
<script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script> <script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<%@include file="summaryajax.jsi" %> <%@include file="summaryajax.jsi" %>
<script nonce="<%=cspNonce%>" type="text/javascript"> <script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
function setupFrame() { function setupFrame() {
f = document.getElementById("susidnsframe"); f = document.getElementById("susidnsframe");
f.addEventListener("load", function() { f.addEventListener("load", function() {
...@@ -34,6 +36,8 @@ ...@@ -34,6 +36,8 @@
resizeFrame(f); resizeFrame(f);
}, true); }, true);
} }
/* @license-end */
</script> </script>
</head><body> </head><body>
<%@include file="summary.jsi" %> <%@include file="summary.jsi" %>
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
<script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script> <script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<%@include file="summaryajax.jsi" %> <%@include file="summaryajax.jsi" %>
<script nonce="<%=cspNonce%>" type="text/javascript"> <script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
function injectClassSpecific(f) { function injectClassSpecific(f) {
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document; var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
if (doc.getElementsByClassName == undefined) { if (doc.getElementsByClassName == undefined) {
...@@ -56,6 +58,8 @@ ...@@ -56,6 +58,8 @@
resizeFrame(f); resizeFrame(f);
}, true); }, true);
} }
/* @license-end */
</script> </script>
</head><body> </head><body>
......
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
// This component is dedicated to the public domain. It uses the CC0
// as a formal dedication to the public domain and in circumstances where
// a public domain is not usable.
var fails = 0; var fails = 0;
function ajax(url, target, refresh) { function ajax(url, target, refresh) {
...@@ -48,3 +54,5 @@ function ajaxDone(url, target, refresh) { ...@@ -48,3 +54,5 @@ function ajaxDone(url, target, refresh) {
setTimeout(function() {ajax(url, target, refresh);}, refresh); setTimeout(function() {ajax(url, target, refresh);}, refresh);
} }
} }
/* @license-end */
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
// This component is dedicated to the public domain. It uses the CC0
// as a formal dedication to the public domain and in circumstances where
// a public domain is not usable.
function initConfigClients() function initConfigClients()
{ {
var buttons = document.getElementsByClassName("delete"); var buttons = document.getElementsByClassName("delete");
...@@ -21,3 +27,5 @@ function addCCClickHandler(elem) ...@@ -21,3 +27,5 @@ function addCCClickHandler(elem)
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
initConfigClients(); initConfigClients();
}, true); }, true);
/* @license-end */
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
// This component is dedicated to the public domain. It uses the CC0
// as a formal dedication to the public domain and in circumstances where
// a public domain is not usable.
function initConfigStats() function initConfigStats()
{ {
checkAll = false; checkAll = false;
...@@ -66,3 +72,5 @@ function toggleAll(category) ...@@ -66,3 +72,5 @@ function toggleAll(category)
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
initConfigStats(); initConfigStats();
}, true); }, true);
/* @license-end */
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
// This component is dedicated to the public domain. It uses the CC0
// as a formal dedication to the public domain and in circumstances where
// a public domain is not usable.
function injectClass(f) { function injectClass(f) {
f.className += ' iframed'; f.className += ' iframed';
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document; var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
doc.body.className += ' iframed'; doc.body.className += ' iframed';
} }
function resizeFrame(f) { function resizeFrame(f) {
// offsetHeight returns the height of the visible area for an object, in pixels. // offsetHeight returns the height of the visible area for an object, in pixels.
// The value contains the height with the padding, scrollBar, and the border, // The value contains the height with the padding, scrollBar, and the border,
...@@ -39,3 +46,5 @@ function resizeFrame(f) { ...@@ -39,3 +46,5 @@ function resizeFrame(f) {
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
setupFrame(); setupFrame();
}, true); }, true);
/* @license-end */
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
// This component is dedicated to the public domain. It uses the CC0
// as a formal dedication to the public domain and in circumstances where
// a public domain is not usable.
// refresh the sidebar mini graph every 15 seconds // refresh the sidebar mini graph every 15 seconds
function refreshGraph() { function refreshGraph() {
...@@ -5,4 +11,6 @@ function refreshGraph() { ...@@ -5,4 +11,6 @@ function refreshGraph() {
setTimeout(refreshGraph, 15000); setTimeout(refreshGraph, 15000);
} }
refreshGraph(); refreshGraph();
\ No newline at end of file
/* @license-end */
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
// This component is dedicated to the public domain. It uses the CC0
// as a formal dedication to the public domain and in circumstances where
// a public domain is not usable.
function initResetScroll() function initResetScroll()
{ {
var buttons = document.getElementsByClassName("resetScrollLeft"); var buttons = document.getElementsByClassName("resetScrollLeft");
...@@ -35,3 +41,5 @@ function resetScrollTop(element) { ...@@ -35,3 +41,5 @@ function resetScrollTop(element) {
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
initResetScroll(); initResetScroll();
}, true); }, true);
/* @license-end */
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
// This component is dedicated to the public domain. It uses the CC0
// as a formal dedication to the public domain and in circumstances where
// a public domain is not usable.
function initStats() function initStats()
{ {
var buttons = document.getElementsByClassName("onchange"); var buttons = document.getElementsByClassName("onchange");
...@@ -18,3 +24,5 @@ function addSChangeHandler(elem) ...@@ -18,3 +24,5 @@ function addSChangeHandler(elem)
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
initStats(); initStats();
}, true); }, true);
/* @license-end */
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
// This component is dedicated to the public domain. It uses the CC0
// as a formal dedication to the public domain and in circumstances where
// a public domain is not usable.
var fails = 0; var fails = 0;
function ajax(url, target, refresh) { function ajax(url, target, refresh) {
...@@ -62,3 +68,5 @@ function ajaxDone(url, target, refresh) { ...@@ -62,3 +68,5 @@ function ajaxDone(url, target, refresh) {
setTimeout(function() {ajax(url, target, refresh);}, refresh); setTimeout(function() {ajax(url, target, refresh);}, refresh);
} }
} }
/* @license-end */
...@@ -2,10 +2,14 @@ ...@@ -2,10 +2,14 @@
if (!intl.getDisableRefresh()) { if (!intl.getDisableRefresh()) {
%><script src="/js/ajax.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script> %><script src="/js/ajax.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<script nonce="<%=cspNonce%>" type="text/javascript"> <script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
var failMessage = "<hr><b><%=intl._t("Router is down")%><\/b>"; var failMessage = "<hr><b><%=intl._t("Router is down")%><\/b>";
function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); } function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); }
function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); } function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); }
initAjax(); initAjax();
/* @license-end */
</script><% </script><%
} }
%> %>
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
<script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script> <script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<%@include file="summaryajax.jsi" %> <%@include file="summaryajax.jsi" %>
<script nonce="<%=cspNonce%>" type="text/javascript"> <script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
function setupFrame() { function setupFrame() {
f = document.getElementById("i2psnarkframe"); f = document.getElementById("i2psnarkframe");
f.addEventListener("load", function() { f.addEventListener("load", function() {
...@@ -35,6 +37,8 @@ ...@@ -35,6 +37,8 @@
resizeFrame(f); resizeFrame(f);
}, true); }, true);
} }
/* @license-end */
</script> </script>
</head><body> </head><body>
<%@include file="summary.jsi" %> <%@include file="summary.jsi" %>
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
<script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script> <script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<%@include file="summaryajax.jsi" %> <%@include file="summaryajax.jsi" %>
<script nonce="<%=cspNonce%>" type="text/javascript"> <script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
function setupFrame() { function setupFrame() {
f = document.getElementById("susimailframe"); f = document.getElementById("susimailframe");
f.addEventListener("load", function() { f.addEventListener("load", function() {
...@@ -35,6 +37,8 @@ ...@@ -35,6 +37,8 @@
resizeFrame(f); resizeFrame(f);
}, true); }, true);
} }
/* @license-end */
</script> </script>
</head><body> </head><body>
<%@include file="summary.jsi" %> <%@include file="summary.jsi" %>
......
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
%> %>
<script src="/js/welcomeajax.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script> <script src="/js/welcomeajax.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<script nonce="<%=cspNonce%>" type="text/javascript"> <script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
var failMessage = "<b><%=intl._t("Router is down")%><\/b>"; var failMessage = "<b><%=intl._t("Router is down")%><\/b>";
var progressMessage = "<b><%=intl._t("Bandwidth test in progress...")%><\/b>"; var progressMessage = "<b><%=intl._t("Bandwidth test in progress...")%><\/b>";
var doneMessage = "<b><%=intl._t("Bandwidth test is complete, click Next")%><\/b>"; var doneMessage = "<b><%=intl._t("Bandwidth test is complete, click Next")%><\/b>";
...@@ -79,6 +81,8 @@ ...@@ -79,6 +81,8 @@
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
initAjax(); initAjax();
}, true); }, true);
/* @license-end */
</script> </script>
<% <%
} // ipg == 3 } // ipg == 3
......
/* #license http://www.jclark.com/xml/copying.txt Expat */
function HideMessages() { function HideMessages() {
var hideableMessages = document.getElementsByClassName("messages"); var hideableMessages = document.getElementsByClassName("messages");
...@@ -17,3 +18,5 @@ function HideMessages() { ...@@ -17,3 +18,5 @@ function HideMessages() {
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
document.body.addEventListener('click', HideMessages, true); document.body.addEventListener('click', HideMessages, true);
}, true); }, true);
/* @license-end */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment