3 Commits

Author SHA1 Message Date
d5c0786a55 add: Добавлена кнопка "Очистить" для формы ввода и счетчик символов. новая версия сайта (v0.2.3)
All checks were successful
Build ETPGRF-site / build (push) Successful in 1m30s
2026-02-11 11:37:28 +03:00
0f2704573d mod: новая версия библиотеки etpgrf (v0.1.4) и версия сайта (v0.2.2)
All checks were successful
Build ETPGRF-site / build (push) Successful in 1m27s
2026-02-03 02:44:41 +03:00
18f4f91382 mod: minor 2026-02-01 23:02:51 +03:00
7 changed files with 60 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
Основные возможности: Основные возможности:
- Веб-интерфейс для ввода текста и настройки параметров типографики. - Веб-интерфейс для ввода текста и настройки параметров типографики.
""" """
__version__ = "0.1.3" __version__ = "0.2.2"
__author__ = "Sergei Erjemin" __author__ = "Sergei Erjemin"
__email__ = "erjemin@gmail.com" __email__ = "erjemin@gmail.com"
__license__ = "MIT" __license__ = "MIT"

View File

@@ -79,7 +79,7 @@
{# Футер #}<footer class="footer mt-auto py-2 mt-4"> {# Футер #}<footer class="footer mt-auto py-2 mt-4">
<div class="container d-flex justify-content-between align-items-center"> <div class="container d-flex justify-content-between align-items-center">
<span class="text-muted small nowrap me-2">&copy; Sergei Erjemin, 2025&ndash;{% now 'Y' %}.</span> <span class="text-muted small nowrap me-2">&copy; Sergei Erjemin, 2025&ndash;{% now 'Y' %}.</span>
<nobr class="text-muted small mx-2"><i class="bi bi-tags me-1" title="Версия библиотеки etpgrf / Версия сайта"></i><a href="/changelog">v0.1.3 / v0.2.1</a></nobr> <nobr class="text-muted small mx-2"><i class="bi bi-tags me-1" title="Версия библиотеки etpgrf / Версия сайта"></i><a href="/changelog">v0.1.4 / v0.2.3</a></nobr>
{# Сводная статистика (HTMX) #}<span class="text-muted small ms-2" hx-get="{% url 'stats_summary' %}" hx-trigger="load"> {# Сводная статистика (HTMX) #}<span class="text-muted small ms-2" hx-get="{% url 'stats_summary' %}" hx-trigger="load">
... ...
</span> </span>

View File

@@ -38,10 +38,18 @@
{# ГЛАВНОЕ ПОЛЕ ВВОДА #} {# ГЛАВНОЕ ПОЛЕ ВВОДА #}
<div class="mb-3"> <div class="mb-3">
<label class="form-label fw-bold small text-muted ls-1"> <div class="d-flex justify-content-between align-items-end mb-2">
<i class="bi bi-file-text me-1"></i> Исходный текст: <label class="form-label fw-bold small text-muted ls-1 mb-0">
</label> <i class="bi bi-file-text me-1"></i> Исходный текст:
<textarea class="form-control" name="text" rows="10" placeholder="Вставьте текст сюда..."></textarea> </label>
<div class="d-flex align-items-center">
<span id="char-count" class="small text-muted me-3 nowrap">0 симв.</span>
<button type="button" id="btn-clear" class="btn btn-sm btn-outline-secondary" title="Очистить поле">
<i class="bi bi-trash me-1"></i> Очистить
</button>
</div>
</div>
<textarea class="form-control" name="text" id="source-text" rows="10" placeholder="Вставьте текст сюда..."></textarea>
</div> </div>
{# Блок настроек (Collapse) #} {# Блок настроек (Collapse) #}
@@ -221,7 +229,7 @@
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" name="sanitizer_enabled" id="optSanitizer" <input class="form-check-input" type="checkbox" name="sanitizer_enabled" id="optSanitizer"
x-model="enabled"> x-model="enabled">
<label class="form-check-label fw-bold" for="optSanitizer">Очистка от HTML (Sanitizer)</label> <label class="form-check-label fw-bold" for="optSanitizer">Очистка от&nbsp;HTML (Sanitizer)</label>
</div> </div>
{# Настройки группы "Санитайзер" (видны, когда включено) #} {# Настройки группы "Санитайзер" (видны, когда включено) #}
<div class="ms-3 mt-1" x-show="enabled" x-transition> <div class="ms-3 mt-1" x-show="enabled" x-transition>
@@ -256,7 +264,7 @@
Юникод (Unicode) Юникод (Unicode)
</option> </option>
<option value="mnemonic" <option value="mnemonic"
data-desc="Совместимость. Все спецсимволы заменяются на&nbsp;HTML-мнемоники (&amp;amp;mdash;, &amp;amp;copy; …)."> data-desc="Совместимость c&nbsp;koi8r и&nbsp;cp1251. Все спецсимволы заменяются на&nbsp;HTML-мнемоники (<tt>&amp;amp;mdash;</tt>, <tt>&amp;amp;copy;</tt> и&nbsp;пр.)">
Мнемоники (Mnemonic) Мнемоники (Mnemonic)
</option> </option>
</select> </select>

8
poetry.lock generated
View File

@@ -58,13 +58,13 @@ bcrypt = ["bcrypt (>=4.1.1)"]
[[package]] [[package]]
name = "etpgrf" name = "etpgrf"
version = "0.1.3" version = "0.1.4"
description = "Electro-Typographer: Python library for advanced web typography (non-breaking spaces, hyphenation, hanging punctuation and ." description = "Electro-Typographer: Python library for advanced web typography (non-breaking spaces, hyphenation, hanging punctuation and ."
optional = false optional = false
python-versions = ">=3.10" python-versions = ">=3.10"
files = [ files = [
{file = "etpgrf-0.1.3-py3-none-any.whl", hash = "sha256:38212713f957ecf12d7e5fd6a11c77995bf41e16cbca4250411fa450ba290d62"}, {file = "etpgrf-0.1.4-py3-none-any.whl", hash = "sha256:62d4371e1b5fab06b99f79bd351767aed8baf7d041cae7e5d4eb63f7c9545114"},
{file = "etpgrf-0.1.3.tar.gz", hash = "sha256:f611948fe747c5470ba27b31d8af5c59a219d58efd033079491c9e61e011e4d0"}, {file = "etpgrf-0.1.4.tar.gz", hash = "sha256:c699382c292e3110915331dd5539e7dde0c961e4f4ca65cf8db0e01e84dab72f"},
] ]
[package.dependencies] [package.dependencies]
@@ -572,4 +572,4 @@ files = [
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = "^3.13" python-versions = "^3.13"
content-hash = "fad76f5756ffa133d1778a1976fd5216450ebf83881fcfacee259b7c41102317" content-hash = "9610a92fa47d1bd0849512ae842b0fdd68dc06d9917ab676cf5d8f6521700837"

View File

@@ -205,6 +205,17 @@ footer.footer a:hover {
--bs-btn-hover-border-color: var(--bs-link-hover-color); --bs-btn-hover-border-color: var(--bs-link-hover-color);
--bs-btn-active-bg: var(--bs-link-hover-color); --bs-btn-active-bg: var(--bs-link-hover-color);
--bs-btn-active-border-color: var(--bs-link-hover-color); --bs-btn-active-border-color: var(--bs-link-hover-color);
transition: background-color 0.8s;
}
.btn-secondary {
--bs-btn-bg: var(--bs-border-color);
--bs-btn-border-color: var(--bs-navbar-bg);
--bs-btn-hover-bg: var(--bs-border-color);
--bs-btn-hover-border-color: var(--bs-border-color);
--bs-btn-active-bg: var(--bs-border-color);
--bs-btn-active-border-color: var(--bs-border-color);
transition: background-color 0.8s;
} }
/* В темной теме текст на кнопке должен быть темным */ /* В темной теме текст на кнопке должен быть темным */

View File

@@ -23,6 +23,34 @@ const btnCopy = document.getElementById('btn-copy');
const sourceTextarea = document.querySelector('textarea[name="text"]'); const sourceTextarea = document.querySelector('textarea[name="text"]');
const processingTimeSpan = document.getElementById('processing-time'); const processingTimeSpan = document.getElementById('processing-time');
// --- ОЧИСТКА И СЧЕТЧИК ---
const btnClear = document.getElementById('btn-clear');
const charCount = document.getElementById('char-count');
if (sourceTextarea && charCount) {
function updateCharCount() {
const count = sourceTextarea.value.length;
// Форматируем число с разделителями тысяч (1 234)
charCount.textContent = `${count.toLocaleString('ru-RU')} симв.`;
}
sourceTextarea.addEventListener('input', updateCharCount);
// Инициализация с задержкой, чтобы браузер успел восстановить состояние формы
setTimeout(updateCharCount, 100);
if (btnClear) {
btnClear.addEventListener('click', () => {
sourceTextarea.value = '';
updateCharCount();
sourceTextarea.focus();
// Сбрасываем результат (триггерим событие input, чтобы сработал существующий обработчик)
sourceTextarea.dispatchEvent(new Event('input'));
});
}
}
const themeCompartment = new Compartment(); const themeCompartment = new Compartment();
function getTheme() { function getTheme() {
return window.matchMedia('(prefers-color-scheme: dark)').matches ? oneDark : []; return window.matchMedia('(prefers-color-scheme: dark)').matches ? oneDark : [];

View File

@@ -11,7 +11,7 @@ python = "^3.13"
django = "^6.0" django = "^6.0"
gunicorn = "^23.0.0" gunicorn = "^23.0.0"
python-dotenv = "^1.2.1" python-dotenv = "^1.2.1"
etpgrf = "^0.1.3" etpgrf = "0.1.4"
# lxml = "^5.1" # etpgrf подтянет как зависимость # lxml = "^5.1" # etpgrf подтянет как зависимость
# regex = "^2023.12" # etpgrf подтянет как зависимость # regex = "^2023.12" # etpgrf подтянет как зависимость
# beautifulsoup4 = "^4.10.0" # etpgrf подтянет как зависимость # beautifulsoup4 = "^4.10.0" # etpgrf подтянет как зависимость