-rw-r--r-- | content/fireflix.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/content/fireflix.js b/content/fireflix.js index 6681303..0f01d26 100644 --- a/content/fireflix.js +++ b/content/fireflix.js | |||
@@ -727,48 +727,49 @@ var fireflix = { | |||
727 | this.rowCount = this.photos.length; | 727 | this.rowCount = this.photos.length; |
728 | this.tree.endUpdateBatch(); | 728 | this.tree.endUpdateBatch(); |
729 | }, | 729 | }, |
730 | search_photos: function() { | 730 | search_photos: function() { |
731 | var pars = { | 731 | var pars = { |
732 | method: 'flickr.photos.search', | 732 | method: 'flickr.photos.search', |
733 | auth_token: 'default', | 733 | auth_token: 'default', |
734 | extras: 'license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo' | 734 | extras: 'license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo' |
735 | }; | 735 | }; |
736 | if(this.search_mine.checked) | 736 | if(this.search_mine.checked) |
737 | pars.user_id='me'; | 737 | pars.user_id='me'; |
738 | if(this.search_tags.checked) { | 738 | if(this.search_tags.checked) { |
739 | pars.tags=this.search_for.value.split(/ +/).join(','); | 739 | pars.tags=this.search_for.value.split(/ +/).join(','); |
740 | }else{ | 740 | }else{ |
741 | pars.text=this.search_for.value; | 741 | pars.text=this.search_for.value; |
742 | } | 742 | } |
743 | var _this = this; | 743 | var _this = this; |
744 | this.fireflix.flickr.api_call( pars, | 744 | this.fireflix.flickr.api_call( pars, |
745 | function(xr) { | 745 | function(xr) { |
746 | var x = xr.responseXML; | 746 | var x = xr.responseXML; |
747 | var xp = x.evaluate( | 747 | var xp = x.evaluate( |
748 | '/rsp/photos/photo', x, null, | 748 | '/rsp/photos/photo', x, null, |
749 | XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); | 749 | XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); |
750 | _this.importXPR(xp); | 750 | _this.importXPR(xp); |
751 | _this.tree.ensureRowIsVisible(0); | ||
751 | _this.on_select(); | 752 | _this.on_select(); |
752 | }, function(x,s,c,m) { | 753 | }, function(x,s,c,m) { |
753 | _this.fireflix.flickr_failure(x,s,c,m); | 754 | _this.fireflix.flickr_failure(x,s,c,m); |
754 | } | 755 | } |
755 | ); | 756 | ); |
756 | }, | 757 | }, |
757 | render_description_frame: function(content) { | 758 | render_description_frame: function(content) { |
758 | if(!content) { | 759 | if(!content) { |
759 | this.searchresult_description.innerHTML = ''; | 760 | this.searchresult_description.innerHTML = ''; |
760 | }else{ | 761 | }else{ |
761 | this.searchresult_description.innerHTML = content?content:''; | 762 | this.searchresult_description.innerHTML = content?content:''; |
762 | /* of all linking elements flickr only allows a */ | 763 | /* of all linking elements flickr only allows a */ |
763 | var as = this.searchresult_description.getElementsByTagName('a'); | 764 | var as = this.searchresult_description.getElementsByTagName('a'); |
764 | for(var a=0;a<as.length;++a) | 765 | for(var a=0;a<as.length;++a) |
765 | as.item(a).setAttribute('target','_blank'); | 766 | as.item(a).setAttribute('target','_blank'); |
766 | } | 767 | } |
767 | }, | 768 | }, |
768 | on_select: function() { | 769 | on_select: function() { |
769 | if(this.selection.currentIndex<0) { | 770 | if(this.selection.currentIndex<0) { |
770 | this.searchresult_props.hidden = true; | 771 | this.searchresult_props.hidden = true; |
771 | }else{ | 772 | }else{ |
772 | var p = this.photos[this.selection.currentIndex]; | 773 | var p = this.photos[this.selection.currentIndex]; |
773 | if(!p) { | 774 | if(!p) { |
774 | this.searchresult_props.hidden = true; | 775 | this.searchresult_props.hidden = true; |