-rw-r--r-- | content/fireflix.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/content/fireflix.js b/content/fireflix.js index 24894df..48053c5 100644 --- a/content/fireflix.js +++ b/content/fireflix.js | |||
@@ -151,37 +151,35 @@ var fireflix = { | |||
151 | }, function(x,s,c,m) { | 151 | }, function(x,s,c,m) { |
152 | _this.fireflix.flickr_failure(x,s,c,m); | 152 | _this.fireflix.flickr_failure(x,s,c,m); |
153 | } | 153 | } |
154 | ); | 154 | ); |
155 | }, | 155 | }, |
156 | on_select: function() { | 156 | on_select: function() { |
157 | if(this.selection.count==1) { | 157 | if(this.selection.count==1) { |
158 | var p = this.photos[this.selection.currentIndex]; | 158 | var p = this.photos[this.selection.currentIndex]; |
159 | this.set_photo.src = | 159 | this.set_photo.src = |
160 | this.fireflix.flickr.get_photo_url(p.server,p.id,p.secret,'t'); | 160 | this.fireflix.flickr.get_photo_url(p.server,p.id,p.secret,'t'); |
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: { |
178 | sets: new Array(), | 176 | sets: new Array(), |
179 | fireflix: null, | 177 | fireflix: null, |
180 | init: function(f) { | 178 | init: function(f) { |
181 | this.fireflix = f; | 179 | this.fireflix = f; |
182 | document.getElementById('setslist').view = this; | 180 | document.getElementById('setslist').view = this; |
183 | }, | 181 | }, |
184 | rowCount: 0, | 182 | rowCount: 0, |
185 | getCellText: function(r,c) { | 183 | getCellText: function(r,c) { |
186 | var s = this.sets[r]; | 184 | var s = this.sets[r]; |
187 | if(c.id=='sl_name') return s.title; | 185 | if(c.id=='sl_name') return s.title; |
@@ -223,32 +221,38 @@ var fireflix = { | |||
223 | '/rsp/photosets/photoset', x, null, | 221 | '/rsp/photosets/photoset', x, null, |
224 | XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); | 222 | XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); |
225 | _this.importXPR(xp); | 223 | _this.importXPR(xp); |
226 | }, function(x,s,c,m) { | 224 | }, function(x,s,c,m) { |
227 | _this.fireflix.flickr_failure(x,s,c,m); | 225 | _this.fireflix.flickr_failure(x,s,c,m); |
228 | } | 226 | } |
229 | ); | 227 | ); |
230 | }, | 228 | }, |
231 | on_select: function() { | 229 | on_select: function() { |
232 | if(this.selection.count==1) { | 230 | if(this.selection.count==1) { |
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; |
245 | this.flickr.api_call( | 249 | this.flickr.api_call( |
246 | { | 250 | { |
247 | method: 'flickr.tags.getListUser', | 251 | method: 'flickr.tags.getListUser', |
248 | auth_token: 'default', | 252 | auth_token: 'default', |
249 | }, function(xr) { | 253 | }, function(xr) { |
250 | var x = xr.responseXML; | 254 | var x = xr.responseXML; |
251 | var xp = x.evaluate( | 255 | var xp = x.evaluate( |
252 | '/rsp/who/tags/tag', x, null, | 256 | '/rsp/who/tags/tag', x, null, |
253 | XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); | 257 | XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); |
254 | // TODO: clear list | 258 | // TODO: clear list |