summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--content/fireflix.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/content/fireflix.js b/content/fireflix.js
index 283e930..d70ab4d 100644
--- a/content/fireflix.js
+++ b/content/fireflix.js
@@ -424,73 +424,72 @@ var fireflix = {
return;
}
}
this.on_finish_upload();
},
upload_to: function(_this) { _this.upload_worker(); },
on_file_upload: function(f) {
this.cmd_uploads_upload.setAttribute('disabled','true');
for(var fi in this.files) {
if(this.files[fi].file==f.file) {
this.tree.ensureRowIsVisible(fi);
this.selection.rangedSelect(fi,fi,false);
this.selection.currentIndex = fi;
this.selToProps();
break;
}
}
},
on_finish_upload: function() {
if(this.batch_ids.length) {
var psn = prompt(this.fireflix.loc_strings.getString('postUploadPhotoset'));
if(psn!=null) {
var pids = this.batch_ids.join(',');
var ppid = this.batch_ids[0];
- var _this = this;
- this.fireflix.flickr.api_call(
+ var that = this;
+ this.fireflix.flickr.api_call_json(
{
method: 'flickr.photosets.create',
auth_token: 'default',
title: psn,
primary_photo_id: ppid
- }, function(x) {
- var npid =
- x.responseXML.getElementsByTagName('photoset').item(0).getAttribute('id');
- _this.fireflix.flickr.api_call(
+ }, function(x,j) {
+ var npid = j.photoset.id;
+ that.fireflix.flickr.api_call_json(
{
method: 'flickr.photosets.editPhotos',
auth_token: 'default',
photoset_id: npid,
primary_photo_id: ppid,
photo_ids: pids
- }, function(x) {
- _this.fireflix.refresh_sets();
+ }, function(x,j) {
+ that.fireflix.refresh_sets();
}, function(x,s,c,m) {
- _this.fireflix.flickr_failure(x,s,c,m);
+ that.fireflix.flickr_failure(x,s,c,m);
}
);
}, function(x,s,c,m) {
- _this.fireflix.flickr_failure(x,s,c,m);
+ that.fireflix.flickr_failure(x,s,c,m);
}
);
}
}
this.selection.clearSelection();
this.cmd_uploads_upload.setAttribute('disabled','false');
this.upload_progress.setAttribute('hidden','true');
},
clear_list: function() {
this.tree.beginUpdateBatch();
this.rowCount = 0;
this.files = new Array();
this.tree.endUpdateBatch();
this.selToProps();
},
selectionChanged: function() {
this.selToProps();
},
disableProps: function() {
this.upload_filename.value='';
this.upload_filename.disabled = true;
this.upload_title.value='';
this.upload_title.disabled = true;