author | Michael Krelin <hacker@klever.net> | 2006-11-16 22:22:23 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2006-11-16 22:22:23 (UTC) |
commit | d98dfeb112f9db06c5e642e14ee9bbda4d90d0cb (patch) (unidiff) | |
tree | dee166a9e25442a9043492f38104397fb748633b /content | |
parent | 4b21b4fc5248322c10ffb24edfd5ec78ebcce824 (diff) | |
download | fireflix-d98dfeb112f9db06c5e642e14ee9bbda4d90d0cb.zip fireflix-d98dfeb112f9db06c5e642e14ee9bbda4d90d0cb.tar.gz fireflix-d98dfeb112f9db06c5e642e14ee9bbda4d90d0cb.tar.bz2 |
double click on photoset opens photoset in flickr now
git-svn-id: http://svn.klever.net/kin/fireflix/trunk@229 fe716a7a-6dde-0310-88d9-d003556173a8
-rw-r--r-- | content/fireflix-panel.xul | 1 | ||||
-rw-r--r-- | content/fireflix.js | 12 | ||||
-rw-r--r-- | content/flickr.js | 4 |
3 files changed, 13 insertions, 4 deletions
diff --git a/content/fireflix-panel.xul b/content/fireflix-panel.xul index b2ca7dc..af92d22 100644 --- a/content/fireflix-panel.xul +++ b/content/fireflix-panel.xul | |||
@@ -181,12 +181,13 @@ | |||
181 | <tabpanel id="tabpanel_sets" flex="1" | 181 | <tabpanel id="tabpanel_sets" flex="1" |
182 | onkeypress="if(event.keyCode==event.DOM_VK_RETURN) | 182 | onkeypress="if(event.keyCode==event.DOM_VK_RETURN) |
183 | document.getElementById('setphotos').focus()"> | 183 | document.getElementById('setphotos').focus()"> |
184 | <vbox flex="1"> | 184 | <vbox flex="1"> |
185 | <tree id="setslist" rows="2" onselect="fireflix.photosets.on_select()" | 185 | <tree id="setslist" rows="2" onselect="fireflix.photosets.on_select()" |
186 | flex="1" context="sets_menu" | 186 | flex="1" context="sets_menu" |
187 | ondblclick="fireflix.photosets.on_cmd_open_in_flickr(event)" | ||
187 | > | 188 | > |
188 | <treecols> | 189 | <treecols> |
189 | <treecol id="sl_name" label="&panel.sets.name.label;" flex="4" crop="end" align="start" tooltiptext="&panel.sets.name.tip;"/> | 190 | <treecol id="sl_name" label="&panel.sets.name.label;" flex="4" crop="end" align="start" tooltiptext="&panel.sets.name.tip;"/> |
190 | <splitter class="tree-splitter" /> | 191 | <splitter class="tree-splitter" /> |
191 | <treecol id="sl_photos" label="&panel.sets.photos.label;" flex="1" align="end" tooltiptext="&panel.sets.photos.tip;" /> | 192 | <treecol id="sl_photos" label="&panel.sets.photos.label;" flex="1" align="end" tooltiptext="&panel.sets.photos.tip;" /> |
192 | </treecols> | 193 | </treecols> |
diff --git a/content/fireflix.js b/content/fireflix.js index 24894df..48053c5 100644 --- a/content/fireflix.js +++ b/content/fireflix.js | |||
@@ -161,17 +161,15 @@ var fireflix = { | |||
161 | this.set_photo.hidden = false; | 161 | this.set_photo.hidden = false; |
162 | }else{ | 162 | }else{ |
163 | this.set_photo.hidden = true; | 163 | this.set_photo.hidden = true; |
164 | } | 164 | } |
165 | }, | 165 | }, |
166 | on_cmd_open: function(ev) { | 166 | on_cmd_open: function(ev) { |
167 | if(this.selection.currentIndex<0) | 167 | if(this.selection.currentIndex<0) return; |
168 | return; | ||
169 | var p = this.photos[this.selection.currentIndex]; | 168 | var p = this.photos[this.selection.currentIndex]; |
170 | if(!p.id) | 169 | if(!p.id) return; |
171 | return; | ||
172 | this.fireflix.openTab(this.fireflix.flickr.make_photo_url(p,'p')); | 170 | this.fireflix.openTab(this.fireflix.flickr.make_photo_url(p,'p')); |
173 | } | 171 | } |
174 | }, | 172 | }, |
175 | 173 | ||
176 | /* photosets treeview */ | 174 | /* photosets treeview */ |
177 | photosets: { | 175 | photosets: { |
@@ -233,12 +231,18 @@ var fireflix = { | |||
233 | this.fireflix.cmd_set_props.setAttribute('disabled','false'); | 231 | this.fireflix.cmd_set_props.setAttribute('disabled','false'); |
234 | var s = this.sets[this.selection.currentIndex]; | 232 | var s = this.sets[this.selection.currentIndex]; |
235 | this.fireflix.photoset.load_photos(s.id); | 233 | this.fireflix.photoset.load_photos(s.id); |
236 | }else{ | 234 | }else{ |
237 | this.fireflix.cmd_set_props.setAttribute('disabled','true'); | 235 | this.fireflix.cmd_set_props.setAttribute('disabled','true'); |
238 | } | 236 | } |
237 | }, | ||
238 | on_cmd_open_in_flickr: function(ev) { | ||
239 | if(this.selection.currentIndex<0) return; | ||
240 | var p = this.sets[this.selection.currentIndex]; | ||
241 | if(!p.id) return; | ||
242 | this.fireflix.openTab(this.fireflix.flickr.make_photoset_url(p)); | ||
239 | } | 243 | } |
240 | }, | 244 | }, |
241 | 245 | ||
242 | refresh_user_tags: function() { | 246 | refresh_user_tags: function() { |
243 | var lb = document.getElementById('tagslist'); | 247 | var lb = document.getElementById('tagslist'); |
244 | var _this = this; | 248 | var _this = this; |
diff --git a/content/flickr.js b/content/flickr.js index 75d1a72..b8360c1 100644 --- a/content/flickr.js +++ b/content/flickr.js | |||
@@ -268,12 +268,16 @@ Flickr.prototype = { | |||
268 | make_photo_url: function(p,sfx) { | 268 | make_photo_url: function(p,sfx) { |
269 | if(sfx=='p') | 269 | if(sfx=='p') |
270 | return this.get_photo_page_url(p); | 270 | return this.get_photo_page_url(p); |
271 | else | 271 | else |
272 | return this.get_image_url(p,sfx); | 272 | return this.get_image_url(p,sfx); |
273 | }, | 273 | }, |
274 | make_photoset_url: function(ps) { | ||
275 | // TODO: allow for using someone else's photoset? | ||
276 | return this.photos_url+this.user.nsid+'/sets/'+ps.id; | ||
277 | }, | ||
274 | 278 | ||
275 | upload_file: function(f,fa,on_success,on_failure) { | 279 | upload_file: function(f,fa,on_success,on_failure) { |
276 | try { | 280 | try { |
277 | var fi = Components.classes["@mozilla.org/file/local;1"] | 281 | var fi = Components.classes["@mozilla.org/file/local;1"] |
278 | .createInstance(Components.interfaces.nsILocalFile); | 282 | .createInstance(Components.interfaces.nsILocalFile); |
279 | fi.initWithPath( f ); | 283 | fi.initWithPath( f ); |