Spaces:
Running
Running
final
Browse files- static/script.js +15 -15
static/script.js
CHANGED
@@ -681,7 +681,7 @@ askBtn.addEventListener('click', async () => {
|
|
681 |
|
682 |
}
|
683 |
|
684 |
-
|
685 |
//quand on clique sur visualisation ----------------------
|
686 |
function loadVisualisationPage() {
|
687 |
// 1. Configuration de l'arrière-plan
|
@@ -698,28 +698,28 @@ askBtn.addEventListener('click', async () => {
|
|
698 |
</div>
|
699 |
|
700 |
<div class="menu-section">
|
701 |
-
<button class="menu-btn" id="resumerButton">
|
702 |
<button class="menu-btn" id="traductionbutton">TRANSLATE</button>
|
703 |
-
<button class="menu-btn" id="qesdocButton">
|
704 |
</div>
|
705 |
|
706 |
<div class="menu-section">
|
707 |
<div class="menu-title">IMAGES</div>
|
708 |
-
<button class="menu-btn" id="interpretationButton">
|
709 |
-
<button class="menu-btn" id="qesimgButton">QUESTIONS</button>
|
710 |
</div>
|
711 |
</div>
|
712 |
|
713 |
<div class="main-content-area">
|
714 |
<div class="document-container">
|
715 |
-
<h1 class="document-main-title">
|
716 |
-
<h2 class="document-subtitle">
|
717 |
|
718 |
<div class="upload-container">
|
719 |
<div class="file-drop-zone" id="fileDropZone">
|
720 |
<label for="graphFileInput" class="file-upload-label">
|
721 |
<img src="up.png" id="uploadIcon" class="upload-icon" alt="Upload">
|
722 |
-
<span class="drop-text" id="dropText">
|
723 |
</label>
|
724 |
<input type="file" id="graphFileInput" class="file-input"
|
725 |
accept=".doc,.docx,.xls,.xlsx,.pdf,.ppt,.pptx" hidden>
|
@@ -741,10 +741,10 @@ askBtn.addEventListener('click', async () => {
|
|
741 |
<div class="graph-results-container">
|
742 |
<div class="graph-results-placeholder">
|
743 |
<img id="graphResultImage" class="graph-result-img">
|
744 |
-
<p class="placeholder-text" id="graphPlaceholderText">
|
745 |
</div>
|
746 |
<div id="downloadSection" style="display: none; margin-top: 20px; text-align: center;">
|
747 |
-
<h3 style="color: white; margin-bottom: 10px;">
|
748 |
<div style="display: flex; justify-content: center; gap: 10px;">
|
749 |
<button id="downloadPng" class="download-btn">PNG</button>
|
750 |
<button id="downloadJpg" class="download-btn">JPG</button>
|
@@ -790,7 +790,7 @@ askBtn.addEventListener('click', async () => {
|
|
790 |
// Réinitialiser l'affichage quand un nouveau fichier est sélectionné
|
791 |
document.getElementById("downloadSection").style.display = "none";
|
792 |
document.getElementById("graphResultImage").style.display = "none";
|
793 |
-
document.getElementById("graphPlaceholderText").textContent = "
|
794 |
}
|
795 |
});
|
796 |
|
@@ -812,13 +812,13 @@ askBtn.addEventListener('click', async () => {
|
|
812 |
|
813 |
// Validation
|
814 |
if (!fileInput.files[0]) {
|
815 |
-
placeholderText.textContent = "
|
816 |
downloadSection.style.display = "none";
|
817 |
return;
|
818 |
}
|
819 |
|
820 |
if (!graphTypeSelect.value) {
|
821 |
-
placeholderText.textContent = "
|
822 |
downloadSection.style.display = "none";
|
823 |
return;
|
824 |
}
|
@@ -826,7 +826,7 @@ askBtn.addEventListener('click', async () => {
|
|
826 |
// Préparation de l'interface
|
827 |
resultImage.style.display = "none";
|
828 |
downloadSection.style.display = "none";
|
829 |
-
placeholderText.textContent = "
|
830 |
|
831 |
try {
|
832 |
// Envoi des données
|
@@ -874,7 +874,7 @@ resultImage.style.display = "block";
|
|
874 |
const downloadGraph = (format) => {
|
875 |
const resultImage = document.getElementById('graphResultImage');
|
876 |
if (!resultImage.src || resultImage.style.display === "none") {
|
877 |
-
alert("
|
878 |
return;
|
879 |
}
|
880 |
|
|
|
681 |
|
682 |
}
|
683 |
|
684 |
+
|
685 |
//quand on clique sur visualisation ----------------------
|
686 |
function loadVisualisationPage() {
|
687 |
// 1. Configuration de l'arrière-plan
|
|
|
698 |
</div>
|
699 |
|
700 |
<div class="menu-section">
|
701 |
+
<button class="menu-btn" id="resumerButton">SUMMARIZE</button>
|
702 |
<button class="menu-btn" id="traductionbutton">TRANSLATE</button>
|
703 |
+
<button class="menu-btn" id="qesdocButton">DOC-QUESTIONS</button>
|
704 |
</div>
|
705 |
|
706 |
<div class="menu-section">
|
707 |
<div class="menu-title">IMAGES</div>
|
708 |
+
<button class="menu-btn" id="interpretationButton">INTERPRETATION</button>
|
709 |
+
<button class="menu-btn" id="qesimgButton">IMAGES-QUESTIONS</button>
|
710 |
</div>
|
711 |
</div>
|
712 |
|
713 |
<div class="main-content-area">
|
714 |
<div class="document-container">
|
715 |
+
<h1 class="document-main-title">Documents Operations</h1>
|
716 |
+
<h2 class="document-subtitle">VISUALIZATION 📊</h2>
|
717 |
|
718 |
<div class="upload-container">
|
719 |
<div class="file-drop-zone" id="fileDropZone">
|
720 |
<label for="graphFileInput" class="file-upload-label">
|
721 |
<img src="up.png" id="uploadIcon" class="upload-icon" alt="Upload">
|
722 |
+
<span class="drop-text" id="dropText">Drop your file here or click to browse</span>
|
723 |
</label>
|
724 |
<input type="file" id="graphFileInput" class="file-input"
|
725 |
accept=".doc,.docx,.xls,.xlsx,.pdf,.ppt,.pptx" hidden>
|
|
|
741 |
<div class="graph-results-container">
|
742 |
<div class="graph-results-placeholder">
|
743 |
<img id="graphResultImage" class="graph-result-img">
|
744 |
+
<p class="placeholder-text" id="graphPlaceholderText">The result will appear here...</p>
|
745 |
</div>
|
746 |
<div id="downloadSection" style="display: none; margin-top: 20px; text-align: center;">
|
747 |
+
<h3 style="color: white; margin-bottom: 10px;">Download the graph</h3>
|
748 |
<div style="display: flex; justify-content: center; gap: 10px;">
|
749 |
<button id="downloadPng" class="download-btn">PNG</button>
|
750 |
<button id="downloadJpg" class="download-btn">JPG</button>
|
|
|
790 |
// Réinitialiser l'affichage quand un nouveau fichier est sélectionné
|
791 |
document.getElementById("downloadSection").style.display = "none";
|
792 |
document.getElementById("graphResultImage").style.display = "none";
|
793 |
+
document.getElementById("graphPlaceholderText").textContent = "Ready to generate the chart";
|
794 |
}
|
795 |
});
|
796 |
|
|
|
812 |
|
813 |
// Validation
|
814 |
if (!fileInput.files[0]) {
|
815 |
+
placeholderText.textContent = "⚠️No file selected";
|
816 |
downloadSection.style.display = "none";
|
817 |
return;
|
818 |
}
|
819 |
|
820 |
if (!graphTypeSelect.value) {
|
821 |
+
placeholderText.textContent = "⚠️No a chart type selected";
|
822 |
downloadSection.style.display = "none";
|
823 |
return;
|
824 |
}
|
|
|
826 |
// Préparation de l'interface
|
827 |
resultImage.style.display = "none";
|
828 |
downloadSection.style.display = "none";
|
829 |
+
placeholderText.textContent = "⏳ Graph generation in progress...";
|
830 |
|
831 |
try {
|
832 |
// Envoi des données
|
|
|
874 |
const downloadGraph = (format) => {
|
875 |
const resultImage = document.getElementById('graphResultImage');
|
876 |
if (!resultImage.src || resultImage.style.display === "none") {
|
877 |
+
alert("Please generate a shart first");
|
878 |
return;
|
879 |
}
|
880 |
|