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

Skip to content
Snippets Groups Projects
Commit 3fac4487 authored by zzz's avatar zzz
Browse files

Console: Rename all the js init() functions

parent f8df7eba
No related branches found
No related tags found
No related merge requests found
function init() function initDelete()
{ {
var buttons = document.getElementsByClassName("delete1"); var buttons = document.getElementsByClassName("delete1");
for(index = 0; index < buttons.length; index++) for(index = 0; index < buttons.length; index++)
...@@ -35,5 +35,5 @@ function addClickHandler2(elem) ...@@ -35,5 +35,5 @@ function addClickHandler2(elem)
} }
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
init(); initDelete();
}, true); }, true);
function init() function initDelete()
{ {
var buttons = document.getElementsByClassName("delete"); var buttons = document.getElementsByClassName("delete");
for(index = 0; index < buttons.length; index++) for(index = 0; index < buttons.length; index++)
...@@ -19,5 +19,5 @@ function addClickHandler(elem) ...@@ -19,5 +19,5 @@ function addClickHandler(elem)
} }
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
init(); initDelete();
}, true); }, true);
function init() function initConfigClients()
{ {
var buttons = document.getElementsByClassName("delete"); var buttons = document.getElementsByClassName("delete");
for(index = 0; index < buttons.length; index++) for(index = 0; index < buttons.length; index++)
{ {
var button = buttons[index]; var button = buttons[index];
addClickHandler(button); addCCClickHandler(button);
} }
} }
function addClickHandler(elem) function addCCClickHandler(elem)
{ {
elem.addEventListener("click", function() { elem.addEventListener("click", function() {
if (!confirm(deleteMessage.replace("{0}", elem.getAttribute("client")))) { if (!confirm(deleteMessage.replace("{0}", elem.getAttribute("client")))) {
...@@ -19,5 +19,5 @@ function addClickHandler(elem) ...@@ -19,5 +19,5 @@ function addClickHandler(elem)
} }
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
init(); initConfigClients();
}, true); }, true);
function init() function initConfigStats()
{ {
checkAll = false; checkAll = false;
var buttons = document.getElementsByClassName("script"); var buttons = document.getElementsByClassName("script");
...@@ -7,10 +7,10 @@ function init() ...@@ -7,10 +7,10 @@ function init()
var button = buttons[index]; var button = buttons[index];
// toggle-foo // toggle-foo
var group = button.id.substring(7); 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;}); elem.addEventListener("click", function(){toggleAll(category); event.preventDefault(); return false;});
} }
...@@ -64,5 +64,5 @@ function toggleAll(category) ...@@ -64,5 +64,5 @@ function toggleAll(category)
} }
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
init(); initConfigStats();
}, true); }, true);
function init() function initStats()
{ {
var buttons = document.getElementsByClassName("onchange"); var buttons = document.getElementsByClassName("onchange");
for(index = 0; index < buttons.length; index++) for(index = 0; index < buttons.length; index++)
{ {
var button = buttons[index]; var button = buttons[index];
addChangeHandler(button); addSChangeHandler(button);
} }
} }
function addChangeHandler(elem) function addSChangeHandler(elem)
{ {
elem.addEventListener("change", function() { elem.addEventListener("change", function() {
location.href=event.target.value; location.href=event.target.value;
...@@ -16,5 +16,5 @@ function addChangeHandler(elem) ...@@ -16,5 +16,5 @@ function addChangeHandler(elem)
} }
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
init(); initStats();
}, true); }, true);
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