Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d5c0786a55 | |||
| 0f2704573d | |||
| 18f4f91382 |
@@ -2,7 +2,7 @@
|
||||
Основные возможности:
|
||||
- Веб-интерфейс для ввода текста и настройки параметров типографики.
|
||||
"""
|
||||
__version__ = "0.1.3"
|
||||
__version__ = "0.2.2"
|
||||
__author__ = "Sergei Erjemin"
|
||||
__email__ = "erjemin@gmail.com"
|
||||
__license__ = "MIT"
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
{# Футер #}<footer class="footer mt-auto py-2 mt-4">
|
||||
<div class="container d-flex justify-content-between align-items-center">
|
||||
<span class="text-muted small nowrap me-2">© Sergei Erjemin, 2025–{% 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">
|
||||
...
|
||||
</span>
|
||||
|
||||
@@ -38,10 +38,18 @@
|
||||
|
||||
{# ГЛАВНОЕ ПОЛЕ ВВОДА #}
|
||||
<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">
|
||||
<label class="form-label fw-bold small text-muted ls-1 mb-0">
|
||||
<i class="bi bi-file-text me-1"></i> Исходный текст:
|
||||
</label>
|
||||
<textarea class="form-control" name="text" rows="10" placeholder="Вставьте текст сюда..."></textarea>
|
||||
<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>
|
||||
|
||||
{# Блок настроек (Collapse) #}
|
||||
@@ -221,7 +229,7 @@
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="sanitizer_enabled" id="optSanitizer"
|
||||
x-model="enabled">
|
||||
<label class="form-check-label fw-bold" for="optSanitizer">Очистка от HTML (Sanitizer)</label>
|
||||
<label class="form-check-label fw-bold" for="optSanitizer">Очистка от HTML (Sanitizer)</label>
|
||||
</div>
|
||||
{# Настройки группы "Санитайзер" (видны, когда включено) #}
|
||||
<div class="ms-3 mt-1" x-show="enabled" x-transition>
|
||||
@@ -256,7 +264,7 @@
|
||||
Юникод (Unicode)
|
||||
</option>
|
||||
<option value="mnemonic"
|
||||
data-desc="Совместимость. Все спецсимволы заменяются на HTML-мнемоники (&amp;mdash;, &amp;copy; …).">
|
||||
data-desc="Совместимость c koi8r и cp1251. Все спецсимволы заменяются на HTML-мнемоники (<tt>&amp;mdash;</tt>, <tt>&amp;copy;</tt> и пр.)">
|
||||
Мнемоники (Mnemonic)
|
||||
</option>
|
||||
</select>
|
||||
|
||||
8
poetry.lock
generated
8
poetry.lock
generated
@@ -58,13 +58,13 @@ bcrypt = ["bcrypt (>=4.1.1)"]
|
||||
|
||||
[[package]]
|
||||
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 ."
|
||||
optional = false
|
||||
python-versions = ">=3.10"
|
||||
files = [
|
||||
{file = "etpgrf-0.1.3-py3-none-any.whl", hash = "sha256:38212713f957ecf12d7e5fd6a11c77995bf41e16cbca4250411fa450ba290d62"},
|
||||
{file = "etpgrf-0.1.3.tar.gz", hash = "sha256:f611948fe747c5470ba27b31d8af5c59a219d58efd033079491c9e61e011e4d0"},
|
||||
{file = "etpgrf-0.1.4-py3-none-any.whl", hash = "sha256:62d4371e1b5fab06b99f79bd351767aed8baf7d041cae7e5d4eb63f7c9545114"},
|
||||
{file = "etpgrf-0.1.4.tar.gz", hash = "sha256:c699382c292e3110915331dd5539e7dde0c961e4f4ca65cf8db0e01e84dab72f"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -572,4 +572,4 @@ files = [
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.13"
|
||||
content-hash = "fad76f5756ffa133d1778a1976fd5216450ebf83881fcfacee259b7c41102317"
|
||||
content-hash = "9610a92fa47d1bd0849512ae842b0fdd68dc06d9917ab676cf5d8f6521700837"
|
||||
|
||||
@@ -205,6 +205,17 @@ footer.footer a:hover {
|
||||
--bs-btn-hover-border-color: var(--bs-link-hover-color);
|
||||
--bs-btn-active-bg: 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;
|
||||
}
|
||||
|
||||
/* В темной теме текст на кнопке должен быть темным */
|
||||
|
||||
@@ -23,6 +23,34 @@ const btnCopy = document.getElementById('btn-copy');
|
||||
const sourceTextarea = document.querySelector('textarea[name="text"]');
|
||||
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();
|
||||
function getTheme() {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? oneDark : [];
|
||||
|
||||
@@ -11,7 +11,7 @@ python = "^3.13"
|
||||
django = "^6.0"
|
||||
gunicorn = "^23.0.0"
|
||||
python-dotenv = "^1.2.1"
|
||||
etpgrf = "^0.1.3"
|
||||
etpgrf = "0.1.4"
|
||||
# lxml = "^5.1" # etpgrf подтянет как зависимость
|
||||
# regex = "^2023.12" # etpgrf подтянет как зависимость
|
||||
# beautifulsoup4 = "^4.10.0" # etpgrf подтянет как зависимость
|
||||
|
||||
Reference in New Issue
Block a user