diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index da16443341..3b71860e4a 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -443,6 +443,13 @@ label.setAttribute("isButton", true); label.setAttribute("onclick", "ZoteroPane_Local.loadURI('" + doi + "', event)"); label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip')); + valueElement.setAttribute('contextmenu', 'zotero-doi-menu'); + + var openURLMenuItem = document.getElementById('zotero-doi-menu-view-online'); + openURLMenuItem.setAttribute("oncommand", "ZoteroPane_Local.loadURI('" + doi + "', event)"); + + var copyMenuItem = document.getElementById('zotero-doi-menu-copy'); + copyMenuItem.setAttribute("oncommand", "Zotero.Utilities.Internal.copyTextToClipboard('" + doi + "')"); } } else if (fieldName == 'abstractNote') { @@ -2361,6 +2368,10 @@ + + + + diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index 3548d93ad7..0b900f4279 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -41,15 +41,45 @@ var Zotero_File_Exporter = function() { * Performs the actual export operation **/ Zotero_File_Exporter.prototype.save = function() { - var translation = new Zotero.Translate.Export(), - me = this; - translation.getTranslators().then(function(translators) { - // present options dialog - var io = {translators:translators} - window.openDialog("chrome://zotero/content/exportOptions.xul", - "_blank", "chrome,modal,centerscreen,resizable=no", io); - if(!io.selectedTranslator) { - return false; + var translation = new Zotero.Translate.Export(); + var translators = translation.getTranslators(); + + // present options dialog + var io = {translators:translators} + window.openDialog("chrome://zotero/content/exportOptions.xul", + "_blank", "chrome,modal,centerscreen,resizable=no", io); + if(!io.selectedTranslator) { + return false; + } + + const nsIFilePicker = Components.interfaces.nsIFilePicker; + var fp = Components.classes["@mozilla.org/filepicker;1"] + .createInstance(nsIFilePicker); + fp.init(window, Zotero.getString("fileInterface.export"), nsIFilePicker.modeSave); + + // set file name and extension + if(io.displayOptions.exportFileData) { + // if the result will be a folder, don't append any extension or use + // filters + fp.defaultString = this.name; + fp.appendFilters(Components.interfaces.nsIFilePicker.filterAll); + } else { + // if the result will be a file, append an extension and use filters + fp.defaultString = this.name+(io.selectedTranslator.target ? "."+io.selectedTranslator.target : ""); + fp.defaultExtension = io.selectedTranslator.target; + fp.appendFilter(io.selectedTranslator.label, "*."+(io.selectedTranslator.target ? io.selectedTranslator.target : "*")); + } + + var rv = fp.show(); + if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) { + if(this.collection) { + translation.setCollection(this.collection); + } else if(this.items) { + translation.setItems(this.items); + } else if(this.libraryID === undefined) { + throw new Error('No export configured'); + } else { + translation.setLibraryID(this.libraryID); } const nsIFilePicker = Components.interfaces.nsIFilePicker; @@ -130,7 +160,11 @@ var Zotero_File_Interface = new function() { */ function exportFile() { var exporter = new Zotero_File_Exporter(); - exporter.name = Zotero.getString("pane.collections.library"); + exporter.libraryID = ZoteroPane_Local.getSelectedLibraryID(); + if (exporter.libraryID === false) { + throw new Error('No library selected'); + } + exporter.name = Zotero.Libraries.getName(exporter.libraryID); exporter.save(); } diff --git a/chrome/content/zotero/integration/addCitationDialog.js b/chrome/content/zotero/integration/addCitationDialog.js index 730a51d172..55bc8e3229 100644 --- a/chrome/content/zotero/integration/addCitationDialog.js +++ b/chrome/content/zotero/integration/addCitationDialog.js @@ -115,7 +115,7 @@ var Zotero_Citation_Dialog = new function () { var i = 0; for(var value in locators) { var locator = locators[value]; - var locatorLabel = locator[0].toUpperCase()+locator.substr(1); + var locatorLabel = Zotero.getString('citation.locator.'+locator.replace(/\s/g,'')); // add to list of labels var child = document.createElement("menuitem"); child.setAttribute("value", value); diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index 401d32b2ed..a455f50ef9 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -79,8 +79,7 @@ var Zotero_QuickFormat = new function () { var menu = document.getElementById("locator-label"); var labelList = document.getElementById("locator-label-popup"); for each(var locator in locators) { - // TODO localize - var locatorLabel = locator[0].toUpperCase()+locator.substr(1); + var locatorLabel = Zotero.getString('citation.locator.'+locator.replace(/\s/g,'')); // add to list of labels var child = document.createElement("menuitem"); diff --git a/chrome/content/zotero/preferences/preferences_firefox.xul b/chrome/content/zotero/preferences/preferences_firefox.xul index 07dc62428a..bfb1e50e07 100644 --- a/chrome/content/zotero/preferences/preferences_firefox.xul +++ b/chrome/content/zotero/preferences/preferences_firefox.xul @@ -23,7 +23,10 @@ ***** END LICENSE BLOCK ***** --> - + %preferencesDTD; + %zoteroDTD; +]> @@ -64,7 +67,7 @@ @@ -73,7 +76,9 @@ - + +