Add some color to gravity output

Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
yubiuser
2025-06-24 13:53:46 +02:00
parent 980a589e6e
commit 4e5d4cfa8d

View File

@@ -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("[✓]", '[<span class="log-green">✓</span>]');
line = line.replaceAll("[✗]", '[<span class="log-red">✗</span>]');
// Append the new text to the end of the output
ta.append(line);
}