-rw-r--r-- | content/fireflix-panel.xul | 3 | ||||
-rw-r--r-- | content/fireflix.js | 17 | ||||
-rw-r--r-- | content/flickr.js | 5 |
3 files changed, 20 insertions, 5 deletions
diff --git a/content/fireflix-panel.xul b/content/fireflix-panel.xul index 405804c..8aec0e4 100644 --- a/content/fireflix-panel.xul +++ b/content/fireflix-panel.xul @@ -245,5 +245,6 @@ <tree id="uploadlist" rows="2" flex="1" onselect="fireflix.uploads.selectionChanged()" - context="uploads_menu"> + context="uploads_menu" ondblclick="fireflix.uploads.on_cmd_open(event)" + onkeypress="if(event.keyCode==event.DOM_VK_RETURN) fireflix.uploads.on_cmd_open(event)" > <treecols> <treecol id="up_file" label="&panel.uploadlist.file.label;" flex="4" crop="start" align="start"/> diff --git a/content/fireflix.js b/content/fireflix.js index 78e56c2..225e21c 100644 --- a/content/fireflix.js +++ b/content/fireflix.js @@ -629,4 +629,15 @@ var fireflix = { } } + }, + on_cmd_open: function(ev) { + if(this.selection.currentIndex<0) return; + var f = this.files[this.selection.currentIndex]; + if(f.photoid) { + this.fireflix.openTab( + this.fireflix.flickr.make_uploader_edit_url(f.photoid) + ); + }else{ + this.fireflix.openTab( 'file://'+f.file); + } } }, @@ -914,9 +925,7 @@ var fireflix = { }, on_cmd_open: function(ev) { - if(this.selection.currentIndex<0) - return; + if(this.selection.currentIndex<0) return; var p = this.photos[this.selection.currentIndex]; - if(!p.id) - return; + if(!p.id) return; this.fireflix.openTab(this.fireflix.flickr.make_photo_url(p,'p')); } diff --git a/content/flickr.js b/content/flickr.js index b8360c1..e09d5f0 100644 --- a/content/flickr.js +++ b/content/flickr.js @@ -98,4 +98,5 @@ Flickr.prototype = { photos_url: 'http://www.flickr.com/photos/', upload_url: 'http://www.flickr.com/services/upload/', + uploader_edit_url: 'http://www.flickr.com/tools/uploader_edit.gne', api_sig: function(paramstr) { @@ -276,4 +277,8 @@ Flickr.prototype = { return this.photos_url+this.user.nsid+'/sets/'+ps.id; }, + make_uploader_edit_url: function(pid) { + // TODO: handle arrays + return this.uploader_edit_url+'?ids='+pid; + }, upload_file: function(f,fa,on_success,on_failure) { |