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