Spaces:
Running
Running
update fn preview image
Browse files
main.js
CHANGED
|
@@ -879,11 +879,17 @@ window.goToEvidence = function () {
|
|
| 879 |
};
|
| 880 |
|
| 881 |
window.previewImage = function (imageRaw) {
|
| 882 |
-
const match =
|
| 883 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 884 |
createTemplateModal(
|
| 885 |
`<img src="data:image/jpeg;base64,${image}" alt="Image Preview" style="max-width: 100%; height: auto;" />`,
|
| 886 |
-
`Image ${
|
| 887 |
);
|
| 888 |
};
|
| 889 |
|
|
|
|
| 879 |
};
|
| 880 |
|
| 881 |
window.previewImage = function (imageRaw) {
|
| 882 |
+
const match = imageRaw.match(/\d+/);
|
| 883 |
+
if (!match) return;
|
| 884 |
+
|
| 885 |
+
const index = Number(match[0]) - 1;
|
| 886 |
+
const image = data.value.readme_content.media[index];
|
| 887 |
+
|
| 888 |
+
if (!image) return;
|
| 889 |
+
|
| 890 |
createTemplateModal(
|
| 891 |
`<img src="data:image/jpeg;base64,${image}" alt="Image Preview" style="max-width: 100%; height: auto;" />`,
|
| 892 |
+
`Image ${index + 1}`
|
| 893 |
);
|
| 894 |
};
|
| 895 |
|