-rw-r--r-- | content/fireflix.js | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/content/fireflix.js b/content/fireflix.js index d70ab4d..34cfd3e 100644 --- a/content/fireflix.js +++ b/content/fireflix.js @@ -220,48 +220,42 @@ var fireflix = { var s = this.sets[this.selection.currentIndex]; this.fireflix.photoset.load_photos(s.id); }else{ this.fireflix.cmd_set_props.setAttribute('disabled','true'); } }, on_cmd_open_in_flickr: function(ev) { if(this.selection.currentIndex<0) return; var p = this.sets[this.selection.currentIndex]; if(!p.id) return; this.fireflix.openTab(this.fireflix.flickr.make_photoset_url(p)); } }, refresh_user_tags: function() { var lb = document.getElementById('tagslist'); - var _this = this; - this.flickr.api_call( + var that = this; + this.flickr.api_call_json( { method: 'flickr.tags.getListUser', auth_token: 'default', - }, function(xr) { - var x = xr.responseXML; - var xp = x.evaluate( - '/rsp/who/tags/tag', x, null, - XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); - // TODO: clear list - var n; while(n=xp.iterateNext()) { - lb.appendItem(n.firstChild.nodeValue); - } + }, function(x,j) { + var tt = j.who.tags.tag; + for(var i in tt) lb.appendItem(tt[i]._content); }, function(x,s,c,m) { - _this.flickr_failure(x,s,c,m); + that.flickr_failure(x,s,c,m); } ); }, uploadObserver: { fireflix: null, init: function(f) { this.fireflix = f; }, getSupportedFlavours: function() { var rv = new FlavourSet(); rv.appendFlavour('application/x-moz-file','nsIFile'); rv.appendFlavour('application/x-moz-url'); rv.appendFlavour('text/uri-list'); rv.appendFlavour('text/unicode'); return rv; |