@aiyiran/myclaw 1.0.221 → 1.0.223
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.
|
@@ -285,10 +285,9 @@
|
|
|
285
285
|
row.onclick = function () {
|
|
286
286
|
if (isLatest && !isLatestSeen) localStorage.setItem(latestSeenKey, '1');
|
|
287
287
|
if (isUpdated && !isUpdateSeen) localStorage.setItem(updateSeenKey, '1');
|
|
288
|
+
openPreviewModal(data, asset);
|
|
288
289
|
if (asset.type === 'html') {
|
|
289
290
|
window.open(buildPreviewUrl(data, asset.path), '_blank');
|
|
290
|
-
} else {
|
|
291
|
-
openPreviewModal(data, asset);
|
|
292
291
|
}
|
|
293
292
|
};
|
|
294
293
|
|
|
@@ -416,6 +415,9 @@
|
|
|
416
415
|
function openPublishModal() {
|
|
417
416
|
if (document.querySelector('#myclaw-artifacts-publish-modal')) return;
|
|
418
417
|
if (!cachedData) return;
|
|
418
|
+
console.log('[myclaw-artifacts-publish] cachedData.assets:', cachedData.assets);
|
|
419
|
+
console.log('[myclaw-artifacts-publish] html assets:', cachedData.assets.filter(function (a) { return a.type && a.type.toLowerCase() === 'html'; }));
|
|
420
|
+
console.log('[myclaw-artifacts-publish] image assets:', cachedData.assets.filter(function (a) { return a.type && a.type.toLowerCase() === 'image'; }));
|
|
419
421
|
|
|
420
422
|
var overlay = document.createElement('div');
|
|
421
423
|
overlay.id = 'myclaw-artifacts-publish-modal';
|
|
@@ -505,11 +507,12 @@
|
|
|
505
507
|
coverDefaultOpt.value = '';
|
|
506
508
|
coverDefaultOpt.textContent = '\u4E0D\u9009\u62E9';
|
|
507
509
|
coverSelect.appendChild(coverDefaultOpt);
|
|
508
|
-
var
|
|
510
|
+
var imageTypes = ['png', 'jpg', 'jpeg', 'gif', 'svg', 'webp', 'bmp'];
|
|
511
|
+
var imageAssets = (cachedData.assets || []).filter(function (a) { return a.type && imageTypes.indexOf(a.type.toLowerCase()) !== -1; });
|
|
509
512
|
imageAssets.forEach(function (asset) {
|
|
510
513
|
var opt = document.createElement('option');
|
|
511
514
|
opt.value = asset.path;
|
|
512
|
-
opt.textContent = asset.
|
|
515
|
+
opt.textContent = asset.path;
|
|
513
516
|
coverSelect.appendChild(opt);
|
|
514
517
|
});
|
|
515
518
|
var coverPreview = document.createElement('img');
|
|
@@ -543,11 +546,11 @@
|
|
|
543
546
|
entryDefaultOpt.value = '';
|
|
544
547
|
entryDefaultOpt.textContent = '\u4E0D\u9009\u62E9';
|
|
545
548
|
entrySelect.appendChild(entryDefaultOpt);
|
|
546
|
-
var htmlAssets = (cachedData.assets || []).filter(function (a) { return a.type === 'html'; });
|
|
549
|
+
var htmlAssets = (cachedData.assets || []).filter(function (a) { return a.type && a.type.toLowerCase() === 'html'; });
|
|
547
550
|
htmlAssets.forEach(function (asset) {
|
|
548
551
|
var opt = document.createElement('option');
|
|
549
552
|
opt.value = asset.path;
|
|
550
|
-
opt.textContent = asset.
|
|
553
|
+
opt.textContent = asset.path;
|
|
551
554
|
entrySelect.appendChild(opt);
|
|
552
555
|
});
|
|
553
556
|
entryGroup.appendChild(entryLabel);
|