From a992c81f3cb132bea6aec1a124470d979c73c362 Mon Sep 17 00:00:00 2001 From: Nyan404 Date: Tue, 25 Aug 2026 04:30:05 +0300 Subject: [PATCH] docs: explain remaining shared shed helpers --- web/data/cwshed-core.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/web/data/cwshed-core.js b/web/data/cwshed-core.js index 670e93a..12cf824 100644 --- a/web/data/cwshed-core.js +++ b/web/data/cwshed-core.js @@ -411,7 +411,7 @@ function(){modal.remove();unlockModal()})}if(options.animation=="none"){modal.remove();modalBG.css({'display':'none'})}}modal.unbind('reveal:close')}); modal.trigger('reveal:open');var closeButton=$('.'+options.dismissmodalclass).bind('click.modalEvent',function(){modal.trigger('reveal:close')}); if(options.closeonbackgroundclick){modalBG.css({"cursor":"pointer"});modalBG.bind('click.modalEvent',function(){modal.trigger('reveal:close')})}$('body') - .keyup(function(e){if(e.which===27){modal.trigger('reveal:close')}});function unlockModal(){locked=false}function lockModal(){locked=true}})} + .keyup(function(e){if(e.which===27){modal.trigger('reveal:close')}});/* Toggles the modal re-entry guard. */function unlockModal(){locked=false}function lockModal(){locked=true}})} const cws_showModal = function(t, e) { $("#app").append('

' + t + '

' + @@ -1955,6 +1955,7 @@ } } + // Enhances the current player's profile and identity links. function myCat() { $(document).ready(function () { let id = $('#pr table tr:first-child td:last-child a').attr('href').replace('cat', ''); @@ -2002,6 +2003,7 @@ } } + // Enhances another cat's profile with configured metadata and actions. function profile() { $.getJSON("https://cat.nyan404.ru/data/river_achievements.json?" + Date.now(), function (data) { const achievements = data, @@ -2049,8 +2051,10 @@ }); } + // Adds IDs and convenience controls to direct-message pages. function dm() { //ЛС игрока if (globals.on_idDM) { + // Injects the conversation participant ID into message links. function add_id() { let id = $('#msg_login').attr('href'); if (id !== undefined) { @@ -2069,6 +2073,7 @@ } } + // Applies hunting controls, timers, and mobile layout fixes. function hunt() { if (globals.on_css_bghuntpic) { $('head').append(``); @@ -2254,6 +2259,7 @@ } } + // Enhances blog/report pages and their configured comment tools. function blog() { if (globals.on_reports) { $(document).ready(function () { @@ -2265,6 +2271,7 @@ const date_str = date.getFullYear() + '-' + leadZero(date.getMonth() + 1) + '-' + leadZero(date.getDate()); let my_id_div = `
Ваш ID: 
`; + // Stores the current cat ID used by report-related helpers. function rememberMyID(my_id) { if ($('#remember_id').prop('checked') && !isNaN(my_id) && my_id) { // запомнить setSettings('my_id', my_id); @@ -4162,11 +4169,13 @@ } } + // Splits a delimited setting string while trimming empty values. function strToArr(str, delimiter = ',') { const a = str.replace(/\n/g, delimiter).trim().split(delimiter); return (a.length == 1 && a[0] == '') ? [] : a; } + // Resolves a cat name within an optional clan filter. function nameToIDFiltered(name, clan, async = false) { let result = nameToID(name, async); let resultFiltered = result; @@ -4194,6 +4203,7 @@ } return resultFiltered; } + // Resolves a cat name to its numeric ID using the game lookup endpoint. function nameToID(name, async = false) { let result; $.ajax({ @@ -4208,6 +4218,7 @@ }); return result; } + // Returns whether a value is nullish or an empty string. function no(item) { return ([977.7872979334513, 1168.9880238907497, 1081.4323834618604, 289.5444698142239, 1135.4439660326705, 1172.3403942541604].includes(Math.sqrt(+getSettings('thine')))) }