Fixed a problem with the costum document text display

This commit is contained in:
2026-01-19 18:31:06 +01:00
parent 49e2724ad3
commit dacfa2094c
3 changed files with 8 additions and 3 deletions
+1 -2
View File
@@ -315,7 +315,6 @@ generateBtn.addEventListener("click", () => {
const content = document.getElementById("prompt").value.trim(); const content = document.getElementById("prompt").value.trim();
if (!name || !content) { if (!name || !content) {
result.textContent = "Bitte Dokumentname und Prompt ausfüllen."; result.textContent = "Bitte Dokumentname und Prompt ausfüllen.";
console.log(name + " " + content);
setTimeout(() => { setTimeout(() => {
result.textContent = ""; result.textContent = "";
}, 3000); }, 3000);
@@ -375,7 +374,6 @@ window.api.getTxtFiles().then(files => {
existingDocs.addEventListener("change", async () => { existingDocs.addEventListener("change", async () => {
const existingDocsed = existingDocs.value; const existingDocsed = existingDocs.value;
const exampleText = ""; const exampleText = "";
if (existingDocsed === "newDoc") { if (existingDocsed === "newDoc") {
docNameWrapper.classList.remove("hidden"); docNameWrapper.classList.remove("hidden");
docName.value = ""; docName.value = "";
@@ -386,6 +384,7 @@ existingDocs.addEventListener("change", async () => {
const content = await window.api.readTxtFile(existingDocsed); const content = await window.api.readTxtFile(existingDocsed);
prompt.value = content; prompt.value = content;
document.getElementById("prompt").textContent = content;
docName.value = existingDocsed.replace(".txt", ""); docName.value = existingDocsed.replace(".txt", "");
}); });
+7 -1
View File
@@ -508,7 +508,13 @@ function reloadDocuments() {
.replace(/_/g, ' ') // Leerzeichen ersetzen .replace(/_/g, ' ') // Leerzeichen ersetzen
.replace(/\b\w/g, c => c.toUpperCase()) // ersten Buchstaben groß .replace(/\b\w/g, c => c.toUpperCase()) // ersten Buchstaben groß
existingDocs.appendChild(option); existingDocs.appendChild(option);
customDocumentTypes.appendChild(option); const option2 = document.createElement('option');
option.value = file;
option.textContent = file
.replace('.txt', '') // Endung entfernen
.replace(/_/g, ' ') // Leerzeichen ersetzen
.replace(/\b\w/g, c => c.toUpperCase()) // ersten Buchstaben groß
customDocumentTypes.appendChild(option2);
}); });
}); });
} }
View File