From 3fac44874eebbbec62283539c78cf3f10cbb0139 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Wed, 27 May 2020 12:35:12 +0000 Subject: [PATCH] Console: Rename all the js init() functions --- apps/i2psnark/resources/js/delete.js | 4 ++-- apps/i2ptunnel/jsp/js/delete.js | 4 ++-- apps/routerconsole/jsp/js/configclients.js | 8 ++++---- apps/routerconsole/jsp/js/configstats.js | 8 ++++---- apps/routerconsole/jsp/js/stats.js | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/i2psnark/resources/js/delete.js b/apps/i2psnark/resources/js/delete.js index c5b8a42be4..c6592104c5 100644 --- a/apps/i2psnark/resources/js/delete.js +++ b/apps/i2psnark/resources/js/delete.js @@ -1,4 +1,4 @@ -function init() +function initDelete() { var buttons = document.getElementsByClassName("delete1"); for(index = 0; index < buttons.length; index++) @@ -35,5 +35,5 @@ function addClickHandler2(elem) } document.addEventListener("DOMContentLoaded", function() { - init(); + initDelete(); }, true); diff --git a/apps/i2ptunnel/jsp/js/delete.js b/apps/i2ptunnel/jsp/js/delete.js index bf005037b0..630e32c1f8 100644 --- a/apps/i2ptunnel/jsp/js/delete.js +++ b/apps/i2ptunnel/jsp/js/delete.js @@ -1,4 +1,4 @@ -function init() +function initDelete() { var buttons = document.getElementsByClassName("delete"); for(index = 0; index < buttons.length; index++) @@ -19,5 +19,5 @@ function addClickHandler(elem) } document.addEventListener("DOMContentLoaded", function() { - init(); + initDelete(); }, true); diff --git a/apps/routerconsole/jsp/js/configclients.js b/apps/routerconsole/jsp/js/configclients.js index 657e29f820..4acac38ec1 100644 --- a/apps/routerconsole/jsp/js/configclients.js +++ b/apps/routerconsole/jsp/js/configclients.js @@ -1,14 +1,14 @@ -function init() +function initConfigClients() { var buttons = document.getElementsByClassName("delete"); for(index = 0; index < buttons.length; index++) { var button = buttons[index]; - addClickHandler(button); + addCCClickHandler(button); } } -function addClickHandler(elem) +function addCCClickHandler(elem) { elem.addEventListener("click", function() { if (!confirm(deleteMessage.replace("{0}", elem.getAttribute("client")))) { @@ -19,5 +19,5 @@ function addClickHandler(elem) } document.addEventListener("DOMContentLoaded", function() { - init(); + initConfigClients(); }, true); diff --git a/apps/routerconsole/jsp/js/configstats.js b/apps/routerconsole/jsp/js/configstats.js index 81bf111510..06725e5234 100644 --- a/apps/routerconsole/jsp/js/configstats.js +++ b/apps/routerconsole/jsp/js/configstats.js @@ -1,4 +1,4 @@ -function init() +function initConfigStats() { checkAll = false; var buttons = document.getElementsByClassName("script"); @@ -7,10 +7,10 @@ function init() var button = buttons[index]; // toggle-foo var group = button.id.substring(7); - addClickHandler(button, group); + addCSClickHandler(button, group); } } -function addClickHandler(elem, category) +function addCSClickHandler(elem, category) { elem.addEventListener("click", function(){toggleAll(category); event.preventDefault(); return false;}); } @@ -64,5 +64,5 @@ function toggleAll(category) } document.addEventListener("DOMContentLoaded", function() { - init(); + initConfigStats(); }, true); diff --git a/apps/routerconsole/jsp/js/stats.js b/apps/routerconsole/jsp/js/stats.js index 9685c5aedc..2e80fa8148 100644 --- a/apps/routerconsole/jsp/js/stats.js +++ b/apps/routerconsole/jsp/js/stats.js @@ -1,14 +1,14 @@ -function init() +function initStats() { var buttons = document.getElementsByClassName("onchange"); for(index = 0; index < buttons.length; index++) { var button = buttons[index]; - addChangeHandler(button); + addSChangeHandler(button); } } -function addChangeHandler(elem) +function addSChangeHandler(elem) { elem.addEventListener("change", function() { location.href=event.target.value; @@ -16,5 +16,5 @@ function addChangeHandler(elem) } document.addEventListener("DOMContentLoaded", function() { - init(); + initStats(); }, true); -- GitLab