From 0d0a6f38b28618ab9311d886ba93df84af52ba90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikko=20R=C3=B6nkk=C3=B6?= Date: Sat, 11 Feb 2012 13:04:14 +0200 Subject: [PATCH 1/2] Added a library link to QuickFormat dialog --- chrome/content/zotero/integration/quickFormat.js | 11 +++++++++++ chrome/content/zotero/integration/quickFormat.xul | 1 + 2 files changed, 12 insertions(+) diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index 24208b7fa..f2627d137 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -110,6 +110,7 @@ var Zotero_QuickFormat = new function () { panelLocatorLabel = document.getElementById("locator-label"); panelLocator = document.getElementById("locator"); panelInfo = document.getElementById("citation-properties-info"); + panelLibraryLink = document.getElementById("citation-properties-library-link"); // Don't need to set noautohide dynamically on these platforms, so do it now if(Zotero.isMac || Zotero.isWin) { @@ -904,11 +905,21 @@ var Zotero_QuickFormat = new function () { panelLocator.value = target.citationItem["locator"] ? target.citationItem["locator"] : ""; panelSuppressAuthor.checked = !!target.citationItem["suppress-author"]; + Zotero.Cite.getItem(panelRefersToBubble.citationItem.id).key; + var item = Zotero.Cite.getItem(target.citationItem.id); document.getElementById("citation-properties-title").textContent = item.getDisplayTitle(); while(panelInfo.hasChildNodes()) panelInfo.removeChild(panelInfo.firstChild); _buildItemDescription(item, panelInfo); + var libraryName = item.libraryID ? Zotero.Libraries.getName(item.libraryID) + : Zotero.getString('pane.collections.library'); + + var libraryLink = document.getElementById("citation-properties-library-link"); + //TODO: Localize "Open in " + libraryLink.textContent ="Open in "+libraryName; + libraryLink.onclick=function() {window.open('zotero://select/'+item.key)}; + target.setAttribute("selected", "true"); panel.openPopup(target, "after_start", target.clientWidth/2, 0, false, false, null); diff --git a/chrome/content/zotero/integration/quickFormat.xul b/chrome/content/zotero/integration/quickFormat.xul index ab8701140..c94e9a7a4 100644 --- a/chrome/content/zotero/integration/quickFormat.xul +++ b/chrome/content/zotero/integration/quickFormat.xul @@ -78,6 +78,7 @@ + From c7b4c41aee68c6a63df0bd9746e44087c33d7724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikko=20R=C3=B6nkk=C3=B6?= Date: Sat, 11 Feb 2012 13:19:36 +0200 Subject: [PATCH 2/2] Added a library link to QuickFormat dialog, fix url --- chrome/content/zotero/integration/quickFormat.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index f2627d137..adf6543c1 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -914,11 +914,10 @@ var Zotero_QuickFormat = new function () { var libraryName = item.libraryID ? Zotero.Libraries.getName(item.libraryID) : Zotero.getString('pane.collections.library'); - var libraryLink = document.getElementById("citation-properties-library-link"); //TODO: Localize "Open in " libraryLink.textContent ="Open in "+libraryName; - libraryLink.onclick=function() {window.open('zotero://select/'+item.key)}; + libraryLink.onclick=function() {window.open('zotero://select/item/'+(item.libraryID ? item.libraryID : 0)+'_'+item.key)}; target.setAttribute("selected", "true"); panel.openPopup(target, "after_start",