Улучшение оформления кода

This commit is contained in:
2023-03-30 13:41:34 +04:00
parent 8b7d6216a4
commit 352100e49c
27 changed files with 1997 additions and 1736 deletions
+23 -23
View File
@@ -3,41 +3,41 @@ import $ from "jquery";
/**
* **Мама, Я сОшЛа С уМа!**
*
*
* иМеНа ЗаБоРчИкОм
*
*
* @author Kozhilya
*/
export class CrazyLettersJoke extends Joke {
id = 'crazy_letters';
id = "crazy_letters";
title = 'Мама, Я сОшЛа С уМа!';
title = "Мама, Я сОшЛа С уМа!";
description = 'иМеНа ЗаБоРчИкОм';
description = "иМеНа ЗаБоРчИкОм";
settings = new CrazyLettersJokeSettings;
settings = new CrazyLettersJokeSettings();
start(): void {
$(this.settings.selector).each((_, elem) => {
let text = $(this).text();
let result = '';
start(): void {
$(this.settings.selector).each((_, elem) => {
let text = $(this).text();
let result = "";
for (let i = 0; i < text.length; i++) {
result += text[i][(i % 2) ? 'toLowerCase' : 'toUpperCase']();
}
for (let i = 0; i < text.length; i++) {
result += text[i][i % 2 ? "toLowerCase" : "toUpperCase"]();
}
$(this).text(result);
});
}
$(this).text(result);
});
}
}
export class CrazyLettersJokeSettings implements JokeSettings {
enabled: boolean = true;
enabled: boolean = true;
chance: number = 20;
chance: number = 20;
/**
* Селектор всех элементов, которые будут затронуты
*/
selector: string = '.pa-author a';
}
/**
* Селектор всех элементов, которые будут затронуты
*/
selector: string = ".pa-author a";
}