From 0bdbfb12ee0e0b25c9efb43eed170613e342ce94 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 13 Dec 2006 05:56:16 +0000 Subject: [PATCH] closes #432, Add hidden pref to enable clipboard export on Mac. The pref is extensions.zotero.enableMacClipboard closes #312, Optional subdomains should be optional in scraper regular expressions. --- chrome/content/zotero/bibliography.js | 5 ++++- chrome/content/zotero/xpcom/cite.js | 4 +++- defaults/preferences/zotero.js | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js index 44c1c4dd61..0c63890341 100644 --- a/chrome/content/zotero/bibliography.js +++ b/chrome/content/zotero/bibliography.js @@ -65,7 +65,10 @@ var Zotero_File_Interface_Bibliography = new function() { styleMenu.selectedIndex = 0; } - if(Zotero.isMac && document.getElementById("copy-to-clipboard")) { + // disable clipboard on the Mac, because it can't support formatted + // output + if(Zotero.isMac && document.getElementById("copy-to-clipboard") && + !Zotero.Prefs.get("enableMacClipboard")) { document.getElementById("copy-to-clipboard").hidden = "true"; } diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js index a6d56f065a..45ff6b88d5 100644 --- a/chrome/content/zotero/xpcom/cite.js +++ b/chrome/content/zotero/xpcom/cite.js @@ -527,7 +527,9 @@ Zotero.CSL.prototype.createBibliography = function(items, format) { index++; output += index+". "; } - output += string+"\r\n\r\n"; + // attach \n on mac (since both \r and \n count as newlines for + // clipboard purposes) + output += string+(Zotero.isMac ? "\n\n" : "\r\n\r\n"); } } diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js index ee9bd491ea..516da939f4 100644 --- a/defaults/preferences/zotero.js +++ b/defaults/preferences/zotero.js @@ -12,4 +12,5 @@ pref("extensions.zotero.parseEndNoteMIMETypes",true); pref("extensions.zotero.automaticSnapshots",true); pref("extensions.zotero.downloadAssociatedFiles",false); pref("extensions.zotero.reportTranslationFailure",true); +pref("extensions.zotero.enableMacClipboard",false); pref("extensions.zotero.lastCreatorFieldMode",0);