summaryrefslogtreecommitdiffabout
path: root/content
Unidiff
Diffstat (limited to 'content') (more/less context) (show whitespace changes)
-rw-r--r--content/fireflix.js2
1 files changed, 0 insertions, 2 deletions
diff --git a/content/fireflix.js b/content/fireflix.js
index a4f13b6..0f51397 100644
--- a/content/fireflix.js
+++ b/content/fireflix.js
@@ -369,57 +369,55 @@ var fireflix = {
369 var ld = t.lastIndexOf('.'); 369 var ld = t.lastIndexOf('.');
370 if(ld>0) t = t.substr(0,ld); 370 if(ld>0) t = t.substr(0,ld);
371 this.files.push( { 371 this.files.push( {
372 file: f, 372 file: f,
373 title: t, 373 title: t,
374 tags: '', 374 tags: '',
375 state: 'pending' 375 state: 'pending'
376 } ); 376 } );
377 this.rowCount = this.files.length; 377 this.rowCount = this.files.length;
378 this.tree.rowCountChanged(this.rowCount-1,1); 378 this.tree.rowCountChanged(this.rowCount-1,1);
379 }, 379 },
380 380
381 upload_worker: function() { 381 upload_worker: function() {
382 for(var f in this.files) { 382 for(var f in this.files) {
383 if(this.files[f].state=='pending') { 383 if(this.files[f].state=='pending') {
384 var ff = this.files[f]; 384 var ff = this.files[f];
385 dump('upload '+ff.file+'\n');
386 this.on_file_upload(ff); 385 this.on_file_upload(ff);
387 ff.state='uploading'; 386 ff.state='uploading';
388 this.tree.invalidate(); 387 this.tree.invalidate();
389 var _this = this; 388 var _this = this;
390 this.fireflix.flickr.upload_file( 389 this.fireflix.flickr.upload_file(
391 ff.file, { title: ff.title, tags: ff.tags }, 390 ff.file, { title: ff.title, tags: ff.tags },
392 function(x,p) { 391 function(x,p) {
393 ff.photoid = p; 392 ff.photoid = p;
394 _this.batch_ids.push(p); 393 _this.batch_ids.push(p);
395 ff.state='completed'; 394 ff.state='completed';
396 _this.tree.invalidate(); 395 _this.tree.invalidate();
397 window.setTimeout(_this.upload_to,0,_this); 396 window.setTimeout(_this.upload_to,0,_this);
398 }, function(x,s,c,m) { 397 }, function(x,s,c,m) {
399 ff.state='failed'; 398 ff.state='failed';
400 ff.flickr_errcode = c; 399 ff.flickr_errcode = c;
401 ff.flickr_errmsg = m; 400 ff.flickr_errmsg = m;
402 _this.tree.invalidate(); 401 _this.tree.invalidate();
403 window.setTimeout(_this.upload_to,0,_this); 402 window.setTimeout(_this.upload_to,0,_this);
404 } 403 }
405 ); 404 );
406 return; 405 return;
407 } 406 }
408 } 407 }
409 dump('uploading done\n');
410 this.on_finish_upload(); 408 this.on_finish_upload();
411 }, 409 },
412 upload_to: function(_this) { _this.upload_worker(); }, 410 upload_to: function(_this) { _this.upload_worker(); },
413 on_file_upload: function(f) { 411 on_file_upload: function(f) {
414 this.cmd_uploads_upload.setAttribute('disabled','true'); 412 this.cmd_uploads_upload.setAttribute('disabled','true');
415 for(var fi in this.files) { 413 for(var fi in this.files) {
416 if(this.files[fi].file==f.file) { 414 if(this.files[fi].file==f.file) {
417 this.tree.ensureRowIsVisible(fi); 415 this.tree.ensureRowIsVisible(fi);
418 this.selection.rangedSelect(fi,fi,false); 416 this.selection.rangedSelect(fi,fi,false);
419 this.selection.currentIndex = fi; 417 this.selection.currentIndex = fi;
420 this.selToProps(); 418 this.selToProps();
421 break; 419 break;
422 } 420 }
423 } 421 }
424 }, 422 },
425 on_finish_upload: function() { 423 on_finish_upload: function() {