summaryrefslogtreecommitdiffabout
path: root/content/fireflix.js
Unidiff
Diffstat (limited to 'content/fireflix.js') (more/less context) (show whitespace changes)
-rw-r--r--content/fireflix.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/content/fireflix.js b/content/fireflix.js
index 78e56c2..225e21c 100644
--- a/content/fireflix.js
+++ b/content/fireflix.js
@@ -619,24 +619,35 @@ var fireflix = {
619 var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(ifp); 619 var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(ifp);
620 fp.init(window, "Select a File", ifp.modeOpenMultiple); 620 fp.init(window, "Select a File", ifp.modeOpenMultiple);
621 fp.appendFilters(ifp.filterImages); 621 fp.appendFilters(ifp.filterImages);
622 var rv = fp.show(); 622 var rv = fp.show();
623 if(rv==ifp.returnOK) { 623 if(rv==ifp.returnOK) {
624 var ff = fp.files; 624 var ff = fp.files;
625 while(ff.hasMoreElements()) { 625 while(ff.hasMoreElements()) {
626 var f = ff.getNext(); 626 var f = ff.getNext();
627 f.QueryInterface(Components.interfaces.nsIFile); 627 f.QueryInterface(Components.interfaces.nsIFile);
628 this.add(f.path); 628 this.add(f.path);
629 } 629 }
630 } 630 }
631 },
632 on_cmd_open: function(ev) {
633 if(this.selection.currentIndex<0) return;
634 var f = this.files[this.selection.currentIndex];
635 if(f.photoid) {
636 this.fireflix.openTab(
637 this.fireflix.flickr.make_uploader_edit_url(f.photoid)
638 );
639 }else{
640 this.fireflix.openTab( 'file://'+f.file);
641 }
631 } 642 }
632 }, 643 },
633 644
634 on_set_props: function() { 645 on_set_props: function() {
635 var pset = this.photosets.sets[this.photosets.selection.currentIndex]; 646 var pset = this.photosets.sets[this.photosets.selection.currentIndex];
636 window.openDialog( 647 window.openDialog(
637 "chrome://fireflix/content/photoset-props.xul", 648 "chrome://fireflix/content/photoset-props.xul",
638 null, "dependent,modal,dialog,chrome", this, 649 null, "dependent,modal,dialog,chrome", this,
639 pset ); 650 pset );
640 if(pset.dirty) { 651 if(pset.dirty) {
641 var _this = this; 652 var _this = this;
642 this.flickr.api_call( 653 this.flickr.api_call(
@@ -904,29 +915,27 @@ var fireflix = {
904 }, function(x,s,c,m) { 915 }, function(x,s,c,m) {
905 _this.fireflix.flickr_failure(x,s,c,m); 916 _this.fireflix.flickr_failure(x,s,c,m);
906 } 917 }
907 ); 918 );
908 this.searchresult_props.hidden = false; 919 this.searchresult_props.hidden = false;
909 }else{ 920 }else{
910 this.render_description_frame(p.description); 921 this.render_description_frame(p.description);
911 } 922 }
912 } 923 }
913 } 924 }
914 }, 925 },
915 on_cmd_open: function(ev) { 926 on_cmd_open: function(ev) {
916 if(this.selection.currentIndex<0) 927 if(this.selection.currentIndex<0) return;
917 return;
918 var p = this.photos[this.selection.currentIndex]; 928 var p = this.photos[this.selection.currentIndex];
919 if(!p.id) 929 if(!p.id) return;
920 return;
921 this.fireflix.openTab(this.fireflix.flickr.make_photo_url(p,'p')); 930 this.fireflix.openTab(this.fireflix.flickr.make_photo_url(p,'p'));
922 } 931 }
923 }, 932 },
924 933
925 photo_html: function(p,i,l) { 934 photo_html: function(p,i,l) {
926 // TODO: add alt/title when possible 935 // TODO: add alt/title when possible
927 var rv = 936 var rv =
928 '<a href="'+this.flickr.make_photo_url(p,l)+'">' + 937 '<a href="'+this.flickr.make_photo_url(p,l)+'">' +
929 '<img src="'+this.flickr.make_photo_url(p,i)+'" />'+ 938 '<img src="'+this.flickr.make_photo_url(p,i)+'" />'+
930 '</a>'; 939 '</a>';
931 return rv; 940 return rv;
932 }, 941 },