- Fix collection creation
- Don't display alerts for errors retrieving bucket contents, since IA returns various errors for a while after bucket creation
This commit is contained in:
Dan Stillman 2010-09-08 17:31:30 +00:00
parent 8b00d11986
commit 6c7413ed72
2 changed files with 7 additions and 5 deletions

View File

@ -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();

View File

@ -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;
}