From 8fa3e45e4799334f99f69b4185fd15a78cab0c07 Mon Sep 17 00:00:00 2001
From: hankhill19580 <hankhill19580@gmail.com>
Date: Sun, 20 Sep 2020 05:05:57 +0000
Subject: [PATCH] Add tags for librejs compatibility on application/console
 pages and in embedded javascript

---
 apps/i2psnark/resources/js/delete.js       |  4 ++++
 apps/i2psnark/resources/js/folder.js       |  4 ++++
 apps/i2psnark/resources/js/initajax.js     |  8 ++++++++
 apps/i2ptunnel/jsp/js/delete.js            |  4 ++++
 apps/i2ptunnel/jsp/js/tableSlider.js       |  4 ++++
 apps/routerconsole/jsp/dns.jsp             |  4 ++++
 apps/routerconsole/jsp/i2ptunnelmgr.jsp    |  4 ++++
 apps/routerconsole/jsp/js/ajax.js          |  8 ++++++++
 apps/routerconsole/jsp/js/configclients.js |  8 ++++++++
 apps/routerconsole/jsp/js/configstats.js   |  8 ++++++++
 apps/routerconsole/jsp/js/iframed.js       |  9 +++++++++
 apps/routerconsole/jsp/js/refreshGraph.js  | 10 +++++++++-
 apps/routerconsole/jsp/js/resetScroll.js   |  8 ++++++++
 apps/routerconsole/jsp/js/stats.js         |  8 ++++++++
 apps/routerconsole/jsp/js/welcomeajax.js   |  8 ++++++++
 apps/routerconsole/jsp/summaryajax.jsi     |  4 ++++
 apps/routerconsole/jsp/torrents.jsp        |  4 ++++
 apps/routerconsole/jsp/webmail.jsp         |  4 ++++
 apps/routerconsole/jsp/welcome.jsp         |  4 ++++
 apps/susidns/src/js/messages.js            |  3 +++
 apps/susimail/src/js/compose.js            |  4 ++++
 apps/susimail/src/js/folder.js             |  4 ++++
 apps/susimail/src/js/notifications.js      |  4 ++++
 23 files changed, 129 insertions(+), 1 deletion(-)

diff --git a/apps/i2psnark/resources/js/delete.js b/apps/i2psnark/resources/js/delete.js
index 45a22fab01..3b7c319075 100644
--- a/apps/i2psnark/resources/js/delete.js
+++ b/apps/i2psnark/resources/js/delete.js
@@ -1,3 +1,5 @@
+/* @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 */
diff --git a/apps/i2psnark/resources/js/folder.js b/apps/i2psnark/resources/js/folder.js
index 53eb7ba416..5f51efb996 100644
--- a/apps/i2psnark/resources/js/folder.js
+++ b/apps/i2psnark/resources/js/folder.js
@@ -1,3 +1,5 @@
+/* @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 */
diff --git a/apps/i2psnark/resources/js/initajax.js b/apps/i2psnark/resources/js/initajax.js
index fa8782412a..3a1d6da397 100644
--- a/apps/i2psnark/resources/js/initajax.js
+++ b/apps/i2psnark/resources/js/initajax.js
@@ -1,3 +1,9 @@
+/* @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 */
diff --git a/apps/i2ptunnel/jsp/js/delete.js b/apps/i2ptunnel/jsp/js/delete.js
index 630e32c1f8..dc13241bf1 100644
--- a/apps/i2ptunnel/jsp/js/delete.js
+++ b/apps/i2ptunnel/jsp/js/delete.js
@@ -1,3 +1,5 @@
+/* @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 */
diff --git a/apps/i2ptunnel/jsp/js/tableSlider.js b/apps/i2ptunnel/jsp/js/tableSlider.js
index 4ff2f14c09..c8199b9882 100644
--- a/apps/i2ptunnel/jsp/js/tableSlider.js
+++ b/apps/i2ptunnel/jsp/js/tableSlider.js
@@ -1,3 +1,5 @@
+/* @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 */
diff --git a/apps/routerconsole/jsp/dns.jsp b/apps/routerconsole/jsp/dns.jsp
index d84f36a0cc..2ac829022b 100644
--- a/apps/routerconsole/jsp/dns.jsp
+++ b/apps/routerconsole/jsp/dns.jsp
@@ -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" %>
diff --git a/apps/routerconsole/jsp/i2ptunnelmgr.jsp b/apps/routerconsole/jsp/i2ptunnelmgr.jsp
index f655bf1c0e..a7884e2b9d 100644
--- a/apps/routerconsole/jsp/i2ptunnelmgr.jsp
+++ b/apps/routerconsole/jsp/i2ptunnelmgr.jsp
@@ -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>
 
diff --git a/apps/routerconsole/jsp/js/ajax.js b/apps/routerconsole/jsp/js/ajax.js
index 6e71b719e4..ae4e582a50 100644
--- a/apps/routerconsole/jsp/js/ajax.js
+++ b/apps/routerconsole/jsp/js/ajax.js
@@ -1,3 +1,9 @@
+/* @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 */
diff --git a/apps/routerconsole/jsp/js/configclients.js b/apps/routerconsole/jsp/js/configclients.js
index 4acac38ec1..b6e8c99a7c 100644
--- a/apps/routerconsole/jsp/js/configclients.js
+++ b/apps/routerconsole/jsp/js/configclients.js
@@ -1,3 +1,9 @@
+/* @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 */
diff --git a/apps/routerconsole/jsp/js/configstats.js b/apps/routerconsole/jsp/js/configstats.js
index 06725e5234..92a8a0731c 100644
--- a/apps/routerconsole/jsp/js/configstats.js
+++ b/apps/routerconsole/jsp/js/configstats.js
@@ -1,3 +1,9 @@
+/* @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 */
diff --git a/apps/routerconsole/jsp/js/iframed.js b/apps/routerconsole/jsp/js/iframed.js
index 0d3c85a405..58fe8bbdcb 100644
--- a/apps/routerconsole/jsp/js/iframed.js
+++ b/apps/routerconsole/jsp/js/iframed.js
@@ -1,8 +1,15 @@
+/* @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 */
diff --git a/apps/routerconsole/jsp/js/refreshGraph.js b/apps/routerconsole/jsp/js/refreshGraph.js
index 5773bdf207..1727033fca 100644
--- a/apps/routerconsole/jsp/js/refreshGraph.js
+++ b/apps/routerconsole/jsp/js/refreshGraph.js
@@ -1,3 +1,9 @@
+/* @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 */
diff --git a/apps/routerconsole/jsp/js/resetScroll.js b/apps/routerconsole/jsp/js/resetScroll.js
index 3abb5a4d47..ecd68b16aa 100644
--- a/apps/routerconsole/jsp/js/resetScroll.js
+++ b/apps/routerconsole/jsp/js/resetScroll.js
@@ -1,3 +1,9 @@
+/* @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 */
diff --git a/apps/routerconsole/jsp/js/stats.js b/apps/routerconsole/jsp/js/stats.js
index 2e80fa8148..200bcb13d0 100644
--- a/apps/routerconsole/jsp/js/stats.js
+++ b/apps/routerconsole/jsp/js/stats.js
@@ -1,3 +1,9 @@
+/* @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 */
diff --git a/apps/routerconsole/jsp/js/welcomeajax.js b/apps/routerconsole/jsp/js/welcomeajax.js
index 1c68fa5445..b4237e48e1 100644
--- a/apps/routerconsole/jsp/js/welcomeajax.js
+++ b/apps/routerconsole/jsp/js/welcomeajax.js
@@ -1,3 +1,9 @@
+/* @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 */
diff --git a/apps/routerconsole/jsp/summaryajax.jsi b/apps/routerconsole/jsp/summaryajax.jsi
index 08abb22da6..bb44b26e6e 100644
--- a/apps/routerconsole/jsp/summaryajax.jsi
+++ b/apps/routerconsole/jsp/summaryajax.jsi
@@ -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><%
     }
 %>
diff --git a/apps/routerconsole/jsp/torrents.jsp b/apps/routerconsole/jsp/torrents.jsp
index 936a78a912..f73d4a7466 100644
--- a/apps/routerconsole/jsp/torrents.jsp
+++ b/apps/routerconsole/jsp/torrents.jsp
@@ -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" %>
diff --git a/apps/routerconsole/jsp/webmail.jsp b/apps/routerconsole/jsp/webmail.jsp
index 24ad450843..242c2cc9a1 100644
--- a/apps/routerconsole/jsp/webmail.jsp
+++ b/apps/routerconsole/jsp/webmail.jsp
@@ -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" %>
diff --git a/apps/routerconsole/jsp/welcome.jsp b/apps/routerconsole/jsp/welcome.jsp
index 0cc93b23ab..4094102b23 100644
--- a/apps/routerconsole/jsp/welcome.jsp
+++ b/apps/routerconsole/jsp/welcome.jsp
@@ -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
diff --git a/apps/susidns/src/js/messages.js b/apps/susidns/src/js/messages.js
index 0a88cb6d02..dbc8f0edea 100644
--- a/apps/susidns/src/js/messages.js
+++ b/apps/susidns/src/js/messages.js
@@ -1,3 +1,4 @@
+/* #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 */
diff --git a/apps/susimail/src/js/compose.js b/apps/susimail/src/js/compose.js
index 6c7b09ffbf..b84bf2200c 100644
--- a/apps/susimail/src/js/compose.js
+++ b/apps/susimail/src/js/compose.js
@@ -1,3 +1,5 @@
+/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
+
 let beforePopup = true;
 window.addEventListener('beforeunload', (e)=>{if (beforePopup) e.returnValue=true;} );
 
@@ -20,3 +22,5 @@ function addClickHandler5(elem)
 document.addEventListener("DOMContentLoaded", function() {
     initPopup();
 }, true);
+
+/* @license-end */
diff --git a/apps/susimail/src/js/folder.js b/apps/susimail/src/js/folder.js
index bb6948b9fe..0cc7dc94b1 100644
--- a/apps/susimail/src/js/folder.js
+++ b/apps/susimail/src/js/folder.js
@@ -1,3 +1,5 @@
+/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
+
 function initButtons() {
 	var buttons = document.getElementsByClassName("delete1");
 	for(index = 0; index < buttons.length; index++)
@@ -100,3 +102,5 @@ document.addEventListener("DOMContentLoaded", function() {
     initButtons();
     deleteboxclicked();
 }, true);
+
+/* @license-end */
diff --git a/apps/susimail/src/js/notifications.js b/apps/susimail/src/js/notifications.js
index 90167d1463..ea636e90ca 100644
--- a/apps/susimail/src/js/notifications.js
+++ b/apps/susimail/src/js/notifications.js
@@ -1,3 +1,5 @@
+/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
+
 function initNotifications() {
 	var buttons = document.getElementsByClassName("notifications");
 	for(index = 0; index < buttons.length; index++)
@@ -17,3 +19,5 @@ function addClickHandler6(elem)
 document.addEventListener("DOMContentLoaded", function() {
     initNotifications();
 }, true);
+
+/* @license-end */
-- 
GitLab