commit 6c7413ed7246265be8cabe2be0a07983aef96206
parent 8b00d1198680edd493eb90a7db975d43af8d502f
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 8 Sep 2010 17:31:30 +0000
Commons:
- Fix collection creation
- Don't display alerts for errors retrieving bucket contents, since IA returns various errors for a while after bucket creation
Diffstat:
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js
@@ -1510,6 +1510,8 @@ var ZoteroPane = new function()
}
this.createCommonsBucket = function () {
+ var self = this;
+
Zotero.Commons.getBuckets(function () {
var prompt = Components.classes["@mozilla.org/network/default-prompt;1"]
.createInstance(Components.interfaces.nsIPrompt);
@@ -1602,7 +1604,7 @@ var ZoteroPane = new function()
// TODO: localize
var progressWin = new Zotero.ProgressWindow();
progressWin.changeHeadline("Creating Zotero Commons Collection");
- var icon = this.collectionsView.getImageSrc(this.collectionsView.selection.currentIndex);
+ var icon = self.collectionsView.getImageSrc(self.collectionsView.selection.currentIndex);
progressWin.addLines(title, icon)
progressWin.show();
diff --git a/chrome/content/zotero/xpcom/commons.js b/chrome/content/zotero/xpcom/commons.js
@@ -232,7 +232,7 @@ Zotero.Commons = new function() {
if (!_userName) {
throw new Exception("Username not set in Zotero.Commons.createBucket()");
}
- name = "zc-test-" + this.userSlug + "-" + name;
+ name = "zc-test-" + this.userNameSlug + "-" + name;
var headers = {
"x-archive-auto-make-bucket":"1",
@@ -515,7 +515,7 @@ Zotero.Commons.Bucket.prototype.getItems = function (callback) {
if (xmlhttp.status != 200) {
Zotero.debug(xmlhttp.status);
Zotero.debug(xmlhttp.responseText);
- alert("Error loading data from the Internet Archive");
+ Zotero.debug("Commons: Error retrieving bucket contents", 2);
self._itemsLoading = false;
return;
}
@@ -527,7 +527,7 @@ Zotero.Commons.Bucket.prototype.getItems = function (callback) {
var xml = new XML(xmlhttp.responseText.replace(/<\?xml.*\?>/, ''));
}
catch (e) {
- alert("Invalid response retrieving file upload parameters");
+ Zotero.debug("Commons: Invalid response retrieving bucket contents", 2);
this._itemsLoading = false;
return;
}
@@ -536,7 +536,7 @@ Zotero.Commons.Bucket.prototype.getItems = function (callback) {
var zipsXML = xml.file.(@source == 'original').(typeof format != 'undefined' && format == 'Zotero ZIP Item');
}
catch (e) {
- alert("Invalid XML response retrieving file upload parameters");
+ Zotero.debug("Commons: Invalid XML retrieving bucket contents", 2);
this._itemsLoading = false;
return;
}