diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js index 6ca7cb271..45750693f 100644 --- a/chrome/content/zotero/itemPane.js +++ b/chrome/content/zotero/itemPane.js @@ -55,7 +55,6 @@ var ZoteroItemPane = new function() this.viewItem = viewItem; this.loadPane = loadPane; this.changeTypeTo = changeTypeTo; - this.onGoToURLClick = onGoToURLClick; this.onOpenURLClick = onOpenURLClick; this.addCreatorRow = addCreatorRow; this.switchCreatorMode = switchCreatorMode; @@ -175,7 +174,17 @@ var ZoteroItemPane = new function() testView: try { var validURI = false; - var spec = _itemBeingEdited.getField('url'); + + var snapID = _itemBeingEdited.getBestSnapshot(); + if (snapID) + { + var spec = Zotero.Items.get(snapID).getLocalFileURL(); + } + else + { + var spec = _itemBeingEdited.getField('url'); + } + if (!spec) { break testView; @@ -183,7 +192,10 @@ var ZoteroItemPane = new function() var uri = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService) .newURI(spec, null, null); - validURI = uri.scheme && uri.host; + + validURI = uri.scheme && (uri.host || uri.scheme=='file'); + + document.getElementById('tb-go-to-url').setAttribute('viewURL', spec); } catch (e){} document.getElementById('tb-go-to-url').setAttribute('disabled', !validURI); @@ -392,11 +404,6 @@ var ZoteroItemPane = new function() } } - function onGoToURLClick() - { - window.loadURI(_itemBeingEdited.getField('url')); - } - function onOpenURLClick() { var url = Zotero.OpenURL.resolve(_itemBeingEdited); diff --git a/chrome/content/zotero/itemPane.xul b/chrome/content/zotero/itemPane.xul index da9da2f83..7413e9722 100644 --- a/chrome/content/zotero/itemPane.xul +++ b/chrome/content/zotero/itemPane.xul @@ -38,7 +38,7 @@ 'typeID', typeID, otherFields)"/> -