mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Fixed and expanded the change language function. fixed custome document creation visibility
This commit is contained in:
@@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
<!-- Here starts code from step 1-->
|
<!-- Here starts code from step 1-->
|
||||||
<div class="step" id="step1">
|
<div class="step" id="step1">
|
||||||
<h2 class="h2">Upload your video here:</h2>
|
<h2 class="h2" id="step1_h2">Upload your video here:</h2>
|
||||||
<div class="upload-container" id="uploadContainer">
|
<div class="upload-container" id="uploadContainer">
|
||||||
<p id="p1">Drag and drop video file</p>
|
<p id="p1">Drag and drop video file</p>
|
||||||
<video id="previewThumbnail" autoplay="false"></video>
|
<video id="previewThumbnail" autoplay="false"></video>
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
|
|
||||||
<!-- Here starts code from step 2-->
|
<!-- Here starts code from step 2-->
|
||||||
<div class="step" id="step2" style="display: none">
|
<div class="step" id="step2" style="display: none">
|
||||||
<h2 class="h2">Choose your preferences:</h2>
|
<h2 class="h2" id="step2_h2">Choose your preferences:</h2>
|
||||||
<div class="step2-form">
|
<div class="step2-form">
|
||||||
<div class="KI-wrapper">
|
<div class="KI-wrapper">
|
||||||
<label id="labelKI">Select ki:</label>
|
<label id="labelKI">Select ki:</label>
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
<!-- Hover Effekt für Dokumentenvorschau, Fragezeichen hinter Text, drüber hoven zeigt Beispieldokument -->
|
<!-- Hover Effekt für Dokumentenvorschau, Fragezeichen hinter Text, drüber hoven zeigt Beispieldokument -->
|
||||||
<div class="step" id="step3" style="display: none">
|
<div class="step" id="step3" style="display: none">
|
||||||
<div class="checkbox-group">
|
<div class="checkbox-group">
|
||||||
<h2 class="h2">Choose prefered document style:</h2>
|
<h2 class="h2" id="step3_h2">Choose prefered document style:</h2>
|
||||||
<div class="checkbox-container">
|
<div class="checkbox-container">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -241,7 +241,7 @@
|
|||||||
|
|
||||||
<!-- Here starts code from step 4-->
|
<!-- Here starts code from step 4-->
|
||||||
<div class="step" id="step4" style="display: none">
|
<div class="step" id="step4" style="display: none">
|
||||||
<h2 class="h2">Click to submit:</h2>
|
<h2 class="h2" id="step4_h2">Click to submit:</h2>
|
||||||
<button
|
<button
|
||||||
class="submit-btn"
|
class="submit-btn"
|
||||||
id="submitButton"
|
id="submitButton"
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
|
|
||||||
<!-- Here starts code from step 5-->
|
<!-- Here starts code from step 5-->
|
||||||
<div class="step" id="step5" style="display: none">
|
<div class="step" id="step5" style="display: none">
|
||||||
<h2 class="h2">Change names of the speakers:</h2>
|
<h2 class="h2" id="step5_h2">Change names of the speakers:</h2>
|
||||||
|
|
||||||
<div class="speaker-container">
|
<div class="speaker-container">
|
||||||
<table class="speaker-table">
|
<table class="speaker-table">
|
||||||
@@ -319,7 +319,7 @@
|
|||||||
|
|
||||||
<!-- Here starts code from step 6-->
|
<!-- Here starts code from step 6-->
|
||||||
<div class="step" id="step6" style="display: none">
|
<div class="step" id="step6" style="display: none">
|
||||||
<h2 class="h2">Click to download your document:</h2>
|
<h2 class="h2" id="step6_h2">Click to download your document:</h2>
|
||||||
<button
|
<button
|
||||||
class="download-btn"
|
class="download-btn"
|
||||||
id="downloadButton"
|
id="downloadButton"
|
||||||
|
|||||||
@@ -41,7 +41,14 @@ var languageOptions = {
|
|||||||
"goBackBtn": "Return",
|
"goBackBtn": "Return",
|
||||||
"deleteBtn": "Delete document",
|
"deleteBtn": "Delete document",
|
||||||
"generateBtn": "Save document",
|
"generateBtn": "Save document",
|
||||||
"newDoc": "-- Create new document --"
|
"newDoc": "-- Create new document --",
|
||||||
|
|
||||||
|
"step1_h2" : "Upload your video here:",
|
||||||
|
"step2_h2" : "Choose your preferences:",
|
||||||
|
"step3_h2" : "Choose prefered document style:",
|
||||||
|
"step4_h2" : "Click to submit:",
|
||||||
|
"step5_h2" : "Change names of the speakers:",
|
||||||
|
"step6_h2" : "Click to download your document:"
|
||||||
|
|
||||||
},
|
},
|
||||||
"de":{
|
"de":{
|
||||||
@@ -86,7 +93,14 @@ var languageOptions = {
|
|||||||
"goBackBtn": "Zurück",
|
"goBackBtn": "Zurück",
|
||||||
"deleteBtn": "Lösche Dokument",
|
"deleteBtn": "Lösche Dokument",
|
||||||
"generateBtn": "Speichere Dokument",
|
"generateBtn": "Speichere Dokument",
|
||||||
"newDoc": "-- Neues Dokument erstellen --"
|
"newDoc": "-- Neues Dokument erstellen --",
|
||||||
|
|
||||||
|
"step1_h2" : "Laden Sie Ihr Video hier hoch:",
|
||||||
|
"step2_h2" : "Wählen Sie Ihre Präferenzen:",
|
||||||
|
"step3_h2" : "Wählen Sie den gewünschten Dokumentstil:",
|
||||||
|
"step4_h2" : "Zum Absenden klicken:",
|
||||||
|
"step5_h2" : "Ändern Sie die Namen der Sprecher:",
|
||||||
|
"step6_h2" : "Klicken Sie hier, um Ihr Dokument herunterzuladen:"
|
||||||
},
|
},
|
||||||
"in":{
|
"in":{
|
||||||
"flagPath": "flags/india-flag-png-large.png",
|
"flagPath": "flags/india-flag-png-large.png",
|
||||||
@@ -130,7 +144,14 @@ var languageOptions = {
|
|||||||
"goBackBtn": "वापस जाएं",
|
"goBackBtn": "वापस जाएं",
|
||||||
"deleteBtn": "दस्तावेज़ हटाएं",
|
"deleteBtn": "दस्तावेज़ हटाएं",
|
||||||
"generateBtn": "दस्तावेज़ सहेजें",
|
"generateBtn": "दस्तावेज़ सहेजें",
|
||||||
"newDoc": "-- नया दस्तावेज़ बनाएं --"
|
"newDoc": "-- नया दस्तावेज़ बनाएं --",
|
||||||
|
|
||||||
|
"step1_h2" : "अपना वीडियो यहां अपलोड करें:",
|
||||||
|
"step2_h2" : "अपनी प्राथमिकताएँ चुनें:",
|
||||||
|
"step3_h2" : "पसंदीदा दस्तावेज़ शैली चुनें:",
|
||||||
|
"step4_h2" : "सबमिट करने के लिए क्लिक करें:",
|
||||||
|
"step5_h2" : "वक्ताओं के नाम बदलें:",
|
||||||
|
"step6_h2" : "अपना दस्तावेज़ डाउनलोड करने के लिए यहां क्लिक करें:"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-3
@@ -27,12 +27,11 @@ function showCD() {
|
|||||||
//language changing feature => changes the language of every displayed text
|
//language changing feature => changes the language of every displayed text
|
||||||
function changeLanguage(language) {
|
function changeLanguage(language) {
|
||||||
try {
|
try {
|
||||||
//document.getElementById('labelLanguageFlag').src = languageOptions[language].flagPath;
|
|
||||||
document.getElementById('labelKI').textContent = languageOptions[language].labelKI;
|
document.getElementById('labelKI').textContent = languageOptions[language].labelKI;
|
||||||
document.getElementById('labelTranscription').textContent = languageOptions[language].labelTranscription;
|
document.getElementById('labelTranscription').textContent = languageOptions[language].labelTranscription;
|
||||||
document.getElementById('labelLanguage').textContent = languageOptions[language].labelLanguage;
|
document.getElementById('labelLanguage').textContent = languageOptions[language].labelLanguage;
|
||||||
document.getElementById('title').textContent = languageOptions[language].title;
|
document.getElementById('title').textContent = languageOptions[language].title;
|
||||||
//document.getElementById('h1').textContent = languageOptions[language].h1;
|
document.getElementById('h1').textContent = languageOptions[language].h1;
|
||||||
document.getElementById('p1').textContent = languageOptions[language].p1;
|
document.getElementById('p1').textContent = languageOptions[language].p1;
|
||||||
document.getElementById('fileName').textContent = languageOptions[language].fileName;
|
document.getElementById('fileName').textContent = languageOptions[language].fileName;
|
||||||
document.getElementById('manualUploadBtn').textContent = languageOptions[language].manualUploadBtn;
|
document.getElementById('manualUploadBtn').textContent = languageOptions[language].manualUploadBtn;
|
||||||
@@ -45,7 +44,6 @@ function changeLanguage(language) {
|
|||||||
document.getElementById('step_nav4').textContent = languageOptions[language].step_nav4;
|
document.getElementById('step_nav4').textContent = languageOptions[language].step_nav4;
|
||||||
document.getElementById('step_nav5').textContent = languageOptions[language].step_nav5;
|
document.getElementById('step_nav5').textContent = languageOptions[language].step_nav5;
|
||||||
document.getElementById('step_nav6').textContent = languageOptions[language].step_nav6;
|
document.getElementById('step_nav6').textContent = languageOptions[language].step_nav6;
|
||||||
//document.getElementById('h2').textContent = languageOptions[language].h2;
|
|
||||||
document.getElementById('labelSpeaker').textContent = languageOptions[language].labelSpeaker;
|
document.getElementById('labelSpeaker').textContent = languageOptions[language].labelSpeaker;
|
||||||
document.getElementById('labelSpeakerAudio').textContent = languageOptions[language].labelSpeakerAudio;
|
document.getElementById('labelSpeakerAudio').textContent = languageOptions[language].labelSpeakerAudio;
|
||||||
document.getElementById('labelSpeakerWriter').textContent = languageOptions[language].labelSpeakerWriter;
|
document.getElementById('labelSpeakerWriter').textContent = languageOptions[language].labelSpeakerWriter;
|
||||||
@@ -69,6 +67,13 @@ function changeLanguage(language) {
|
|||||||
document.getElementById('generateBtn').textContent = languageOptions[language].generateBtn;
|
document.getElementById('generateBtn').textContent = languageOptions[language].generateBtn;
|
||||||
document.getElementById('newDoc').textContent = languageOptions[language].newDoc;
|
document.getElementById('newDoc').textContent = languageOptions[language].newDoc;
|
||||||
|
|
||||||
|
document.getElementById("step1_h2").textContent = languageOptions[language].step1_h2;
|
||||||
|
document.getElementById("step2_h2").textContent = languageOptions[language].step2_h2;
|
||||||
|
document.getElementById("step3_h2").textContent = languageOptions[language].step3_h2;
|
||||||
|
document.getElementById("step4_h2").textContent = languageOptions[language].step4_h2;
|
||||||
|
document.getElementById("step5_h2").textContent = languageOptions[language].step5_h2;
|
||||||
|
document.getElementById("step6_h2").textContent = languageOptions[language].step6_h2;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in script.js changeLanguage function");
|
console.log("Error in script.js changeLanguage function");
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -89,6 +94,10 @@ let currentStep = 1;
|
|||||||
const totalSteps = steps.length;
|
const totalSteps = steps.length;
|
||||||
|
|
||||||
function showStep(stepNumber) {
|
function showStep(stepNumber) {
|
||||||
|
if(showCDValue == 1){
|
||||||
|
showCDValue = 0;
|
||||||
|
document.getElementById('cdContainer').style.display = "none";
|
||||||
|
}
|
||||||
if (stepNumber < 1 || stepNumber > totalSteps) {
|
if (stepNumber < 1 || stepNumber > totalSteps) {
|
||||||
console.error("StepNumber out of Bounds", stepNumber);
|
console.error("StepNumber out of Bounds", stepNumber);
|
||||||
return;
|
return;
|
||||||
@@ -487,6 +496,8 @@ Functions for the custom document section
|
|||||||
function reloadDocuments() {
|
function reloadDocuments() {
|
||||||
[...existingDocs.querySelectorAll('option:not([value="newDoc"])')]
|
[...existingDocs.querySelectorAll('option:not([value="newDoc"])')]
|
||||||
.forEach(o => o.remove());
|
.forEach(o => o.remove());
|
||||||
|
[...customDocumentTypes.querySelectorAll('option:not([value="newDoc"])')]
|
||||||
|
.forEach(o => o.remove());
|
||||||
|
|
||||||
window.api.getTxtFiles().then(files => {
|
window.api.getTxtFiles().then(files => {
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
@@ -497,6 +508,7 @@ 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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user