Ensure plaintext is always first

This commit is contained in:
Mikko Ahlroth 2023-01-02 21:34:01 +02:00
parent 14501a6d09
commit 56bc0a8b08
2 changed files with 6 additions and 1 deletions

View file

@ -36,7 +36,7 @@
<div id="length">Waiting...</div>
<div id="info">
v2.2.0 | © Nicd 2022 | <a href="https://gitlab.com/Nicd/t" target="_blank">Source</a> | <a href="./licenses.txt"
v2.2.1 | © Nicd 2023 | <a href="https://gitlab.com/Nicd/t" target="_blank">Source</a> | <a href="./licenses.txt"
target="_blank">Licenses</a>
</div>
</footer>

View file

@ -74,6 +74,11 @@ function getLanguageClassName(language) {
function renderLanguageOptions() {
const languages = [...LANGUAGE_NAMES];
languages.sort();
// Plain text must be first
languages.splice(languages.indexOf(PLAINTEXT), 1);
languages.unshift(PLAINTEXT);
for (const language of languages) {
const option = document.createElement("option");
option.value = language;