Add pref launchNonNativeFiles to launch PDF and other non-native files rather than displaying in-browser

This commit is contained in:
Dan Stillman 2007-08-21 08:33:17 +00:00
parent 68d880173d
commit dd3acad06b
2 changed files with 12 additions and 3 deletions

View File

@ -1873,14 +1873,22 @@ var ZoteroPane = new function()
var file = attachment.getFile();
if (file) {
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 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();
if (internal || Zotero.MIME.fileHasInternalHandler(file)) {
if (isNative ||
(internal && !Zotero.Prefs.get('launchNonNativeFiles'))) {
this.loadURI(fileURL, event, { attachmentID: itemID});
}
else {

View File

@ -20,6 +20,7 @@ pref("extensions.zotero.fontSize", "1.0");
pref("extensions.zotero.recursiveCollections", false);
pref("extensions.zotero.attachmentRenameFormatString", '{%c - }{%y - }{%t{50}}');
pref("extensions.zotero.capitalizeTitles", true);
pref("extensions.zotero.launchNonNativeFiles", false);
pref("extensions.zotero.lastCreatorFieldMode",0);
pref("extensions.zotero.lastAbstractExpand",0);