- fix export when dataMode is undefined (translate architecture should assume plain text)
- don't use "null" as a file extension
This commit is contained in:
parent
0256f5b980
commit
259c286db7
|
@ -65,9 +65,9 @@ Zotero_File_Exporter.prototype.save = function() {
|
|||
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;
|
||||
fp.defaultString = this.name+(io.selectedTranslator.target ? "."+io.selectedTranslator.target : "");
|
||||
fp.defaultExtension = io.selectedTranslator.target;
|
||||
fp.appendFilter(io.selectedTranslator.label, "*."+io.selectedTranslator.target);
|
||||
fp.appendFilter(io.selectedTranslator.label, "*."+(io.selectedTranslator.target ? io.selectedTranslator.target : "*"));
|
||||
}
|
||||
|
||||
var rv = fp.show();
|
||||
|
|
|
@ -84,6 +84,7 @@ Zotero.Translate.SandboxManager.prototype = {
|
|||
|
||||
return object[localKey].apply(object, args);
|
||||
};
|
||||
attachTo[localKey].name = localKey;
|
||||
|
||||
// attach members
|
||||
if(!(object instanceof Components.interfaces.nsISupports)) {
|
||||
|
@ -347,7 +348,7 @@ Zotero.Translate.IO.Write = function(file, mode, charset) {
|
|||
.createInstance(Components.interfaces.nsIFileOutputStream);
|
||||
this._rawStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0); // write, create, truncate
|
||||
this._writtenToStream = false;
|
||||
if(mode) this.reset(mode, charset);
|
||||
if(mode || charset) this.reset(mode, charset);
|
||||
}
|
||||
|
||||
Zotero.Translate.IO.Write.prototype = {
|
||||
|
@ -372,6 +373,8 @@ Zotero.Translate.IO.Write.prototype = {
|
|||
},
|
||||
|
||||
"write":function(data) {
|
||||
if(!this._charset) this.setCharacterSet("UTF-8");
|
||||
|
||||
if(!this._writtenToStream && this._charset.substr(this._charset.length-4) == "xBOM"
|
||||
&& BOMs[this._charset.substr(0, this._charset.length-4).toUpperCase()]) {
|
||||
// If stream has not yet been written to, and a UTF type has been selected, write BOM
|
||||
|
|
Loading…
Reference in New Issue
Block a user