docs: explain shared game page helpers
This commit is contained in:
1 parent
915ac6bfb8
commit
67688052bd
1 file changed
+8
@@ -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(` | <a href="/settings">Настройки модов</a>`); //Настройки мода
|
||||
@@ -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,6 +1643,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 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();
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user