From 02efb5690299856b1c9a2ca50f1d05031dd91ee5 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 30 Jan 2011 09:52:51 +0000 Subject: [PATCH] fix some ZoteroPane references --- chrome/content/zotero/advancedSearch.js | 7 ++----- chrome/content/zotero/bindings/noteeditor.xml | 11 ++--------- chrome/content/zotero/bindings/relatedbox.xml | 8 ++++---- chrome/content/zotero/browser.js | 4 ++-- chrome/content/zotero/lookup.js | 5 +++-- chrome/content/zotero/xpcom/connector.js | 5 +++-- chrome/content/zotero/xpcom/mimeTypeHandler.js | 5 +++-- 7 files changed, 19 insertions(+), 26 deletions(-) diff --git a/chrome/content/zotero/advancedSearch.js b/chrome/content/zotero/advancedSearch.js index 7553e333ea..564ba2e4a2 100644 --- a/chrome/content/zotero/advancedSearch.js +++ b/chrome/content/zotero/advancedSearch.js @@ -152,11 +152,8 @@ var ZoteroAdvancedSearch = new function() { return; } - if (lastWin.document.getElementById('zotero-pane').getAttribute('hidden') == 'true') { - lastWin.ZoteroOverlay.toggleDisplay(); - } - - lastWin.ZoteroPane.selectItem(item.getID(), false, true); + lastWin.ZoteroPane.show(); + lastWin.ZoteroPane.getActiveZoteroPane.selectItem(item.getID(), false, true); lastWin.focus(); } } diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml index c9f37bd0fc..8baeb7f650 100644 --- a/chrome/content/zotero/bindings/noteeditor.xml +++ b/chrome/content/zotero/bindings/noteeditor.xml @@ -317,15 +317,8 @@ return; } - if (lastWin.document.getElementById('zotero-pane').getAttribute('hidden') == 'true') { - lastWin.ZoteroOverlay.toggleDisplay(); - - // DEBUG: The actions below seem to crash Firefox 2.0.0.1 on OS X if - // the Z pane isn't already open, so we don't try - return; - } - - var zp = lastWin.ZoteroPane; + lastWin.ZoteroPane.show(); + var zp = lastWin.ZoteroPane.getActiveZoteroPane(); } var parentID = this.item.getSource(); diff --git a/chrome/content/zotero/bindings/relatedbox.xml b/chrome/content/zotero/bindings/relatedbox.xml index 8199721a80..f0cf905439 100644 --- a/chrome/content/zotero/bindings/relatedbox.xml +++ b/chrome/content/zotero/bindings/relatedbox.xml @@ -223,7 +223,7 @@ var p; if(window.ZoteroPane) { - p = window.ZoteroPane; + p = window.ZoteroPane.getActiveZoteroPane(); } else { @@ -242,10 +242,10 @@ return; } - p = win.ZoteroPane; + p = win.ZoteroPane.getActiveZoteroPane(); } - - p.selectItem(id); + + if(p) p.selectItem(id); } ]]> diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index a62252de7e..ca596eaccb 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -153,8 +153,8 @@ var Zotero_Browser = new function() { var libraryID, collectionID; var pane = ZoteroOverlay.getActiveZoteroPane(); if(pane) { - libraryID = ZoteroPane.getSelectedLibraryID(); - collectionID = ZoteroPane.getSelectedCollection(true); + libraryID = pane.getSelectedLibraryID(); + collectionID = pane.getSelectedCollection(true); } else { libraryID = collectionID = null; } diff --git a/chrome/content/zotero/lookup.js b/chrome/content/zotero/lookup.js index 86a02fd2ff..ba60a207dd 100644 --- a/chrome/content/zotero/lookup.js +++ b/chrome/content/zotero/lookup.js @@ -68,8 +68,9 @@ const Zotero_Lookup = new function () { var libraryID = null; var collection = false; try { - libraryID = window.opener.ZoteroPane.getSelectedLibraryID(); - collection = window.opener.ZoteroPane.getSelectedCollection(); + var zp = window.opener.ZoteroPane.getActiveZoteroPane(); + libraryID = zp.getSelectedLibraryID(); + collection = zp.getSelectedCollection(); } catch(e) {} translate.setHandler("itemDone", function(obj, item) { if(collection) collection.addItem(item.id); diff --git a/chrome/content/zotero/xpcom/connector.js b/chrome/content/zotero/xpcom/connector.js index 10a4431698..6ed7634fb1 100755 --- a/chrome/content/zotero/xpcom/connector.js +++ b/chrome/content/zotero/xpcom/connector.js @@ -703,8 +703,9 @@ Zotero.Connector.Translate.Save.prototype = { this._libraryID = null; var collection = null; try { - this._libraryID = win.ZoteroPane.getSelectedLibraryID(); - collection = win.ZoteroPane.getSelectedCollection(); + var zp = win.ZoteroPane.getActiveZoteroPane(); + this._libraryID = zp.getSelectedLibraryID(); + collection = zp.getSelectedCollection(); } catch(e) {} var me = this; translate.setHandler("select", function(obj, item) { return me._selectItems(obj, item) }); diff --git a/chrome/content/zotero/xpcom/mimeTypeHandler.js b/chrome/content/zotero/xpcom/mimeTypeHandler.js index e48d38afac..7199251659 100644 --- a/chrome/content/zotero/xpcom/mimeTypeHandler.js +++ b/chrome/content/zotero/xpcom/mimeTypeHandler.js @@ -118,8 +118,9 @@ Zotero.MIMETypeHandler = new function () { var libraryID = null; var collection = null; try { - libraryID = frontWindow.ZoteroPane.getSelectedLibraryID(); - collection = frontWindow.ZoteroPane.getSelectedCollection(); + var zp = frontWindow.ZoteroPane.getActiveZoteroPane(); + libraryID = zp.getSelectedLibraryID(); + collection = zp.getSelectedCollection(); } catch(e) {} translation.setHandler("itemDone", function(obj, item) { frontWindow.Zotero_Browser.itemDone(obj, item, collection) }); translation.setHandler("done", function(obj, item) { frontWindow.Zotero_Browser.finishScraping(obj, item, collection) });