-rw-r--r-- | content/fireflix.js | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/content/fireflix.js b/content/fireflix.js index 7291b68..78e56c2 100644 --- a/content/fireflix.js +++ b/content/fireflix.js | |||
@@ -333,7 +333,20 @@ var fireflix = { | |||
333 | 'upload_filename','upload_title','upload_file_preview', | 333 | 'upload_filename','upload_title','upload_file_preview', |
334 | 'upload_file_props','upload_progress','upload_tags', | 334 | 'upload_file_props','upload_progress','upload_tags', |
335 | 'cmd_uploads_upload', 'upload_failure' | 335 | 'cmd_uploads_upload', 'upload_failure', 'upload_is_public', |
336 | 'upload_is_friends', 'upload_is_family' | ||
336 | ]); | 337 | ]); |
337 | document.getElementById('uploadlist').view = this; | 338 | document.getElementById('uploadlist').view = this; |
339 | this.upload_is_public.addEventListener( | ||
340 | 'CheckboxStateChange', { that: this, | ||
341 | handleEvent: function(ev) { this.that.propsToSel('is_public'); } | ||
342 | }, false ); | ||
343 | this.upload_is_friends.addEventListener( | ||
344 | 'CheckboxStateChange', { that: this, | ||
345 | handleEvent: function(ev) { this.that.propsToSel('is_friends'); } | ||
346 | }, false ); | ||
347 | this.upload_is_family.addEventListener( | ||
348 | 'CheckboxStateChange', { that: this, | ||
349 | handleEvent: function(ev) { this.that.propsToSel('is_family'); } | ||
350 | }, false ); | ||
338 | }, | 351 | }, |
339 | files: new Array(), | 352 | files: new Array(), |
@@ -386,4 +399,5 @@ var fireflix = { | |||
386 | title: t, | 399 | title: t, |
387 | tags: '', | 400 | tags: '', |
401 | is_public: true, is_friend: false, is_family: false, | ||
388 | state: 'pending' | 402 | state: 'pending' |
389 | } ); | 403 | } ); |
@@ -401,6 +415,10 @@ var fireflix = { | |||
401 | var _this = this; | 415 | var _this = this; |
402 | this.fireflix.flickr.upload_file( | 416 | this.fireflix.flickr.upload_file( |
403 | ff.file, { title: ff.title, tags: ff.tags }, | 417 | ff.file, { |
404 | function(x,p) { | 418 | title: ff.title, tags: ff.tags, |
419 | is_public: ff.is_public?'1':'0', | ||
420 | is_friend: ff.is_friend?'1':'0', | ||
421 | is_family: ff.is_family?'1':'0' | ||
422 | }, function(x,p) { | ||
405 | ff.photoid = p; | 423 | ff.photoid = p; |
406 | _this.batch_ids.push(p); | 424 | _this.batch_ids.push(p); |
@@ -492,4 +510,7 @@ var fireflix = { | |||
492 | this.upload_tags.value=''; | 510 | this.upload_tags.value=''; |
493 | this.upload_tags.disabled = true; | 511 | this.upload_tags.disabled = true; |
512 | this.upload_is_public.disabled = true; | ||
513 | this.upload_is_friends.disabled = true; | ||
514 | this.upload_is_family.disabled = true; | ||
494 | /* this.upload_file_props.hidden = true; */ | 515 | /* this.upload_file_props.hidden = true; */ |
495 | }, | 516 | }, |
@@ -505,13 +526,13 @@ var fireflix = { | |||
505 | }else{ | 526 | }else{ |
506 | var inactives = f.state!='pending'; | 527 | var inactives = f.state!='pending'; |
507 | this.upload_filename.value = f.file; | 528 | this.upload_filename.value = f.file; this.upload_filename.disabled = inactives; |
508 | this.upload_filename.disabled = inactives; | 529 | this.upload_title.value = f.title; this.upload_title.disabled = inactives; |
509 | this.upload_title.value = f.title; | ||
510 | this.upload_title.disabled = inactives; | ||
511 | this.upload_file_preview.src = 'file:///'+f.file; | 530 | this.upload_file_preview.src = 'file:///'+f.file; |
512 | this.upload_tags.value = f.tags; | 531 | this.upload_tags.value = f.tags; this.upload_tags.disabled = inactives; |
513 | this.upload_tags.disabled = inactives; | 532 | this.upload_is_public.checked = f.is_public; this.upload_is_public.disabled = inactives; |
533 | this.upload_is_friends.checked = f.is_friend; this.upload_is_friends.disabled = inactives; | ||
534 | this.upload_is_family.checked = f.is_family; this.upload_is_family.disabled = inactives; | ||
514 | if(f.state=='failed') { | 535 | if(f.state=='failed') { |
515 | this.upload_failure.textContent=f.flickr_errcode+': '+f.flickr_errmsg; | 536 | this.upload_failure.textContent=((f.flickr_errcode<0)?'':f.flickr_errcode+': ')+f.flickr_errmsg; |
516 | this.upload_failure.hidden = false; | 537 | this.upload_failure.hidden = false; |
517 | }else{ | 538 | }else{ |
@@ -560,10 +581,10 @@ var fireflix = { | |||
560 | for(var ff in this.files) { | 581 | for(var ff in this.files) { |
561 | if(this.selection.isSelected(ff) && this.files[ff].state=='pending') { | 582 | if(this.selection.isSelected(ff) && this.files[ff].state=='pending') { |
562 | if(prop=='filename') | 583 | if(prop=='filename') this.files[ff].file = this.upload_filename.value; |
563 | this.files[ff].file = this.upload_filename.value; | 584 | if(prop=='title') this.files[ff].title = this.upload_title.value; |
564 | if(prop=='title') | 585 | if(prop=='tags') this.files[ff].tags = this.upload_tags.value; |
565 | this.files[ff].title = this.upload_title.value; | 586 | if(prop=='is_public') this.files[ff].is_public = this.upload_is_public.checked; |
566 | if(prop=='tags') | 587 | if(prop=='is_friends') this.files[ff].is_friend = this.upload_is_friends.checked; |
567 | this.files[ff].tags = this.upload_tags.value; | 588 | if(prop=='is_family') this.files[ff].is_family = this.upload_is_family.checked; |
568 | this.tree.invalidateRow(ff); | 589 | this.tree.invalidateRow(ff); |
569 | } | 590 | } |