author | Michael Krelin <hacker@klever.net> | 2006-12-18 18:56:09 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2006-12-18 18:56:09 (UTC) |
commit | 71a2c8a80f3c7a99e893efb32c6bbf5080e16ff1 (patch) (unidiff) | |
tree | 1f9051339dee22f5c64206568638675ca9f7636a /content | |
parent | 1838bc18394967371d7a1c00516db5e290f80ea3 (diff) | |
download | fireflix-71a2c8a80f3c7a99e893efb32c6bbf5080e16ff1.zip fireflix-71a2c8a80f3c7a99e893efb32c6bbf5080e16ff1.tar.gz fireflix-71a2c8a80f3c7a99e893efb32c6bbf5080e16ff1.tar.bz2 |
doubleclicking files in upload
git-svn-id: http://svn.klever.net/kin/fireflix/trunk@241 fe716a7a-6dde-0310-88d9-d003556173a8
-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 | |||
@@ -244,7 +244,8 @@ | |||
244 | <vbox flex="1"> | 244 | <vbox flex="1"> |
245 | <tree id="uploadlist" rows="2" flex="1" | 245 | <tree id="uploadlist" rows="2" flex="1" |
246 | onselect="fireflix.uploads.selectionChanged()" | 246 | onselect="fireflix.uploads.selectionChanged()" |
247 | context="uploads_menu"> | 247 | context="uploads_menu" ondblclick="fireflix.uploads.on_cmd_open(event)" |
248 | onkeypress="if(event.keyCode==event.DOM_VK_RETURN) fireflix.uploads.on_cmd_open(event)" > | ||
248 | <treecols> | 249 | <treecols> |
249 | <treecol id="up_file" label="&panel.uploadlist.file.label;" flex="4" crop="start" align="start"/> | 250 | <treecol id="up_file" label="&panel.uploadlist.file.label;" flex="4" crop="start" align="start"/> |
250 | <splitter class="tree-splitter" /> | 251 | <splitter class="tree-splitter" /> |
diff --git a/content/fireflix.js b/content/fireflix.js index 78e56c2..225e21c 100644 --- a/content/fireflix.js +++ b/content/fireflix.js | |||
@@ -628,6 +628,17 @@ var fireflix = { | |||
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 | ||
@@ -913,11 +924,9 @@ var fireflix = { | |||
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 | }, |
diff --git a/content/flickr.js b/content/flickr.js index b8360c1..e09d5f0 100644 --- a/content/flickr.js +++ b/content/flickr.js | |||
@@ -97,6 +97,7 @@ Flickr.prototype = { | |||
97 | photo_url: 'http://static.flickr.com/', | 97 | photo_url: 'http://static.flickr.com/', |
98 | photos_url: 'http://www.flickr.com/photos/', | 98 | photos_url: 'http://www.flickr.com/photos/', |
99 | upload_url: 'http://www.flickr.com/services/upload/', | 99 | upload_url: 'http://www.flickr.com/services/upload/', |
100 | uploader_edit_url: 'http://www.flickr.com/tools/uploader_edit.gne', | ||
100 | 101 | ||
101 | api_sig: function(paramstr) { | 102 | api_sig: function(paramstr) { |
102 | return MD5(toutf8(this.api_shs+paramstr)); | 103 | return MD5(toutf8(this.api_shs+paramstr)); |
@@ -275,6 +276,10 @@ Flickr.prototype = { | |||
275 | // TODO: allow for using someone else's photoset? | 276 | // TODO: allow for using someone else's photoset? |
276 | return this.photos_url+this.user.nsid+'/sets/'+ps.id; | 277 | return this.photos_url+this.user.nsid+'/sets/'+ps.id; |
277 | }, | 278 | }, |
279 | make_uploader_edit_url: function(pid) { | ||
280 | // TODO: handle arrays | ||
281 | return this.uploader_edit_url+'?ids='+pid; | ||
282 | }, | ||
278 | 283 | ||
279 | upload_file: function(f,fa,on_success,on_failure) { | 284 | upload_file: function(f,fa,on_success,on_failure) { |
280 | try { | 285 | try { |