Add pref launchNonNativeFiles to launch PDF and other non-native files rather than displaying in-browser
This commit is contained in:
parent
68d880173d
commit
dd3acad06b
|
@ -1873,14 +1873,22 @@ var ZoteroPane = new function()
|
||||||
var file = attachment.getFile();
|
var file = attachment.getFile();
|
||||||
if (file) {
|
if (file) {
|
||||||
var mimeType = attachment.getAttachmentMimeType();
|
var mimeType = attachment.getAttachmentMimeType();
|
||||||
if (mimeType) {
|
// If no MIME type specified, try to detect again (I guess in case
|
||||||
|
// we've gotten smarter since the file was imported?)
|
||||||
|
if (!mimeType) {
|
||||||
|
var mimeType = Zotero.MIME.getMIMETypeFromFile(file);
|
||||||
var ext = Zotero.File.getExtension(file);
|
var ext = Zotero.File.getExtension(file);
|
||||||
var internal = Zotero.MIME.hasInternalHandler(mimeType, ext);
|
|
||||||
|
// TODO: update DB with new info
|
||||||
}
|
}
|
||||||
|
var ext = Zotero.File.getExtension(file);
|
||||||
|
var isNative = Zotero.MIME.hasNativeHandler(mimeType, ext);
|
||||||
|
var internal = Zotero.MIME.hasInternalHandler(mimeType, ext);
|
||||||
|
|
||||||
var fileURL = attachment.getLocalFileURL();
|
var fileURL = attachment.getLocalFileURL();
|
||||||
|
|
||||||
if (internal || Zotero.MIME.fileHasInternalHandler(file)) {
|
if (isNative ||
|
||||||
|
(internal && !Zotero.Prefs.get('launchNonNativeFiles'))) {
|
||||||
this.loadURI(fileURL, event, { attachmentID: itemID});
|
this.loadURI(fileURL, event, { attachmentID: itemID});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -20,6 +20,7 @@ pref("extensions.zotero.fontSize", "1.0");
|
||||||
pref("extensions.zotero.recursiveCollections", false);
|
pref("extensions.zotero.recursiveCollections", false);
|
||||||
pref("extensions.zotero.attachmentRenameFormatString", '{%c - }{%y - }{%t{50}}');
|
pref("extensions.zotero.attachmentRenameFormatString", '{%c - }{%y - }{%t{50}}');
|
||||||
pref("extensions.zotero.capitalizeTitles", true);
|
pref("extensions.zotero.capitalizeTitles", true);
|
||||||
|
pref("extensions.zotero.launchNonNativeFiles", false);
|
||||||
|
|
||||||
pref("extensions.zotero.lastCreatorFieldMode",0);
|
pref("extensions.zotero.lastCreatorFieldMode",0);
|
||||||
pref("extensions.zotero.lastAbstractExpand",0);
|
pref("extensions.zotero.lastAbstractExpand",0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user