From 3349acc7475432b69cad04bdfec7a6dfef7ddaf5 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 4 Dec 2011 14:17:51 -0500 Subject: [PATCH 01/13] Fix description of how to add a locate engine --- chrome/locale/en-US/zotero/preferences.dtd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd index b8c78505d..3cd7a8742 100644 --- a/chrome/locale/en-US/zotero/preferences.dtd +++ b/chrome/locale/en-US/zotero/preferences.dtd @@ -159,7 +159,7 @@ - + From b43ce3254d1821c1d787c57988d1beb66bdc86fe Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 6 Dec 2011 18:01:28 -0500 Subject: [PATCH 02/13] Year part of title/creator/year search worked only if month/day were set --- chrome/content/zotero/xpcom/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js index 851c68795..76a7192f0 100644 --- a/chrome/content/zotero/xpcom/search.js +++ b/chrome/content/zotero/xpcom/search.js @@ -2148,7 +2148,7 @@ Zotero.SearchConditions = new function(){ doesNotContain: true }, table: 'itemData', - field: 'STRFTIME("%Y", SUBSTR(value, 1, 10))', + field: 'SUBSTR(value, 1, 4)', special: true }, From fbb09565ae6171de299b369eafc883594078e1a9 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 7 Dec 2011 01:05:20 -0500 Subject: [PATCH 03/13] Fix an error adding a citation --- chrome/content/zotero/xpcom/integration.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 8d0962e2c..529cc031c 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -1366,7 +1366,8 @@ Zotero.Integration.Fields.prototype.addEditCitation = function(field, callback) if(!session.bibliographyHasChanged) { for(var i=0, n=citation.citationItems.length; i Date: Wed, 7 Dec 2011 02:31:40 -0500 Subject: [PATCH 04/13] Fix quotation marks --- chrome/locale/en-US/zotero/preferences.dtd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd index 3cd7a8742..d308ec64f 100644 --- a/chrome/locale/en-US/zotero/preferences.dtd +++ b/chrome/locale/en-US/zotero/preferences.dtd @@ -159,7 +159,7 @@ - + From b916935256ee533c0caa6f398916f74671f9e288 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 8 Dec 2011 01:28:57 -0500 Subject: [PATCH 05/13] Replace direct nsITimer call with setTimeout() --- chrome/content/zotero/xpcom/attachments.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 86a53a1a8..40cab4c05 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -328,11 +328,9 @@ Zotero.Attachments = new function(){ // if it fails // // TODO: index later - var timer = Components.classes["@mozilla.org/timer;1"]. - createInstance(Components.interfaces.nsITimer); - timer.initWithCallback({notify: function() { + setTimeout(function() { Zotero.Fulltext.indexItems([itemID]); - }}, 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); + }, 1000); } catch (e) { // Clean up From 14bb52a43f42dc6271128b4989460bbaafb40833 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 8 Dec 2011 01:35:24 -0500 Subject: [PATCH 06/13] Replace a couple more nsITimer calls --- chrome/content/zotero/xpcom/attachments.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 40cab4c05..4b8216731 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -610,10 +610,9 @@ Zotero.Attachments = new function(){ // we'll index it later if it fails // // TODO: index later - var timer = Components.classes["@mozilla.org/timer;1"]. - createInstance(Components.interfaces.nsITimer); - timer.initWithCallback({notify: f}, 1000, - Components.interfaces.nsITimer.TYPE_ONE_SHOT); + setTimeout(function () { + f(); + }, 1000); } catch (e) { // Clean up @@ -650,10 +649,9 @@ Zotero.Attachments = new function(){ Zotero.Notifier.trigger('add', 'item', itemID); // Wait a second before indexing (see note above) - var timer = Components.classes["@mozilla.org/timer;1"]. - createInstance(Components.interfaces.nsITimer); - timer.initWithCallback({notify: f}, 1000, - Components.interfaces.nsITimer.TYPE_ONE_SHOT); + setTimeout(function () { + f(); + }, 1000); } // Caution: Take care using this itemID. The notifier may not yet have been called, From f0bd8beebcb0384186d92788ed4b99ccb9d1dea3 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 8 Dec 2011 04:27:25 -0500 Subject: [PATCH 07/13] Don't load date.js twice. --- components/zotero-service.js | 1 - 1 file changed, 1 deletion(-) diff --git a/components/zotero-service.js b/components/zotero-service.js index 8f9a8d80d..070c06273 100644 --- a/components/zotero-service.js +++ b/components/zotero-service.js @@ -76,7 +76,6 @@ const xpcomFilesLocal = [ 'data/relations', 'data/tag', 'data/tags', - 'date', 'db', 'duplicates', 'enstyle', From 87c4dfb893b65e5f1d034e50ee25dbd0d403cc98 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 12 Dec 2011 16:41:49 -0500 Subject: [PATCH 08/13] Remove excessive Zotero.libraryID calls syncing deleted items --- chrome/content/zotero/xpcom/sync.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 0956f4a99..d05336875 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -3343,6 +3343,8 @@ Zotero.Sync.Server.Data = new function() { var xmlDeletedNode = doc.createElement('deleted'); var inserted = false; + var defaultLibraryID = Zotero.libraryID; + for each(var syncObject in Zotero.Sync.syncObjects) { var Type = syncObject.singular; // 'Item' var Types = syncObject.plural; // 'Items' @@ -3367,7 +3369,7 @@ Zotero.Sync.Server.Data = new function() { } var n = doc.createElement(type); - n.setAttribute('libraryID', parseInt(libraryID) ? parseInt(libraryID) : Zotero.libraryID); + n.setAttribute('libraryID', parseInt(libraryID) ? parseInt(libraryID) : defaultLibraryID); n.setAttribute('key', key); xmlDeletedObjectsNode.appendChild(n); } From f87bee9f7c4a8164753bca6aecfa8b5a2a4ff02a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 14 Dec 2011 17:46:21 -0500 Subject: [PATCH 09/13] Fix blank window/tab when file.launch() fails Use nsIExternalProtocolService.loadUrl() as a fallback rather than window.loadURI() If "Remember my choice for file links" is selected, there's currently no way to change that in Standalone short of deleting mimeTypes.rdf. --- chrome/content/zotero/zoteroPane.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 9a5bea846..61dd79450 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -3386,15 +3386,21 @@ var ZoteroPane = new function() this.loadURI(url, event, { attachmentID: itemID}); } else { - // Some platforms don't have nsILocalFile.launch, so we just load it and + // Some platforms don't have nsILocalFile.launch, so we just // let the Firefox external helper app window handle it try { file.launch(); } catch (e) { - Zotero.debug("launch() not supported -- passing file to loadURI()"); - var fileURL = attachment.getLocalFileURL(); - this.loadURI(fileURL); + Zotero.debug("launch() not supported -- passing file to loadUrl()"); + + var uri = Components.classes["@mozilla.org/network/standard-url;1"]. + createInstance(Components.interfaces.nsIURI); + uri.spec = attachment.getLocalFileURL(); + + var nsIEPS = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]. + getService(Components.interfaces.nsIExternalProtocolService); + nsIEPS.loadUrl(uri); } } } From b4512ac91d71fb0284327533915fb9edec0e8426 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 14 Dec 2011 17:49:14 -0500 Subject: [PATCH 10/13] Remove unused third parameter to ZoteroPane.loadURI() --- chrome/content/zotero/zoteroPane.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 61dd79450..0165c3ae7 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -2649,7 +2649,7 @@ var ZoteroPane = new function() * (e.g. meta-click == new background tab, meta-shift-click == new front tab, * shift-click == new window, no modifier == frontmost tab */ - function loadURI(uris, event, data) { + function loadURI(uris, event) { if(typeof uris === "string") { uris = [uris]; } @@ -3383,7 +3383,7 @@ var ZoteroPane = new function() if (!externalViewer) { var url = 'zotero://attachment/' + itemID + '/'; - this.loadURI(url, event, { attachmentID: itemID}); + this.loadURI(url, event); } else { // Some platforms don't have nsILocalFile.launch, so we just From 0456e5d3be76c00a09f64720c42d89d956ab88ef Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 14 Dec 2011 17:52:10 -0500 Subject: [PATCH 11/13] About pane updates --- chrome/content/zotero/about.xul | 13 ++----------- chrome/locale/en-US/zotero/about.dtd | 4 +++- chrome/skin/default/zotero/about.css | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/chrome/content/zotero/about.xul b/chrome/content/zotero/about.xul index 1a2daa342..ecee69c10 100644 --- a/chrome/content/zotero/about.xul +++ b/chrome/content/zotero/about.xul @@ -254,9 +254,8 @@