|
10 | 10 | Modestly updated by https://github.com/toutjavascript |
11 | 11 | https://www.toutjavascript.com |
12 | 12 |
|
13 | | -File Version 2024-01-12/A1 |
| 13 | +File Version 2024-01-18/A1 |
14 | 14 | --> |
15 | 15 |
|
16 | 16 | <html lang="us"> |
|
44 | 44 | {item: "displayMetaBlock", type:"checkbox", label:"View Meta Detail on Zoomed Image", value: true}, |
45 | 45 | {item: "nbColumns", type:"integer", label:"Number of columns in the grid", value: 3}, |
46 | 46 | {item: "nbImagePerPage", type:"integer", label:"Number of images displayed per page", value: 32}, |
47 | | - |
48 | | - |
49 | | - |
50 | 47 | ]; |
| 48 | + var workingDates=[], detailDates=[]; |
| 49 | + var nbImageNotFoundByBatches=[]; /* Number of images not found by batch (deleted by user) : use to display on each batch block */ |
51 | 50 |
|
52 | 51 |
|
53 | 52 |
|
|
112 | 111 | }); |
113 | 112 | } |
114 | 113 |
|
115 | | - /* Create an empty image */ |
116 | | - function getNotFoundImg() { |
| 114 | + /* Create an empty image |
| 115 | + Update batch label error |
| 116 | + */ |
| 117 | + function getNotFoundImg(batchNumber) { |
| 118 | + if (typeof nbImageNotFoundByBatches[batchNumber]=="undefined") { |
| 119 | + nbImageNotFoundByBatches[batchNumber]=0; |
| 120 | + } |
| 121 | + nbImageNotFoundByBatches[batchNumber]++; |
| 122 | + |
| 123 | + $("span#batchNumber-"+batchNumber).html(" / "+nbImageNotFoundByBatches[batchNumber]+" not found").attr("title", "Probably deleted by user"); |
| 124 | + |
| 125 | + /* Generate image not found */ |
117 | 126 | let svgElement = document.createElementNS("http://www.w3.org/2000/svg", 'svg'); // Create a new SVG element |
118 | 127 | svgElement.setAttribute('width', '500'); // Set the width and height of the SVG canvas |
119 | 128 | svgElement.setAttribute('height', '500'); |
|
170 | 179 | return autoReload; |
171 | 180 | }); |
172 | 181 | React.useEffect(() => { |
173 | | - console.log("autorelod=") |
174 | | - console.log(autoReload) |
175 | 182 | localStorage.setItem("autoReload", autoReload.toString()); |
176 | 183 | }, [autoReload]); |
177 | 184 |
|
|
270 | 277 | React.useEffect(fetchData, [date]); |
271 | 278 |
|
272 | 279 | React.useEffect(() => { |
273 | | - setPlaySound(getParam("playSound")=="true"?true:false); |
274 | 280 |
|
275 | 281 | if (autoReload) { |
276 | 282 | const interval = setInterval(() => { |
|
512 | 518 | const batchData = getBatchData(sortedData); |
513 | 519 |
|
514 | 520 | React.useEffect(() => { |
| 521 | + nbImageNotFoundByBatches=[]; |
515 | 522 |
|
516 | 523 | setShowDetail(getParam("displayDetails")=="true"?true:false); |
517 | 524 | setShowDiff(getParam("displayDiff")=="true"?true:false); |
|
676 | 683 | <p className="flex justify-between"> |
677 | 684 | <span className="text-base mb-0"> |
678 | 685 | <strong>Batch {batch.batchNumber}</strong> ({numBatchImages}{" "} |
679 | | - Images) |
| 686 | + Images<span id={"batchNumber-"+batch.batchNumber} class="batchError"></span>) |
680 | 687 | </span> |
681 | 688 | <span>{batch.timeStr}</span> |
682 | 689 | </p> |
|
753 | 760 | data-name={data.src} |
754 | 761 | data-json={JSON.stringify(data)} |
755 | 762 | data-error="false" |
| 763 | + data-batch={batch.batchNumber} |
756 | 764 | onError={ (evt => { |
757 | | - console.log("error on "+evt.target.src); |
758 | 765 | evt.target.dataset.error="true"; |
759 | | - evt.target.src=getNotFoundImg(); |
| 766 | + evt.target.src=getNotFoundImg(evt.target.dataset.batch); |
| 767 | + $(evt.target).parent().hide(); |
760 | 768 | }) } |
761 | 769 | width="100%" |
762 | 770 | /> |
|
1437 | 1445 | i.addEventListener("load", function() { |
1438 | 1446 | image.setAttribute("data-width", i.width) |
1439 | 1447 | image.setAttribute("data-height", i.height) |
1440 | | - $(image).addClass("cursor-zoom-in"); |
1441 | | - if (typeof image.dataset.onclick == "undefined") { |
| 1448 | + if ((typeof image.dataset.onclick == "undefined")&&(image.dataset.error=="false")) { |
1442 | 1449 | /* Add only one eventClickListener, necessary because multiple calls*/ |
| 1450 | + /* Add only if image is not broken */ |
| 1451 | + $(image).addClass("cursor-zoom-in"); |
1443 | 1452 | image.setAttribute("data-onclick", "1"); |
1444 | 1453 | image.addEventListener("click", function(evt) { |
1445 | 1454 | zoomImage(evt.target); |
|
1663 | 1672 |
|
1664 | 1673 |
|
1665 | 1674 | /* Get all outputs directory working dates */ |
1666 | | - var workingDates=[], detailDates=[]; |
1667 | 1675 | function calendarGeneration() { |
1668 | 1676 | console.log("Working date calendar generation"); |
1669 | 1677 | getAllDates(); |
|
2024 | 2032 | } |
2025 | 2033 | } |
2026 | 2034 |
|
| 2035 | + span.batchError { |
| 2036 | + color:#f33; |
| 2037 | + font-weight: bold; |
| 2038 | + } |
| 2039 | + |
2027 | 2040 |
|
2028 | 2041 | .jBox-TooltipDark .jBox-content { |
2029 | 2042 | background-color: #ba00bd !important; |
|
0 commit comments