From 355b1fbc577b991ed7b966d075e5570f5f959236 Mon Sep 17 00:00:00 2001 From: gracile-fr Date: Thu, 15 Aug 2013 22:45:04 +0200 Subject: [PATCH 01/15] Localize Ctrl/Cmd-Shift in Prefs --- chrome/content/zotero/preferences/preferences_export.js | 2 +- chrome/content/zotero/preferences/preferences_keys.js | 2 +- chrome/locale/en-US/zotero/zotero.properties | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences_export.js b/chrome/content/zotero/preferences/preferences_export.js index 4a4befbe5..7622673ed 100644 --- a/chrome/content/zotero/preferences/preferences_export.js +++ b/chrome/content/zotero/preferences/preferences_export.js @@ -225,7 +225,7 @@ Zotero_Preferences.Export = { updateQuickCopyInstructions: function () { - var prefix = Zotero.isMac ? 'Cmd+Shift+' : 'Ctrl+Alt+'; + var prefix = Zotero.isMac ? (Zotero.getString('general.keys.cmdShift')) : (Zotero.getString('general.keys.ctrlShift')); var key = Zotero.Prefs.get('keys.copySelectedItemsToClipboard'); var str = Zotero.getString('zotero.preferences.export.quickCopy.instructions', prefix + key); diff --git a/chrome/content/zotero/preferences/preferences_keys.js b/chrome/content/zotero/preferences/preferences_keys.js index 04ee513f4..87361fc16 100644 --- a/chrome/content/zotero/preferences/preferences_keys.js +++ b/chrome/content/zotero/preferences/preferences_keys.js @@ -30,7 +30,7 @@ Zotero_Preferences.Keys = { var rows = document.getElementById('zotero-prefpane-keys').getElementsByTagName('row'); for (var i=0; i Date: Thu, 15 Aug 2013 22:53:56 +0200 Subject: [PATCH 02/15] Localize Ctrl/Cmd-Shift in Prefs --- chrome/content/zotero/preferences/preferences_export.js | 2 +- chrome/content/zotero/preferences/preferences_keys.js | 2 +- chrome/locale/en-US/zotero/zotero.properties | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences_export.js b/chrome/content/zotero/preferences/preferences_export.js index 7622673ed..ce1a302c7 100644 --- a/chrome/content/zotero/preferences/preferences_export.js +++ b/chrome/content/zotero/preferences/preferences_export.js @@ -225,7 +225,7 @@ Zotero_Preferences.Export = { updateQuickCopyInstructions: function () { - var prefix = Zotero.isMac ? (Zotero.getString('general.keys.cmdShift')) : (Zotero.getString('general.keys.ctrlShift')); + var prefix = Zotero.isMac ? Zotero.getString('general.keys.cmdShift') : Zotero.getString('general.keys.ctrlShift'); var key = Zotero.Prefs.get('keys.copySelectedItemsToClipboard'); var str = Zotero.getString('zotero.preferences.export.quickCopy.instructions', prefix + key); diff --git a/chrome/content/zotero/preferences/preferences_keys.js b/chrome/content/zotero/preferences/preferences_keys.js index 87361fc16..20f7ecd19 100644 --- a/chrome/content/zotero/preferences/preferences_keys.js +++ b/chrome/content/zotero/preferences/preferences_keys.js @@ -30,7 +30,7 @@ Zotero_Preferences.Keys = { var rows = document.getElementById('zotero-prefpane-keys').getElementsByTagName('row'); for (var i=0; i Date: Thu, 15 Aug 2013 23:15:02 +0200 Subject: [PATCH 03/15] Localize et al. in the middle pane (Heromyth's PR #358, #360, #361) --- chrome/content/zotero/xpcom/data/item.js | 2 +- chrome/content/zotero/xpcom/data/items.js | 7 ++++--- chrome/locale/en-US/zotero/zotero.properties | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index b04c12bcb..42223fb5c 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -204,7 +204,7 @@ Zotero.Item.prototype.getField = function(field, unformatted, includeBaseMapped) } else if(creators.length === 2) { return creators[0].ref.lastName+" "+Zotero.getString('general.and')+" "+creators[1].ref.lastName; } else if(creators.length > 3) { - return creators[0].ref.lastName+" et al." + return creators[0].ref.lastName+" "+Zotero.getString('general.etAl'); } } else if (field === 'id' || Zotero.Items.isPrimaryField(field)) { var privField = '_' + field; diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js index 542525332..e8fddb1ef 100644 --- a/chrome/content/zotero/xpcom/data/items.js +++ b/chrome/content/zotero/xpcom/data/items.js @@ -628,6 +628,7 @@ Zotero.Items = new function() { /* This whole block is to get the firstCreator */ var localizedAnd = Zotero.getString('general.and'); + var localizedEtAl = Zotero.getString('general.etAl'); var sql = "COALESCE(" + // First try for primary creator types "CASE (" + @@ -665,7 +666,7 @@ Zotero.Items = new function() { "LEFT JOIN itemTypeCreatorTypes ITCT " + "ON (IC.creatorTypeID=ITCT.creatorTypeID AND ITCT.itemTypeID=I.itemTypeID) " + "WHERE itemID=I.itemID AND primaryField=1 ORDER BY orderIndex LIMIT 1)" + - " || ' et al.' " + + " || ' " + localizedEtAl + "' " + ") " + "END, " + @@ -691,7 +692,7 @@ Zotero.Items = new function() { "SELECT " + "(SELECT lastName FROM itemCreators NATURAL JOIN creators NATURAL JOIN creatorData " + "WHERE itemID=I.itemID AND creatorTypeID IN (3) ORDER BY orderIndex LIMIT 1)" + - " || ' et al.' " + + " || ' " + localizedEtAl + "' " + ") " + "END, " + @@ -717,7 +718,7 @@ Zotero.Items = new function() { "SELECT " + "(SELECT lastName FROM itemCreators NATURAL JOIN creators NATURAL JOIN creatorData " + "WHERE itemID=I.itemID AND creatorTypeID IN (2) ORDER BY orderIndex LIMIT 1)" + - " || ' et al.' " + + " || ' " + localizedEtAl + "' " + ") " + "END" + ") AS firstCreator"; diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 621c90679..340bcfbd9 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -30,6 +30,7 @@ general.no = No general.passed = Passed general.failed = Failed general.and = and +general.etAl = et al. general.accessDenied = Access Denied general.permissionDenied = Permission Denied general.character.singular = character From 0c431e07ef3b4fb003dbbdcfc25f5561b0c278f0 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sat, 17 Aug 2013 17:43:39 -0400 Subject: [PATCH 04/15] Fix unnecessary reloading of session data See https://forums.zotero.org/discussion/30740?page=1#Item_16 --- chrome/content/zotero/xpcom/integration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 26d1b14f3..0c7f385c6 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -1896,8 +1896,8 @@ Zotero.Integration.CitationEditInterface.prototype = { for(var i=0; i Date: Tue, 27 Aug 2013 14:26:29 -0400 Subject: [PATCH 05/15] Fix "Invalid sync state '4'" error --- chrome/content/zotero/xpcom/data/item.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index c25598120..70fe345ed 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -3384,6 +3384,8 @@ Zotero.Item.prototype.__defineSetter__('attachmentSyncState', function (val) { case Zotero.Sync.Storage.SYNC_STATE_TO_UPLOAD: case Zotero.Sync.Storage.SYNC_STATE_TO_DOWNLOAD: case Zotero.Sync.Storage.SYNC_STATE_IN_SYNC: + case Zotero.Sync.Storage.SYNC_STATE_FORCE_UPLOAD: + case Zotero.Sync.Storage.SYNC_STATE_FORCE_DOWNLOAD: break; default: From ba32544c8706e5c12b6a15350986f3c49573604f Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 27 Aug 2013 16:00:47 -0400 Subject: [PATCH 06/15] Don't call done handler multiple times on import Broken by ff0f649a4d8a7f3ebcd4aec0932667bac2a40f8a --- chrome/content/zotero/xpcom/translation/translate.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index bfa2fb37a..988081326 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1132,6 +1132,7 @@ Zotero.Translate.Base.prototype = { this._saveAttachments = saveAttachments === undefined || saveAttachments; this._savingAttachments = []; this._savingItems = 0; + this._waitingForSave = false; var me = this; if(typeof this.translator[0] === "object") { @@ -1258,7 +1259,6 @@ Zotero.Translate.Base.prototype = { } return; } - var oldState = this._currentState; // reset async processes and propagate them to parent if(this._parentTranslator && this._runningAsyncProcesses) { @@ -1271,7 +1271,7 @@ Zotero.Translate.Base.prototype = { var errorString = null; if(!returnValue && error) errorString = this._generateErrorString(error); - if(oldState === "detect") { + if(this._currentState === "detect") { if(this._potentialTranslators.length) { var lastTranslator = this._potentialTranslators.shift(); var lastProperToProxyFunction = this._properToProxyFunctions ? this._properToProxyFunctions.shift() : null; @@ -1309,6 +1309,7 @@ Zotero.Translate.Base.prototype = { if(returnValue) { if(this.saveQueue.length) { + this._waitingForSave = true; this._saveItems(this.saveQueue); this.saveQueue = []; return; @@ -1413,7 +1414,7 @@ Zotero.Translate.Base.prototype = { * Checks if saving done, and if so, fires done event */ "_checkIfDone":function() { - if(!this._savingItems && !this._savingAttachments.length) { + if(!this._savingItems && !this._savingAttachments.length && (!this._currentState || this._waitingForSave)) { this._runHandler("done", true); } }, From 5a6e8cb65bc947c5d62f967a74556e682d855129 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 27 Aug 2013 17:08:31 -0400 Subject: [PATCH 07/15] Fix secondary function name --- chrome/content/zotero/xpcom/utilities.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 2ebbfe7bf..d00362c78 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1730,7 +1730,7 @@ Zotero.Utilities = { /** * Generates a valid object key for the server API */ - "generateObjectKey":function getKey() { + "generateObjectKey":function generateObjectKey() { // TODO: add 'L' and 'Y' after 3.0.11 cut-off var baseString = "23456789ABCDEFGHIJKMNPQRSTUVWXZ"; return Zotero.Utilities.randomString(8, baseString); From a5bc68bc17a0cb994d03f3ce1ad966148ddd534f Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 28 Aug 2013 22:05:58 -0400 Subject: [PATCH 08/15] Fix updating translators and styles from unpacked build --- chrome/content/zotero/xpcom/schema.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 178d934d4..baff2c029 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -510,6 +510,17 @@ Zotero.Schema = new function(){ xpiZipReader = Components.classes["@mozilla.org/libjar/zip-reader;1"] .createInstance(Components.interfaces.nsIZipReader); xpiZipReader.open(installLocation); + + if(Zotero.isStandalone && !xpiZipReader.hasEntry("translators.index")) { + // Symlinked Standalone build + var installLocation2 = installLocation.parent; + installLocation2.append("translators"); + if(installLocation2.exists()) { + installLocation = installLocation2; + isUnpacked = true; + xpiZipReader.close(); + } + } } switch (mode) { From 2f275a187c946f452b3286fb1b786651c5f8f53c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 29 Aug 2013 11:46:30 -0400 Subject: [PATCH 09/15] Fix path for translators/styles directories in symlinked dev Standalone build --- chrome/content/zotero/xpcom/schema.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index baff2c029..41ab25235 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -512,10 +512,11 @@ Zotero.Schema = new function(){ xpiZipReader.open(installLocation); if(Zotero.isStandalone && !xpiZipReader.hasEntry("translators.index")) { - // Symlinked Standalone build - var installLocation2 = installLocation.parent; - installLocation2.append("translators"); - if(installLocation2.exists()) { + // Symlinked dev Standalone build + var installLocation2 = installLocation.parent, + translatorsDir = installLocation2.clone(); + translatorsDir.append("translators"); + if(translatorsDir.exists()) { installLocation = installLocation2; isUnpacked = true; xpiZipReader.close(); From 94233108ae89b9085005e481a03425039818c45b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 31 Aug 2013 04:47:39 -0400 Subject: [PATCH 10/15] Fix saving advanced search Fixes #379 --- 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 fa84c83f8..ea9189af7 100644 --- a/chrome/content/zotero/xpcom/search.js +++ b/chrome/content/zotero/xpcom/search.js @@ -1684,7 +1684,7 @@ Zotero.Search.prototype._buildQuery = function(){ Zotero.Search.prototype._generateKey = function () { - return Zotero.ID.getKey(); + return Zotero.Utilities.generateObjectKey(); } From 4d4d074ad95832254f4315f9e248c5ef5db5fd3f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 31 Aug 2013 04:58:16 -0400 Subject: [PATCH 11/15] Fix saving advanced search with no name Addresses #379 --- chrome/content/zotero/advancedSearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/advancedSearch.js b/chrome/content/zotero/advancedSearch.js index eb9dd9aa3..eec434fc8 100644 --- a/chrome/content/zotero/advancedSearch.js +++ b/chrome/content/zotero/advancedSearch.js @@ -118,7 +118,7 @@ var ZoteroAdvancedSearch = new function() { if (!name.value) { - newName.value = untitled; + name.value = untitled; } var s = _searchBox.search.clone(); From 82769f0b9cb3cc0b43a696cb68a669383f1565cd Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 3 Sep 2013 04:25:35 -0400 Subject: [PATCH 12/15] Allow moving (instead of copying) files into Zotero Cmd-drag on OS X, Shift on Windows and Linux As requested in https://forums.zotero.org/discussion/31717/delete-source-file-on-import/ Unfortunately due to https://bugzilla.mozilla.org/show_bug.cgi?id=911918 (and another issue on Windows) we can't show proper cursor feedback for external file drags. --- .../zotero/xpcom/collectionTreeView.js | 43 +++++++++++++++++-- chrome/content/zotero/xpcom/itemTreeView.js | 42 ++++++++++++++++-- chrome/content/zotero/zoteroPane.xul | 2 +- 3 files changed, 79 insertions(+), 8 deletions(-) diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index 23864d2e0..e4271b975 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -1729,10 +1729,16 @@ Zotero.CollectionTreeView.prototype.drop = function(row, orient) var itemID = Zotero.Attachments.linkFromFile(file); } else { - if (dragData.dropEffect != 'copy') { - Components.utils.reportError("Invalid dropEffect '" + dragData.dropEffect + "' dropping file"); - } var itemID = Zotero.Attachments.importFromFile(file, false, targetLibraryID); + // If moving, delete original file + if (dragData.dropEffect == 'move') { + try { + file.remove(false); + } + catch (e) { + Components.utils.reportError("Error deleting original file " + file.path + " after drag"); + } + } } if (parentCollectionID) { @@ -1802,7 +1808,36 @@ Zotero.CollectionTreeView.prototype.onDragOver = function (event) { * Called by HTML 5 Drag and Drop when dropping onto the tree */ Zotero.CollectionTreeView.prototype.onDrop = function (event) { - Zotero.DragDrop.currentDataTransfer = event.dataTransfer; + if (event.dataTransfer.types.contains("application/x-moz-file")) { + Zotero.DragDrop.currentDataTransfer = event.dataTransfer; + Zotero.safeDebug(event); + if (Zotero.isMac) { + if (event.metaKey) { + if (event.altKey) { + event.dataTransfer.dropEffect = 'link'; + } + else { + event.dataTransfer.dropEffect = 'move'; + } + } + else { + event.dataTransfer.dropEffect = 'copy'; + } + } + else { + if (event.shiftKey) { + if (event.ctrlKey) { + event.dataTransfer.dropEffect = "link"; + } + else { + event.dataTransfer.dropEffect = "move"; + } + } + else { + event.dataTransfer.dropEffect = "copy"; + } + } + } return false; } diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index 9656ed579..e36e15601 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -3015,10 +3015,16 @@ Zotero.ItemTreeView.prototype.drop = function(row, orient) var itemID = Zotero.Attachments.linkFromFile(file, sourceItemID); } else { - if (dragData.dropEffect != 'copy') { - Components.utils.reportError("Invalid dropEffect '" + dragData.dropEffect + "' dropping file"); - } var itemID = Zotero.Attachments.importFromFile(file, sourceItemID, targetLibraryID); + // If moving, delete original file + if (dragData.dropEffect == 'move') { + try { + file.remove(false); + } + catch (e) { + Components.utils.reportError("Error deleting original file " + file.path + " after drag"); + } + } } if (parentCollectionID) { var col = Zotero.Collections.get(parentCollectionID); @@ -3077,10 +3083,40 @@ Zotero.ItemTreeView.prototype.onDragOver = function (event) { return false; } + /* * Called by HTML 5 Drag and Drop when dropping onto the tree */ Zotero.ItemTreeView.prototype.onDrop = function (event) { + if (event.dataTransfer.types.contains("application/x-moz-file")) { + Zotero.DragDrop.currentDataTransfer = event.dataTransfer; + if (Zotero.isMac) { + if (event.metaKey) { + if (event.altKey) { + event.dataTransfer.dropEffect = 'link'; + } + else { + event.dataTransfer.dropEffect = 'move'; + } + } + else { + event.dataTransfer.dropEffect = 'copy'; + } + } + else { + if (event.shiftKey) { + if (event.ctrlKey) { + event.dataTransfer.dropEffect = "link"; + } + else { + event.dataTransfer.dropEffect = "move"; + } + } + else { + event.dataTransfer.dropEffect = "copy"; + } + } + } return false; } diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul index f14e5204a..9952a8dc3 100644 --- a/chrome/content/zotero/zoteroPane.xul +++ b/chrome/content/zotero/zoteroPane.xul @@ -341,7 +341,7 @@ ondragstart="if (event.target.localName == 'treechildren') { ZoteroPane_Local.itemsView.onDragStart(event); }" ondragenter="return ZoteroPane_Local.itemsView.onDragEnter(event)" ondragover="return ZoteroPane_Local.itemsView.onDragOver(event)" - ondragdrop="return ZoteroPane_Local.itemsView.onDrop(event)" + ondrop="return ZoteroPane_Local.itemsView.onDrop(event)" oncommand="ZoteroPane_Local.serializePersist()" flex="1"> From 6eb354bf3630e58fa25cdfd82488ed074bd6694b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 3 Sep 2013 04:49:02 -0400 Subject: [PATCH 13/15] Fix cursor feedback for file drag-in on Linux, where we can set it --- .../zotero/xpcom/collectionTreeView.js | 31 +++++++------------ chrome/content/zotero/xpcom/itemTreeView.js | 30 +++++++----------- 2 files changed, 24 insertions(+), 37 deletions(-) diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index e4271b975..9f506b9fc 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -1782,14 +1782,21 @@ Zotero.CollectionTreeView.prototype.onDragOver = function (event) { // - Setting the dropEffect only works on Linux and OS X. // // - Modifier keys don't show up in the drag event on OS X until the - // drop, so since we can't show a correct effect, we leave it at - // the default 'move', the least misleading option. + // drop (https://bugzilla.mozilla.org/show_bug.cgi?id=911918), + // so since we can't show a correct effect, we leave it at + // the default 'move', the least misleading option, and set it + // below in onDrop(). // // - The cursor effect gets set by the system on Windows 7 and can't // be overridden. if (!Zotero.isMac) { - if (event.ctrlKey && event.shiftKey) { - event.dataTransfer.dropEffect = "link"; + if (event.shiftKey) { + if (event.ctrlKey) { + event.dataTransfer.dropEffect = "link"; + } + else { + event.dataTransfer.dropEffect = "move"; + } } else { event.dataTransfer.dropEffect = "copy"; @@ -1809,9 +1816,8 @@ Zotero.CollectionTreeView.prototype.onDragOver = function (event) { */ Zotero.CollectionTreeView.prototype.onDrop = function (event) { if (event.dataTransfer.types.contains("application/x-moz-file")) { - Zotero.DragDrop.currentDataTransfer = event.dataTransfer; - Zotero.safeDebug(event); if (Zotero.isMac) { + Zotero.DragDrop.currentDataTransfer = event.dataTransfer; if (event.metaKey) { if (event.altKey) { event.dataTransfer.dropEffect = 'link'; @@ -1824,19 +1830,6 @@ Zotero.CollectionTreeView.prototype.onDrop = function (event) { event.dataTransfer.dropEffect = 'copy'; } } - else { - if (event.shiftKey) { - if (event.ctrlKey) { - event.dataTransfer.dropEffect = "link"; - } - else { - event.dataTransfer.dropEffect = "move"; - } - } - else { - event.dataTransfer.dropEffect = "copy"; - } - } } return false; } diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index e36e15601..ef35b0383 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -3062,14 +3062,21 @@ Zotero.ItemTreeView.prototype.onDragOver = function (event) { // - Setting the dropEffect only works on Linux and OS X. // // - Modifier keys don't show up in the drag event on OS X until the - // drop, so since we can't show a correct effect, we leave it at - // the default 'move', the least misleading option. + // drop (https://bugzilla.mozilla.org/show_bug.cgi?id=911918), + // so since we can't show a correct effect, we leave it at + // the default 'move', the least misleading option, and set it + // below in onDrop(). // // - The cursor effect gets set by the system on Windows 7 and can't // be overridden. if (!Zotero.isMac) { - if (event.ctrlKey && event.shiftKey) { - event.dataTransfer.dropEffect = "link"; + if (event.shiftKey) { + if (event.ctrlKey) { + event.dataTransfer.dropEffect = "link"; + } + else { + event.dataTransfer.dropEffect = "move"; + } } else { event.dataTransfer.dropEffect = "copy"; @@ -3089,8 +3096,8 @@ Zotero.ItemTreeView.prototype.onDragOver = function (event) { */ Zotero.ItemTreeView.prototype.onDrop = function (event) { if (event.dataTransfer.types.contains("application/x-moz-file")) { - Zotero.DragDrop.currentDataTransfer = event.dataTransfer; if (Zotero.isMac) { + Zotero.DragDrop.currentDataTransfer = event.dataTransfer; if (event.metaKey) { if (event.altKey) { event.dataTransfer.dropEffect = 'link'; @@ -3103,19 +3110,6 @@ Zotero.ItemTreeView.prototype.onDrop = function (event) { event.dataTransfer.dropEffect = 'copy'; } } - else { - if (event.shiftKey) { - if (event.ctrlKey) { - event.dataTransfer.dropEffect = "link"; - } - else { - event.dataTransfer.dropEffect = "move"; - } - } - else { - event.dataTransfer.dropEffect = "copy"; - } - } } return false; } From 840790926bddd0ee8a94271ae976d92ae192eb1f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 4 Sep 2013 17:53:11 -0400 Subject: [PATCH 14/15] Fix merging of tags during sync conflict If an item was added to a tag on one computer and another item was added to the tag on a different computer, and then they both synced one of the tags could be removed on the second computer to sync. --- chrome/content/zotero/xpcom/data/tag.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/tag.js b/chrome/content/zotero/xpcom/data/tag.js index 71bb53bd3..0c68710b5 100644 --- a/chrome/content/zotero/xpcom/data/tag.js +++ b/chrome/content/zotero/xpcom/data/tag.js @@ -535,10 +535,10 @@ Zotero.Tag.prototype.diff = function (tag, includeMatches, ignoreOnlyDateModifie // For the moment, just compare linked items and increase numDiffs if any differences var d1 = Zotero.Utilities.arrayDiff( - otherData.linkedItems, thisData.linkedItems + thisData.linkedItems, otherData.linkedItems ); var d2 = Zotero.Utilities.arrayDiff( - thisData.linkedItems, otherData.linkedItems + otherData.linkedItems, thisData.linkedItems ); numDiffs += d1.length + d2.length; From 6c0be3426bc5942ee04a0a27af97ce94d0a10ed5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 5 Sep 2013 16:36:15 -0400 Subject: [PATCH 15/15] Use async storage mtime checking in Fx24 on Windows https://bugzilla.mozilla.org/show_bug.cgi?id=899436 was backported to 24 --- chrome/content/zotero/xpcom/storage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index f393644fc..c49ef8bfb 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -812,11 +812,11 @@ Zotero.Sync.Storage = new function () { var updatedStates = {}; // OS.File didn't work reliably before Firefox 23, and on Windows it returns - // the access time instead of the modification time until Firefox 25 + // the access time instead of the modification time until Firefox 24 // (https://bugzilla.mozilla.org/show_bug.cgi?id=899436), // so use the old code if (Zotero.platformMajorVersion < 23 - || (Zotero.isWin && Zotero.platformMajorVersion < 25)) { + || (Zotero.isWin && Zotero.platformMajorVersion < 24)) { Zotero.debug("Performing synchronous file update check"); for each(var item in items) {