-rw-r--r-- | content/fireflix.js | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/content/fireflix.js b/content/fireflix.js index 6773134..6681303 100644 --- a/content/fireflix.js +++ b/content/fireflix.js @@ -743,47 +743,39 @@ var fireflix = { var _this = this; this.fireflix.flickr.api_call( pars, function(xr) { var x = xr.responseXML; var xp = x.evaluate( '/rsp/photos/photo', x, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); _this.importXPR(xp); _this.on_select(); }, function(x,s,c,m) { _this.fireflix.flickr_failure(x,s,c,m); } ); }, render_description_frame: function(content) { if(!content) { - try { - this.searchresult_description.contentDocument.lastChild.innerHTML - = ''; - }catch(e) { } /* it will throw exceptions when the iframe isn't well - prepared to meet me, but it's unimportant then, anyway */ + this.searchresult_description.innerHTML = ''; }else{ - this.searchresult_description.contentDocument.lastChild.setAttribute( - 'style', - 'font-size: 80%; margin: 1px 3px; font-family: arial, sans-serif' - ); - this.searchresult_description.contentDocument.lastChild.innerHTML - = content; - var ls = this.searchresult_description.contentDocument.links; - for(var l=0;l<ls.length;++l) - ls.item(l).setAttribute('target','_blank'); + this.searchresult_description.innerHTML = content?content:''; + /* of all linking elements flickr only allows a */ + var as = this.searchresult_description.getElementsByTagName('a'); + for(var a=0;a<as.length;++a) + as.item(a).setAttribute('target','_blank'); } }, on_select: function() { if(this.selection.currentIndex<0) { this.searchresult_props.hidden = true; }else{ var p = this.photos[this.selection.currentIndex]; if(!p) { this.searchresult_props.hidden = true; }else{ this.search_photo.src = this.fireflix.flickr.make_photo_url(p,'t'); this.searchresult_title.value = p.title; this.render_description_frame(null); if(p.description==null && p.description==undefined) { var pid = p.id; var ci = this.selection.currentIndex; |