From 67688052bdf026317440517b70b5ab42e16fa812 Mon Sep 17 00:00:00 2001 From: Nyan404 Date: Tue, 25 Aug 2026 04:27:54 +0300 Subject: [PATCH] docs: explain shared game page helpers --- web/data/cwshed-core.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/data/cwshed-core.js b/web/data/cwshed-core.js index b3564e5..670e93a 100644 --- a/web/data/cwshed-core.js +++ b/web/data/cwshed-core.js @@ -313,6 +313,7 @@ }`); } + // Initializes helpers shared by profiles, blogs, messages, and other pages. function site() { // Весь сайт, кроме Игровой и её разделов if (globals.on_deletionWarning) { const el = $('.other_cats_list').first(); @@ -350,6 +351,7 @@ } } } + // Initializes the main game page and installs its dynamic DOM observers. function cw3() { //Игровая if (globals.on_settLink) { $('.small').first().append(` | Настройки модов`); //Настройки мода @@ -530,6 +532,7 @@ let firstNote = ""; let rang = true; + // Updates the smell countdown and triggers the configured alert at zero. function smellTimerTick() { let val = parseInt($('#cws_smell_timer').attr('value')); if (val) { @@ -849,6 +852,7 @@ }); } if (globals.on_actNotif) { + // Maps an action label to the corresponding configured sound/text key. function which_action(text) { const act_detect = { "move": "Переход", @@ -1265,6 +1269,7 @@ "Воевода": "воеводу" }; + // Converts a raw game title into the localized display form. function title_convert(title) { return convert[title] || title; } @@ -1628,6 +1633,7 @@ $('.cws-tt-table[page=' + page + ']').show(); } + // Applies a saved minefield panel style to one DOM element. function tt_setStyle($elem, style) { $elem.removeClass('cws-tt-safe cws-tt-unsafe cws-tt-move').addClass(style); if (proj) { @@ -1637,7 +1643,8 @@ } } - function tt_draw() { + // Renders the configurable minefield panel and its page controls. + function tt_draw() { $('.cws-tt-table[page=' + page + '] td.cws-tt-safe, .cws-tt-table[page=' + page + '] td.cws-tt-unsafe, .cws-tt-table[page=' + page + '] td.cws-tt-move').each(function () { let col = $(this).index(); let row = $(this).parent().index(); @@ -1726,6 +1733,7 @@ }); } if (globals.on_paramInfo) { + // Formats seconds as the compact timer string used in game panels. function timeConv(sec) { let str = ""; let hr = parseInt(sec / 3600);