From 4e5d4cfa8d38f688160fb3e8e89af40b67c3e965 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Tue, 24 Jun 2025 13:53:46 +0200 Subject: [PATCH] Add some color to gravity output Signed-off-by: yubiuser --- scripts/js/gravity.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/js/gravity.js b/scripts/js/gravity.js index 893763e8..36ee39a8 100644 --- a/scripts/js/gravity.js +++ b/scripts/js/gravity.js @@ -82,9 +82,13 @@ function parseLines(ta, str) { line = line.replaceAll("\r", "\n").replaceAll("\r", "\n"); // Last line from the textarea will be overwritten, so we remove it - ta.text(ta.text().substring(0, ta.text().lastIndexOf("\n"))); + ta.html(ta.html().substring(0, ta.html().lastIndexOf("\n"))); } + // Add some color to the text + line = line.replaceAll("[✓]", '[]'); + line = line.replaceAll("[✗]", '[]'); + // Append the new text to the end of the output ta.append(line); }