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()
{
var main = document.getElementById("mainsection");
......@@ -21,3 +23,5 @@ function initDelete()
document.addEventListener("DOMContentLoaded", function() {
initDelete();
}, true);
/* @license-end */
/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
const setupbuttons=()=>{
let sp = document.forms[0].savepri;
if ( sp ) updatesetallbuttons(), sp.disabled = true, sp.className = 'disabled';
......@@ -115,3 +117,5 @@ function addClickHandler(elem)
document.addEventListener("DOMContentLoaded", function() {
setupbuttons();
}, 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() {
var url = ".ajax/xhr1.html";
var query = window.location.search;
......@@ -13,3 +19,5 @@ function initAjax() {
document.addEventListener("DOMContentLoaded", function() {
initAjax();
}, true);
/* #license-end */
/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
function initDelete()
{
var buttons = document.getElementsByClassName("delete");
......@@ -21,3 +23,5 @@ function addClickHandler(elem)
document.addEventListener("DOMContentLoaded", function() {
initDelete();
}, true);
/* @license-end */
/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
function initTables() {
var hideableTables = document.querySelectorAll("table.tunnelConfig th");
......@@ -75,3 +77,5 @@ hideableTables.forEach(function(configTable) {
document.addEventListener("DOMContentLoaded", function() {
initTables();
}, true);
/* @license-end */
......@@ -27,6 +27,8 @@
<script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<%@include file="summaryajax.jsi" %>
<script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
function setupFrame() {
f = document.getElementById("susidnsframe");
f.addEventListener("load", function() {
......@@ -34,6 +36,8 @@
resizeFrame(f);
}, true);
}
/* @license-end */
</script>
</head><body>
<%@include file="summary.jsi" %>
......
......@@ -27,6 +27,8 @@
<script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<%@include file="summaryajax.jsi" %>
<script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
function injectClassSpecific(f) {
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
if (doc.getElementsByClassName == undefined) {
......@@ -56,6 +58,8 @@
resizeFrame(f);
}, true);
}
/* @license-end */
</script>
</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;
function ajax(url, target, refresh) {
......@@ -48,3 +54,5 @@ function ajaxDone(url, target, 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()
{
var buttons = document.getElementsByClassName("delete");
......@@ -21,3 +27,5 @@ function addCCClickHandler(elem)
document.addEventListener("DOMContentLoaded", function() {
initConfigClients();
}, 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()
{
checkAll = false;
......@@ -66,3 +72,5 @@ function toggleAll(category)
document.addEventListener("DOMContentLoaded", function() {
initConfigStats();
}, 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) {
f.className += ' iframed';
var doc = 'contentDocument' in f? f.contentDocument : f.contentWindow.document;
doc.body.className += ' iframed';
}
function resizeFrame(f) {
// 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,
......@@ -39,3 +46,5 @@ function resizeFrame(f) {
document.addEventListener("DOMContentLoaded", function() {
setupFrame();
}, 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
function refreshGraph() {
......@@ -5,4 +11,6 @@ function refreshGraph() {
setTimeout(refreshGraph, 15000);
}
refreshGraph();
\ No newline at end of file
refreshGraph();
/* @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()
{
var buttons = document.getElementsByClassName("resetScrollLeft");
......@@ -35,3 +41,5 @@ function resetScrollTop(element) {
document.addEventListener("DOMContentLoaded", function() {
initResetScroll();
}, 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()
{
var buttons = document.getElementsByClassName("onchange");
......@@ -18,3 +24,5 @@ function addSChangeHandler(elem)
document.addEventListener("DOMContentLoaded", function() {
initStats();
}, 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;
function ajax(url, target, refresh) {
......@@ -62,3 +68,5 @@ function ajaxDone(url, target, refresh) {
setTimeout(function() {ajax(url, target, refresh);}, refresh);
}
}
/* @license-end */
......@@ -2,10 +2,14 @@
if (!intl.getDisableRefresh()) {
%><script src="/js/ajax.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<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>";
function requestAjax1() { ajax("/xhr1.jsp?requestURI=<%=request.getRequestURI()%>", "xhr", <%=intl.getRefresh()%>000); }
function initAjax() { setTimeout(requestAjax1, <%=intl.getRefresh()%>000); }
initAjax();
/* @license-end */
</script><%
}
%>
......@@ -28,6 +28,8 @@
<script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<%@include file="summaryajax.jsi" %>
<script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
function setupFrame() {
f = document.getElementById("i2psnarkframe");
f.addEventListener("load", function() {
......@@ -35,6 +37,8 @@
resizeFrame(f);
}, true);
}
/* @license-end */
</script>
</head><body>
<%@include file="summary.jsi" %>
......
......@@ -28,6 +28,8 @@
<script src="/js/iframed.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<%@include file="summaryajax.jsi" %>
<script nonce="<%=cspNonce%>" type="text/javascript">
/* @license http://creativecommons.org/publicdomain/zero/1.0/legalcode CC0-1.0 */
function setupFrame() {
f = document.getElementById("susimailframe");
f.addEventListener("load", function() {
......@@ -35,6 +37,8 @@
resizeFrame(f);
}, true);
}
/* @license-end */
</script>
</head><body>
<%@include file="summary.jsi" %>
......
......@@ -68,6 +68,8 @@
%>
<script src="/js/welcomeajax.js?<%=net.i2p.CoreVersion.VERSION%>" type="text/javascript"></script>
<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 progressMessage = "<b><%=intl._t("Bandwidth test in progress...")%><\/b>";
var doneMessage = "<b><%=intl._t("Bandwidth test is complete, click Next")%><\/b>";
......@@ -79,6 +81,8 @@
document.addEventListener("DOMContentLoaded", function() {
initAjax();
}, true);
/* @license-end */
</script>
<%
} // ipg == 3
......
/* #license http://www.jclark.com/xml/copying.txt Expat */
function HideMessages() {
var hideableMessages = document.getElementsByClassName("messages");
......@@ -17,3 +18,5 @@ function HideMessages() {
document.addEventListener("DOMContentLoaded", function() {
document.body.addEventListener('click', HideMessages, 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