From ff5631d9ec27f338e9867a58e918cd1b18598b70 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 31 Mar 2009 09:12:24 +0000 Subject: [PATCH] Addresses #1239, Add options to Locate button When an item has a URL, turn Locate button into a menu and allow lookup via Wayback Machine Support for additional user-configurable providers is forthcoming --- chrome/content/zotero/bindings/itembox.xml | 72 +++++++++++++++---- .../skin/default/zotero/bindings/itembox.css | 6 ++ 2 files changed, 66 insertions(+), 12 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 2bf8d055e..20178b7f3 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -282,9 +282,8 @@ } viewButton.setAttribute('disabled', !validURI); - // Enable/disable "Locate =>" (OpenURL) button - switch (this.item.itemTypeID) - { + // 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'): @@ -296,7 +295,20 @@ default: var openURL = false; } - document.getElementById('openurl-button').setAttribute('disabled', !openURL); + + 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; } @@ -515,6 +527,16 @@ + + + + + + + @@ -943,13 +965,34 @@ - + @@ -2073,10 +2116,15 @@