-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 | |||
@@ -719,64 +719,65 @@ var fireflix = { | |||
719 | this.selection.clearSelection(); | 719 | this.selection.clearSelection(); |
720 | this.selection.currentIndex = -1; | 720 | this.selection.currentIndex = -1; |
721 | this.searchresult_props.hidden = true; | 721 | this.searchresult_props.hidden = true; |
722 | this.tree.beginUpdateBatch(); | 722 | this.tree.beginUpdateBatch(); |
723 | this.photos = new Array(); | 723 | this.photos = new Array(); |
724 | var n; while(n=xp.iterateNext()) { | 724 | var n; while(n=xp.iterateNext()) { |
725 | this.photos.push(new Photo(n)); | 725 | this.photos.push(new Photo(n)); |
726 | } | 726 | } |
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; |
775 | }else{ | 776 | }else{ |
776 | this.search_photo.src = this.fireflix.flickr.make_photo_url(p,'t'); | 777 | this.search_photo.src = this.fireflix.flickr.make_photo_url(p,'t'); |
777 | this.searchresult_title.value = p.title; | 778 | this.searchresult_title.value = p.title; |
778 | this.render_description_frame(null); | 779 | this.render_description_frame(null); |
779 | if(p.description==null && p.description==undefined) { | 780 | if(p.description==null && p.description==undefined) { |
780 | var pid = p.id; | 781 | var pid = p.id; |
781 | var ci = this.selection.currentIndex; | 782 | var ci = this.selection.currentIndex; |
782 | var _this = this; | 783 | var _this = this; |