mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Fixed a problem with the costum document text display
This commit is contained in:
@@ -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", "");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user