docs: explain remaining CatWar page handlers
This commit is contained in:
1 parent
06229ed658
commit
a649fc295f
1 file changed
+15
@@ -487,6 +487,7 @@
|
||||
return dateToString(birthday + age);
|
||||
}
|
||||
|
||||
// Applies shared enhancements to blog listing, report, and comment pages.
|
||||
function changeAllBlogsPages() {
|
||||
addBBcode(1);
|
||||
let css = `
|
||||
@@ -767,6 +768,7 @@
|
||||
textarea.focus();
|
||||
}
|
||||
|
||||
// Enhances the blog creation form with editor and preview helpers.
|
||||
function changeCreationPage() {
|
||||
if (globals.creationAlert) addSaveAlert();
|
||||
if (isPage('blogs?creation', true) || isPage('sniff?creation', true)) {
|
||||
@@ -892,10 +894,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Filters visible blog entries by the selected tag value.
|
||||
function searchByTag(tag) {
|
||||
window.location.href = window.location.href.split('?')[0] + '?tag=' + tag;
|
||||
}
|
||||
|
||||
// Enhances a cat page with notes, identity data, and configured controls.
|
||||
function changeCatPage() {
|
||||
addCSS(`#info { color: black; } #age_icon, #age2_icon, #act_icon, img[src^="medal"] { cursor: pointer; }`);
|
||||
moonCalc();
|
||||
@@ -979,6 +983,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Installs chat-specific formatting, mentions, and notification behavior.
|
||||
function changeChatPage() {
|
||||
addCSS(`.tabName, #confirm_text, .mess_tr[style^="background: rgb(255, 204, 153)"] { color: black; } .mess_tr[style^="background: rgb(255, 204, 153)"] a { color: #003; }`);
|
||||
addBBcode(1);
|
||||
@@ -998,6 +1003,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Coordinates the full game-page feature set for the CW3 layout.
|
||||
function changeCW3Page() {
|
||||
const menu = $('.small').first();
|
||||
//const isMale = /Мой кот/.test(menu.text());
|
||||
@@ -1472,6 +1478,7 @@
|
||||
let isSnow = false;
|
||||
let sky = null;
|
||||
|
||||
// Creates one animated snow layer for the seasonal visual effect.
|
||||
function snow() {
|
||||
console.log("Создаем снежинку");
|
||||
const randomSnowflake = snowSVG[Math.floor(Math.random() * snowSVG.length)];
|
||||
@@ -1506,6 +1513,7 @@
|
||||
$('body').append(snowflakeDiv);
|
||||
}
|
||||
|
||||
// Starts the seasonal animation loop and keeps layers moving downward.
|
||||
function runSnow() {
|
||||
console.log("Запускаем runSnow");
|
||||
snow();
|
||||
@@ -1783,6 +1791,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Builds the alternate snow implementation used by the legacy layout.
|
||||
function snow() {
|
||||
const id = Date.now()
|
||||
, flake = 'https://porch.website/cwmod/snow/' + Math.ceil(Math.random() * 20) + '.png'
|
||||
@@ -1810,6 +1819,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Enhances the fairy/resource page with configured display adjustments.
|
||||
function changeFaePage() {
|
||||
if (globals.enableFaeNotes) {
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
@@ -1846,6 +1856,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Enhances the ideas page with filtering and presentation helpers.
|
||||
function changeIdeasPage() {
|
||||
addCSS(`.vote[style="color:#000"] { color: inherit !important; } .idea { color: black; } .idea a, .idea a:hover { color: #005 !important; }`);
|
||||
}
|
||||
@@ -2754,6 +2765,7 @@
|
||||
}
|
||||
/*
|
||||
// Synchronizes the calculator with the currently selected training page.
|
||||
// Initializes the training-time calculator and its form interactions.
|
||||
function changeTimePage() {
|
||||
const catTimeNow = timestampToCatTime(Date.now());
|
||||
$(isDesctop ? '#branch' : '#site_table').append(`
|
||||
@@ -2767,6 +2779,7 @@
|
||||
`);
|
||||
}
|
||||
*/
|
||||
// Builds the userscript settings page and wires import/export controls.
|
||||
function changeSettingsPage() {
|
||||
let css = `
|
||||
.copy { cursor: pointer; }
|
||||
@@ -3591,10 +3604,12 @@
|
||||
};
|
||||
}
|
||||
|
||||
// Extracts the first numeric token from a string for parser helpers.
|
||||
function getNumber(s) {
|
||||
return Number(s.match(/\d+/)[0]);
|
||||
}
|
||||
|
||||
// Converts a limited HTML subset into the forum's BBCode representation.
|
||||
function bbencode(html) {
|
||||
html = html.replace(/<br>/g, '[br]');
|
||||
html = html.replace(/<(\/?)b>/gm, '[$1b]');
|
||||
|
||||
Reference in new issue
Block a user