diff --git a/chrome/content/zotero-platform/win/overlay.css b/chrome/content/zotero-platform/win/overlay.css index 1afdc6e0b..464090cbc 100644 --- a/chrome/content/zotero-platform/win/overlay.css +++ b/chrome/content/zotero-platform/win/overlay.css @@ -67,6 +67,13 @@ -moz-border-left-colors: none; } +/* Undo tree row spacing change in Fx25 on Windows */ +#zotero-collections-tree treechildren::-moz-tree-row, +#zotero-items-tree treechildren::-moz-tree-row, +#zotero-prefs treechildren::-moz-tree-row { + height: 1.6em; +} + #zotero-collections-tree { border-width: 0 1px 1px 0; } diff --git a/chrome/content/zotero/advancedSearch.xul b/chrome/content/zotero/advancedSearch.xul index fe7575716..57b16540a 100644 --- a/chrome/content/zotero/advancedSearch.xul +++ b/chrome/content/zotero/advancedSearch.xul @@ -2,6 +2,7 @@ + diff --git a/chrome/content/zotero/bindings/attachmentbox.xml b/chrome/content/zotero/bindings/attachmentbox.xml index 0630c6fd8..7e53b2517 100644 --- a/chrome/content/zotero/bindings/attachmentbox.xml +++ b/chrome/content/zotero/bindings/attachmentbox.xml @@ -388,22 +388,30 @@ // Rename associated file if (checkState.value) { - var renamed = item.renameAttachmentFile(newTitle.value); + var newFilename = newTitle.value.trim(); + if (newFilename.search(/\.\w{1,10}$/) == -1) { + // User did not specify extension. Use current + var oldExt = item.getFilename().match(/\.\w{1,10}$/); + if (oldExt) newFilename += oldExt[0]; + } + var renamed = item.renameAttachmentFile(newFilename); if (renamed == -1) { var confirmed = nsIPS.confirm( window, '', - newTitle.value + ' exists. Overwrite existing file?' + newFilename + ' exists. Overwrite existing file?' ); - if (confirmed) { - item.renameAttachmentFile(newTitle.value, true); - break; + if (!confirmed) { + // If they said not to overwrite existing file, + // start again + continue; } - // If they said not to overwrite existing file, - // start again - continue; + + // Force overwrite, but make sure we check that this doesn't fail + renamed = item.renameAttachmentFile(newFilename, true); } - else if (renamed == -2) { + + if (renamed == -2) { nsIPS.alert( window, Zotero.getString('general.error'), diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 55bbb0e7b..f82050e1f 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -1295,12 +1295,17 @@ var firstSpace = valueText.indexOf(" "); - // To support newlines in 'extra' fields, we use multiple + // To support newlines in Abstract and Extra fields, use multiple // elements inside a vbox if (useVbox) { var lines = valueText.split("\n"); for (var i = 0; i < lines.length; i++) { var descriptionNode = document.createElement("description"); + // Add non-breaking space to empty lines to prevent them from collapsing. + // (Just using CSS min-height results in overflow in some cases.) + if (lines[i] === "") { + lines[i] = "\u00a0"; + } var linetext = document.createTextNode(lines[i]); descriptionNode.appendChild(linetext); valueElement.appendChild(descriptionNode); diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index 31c9c0282..2ac405635 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -81,7 +81,9 @@ Zotero_File_Exporter.prototype.save = function() { translation.setLocation(fp.file); translation.setTranslator(io.selectedTranslator); translation.setDisplayOptions(io.displayOptions); - translation.setHandler("itemDone", Zotero_File_Interface.updateProgress); + translation.setHandler("itemDone", function () { + Zotero_File_Interface.updateProgress(translation, false); + }); translation.setHandler("done", me._exportDone); Zotero.UnresponsiveScriptIndicator.disable(); Zotero_File_Interface.Progress.show( @@ -309,7 +311,9 @@ var Zotero_File_Interface = new function() { }); } - translation.setHandler("itemDone", Zotero_File_Interface.updateProgress); + translation.setHandler("itemDone", function () { + Zotero_File_Interface.updateProgress(translation, true); + }); /* * closes items imported indicator @@ -325,12 +329,10 @@ var Zotero_File_Interface = new function() { Zotero_File_Interface.Progress.close(); Zotero.UnresponsiveScriptIndicator.enable(); - if (worked) { - if(importCollection) { - Zotero.Notifier.trigger('refresh', 'collection', importCollection.id); - } - } else { - if(importCollection) importCollection.erase(); + if(importCollection) { + Zotero.Notifier.trigger('refresh', 'collection', importCollection.id); + } + if (!worked) { window.alert(Zotero.getString("fileInterface.importError")); } }); @@ -628,33 +630,23 @@ var Zotero_File_Interface = new function() { /** * Updates progress indicators based on current progress of translation */ - this.updateProgress = function(translate) { + this.updateProgress = function(translate, closeTransaction) { Zotero.updateZoteroPaneProgressMeter(translate.getProgress()); var now = Date.now(); - // Don't repaint more than 10 times per second unless forced. - if(window.zoteroLastRepaint && (now - window.zoteroLastRepaint) < 100) return + // Don't repaint more than once per second unless forced. + if(window.zoteroLastRepaint && (now - window.zoteroLastRepaint) < 1000) return - // Start a nested event queue - // TODO Remove when Fx > 14 - var eventQueuePushed = "pushEventQueue" in Zotero.mainThread; - if(eventQueuePushed) { - Zotero.mainThread.pushEventQueue(null); - } + // Add the redraw event onto event queue + window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) + .getInterface(Components.interfaces.nsIDOMWindowUtils) + .redraw(); - try { - // Add the redraw event onto event queue - window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) - .getInterface(Components.interfaces.nsIDOMWindowUtils) - .redraw(); - - // Process redraw event - Zotero.wait(0); - } finally { - // Close nested event queue - if(eventQueuePushed) Zotero.mainThread.popEventQueue(); - } + // Process redraw event + if(closeTransaction) Zotero.DB.commitTransaction(); + Zotero.wait(); + if(closeTransaction) Zotero.DB.beginTransaction(); window.zoteroLastRepaint = now; } diff --git a/chrome/content/zotero/locale/csl b/chrome/content/zotero/locale/csl index 9ffb5dd60..c5400c59d 160000 --- a/chrome/content/zotero/locale/csl +++ b/chrome/content/zotero/locale/csl @@ -1 +1 @@ -Subproject commit 9ffb5dd60475e6af46f404b4cf95f7890f75fb9b +Subproject commit c5400c59d9453887252f948a8273632de7963e08 diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index e71f4daea..b88eee208 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -133,14 +133,19 @@ var ZoteroOverlay = new function() // Hide browser chrome on Zotero tab XULBrowserWindow.inContentWhitelist.push("chrome://zotero/content/tab.xul"); - // Close pane if connector is enabled - ZoteroPane_Local.addReloadListener(function() { - if(Zotero.isConnector) { + // Close pane before reload + ZoteroPane_Local.addBeforeReloadListener(function(newMode) { + if(newMode == "connector") { // save current state _stateBeforeReload = !zoteroPane.hidden && !zoteroPane.collapsed; // ensure pane is closed if(!zoteroPane.collapsed) ZoteroOverlay.toggleDisplay(false, true); - } else { + } + }); + + // Close pane if connector is enabled + ZoteroPane_Local.addReloadListener(function() { + if(!Zotero.isConnector) { // reopen pane if it was open before ZoteroOverlay.toggleDisplay(_stateBeforeReload, true); } diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index c2744ec87..0e04413c7 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -43,10 +43,6 @@ var Zotero_Preferences = { if(io.pane) { var pane = document.getElementById(io.pane); document.getElementById('zotero-prefs').showPane(pane); - // Quick hack to support install prompt from PDF recognize option - if (io.action && io.action == 'pdftools-install') { - this.Search.checkPDFToolsDownloadVersion(); - } } } else if(document.location.hash == "#cite") { document.getElementById('zotero-prefs').showPane(document.getElementById("zotero-prefpane-cite")); diff --git a/chrome/content/zotero/preferences/preferences.xul b/chrome/content/zotero/preferences/preferences.xul index 74d6e59e9..964aa93ae 100644 --- a/chrome/content/zotero/preferences/preferences.xul +++ b/chrome/content/zotero/preferences/preferences.xul @@ -29,6 +29,7 @@ +