summaryrefslogtreecommitdiffabout
path: root/content/fireflix.js
Unidiff
Diffstat (limited to 'content/fireflix.js') (more/less context) (ignore whitespace changes)
-rw-r--r--content/fireflix.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/content/fireflix.js b/content/fireflix.js
index 92c42f4..966630c 100644
--- a/content/fireflix.js
+++ b/content/fireflix.js
@@ -785,36 +785,42 @@ var fireflix = {
785 pars.page=this.paging.page+1; pars.per_page=this.paging.perpage; 785 pars.page=this.paging.page+1; pars.per_page=this.paging.perpage;
786 this.perform_search(pars); 786 this.perform_search(pars);
787 }, 787 },
788 update_paging: function() { 788 update_paging: function() {
789 if(! (this.paging.pars && this.paging.page && this.paging.pages) ) { 789 if(! (this.paging.pars && this.paging.page && this.paging.pages) ) {
790 this.search_page.value=''; this.search_page.hidden = true; 790 this.search_page.value=''; this.search_page.hidden = true;
791 this.cmd_search_prev_page.setAttribute('disabled','true'); 791 this.cmd_search_prev_page.setAttribute('disabled','true');
792 this.cmd_search_next_page.setAttribute('disabled','true'); 792 this.cmd_search_next_page.setAttribute('disabled','true');
793 }else{ 793 }else{
794 this.search_page.value=this.fireflix.loc_strings.getFormattedString('search_page',[this.paging.page,this.paging.pages]); 794 this.search_page.value=this.fireflix.loc_strings.getFormattedString('search_page',[this.paging.page,this.paging.pages]);
795 this.search_page.hidden=false; 795 this.search_page.hidden=false;
796 this.cmd_search_prev_page.setAttribute('disabled',(this.paging.page>1)?'false':'true'); 796 this.cmd_search_prev_page.setAttribute('disabled',(this.paging.page>1)?'false':'true');
797 this.cmd_search_next_page.setAttribute('disabled',(this.paging.page<this.paging.pages)?'false':'true'); 797 this.cmd_search_next_page.setAttribute('disabled',(this.paging.page<this.paging.pages)?'false':'true');
798 } 798 }
799 }, 799 },
800 render_description_frame: function(content) { 800 render_description_frame: function(content) {
801 if(!content) { 801 this.searchresult_description.innerHTML = '';
802 this.searchresult_description.innerHTML = ''; 802 if(content) {
803 }else{ 803 var dp = new DOMParser();
804 this.searchresult_description.innerHTML = content?content:''; 804 var pd = dp.parseFromString(
805 '<div xmlns="http://www.w3.org/1999/xhtml">'+content+'</div>', 'text/xml' );
806 var de = pd.documentElement;
807 if(de.tagName=='parsererror')
808 this.searchresult_description.innerHTML=this.fireflix.loc_strings.getString('broken_description');
809 else
810 this.searchresult_description.appendChild(de);
805 /* of all linking elements flickr only allows a */ 811 /* of all linking elements flickr only allows a */
806 var as = this.searchresult_description.getElementsByTagName('a'); 812 var as = this.searchresult_description.getElementsByTagName('a');
807 for(var a=0;a<as.length;++a) 813 for(var a=0;a<as.length;++a)
808 as.item(a).setAttribute('target','_blank'); 814 as.item(a).setAttribute('target','_blank');
809 } 815 }
810 }, 816 },
811 on_select: function() { 817 on_select: function() {
812 if(this.selection.currentIndex<0) { 818 if(this.selection.currentIndex<0) {
813 this.searchresult_props.hidden = true; 819 this.searchresult_props.hidden = true;
814 }else{ 820 }else{
815 var p = this.photos[this.selection.currentIndex]; 821 var p = this.photos[this.selection.currentIndex];
816 if(!p) { 822 if(!p) {
817 this.searchresult_props.hidden = true; 823 this.searchresult_props.hidden = true;
818 }else{ 824 }else{
819 this.search_photo.src = this.fireflix.flickr.make_photo_url(p,'t'); 825 this.search_photo.src = this.fireflix.flickr.make_photo_url(p,'t');
820 this.searchresult_title.value = p.title; 826 this.searchresult_title.value = p.title;