From fb9aab3bb05b7bbea07c624f4808e783a25d2d9d Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 10 Mar 2025 12:08:26 -0400 Subject: [PATCH] Define "snapshot" the same way everywhere --- chrome/content/zotero/xpcom/data/item.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 6e62e3f6c2..b917e23561 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -2485,12 +2485,10 @@ Zotero.Item.prototype.isEmbeddedImageAttachment = function() { * @return {Boolean} - Returns true if item is a snapshot */ Zotero.Item.prototype.isSnapshotAttachment = function () { - return this.attachmentLinkMode == Zotero.Attachments.LINK_MODE_IMPORTED_URL - && this.attachmentContentType == 'text/html'; + return this.isFileAttachment() && this.attachmentContentType == 'text/html'; }; - /** * @return {Boolean} - Returns true if item is a stored or linked PDF attachment */ @@ -4600,6 +4598,14 @@ Zotero.Item.prototype.getItemTypeIconName = function (skipLinkMode = false) { itemType += 'EPUB'; } } + else if (this.isSnapshotAttachment()) { + if (!skipLinkMode && linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) { + itemType += 'WebLink'; + } + else { + itemType += 'Snapshot'; + } + } else if (this.isImageAttachment()) { itemType += linkMode == (!skipLinkMode && Zotero.Attachments.LINK_MODE_LINKED_FILE) ? 'ImageLink' : 'Image'; } @@ -4612,9 +4618,6 @@ Zotero.Item.prototype.getItemTypeIconName = function (skipLinkMode = false) { else if (!skipLinkMode && linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) { itemType += "Link"; } - else if (linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_URL) { - itemType += "Snapshot"; - } else if (linkMode == Zotero.Attachments.LINK_MODE_LINKED_URL) { itemType += "WebLink"; }