seeemess 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/templates/admin.eta +4 -54
- package/package.json +1 -1
|
@@ -386,15 +386,16 @@
|
|
|
386
386
|
|
|
387
387
|
<div>
|
|
388
388
|
<label>Content (Markdown)</label>
|
|
389
|
+
<p style="font-size: 0.85rem; color: #666; margin: 0.25rem 0 0.5rem;">[Photo](photo.jpg){.float-left .w-1/3 .mt-4 .mb-4 .mr-4} or [Photo](photo.jpg){.float-right .w-1/3 .mt-4 .mb-4 .ml-4}</p>
|
|
389
390
|
<textarea id="body" required></textarea>
|
|
390
391
|
</div>
|
|
391
392
|
|
|
392
393
|
<div class="image-section" id="inlineImagesSection" style="display: none;">
|
|
393
394
|
<div style="display: flex; justify-content: space-between; align-items: center;">
|
|
394
|
-
<label>
|
|
395
|
+
<label>Images in Content</label>
|
|
395
396
|
<button type="button" class="btn btn-secondary" onclick="syncInlineImages()" style="padding: 0.25rem 0.5rem; font-size: 0.8rem;">Refresh</button>
|
|
396
397
|
</div>
|
|
397
|
-
<p style="font-size: 0.85rem; color: #666; margin: 0.25rem 0 0.5rem;">
|
|
398
|
+
<p style="font-size: 0.85rem; color: #666; margin: 0.25rem 0 0.5rem;">Images found in your markdown content (manage captions/credits in gallery)</p>
|
|
398
399
|
<div id="inlineImagesList" class="gallery-thumbnails"></div>
|
|
399
400
|
</div>
|
|
400
401
|
|
|
@@ -495,7 +496,6 @@
|
|
|
495
496
|
let modalResolve = null;
|
|
496
497
|
let formDirty = false;
|
|
497
498
|
let editingGalleryIndex = null;
|
|
498
|
-
let editingImageIndex = null;
|
|
499
499
|
let currentSection = 'news';
|
|
500
500
|
let pendingChanges = false;
|
|
501
501
|
|
|
@@ -1430,60 +1430,17 @@
|
|
|
1430
1430
|
container.innerHTML = '';
|
|
1431
1431
|
|
|
1432
1432
|
images.forEach((item, idx) => {
|
|
1433
|
-
const hasMetadata = item.caption || item.credit;
|
|
1434
1433
|
const thumb = document.createElement('div');
|
|
1435
|
-
thumb.className = 'gallery-thumb'
|
|
1434
|
+
thumb.className = 'gallery-thumb';
|
|
1436
1435
|
|
|
1437
1436
|
thumb.innerHTML =
|
|
1438
1437
|
'<img src="' + imageUrlPath + '/' + item.src.replace(/(\.[^.]+)$/, '-thumb$1') + '" alt="" onerror="this.onerror=null; this.src=\'' + imageUrlPath + '/' + item.src + '\'">' +
|
|
1439
|
-
'<div class="gallery-thumb-actions">' +
|
|
1440
|
-
'<button type="button" class="gallery-thumb-btn edit" onclick="openInlineImageEditModal(' + idx + ')" title="Edit caption/credit">✎</button>' +
|
|
1441
|
-
'</div>' +
|
|
1442
1438
|
'<div class="gallery-thumb-name">' + item.src + '</div>';
|
|
1443
1439
|
|
|
1444
1440
|
container.appendChild(thumb);
|
|
1445
1441
|
});
|
|
1446
1442
|
}
|
|
1447
1443
|
|
|
1448
|
-
function openInlineImageEditModal(idx) {
|
|
1449
|
-
editingImageIndex = idx;
|
|
1450
|
-
const item = images[idx];
|
|
1451
|
-
|
|
1452
|
-
document.getElementById('galleryCaption').value = item.caption || '';
|
|
1453
|
-
document.getElementById('galleryCredit').value = item.credit || '';
|
|
1454
|
-
document.getElementById('captionCount').textContent = (item.caption || '').length;
|
|
1455
|
-
document.getElementById('creditCount').textContent = (item.credit || '').length;
|
|
1456
|
-
|
|
1457
|
-
// Update modal title to indicate inline image
|
|
1458
|
-
document.querySelector('#galleryEditModal .modal-title').textContent = 'Edit Inline Image Details';
|
|
1459
|
-
document.getElementById('galleryEditModal').classList.add('active');
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
function closeInlineImageEditModal() {
|
|
1463
|
-
document.getElementById('galleryEditModal').classList.remove('active');
|
|
1464
|
-
editingImageIndex = null;
|
|
1465
|
-
// Restore modal title
|
|
1466
|
-
document.querySelector('#galleryEditModal .modal-title').textContent = 'Edit Photo Details';
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
function saveInlineImageEdit() {
|
|
1470
|
-
if (editingImageIndex === null) return;
|
|
1471
|
-
|
|
1472
|
-
const caption = document.getElementById('galleryCaption').value.trim();
|
|
1473
|
-
const credit = document.getElementById('galleryCredit').value.trim();
|
|
1474
|
-
|
|
1475
|
-
images[editingImageIndex] = {
|
|
1476
|
-
src: images[editingImageIndex].src,
|
|
1477
|
-
caption,
|
|
1478
|
-
credit
|
|
1479
|
-
};
|
|
1480
|
-
|
|
1481
|
-
closeInlineImageEditModal();
|
|
1482
|
-
renderInlineImages();
|
|
1483
|
-
markFormDirty();
|
|
1484
|
-
showStatus('Image details saved', 'success');
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
1444
|
// Listen for body changes to sync inline images
|
|
1488
1445
|
document.getElementById('body').addEventListener('blur', syncInlineImages);
|
|
1489
1446
|
|
|
@@ -1546,18 +1503,11 @@
|
|
|
1546
1503
|
function closeGalleryEditModal() {
|
|
1547
1504
|
document.getElementById('galleryEditModal').classList.remove('active');
|
|
1548
1505
|
editingGalleryIndex = null;
|
|
1549
|
-
editingImageIndex = null;
|
|
1550
1506
|
// Restore modal title
|
|
1551
1507
|
document.querySelector('#galleryEditModal .modal-title').textContent = 'Edit Photo Details';
|
|
1552
1508
|
}
|
|
1553
1509
|
|
|
1554
1510
|
function saveGalleryEdit() {
|
|
1555
|
-
// Check if editing inline image or gallery image
|
|
1556
|
-
if (editingImageIndex !== null) {
|
|
1557
|
-
saveInlineImageEdit();
|
|
1558
|
-
return;
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
1511
|
if (editingGalleryIndex === null) return;
|
|
1562
1512
|
|
|
1563
1513
|
const caption = document.getElementById('galleryCaption').value.trim();
|