From 040f461b86d437a2bdf18e4c5f1ee14fb1ff6c70 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Fri, 13 Mar 2026 11:48:12 +0300 Subject: [PATCH] Instead of "setTextSizeOnInfoBlock," we now use the new "setTextSizeOnInfoBlocks" function, which sets the text size for all blocks. (skin.js) "setTextSizeOnInfoBlock" sets the text size for a specific block and is now used in MonitorStream.js. --- web/skins/classic/js/skin.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js index 43deab3d4..99c2d2016 100644 --- a/web/skins/classic/js/skin.js +++ b/web/skins/classic/js/skin.js @@ -1863,18 +1863,22 @@ function calcTextSizeOnInfoBlock(el) { return parseInt((w/textLength) * 0.6 / d); // ~40% of the block width } -function setTextSizeOnInfoBlock() { +function setTextSizeOnInfoBlocks() { const block = document.querySelectorAll('[id ^= "stream-info-block"]'); Array.prototype.forEach.call(block, (el) => { - if (el.innerText.length == 0) return; - const fontSize = calcTextSizeOnInfoBlock(el); - el.style.fontSize = fontSize + "px"; - el.classList.remove("text-3d-mini", "text-3d"); - const blockClass = (fontSize !== fontSize || fontSize < 50) ? 'text-3d-mini' : 'text-3d'; - el.classList.add(blockClass); + setTextSizeOnInfoBlock(el); }); } +function setTextSizeOnInfoBlock(el) { + if (el.innerText.length == 0) return; + const fontSize = calcTextSizeOnInfoBlock(el); + el.style.fontSize = fontSize + "px"; + el.classList.remove("text-3d-mini", "text-3d"); + const blockClass = (fontSize !== fontSize || fontSize < 50) ? 'text-3d-mini' : 'text-3d'; + el.classList.add(blockClass); +} + /* * date - object type Date() * shift.offset - number (can be negative) @@ -2789,7 +2793,7 @@ function monitorsSetScale(id=null) { } } // End function _setScale setButtonSizeOnStream(); - setTextSizeOnInfoBlock(); + setTextSizeOnInfoBlocks(); } // End function monitorsSetScale /*IMPORTANT DO NOT CALL WITHOUT CONSCIOUS NEED!!!*/