closes #574, create bibliography chokes on forum post

fixes copy to clipboard (from dialog, not quick copy) feature
This commit is contained in:
Simon Kornblith 2007-03-22 17:34:19 +00:00
parent a9c2536515
commit 632e98691d
2 changed files with 20 additions and 13 deletions

View File

@ -370,8 +370,8 @@ var Zotero_File_Interface = new function() {
// generate bibliography
try {
if (io.output == 'clipboard') {
this.copyItemsToClipboard(items, io.style);
if(io.output == 'copy-to-clipboard') {
copyItemsToClipboard(items, io.style);
return;
}
else {

View File

@ -1102,9 +1102,6 @@ Zotero.CSL.prototype._getCitation = function(item, position, locatorType, locato
}
}
if(!type) {
return false;
}
Zotero.debug("CSL: using CSL type "+typeName);
// remove previous ignore entries from list
@ -1730,12 +1727,13 @@ Zotero.CSL.Global.fallbackTypeMappings = {
map:"article",
blogPost:"article",
instantMessage:"article",
audioRecording:"book",
forumPost:"article",
audioRecording:"article",
presentation:"article",
videoRecording:"book",
tvBroadcast:"book",
radioBroadcast:"book",
podcast:"book",
videoRecording:"article",
tvBroadcast:"article",
radioBroadcast:"article",
podcast:"article",
computerProgram:"book"
};
@ -1744,9 +1742,18 @@ Zotero.CSL.prototype._getTypeFromItem = function(item) {
// get type
Zotero.debug("CSL: parsing item of Scholar type "+scholarType);
if(Zotero.CSL.Global.optionalTypeMappings[scholarType]) {
return [Zotero.CSL.Global.optionalTypeMappings[scholarType], Zotero.CSL.Global.fallbackTypeMappings[scholarType]];
} else if(Zotero.CSL.Global.fallbackTypeMappings[scholarType]) {
if(Zotero.CSL.Global.optionalTypeMappings[scholarType]) { // if there is an optional type mapping
var array = [Zotero.CSL.Global.optionalTypeMappings[scholarType]];
// check if there is a fallback type mapping; otherwise, use article
if(Zotero.CSL.Global.fallbackTypeMappings[scholarType]) {
array.push(Zotero.CSL.Global.fallbackTypeMappings[scholarType]);
} else {
array.push("article");
}
return array;
} else if(Zotero.CSL.Global.fallbackTypeMappings[scholarType]) { // if there is a fallback type mapping
return [Zotero.CSL.Global.fallbackTypeMappings[scholarType]];
} else { // use article as backup type mapping
return ["article"];