Commons:
- 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:
parent
8b00d11986
commit
6c7413ed72
|
@ -1510,6 +1510,8 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.createCommonsBucket = function () {
|
this.createCommonsBucket = function () {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
Zotero.Commons.getBuckets(function () {
|
Zotero.Commons.getBuckets(function () {
|
||||||
var prompt = Components.classes["@mozilla.org/network/default-prompt;1"]
|
var prompt = Components.classes["@mozilla.org/network/default-prompt;1"]
|
||||||
.createInstance(Components.interfaces.nsIPrompt);
|
.createInstance(Components.interfaces.nsIPrompt);
|
||||||
|
@ -1602,7 +1604,7 @@ var ZoteroPane = new function()
|
||||||
// TODO: localize
|
// TODO: localize
|
||||||
var progressWin = new Zotero.ProgressWindow();
|
var progressWin = new Zotero.ProgressWindow();
|
||||||
progressWin.changeHeadline("Creating Zotero Commons Collection");
|
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.addLines(title, icon)
|
||||||
progressWin.show();
|
progressWin.show();
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ Zotero.Commons = new function() {
|
||||||
if (!_userName) {
|
if (!_userName) {
|
||||||
throw new Exception("Username not set in Zotero.Commons.createBucket()");
|
throw new Exception("Username not set in Zotero.Commons.createBucket()");
|
||||||
}
|
}
|
||||||
name = "zc-test-" + this.userSlug + "-" + name;
|
name = "zc-test-" + this.userNameSlug + "-" + name;
|
||||||
|
|
||||||
var headers = {
|
var headers = {
|
||||||
"x-archive-auto-make-bucket":"1",
|
"x-archive-auto-make-bucket":"1",
|
||||||
|
@ -515,7 +515,7 @@ Zotero.Commons.Bucket.prototype.getItems = function (callback) {
|
||||||
if (xmlhttp.status != 200) {
|
if (xmlhttp.status != 200) {
|
||||||
Zotero.debug(xmlhttp.status);
|
Zotero.debug(xmlhttp.status);
|
||||||
Zotero.debug(xmlhttp.responseText);
|
Zotero.debug(xmlhttp.responseText);
|
||||||
alert("Error loading data from the Internet Archive");
|
Zotero.debug("Commons: Error retrieving bucket contents", 2);
|
||||||
self._itemsLoading = false;
|
self._itemsLoading = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -527,7 +527,7 @@ Zotero.Commons.Bucket.prototype.getItems = function (callback) {
|
||||||
var xml = new XML(xmlhttp.responseText.replace(/<\?xml.*\?>/, ''));
|
var xml = new XML(xmlhttp.responseText.replace(/<\?xml.*\?>/, ''));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
alert("Invalid response retrieving file upload parameters");
|
Zotero.debug("Commons: Invalid response retrieving bucket contents", 2);
|
||||||
this._itemsLoading = false;
|
this._itemsLoading = false;
|
||||||
return;
|
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');
|
var zipsXML = xml.file.(@source == 'original').(typeof format != 'undefined' && format == 'Zotero ZIP Item');
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
alert("Invalid XML response retrieving file upload parameters");
|
Zotero.debug("Commons: Invalid XML retrieving bucket contents", 2);
|
||||||
this._itemsLoading = false;
|
this._itemsLoading = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user