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 // HiDPI images available
case 'attachment-link': case 'attachment-link':
case 'attachment-pdf': case 'attachment-pdf':
case 'attachment-pdf-link':
case 'attachment-snapshot': case 'attachment-snapshot':
case 'attachment-web-link': case 'attachment-web-link':
case 'artwork': case 'artwork':

View file

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