commit fadd486dc1b5b1d6c47d00542e6ba919e073dc10
parent 07b8d5640160e5b18a283feb8198994264935e1a
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 1 Feb 2014 03:16:21 -0500
API change: item.attachmentCharset now returns charset name, not ID
Since apparently half of our own code didn't know that it returned an
ID...
The item.attachmentCharset setter can still take either name or ID.
Diffstat:
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js
@@ -1527,7 +1527,7 @@ Zotero.Item.prototype.save = function(options) {
var parent = this.getSource();
var linkMode = this.attachmentLinkMode;
var mimeType = this.attachmentMIMEType;
- var charsetID = this.attachmentCharset;
+ var charsetID = Zotero.CharacterSets.getID(this.attachmentCharset);
var path = this.attachmentPath;
var syncState = this.attachmentSyncState;
@@ -1944,7 +1944,7 @@ Zotero.Item.prototype.save = function(options) {
let parent = this.getSource();
var linkMode = this.attachmentLinkMode;
var mimeType = this.attachmentMIMEType;
- var charsetID = this.attachmentCharset;
+ var charsetID = Zotero.CharacterSets.getID(this.attachmentCharset);
var path = this.attachmentPath;
var syncState = this.attachmentSyncState;
@@ -3242,7 +3242,7 @@ Zotero.Item.prototype.__defineGetter__('attachmentCharset', function () {
}
if (this._attachmentCharset != undefined) {
- return this._attachmentCharset;
+ return Zotero.CharacterSets.getName(this._attachmentCharset);
}
if (!this.id) {
@@ -3255,7 +3255,7 @@ Zotero.Item.prototype.__defineGetter__('attachmentCharset', function () {
charset = null;
}
this._attachmentCharset = charset;
- return charset;
+ return Zotero.CharacterSets.getName(charset);
});
@@ -4850,8 +4850,7 @@ Zotero.Item.prototype.serialize = function(mode) {
arr.attachment = {};
arr.attachment.linkMode = this.attachmentLinkMode;
arr.attachment.mimeType = this.attachmentMIMEType;
- var charsetID = this.attachmentCharset;
- arr.attachment.charset = Zotero.CharacterSets.getName(charsetID);
+ arr.attachment.charset = this.attachmentCharset;
arr.attachment.path = this.attachmentPath;
}