From 54907db896449183e9083f2a685a7ae5c8bfa32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Mon, 1 Dec 2025 08:27:59 +0300 Subject: [PATCH] make quote button allow preview without needing to edit --- data/static/js/bitties/pyrom-bitty.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/data/static/js/bitties/pyrom-bitty.js b/data/static/js/bitties/pyrom-bitty.js index b2c54f0..099f98b 100644 --- a/data/static/js/bitties/pyrom-bitty.js +++ b/data/static/js/bitties/pyrom-bitty.js @@ -141,7 +141,7 @@ export default class { } } - #previousMarkup = ''; + #previousMarkup = null; async babycodePreview(ev, el) { if (ev.sender.classList.contains('active')) { return; @@ -151,11 +151,17 @@ export default class { const previewContainer = el.querySelector('#babycode-preview-container'); const ta = document.getElementById('babycode-content'); const markup = ta.value.trim(); - if (markup === '' || markup === this.#previousMarkup) { + if (markup === '') { previewErrorsContainer.textContent = 'Type something!'; previewContainer.textContent = ''; + this.#previousMarkup = ''; return; } + + if (markup === this.#previousMarkup) { + return; + } + const bannedTags = JSON.parse(document.getElementById('babycode-banned-tags').value); this.#previousMarkup = markup;