From 9b455c2067123f24d4ed17c698134cace167f243 Mon Sep 17 00:00:00 2001 From: zurg3 <20664125+zurg3@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:44:11 +0300 Subject: [PATCH] Edited image_galleries.html --- html/image_galleries.html | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/html/image_galleries.html b/html/image_galleries.html index afa5e2e..bf83390 100644 --- a/html/image_galleries.html +++ b/html/image_galleries.html @@ -131,7 +131,6 @@ var image_url = ''; var image_item = ''; - document.getElementById('statistics').hidden = false; document.getElementById('scale_control').hidden = false; document.getElementById('output').hidden = false; @@ -149,6 +148,7 @@ var id_step = document.getElementById('id_step').value; var hide_failed_images = document.getElementsByName('hide_failed_images')[0].checked; var blur_images = document.getElementsByName('blur_images')[0].checked; + var show_statistics = document.getElementsByName('show_statistics')[0].checked; var final_id = images_amount; @@ -188,7 +188,14 @@ } reset_statistics(); - document.getElementById('total_counter').innerText = images_amount; + + if (show_statistics) { + document.getElementById('statistics').hidden = false; + document.getElementById('total_counter').innerText = images_amount; + } + else { + document.getElementById('statistics').hidden = true; + } clear_output(); @@ -207,15 +214,17 @@ document.getElementById('output').innerHTML += image_item; // Statistics - var img_test = new Image(); - img_test.onload = function() { - document.getElementById('loaded_counter').innerText = parseInt(document.getElementById('loaded_counter').innerText, 10) + 1; - document.getElementById('loaded_rate').innerText = Math.floor(parseInt(document.getElementById('loaded_counter').innerText, 10) / images_amount * 100); - }; - img_test.onerror = function() { - document.getElementById('failed_counter').innerText = parseInt(document.getElementById('failed_counter').innerText, 10) + 1; - }; - img_test.src = image_url; + if (show_statistics) { + var img_test = new Image(); + img_test.onload = function() { + document.getElementById('loaded_counter').innerText = parseInt(document.getElementById('loaded_counter').innerText, 10) + 1; + document.getElementById('loaded_rate').innerText = Math.floor(parseInt(document.getElementById('loaded_counter').innerText, 10) / images_amount * 100); + }; + img_test.onerror = function() { + document.getElementById('failed_counter').innerText = parseInt(document.getElementById('failed_counter').innerText, 10) + 1; + }; + img_test.src = image_url; + } } } else { @@ -304,6 +313,10 @@
++ + +