From 660548635401a3ee55419728c08d13cabf34979b Mon Sep 17 00:00:00 2001 From: Frank Bennett Date: Fri, 9 May 2014 22:02:48 +0900 Subject: [PATCH 01/15] Use ID rather than name on getPrimaryIDForType() Use creator name for comparison (creatorTypeID does not exist on array-form creators) --- chrome/content/zotero/xpcom/utilities.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index d425665cc..dfe0cd6c8 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1464,13 +1464,14 @@ Zotero.Utilities = { } // separate name variables - var authorID = Zotero.CreatorTypes.getPrimaryIDForType(item.itemType); + var authorID = Zotero.CreatorTypes.getPrimaryIDForType(itemTypeID); + var authorFieldName = Zotero.CreatorTypes.getName(authorID); var creators = item.creators; if(creators) { for(var i=0, n=creators.length; i Date: Tue, 13 May 2014 12:53:38 -0500 Subject: [PATCH 02/15] Recognize Windows network shares on file attachment import Related to zotero/translators#735 --- chrome/content/zotero/xpcom/translation/translate_item.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js index 6778820df..30a1515ee 100644 --- a/chrome/content/zotero/xpcom/translation/translate_item.js +++ b/chrome/content/zotero/xpcom/translation/translate_item.js @@ -329,7 +329,8 @@ Zotero.Translate.ItemSaver.prototype = { var file; // First, try to parse as absolute path - if(((/[a-zA-Z]:\\/.test(path) && Zotero.isWin) || (path[0] === "/" && !Zotero.isWin)) + if(((/^[a-zA-Z]:\\|^\\\\/.test(path) && Zotero.isWin) // Paths starting with drive letter or network shares starting with \\ + || (path[0] === "/" && !Zotero.isWin)) && (file = this._parseAbsolutePath(path))) { Zotero.debug("Translate: Got file "+path+" as absolute path"); return file; From e861c3e298244256e8efad1225d371f597f37a22 Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Tue, 13 May 2014 13:22:59 -0500 Subject: [PATCH 03/15] Fix slash direction on Windows for absolute paths E.g. Mendeley exports something like `C:/some/path/test.pdf` --- .../zotero/xpcom/translation/translate_item.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js index 30a1515ee..11336eccc 100644 --- a/chrome/content/zotero/xpcom/translation/translate_item.js +++ b/chrome/content/zotero/xpcom/translation/translate_item.js @@ -329,11 +329,16 @@ Zotero.Translate.ItemSaver.prototype = { var file; // First, try to parse as absolute path - if(((/^[a-zA-Z]:\\|^\\\\/.test(path) && Zotero.isWin) // Paths starting with drive letter or network shares starting with \\ - || (path[0] === "/" && !Zotero.isWin)) - && (file = this._parseAbsolutePath(path))) { - Zotero.debug("Translate: Got file "+path+" as absolute path"); - return file; + if((/^[a-zA-Z]:[\\\/]|^\\\\/.test(path) && Zotero.isWin) // Paths starting with drive letter or network shares starting with \\ + || (path[0] === "/" && !Zotero.isWin)) { + // Forward slashes on Windows are not allowed in filenames, so we can + // assume they're meant to be backslashes. Backslashes are technically + // allowed on Linux, so the reverse cannot be done reliably. + var nativePath = Zotero.isWin ? path.replace('/', '\\', 'g') : path; + if (file = this._parseAbsolutePath(nativePath)) { + Zotero.debug("Translate: Got file "+nativePath+" as absolute path"); + return file; + } } // Next, try to parse as URI From 3ee09e8d38b73247cab4cb8df00b4d03d66f62e2 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 14 May 2014 17:14:45 -0400 Subject: [PATCH 04/15] Fix gray bar below Zotero pane when resizing Firebug down Follow-up from c1c0b42a12 --- chrome/content/zotero/bindings/guidancepanel.xml | 5 ++++- chrome/content/zotero/overlay.xul | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/bindings/guidancepanel.xml b/chrome/content/zotero/bindings/guidancepanel.xml index 5f9999e50..6703bb9b9 100644 --- a/chrome/content/zotero/bindings/guidancepanel.xml +++ b/chrome/content/zotero/bindings/guidancepanel.xml @@ -60,10 +60,13 @@ if(text.length) descriptionNode.appendChild(document.createElementNS( "http://www.w3.org/1999/xhtml", "br")); } - + + this.setAttribute('onpopuphidden', 'this.hidden = true'); + var me = this; var f = function() { if(me.hasAttribute("foregroundonly") && Services.ww.activeWindow != window) return; + me.hidden = false; panel.openPopup(forEl, position ? position : "after_start", x ? parseInt(x, 10) : 0, y ? parseInt(y, 10) : 0, false, false, null); Zotero.Prefs.set(pref, true); diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul index 410d4a663..5e6189107 100644 --- a/chrome/content/zotero/overlay.xul +++ b/chrome/content/zotero/overlay.xul @@ -58,7 +58,7 @@