Spaces:
Sleeping
Sleeping
Update templates/gui.html
Browse files- templates/gui.html +19 -19
templates/gui.html
CHANGED
|
@@ -14,33 +14,31 @@
|
|
| 14 |
///////////////////////////////////////////////BEGIN JS CODE//////////////////////////////////////////////////
|
| 15 |
// Function to send the Dropbox link and keyword to the server
|
| 16 |
function getURLParams() {
|
| 17 |
-
// Get URL parameters
|
| 18 |
const params = new URLSearchParams(window.location.search);
|
| 19 |
-
const pdfLink = params.get("pdfLink");
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
console.log("Decoded Dropbox Link:", decodedLink);
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
return {
|
| 28 |
-
pdfLink: decodedLink
|
| 29 |
-
};
|
| 30 |
-
}
|
| 31 |
|
|
|
|
|
|
|
| 32 |
|
|
|
|
|
|
|
|
|
|
| 33 |
function processPdf() {
|
| 34 |
-
const
|
| 35 |
|
| 36 |
-
if (
|
| 37 |
-
|
| 38 |
-
|
| 39 |
}
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
keyword='
|
|
|
|
|
|
|
| 44 |
// Create a new FormData object to send the data as form data
|
| 45 |
const formData = new FormData();
|
| 46 |
formData.append('pdfLink', pdfLink);
|
|
@@ -64,6 +62,8 @@ function processPdf() {
|
|
| 64 |
});
|
| 65 |
}
|
| 66 |
|
|
|
|
|
|
|
| 67 |
// Call the function to process the PDF
|
| 68 |
processPdf();
|
| 69 |
</script>
|
|
|
|
| 14 |
///////////////////////////////////////////////BEGIN JS CODE//////////////////////////////////////////////////
|
| 15 |
// Function to send the Dropbox link and keyword to the server
|
| 16 |
function getURLParams() {
|
|
|
|
| 17 |
const params = new URLSearchParams(window.location.search);
|
|
|
|
| 18 |
|
| 19 |
+
// Decode values
|
| 20 |
+
const pdfLink = params.get("pdfLink") ? decodeURIComponent(params.get("pdfLink")) : null;
|
| 21 |
+
const keyword = params.get("keyword") ? decodeURIComponent(params.get("keyword")) : null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
console.log("Decoded Dropbox Link:", pdfLink);
|
| 24 |
+
console.log("Decoded Keyword:", keyword);
|
| 25 |
|
| 26 |
+
return { pdfLink, keyword };
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
function processPdf() {
|
| 30 |
+
const { pdfLink, keyword } = getURLParams();
|
| 31 |
|
| 32 |
+
if (pdfLink ) {
|
| 33 |
+
console.log("Extracted PDF Link:", pdfLink);
|
| 34 |
+
console.log("Extracted Keyword:", keyword);
|
| 35 |
}
|
| 36 |
|
| 37 |
+
else{
|
| 38 |
+
const pdfLink = 'https://www.dropbox.com/scl/fi/hnp4mqigb51a5kp89kgfa/00801-ARC-20-ZZ-S-A-0002.pdf?rlkey=45abeoebzqw4qwnslnei6dkd6&st=m4yrcjm2&dl=1'; // Dropbox link
|
| 39 |
+
const keyword = ['115 INTEGRATED MRI ROOM LININGS'] ; // Example keyword
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
// Create a new FormData object to send the data as form data
|
| 43 |
const formData = new FormData();
|
| 44 |
formData.append('pdfLink', pdfLink);
|
|
|
|
| 62 |
});
|
| 63 |
}
|
| 64 |
|
| 65 |
+
|
| 66 |
+
|
| 67 |
// Call the function to process the PDF
|
| 68 |
processPdf();
|
| 69 |
</script>
|