diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 5643f323ce..35fcce1b47 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -44,7 +44,6 @@ false false false - false false false false @@ -61,7 +60,6 @@ this.clickable = false; this.editable = false; this.saveOnEdit = false; - this.displayGoButtons = false; this.showTypeMenu = false; this.hideEmptyFields = false; this.clickByRow = false; @@ -75,7 +73,6 @@ this.clickable = true; this.editable = true; this.saveOnEdit = true - this.displayGoButtons = true; this.showTypeMenu = true; this.clickHandler = this.showEditor; this.blurHandler = this.hideEditor; @@ -90,7 +87,6 @@ this.clickable = true; this.editable = true; this.saveOnEdit = false; - this.displayGoButtons = false; this.showTypeMenu = true; this.clickHandler = this.showEditor; this.blurHandler = this.hideEditor; @@ -230,111 +226,6 @@ 'document.getBindingParent(this).clickHandler(this)'); } - if (this.displayGoButtons) { - // Enable/disable "View =>" button - testView: try { - var viewButton = document.getElementById('view-button'); - - viewButton.removeAttribute('viewSnapshot'); - viewButton.removeAttribute('viewURL'); - viewButton.setAttribute('label', - Zotero.getString('pane.item.goToURL.online.label')); - viewButton.setAttribute('tooltiptext', - Zotero.getString('pane.item.goToURL.online.tooltip')); - - var spec = false, validURI = false; - - var uri = Components.classes["@mozilla.org/network/standard-url;1"]. - createInstance(Components.interfaces.nsIURI); - - // First try to find a snapshot matching the item's URL field - var snapID = this.item.getBestAttachment(); - if (snapID) { - spec = Zotero.Items.get(snapID).getLocalFileURL(); - uri.spec = spec; - if (!uri.scheme || uri.scheme != 'file') { - snapID = false; - spec = false; - } - } - - // If that fails, try the URL field itself - if (!spec) { - spec = this.item.getField('url'); - uri.spec = spec; - if (!(uri.scheme && (uri.host || uri.scheme == 'file'))) { - spec = false; - } - } - - // If that fails, try the DOI field - if (!spec) { - var doi = this.item.getField('DOI'); - if (doi && typeof val == 'String') { - // Pull out DOI, in case there's a prefix - doi = Zotero.Utilities.cleanDOI(doi);; - if (doi) { - spec = "http://dx.doi.org/" + encodeURIComponent(doi); - } - } - } - - if (!spec) { - break testView; - } - - validURI = true; - - if (snapID) { - viewButton.setAttribute('label', - Zotero.getString('pane.item.goToURL.snapshot.label')); - viewButton.setAttribute('tooltiptext', - Zotero.getString('pane.item.goToURL.snapshot.tooltip')); - viewButton.setAttribute('viewSnapshot', snapID); - } - else { - viewButton.setAttribute('viewURL', spec); - } - } - catch (e) { - Zotero.debug(e); - } - viewButton.setAttribute('disabled', !validURI); - - // Enable/disable "Locate =>" button - switch (this.item.itemTypeID) { - // DEBUG: handle descendents of these types as well? - case Zotero.ItemTypes.getID('book'): - case Zotero.ItemTypes.getID('bookSection'): - case Zotero.ItemTypes.getID('journalArticle'): - case Zotero.ItemTypes.getID('thesis'): - var openURL = true; - break; - - default: - var openURL = false; - } - - var locateButton = document.getElementById('locate-button'); - - // TODO: move Locate service logic to separate interface - var wayback = this._itemHasURL(); - if (wayback) { - locateButton.setAttribute('type', 'menu'); - locateButton.setAttribute('disabled', false); - document.getElementById('locate-service-openurl').disabled = !openURL; - } - else { - locateButton.removeAttribute('type'); - locateButton.disabled = !openURL; - } - - this._id('go-buttons').hidden = false; - } - else { - this._id('go-buttons').hidden = true; - } - // Item type menu if (this.showTypeMenu) { // Build item type menu if it hasn't been built yet @@ -452,7 +343,7 @@ label.setAttribute("isButton", true); // TODO: make getFieldValue non-private and use below instead label.setAttribute("onclick", "ZoteroPane.loadURI(this.nextSibling.firstChild ? this.nextSibling.firstChild.nodeValue : this.nextSibling.value, event)"); - label.setAttribute("tooltiptext", Zotero.getString('pane.item.goToURL.online.tooltip')); + label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip')); } else if (fieldName == 'DOI' && val && typeof val == 'string') { // Pull out DOI, in case there's a prefix @@ -461,7 +352,7 @@ doi = "http://dx.doi.org/" + encodeURIComponent(doi); label.setAttribute("isButton", true); label.setAttribute("onclick", "ZoteroPane.loadURI('" + doi + "', event)"); - label.setAttribute("tooltiptext", Zotero.getString('pane.item.goToURL.online.tooltip')); + label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip')); } } else if (fieldName == 'abstractNote') { @@ -567,16 +458,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2395,29 +2226,13 @@ - - - +