- Include a line between notes when copying multiple notes

- Don't display "JavaScript Application" in alert when pressing Quick Copy shortcut key with no regular items selected
This commit is contained in:
Dan Stillman 2009-12-26 10:38:45 +00:00
parent a5818604fb
commit 6ca230379d
2 changed files with 30 additions and 5 deletions

View file

@ -1428,16 +1428,25 @@ var ZoteroPane = new function()
return;
}
// Make sure at least one item is not a standalone note or attachment
var haveRegularItem = false;
// Make sure at least one item is a regular item
//
// DEBUG: We could copy notes via keyboard shortcut if we altered
// Z_F_I.copyItemsToClipboard() to use Z.QuickCopy.getContentFromItems(),
// but 1) we'd need to override that function's drag limit and 2) when I
// tried it the OS X clipboard seemed to be getting text vs. HTML wrong,
// automatically converting text/html to plaintext rather than using
// text/unicode. (That may be fixable, however.)
var canCopy = false;
for each(var item in items) {
if (item.isRegularItem()) {
haveRegularItem = true;
canCopy = true;
break;
}
}
if (!haveRegularItem) {
window.alert(Zotero.getString("fileInterface.noReferencesError"));
if (!canCopy) {
var pr = Components.classes["@mozilla.org/network/default-prompt;1"]
.getService(Components.interfaces.nsIPrompt);
pr.alert("", Zotero.getString("fileInterface.noReferencesError"));
return;
}

View file

@ -198,6 +198,14 @@ Zotero.QuickCopy = new function() {
// Text-only adjustments
//
// Add placeholders for newlines between notes
if (notes.length > 1) {
var divs = textXML.div;
for (var i=0, len=divs.length(); i<len-1; i++) {
divs[i].p += <p>--------------------------------------------------</p>;
}
}
if (Zotero.Prefs.get('export.quickCopy.quoteBlockquotes.plainText')) {
// Add quotes around blockquote paragraphs
var nodes = textXML..blockquote;
@ -294,6 +302,13 @@ Zotero.QuickCopy = new function() {
}
}
if (notes.length > 1) {
var divs = htmlXML.div;
for (var i=0, len=divs.length(); i<len-1; i++) {
divs[i].p += <p>----------------------------------------------------------------------</p>;
}
}
// Add quotes around blockquote paragraphs
if (Zotero.Prefs.get('export.quickCopy.quoteBlockquotes.richText')) {
var nodes = htmlXML..blockquote;
@ -370,6 +385,7 @@ Zotero.QuickCopy = new function() {
html: csl.formatBibliography(itemSet, "HTML")
};
}
return bibliography;
}