Add icon for linked PDF files

This commit is contained in:
Dan Stillman 2019-03-03 20:50:38 -05:00
parent e2c4e3e86a
commit 8cd5b09053
5 changed files with 8 additions and 6 deletions

View file

@ -460,6 +460,7 @@ Zotero.ItemTypes = new function() {
// HiDPI images available
case 'attachment-link':
case 'attachment-pdf':
case 'attachment-pdf-link':
case 'attachment-snapshot':
case 'attachment-web-link':
case 'artwork':

View file

@ -3686,13 +3686,14 @@ Zotero.Item.prototype.getImageSrc = function() {
if (itemType == 'attachment') {
var linkMode = this.attachmentLinkMode;
// Quick hack to use PDF icon for imported files and URLs --
// extend to support other document types later
if ((linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_FILE ||
linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_URL) &&
this.attachmentContentType == 'application/pdf') {
if (this.attachmentContentType == 'application/pdf') {
if (linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) {
itemType += '-pdf-link';
}
else {
itemType += '-pdf';
}
}
else if (linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_FILE) {
itemType += "-file";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before After
Before After