-rw-r--r-- | content/fireflix.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/content/fireflix.js b/content/fireflix.js index 63a4118..85b4d39 100644 --- a/content/fireflix.js +++ b/content/fireflix.js @@ -815,129 +815,129 @@ var fireflix = { } }, 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.searchresult_title.tooltipText = p.title; this.render_description_frame(null); if(p.description==null && p.description==undefined) { var pid = p.id; var ci = this.selection.currentIndex; var _this = this; this.fireflix.flickr.api_call( { method: 'flickr.photos.getInfo', auth_token: 'default', photo_id: p.id, secret: p.secret }, function(xr) { var pp = _this.photos[ci]; if(ci==_this.selection.currentIndex && pp.id==pid) { var n = xp_node('/rsp/photo',xr.responseXML); pp.fromNode_(n); _this.render_description_frame(pp.description); } }, function(x,s,c,m) { _this.fireflix.flickr_failure(x,s,c,m); } ); this.searchresult_props.hidden = false; }else{ this.render_description_frame(p.description); } } } }, on_cmd_open: function(ev) { if(this.selection.currentIndex<0) return; var p = this.photos[this.selection.currentIndex]; if(!p.id) return; this.fireflix.openTab(this.fireflix.flickr.make_photo_url(p,'p')); } }, photo_html: function(p,i,l) { // TODO: add alt/title when possible var rv = '<a href="'+this.flickr.make_photo_url(p,l)+'">' + '<img src="'+this.flickr.make_photo_url(p,i)+'" />'+ '</a>'; return rv; }, build_html: function(photos,uti,utl) { var rv = ''; for(var i in photos) { var p = photos[i]; - rv += this.photo_html(p,utl,uti)+'\n'; + rv += this.photo_html(p,uti,utl)+'\n'; } return rv; }, popup_content: function(s) { window.openDialog( "chrome://fireflix/content/generated-content.xul", null, "dialog,chrome", this, s ); }, copy_to_clipboard: function(s) { var ch = Components.classes["@mozilla.org/widget/clipboardhelper;1"] .getService(Components.interfaces.nsIClipboardHelper); ch.copyString(s); }, openTab: function(l) { var wm = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService( Components.interfaces.nsIWindowMediator ); var bw = wm.getMostRecentWindow('navigator:browser'); var b = bw.getBrowser(); var t = b.addTab(l); b.selectedTab = t; }, build_menus: function() { this.append_html_menu( document.getElementById('sets_html_menu'), 'stm_','m_bop','cmdset_sets','cmd_sets_html' ); this.append_html_menu( document.getElementById('uploads_html_menu'), 'stm_','m_bop','cmdset_uploads','cmd_uploads_html' ); return; }, append_html_menu: function(m,imgt,lnkt,csid,cpfx) { var mp = m.appendChild(document.createElement('menupopup')); var t; t=mp.appendChild(document.createElement('menuitem')); t.setAttribute('label',this.loc_strings.getString('menutitle_Images')); t.setAttribute('class','menuhead');t.setAttribute('disabled','true'); mp.appendChild(document.createElement('menuseparator')); var cs = document.getElementById(csid); for(var iti=0;iti<imgt.length;++iti) { t = mp.appendChild(document.createElement('menu')); t.setAttribute('label',this.loc_strings.getString('urltype_'+imgt.charAt(iti))); var smp = t.appendChild(document.createElement('menupopup')); t=smp.appendChild(document.createElement('menuitem')); t.setAttribute('label',this.loc_strings.getString('menutitle_Links')); t.setAttribute('class','menuhead');t.setAttribute('disabled','true'); smp.appendChild(document.createElement('menuseparator')); for(var lti=0;lti<lnkt.length;++lti) { var csfx = imgt.charAt(iti)+lnkt.charAt(lti); t=smp.appendChild(document.createElement('menuitem')); t.setAttribute('label',this.loc_strings.getString('urltype_'+lnkt.charAt(lti))); t.setAttribute('command',cpfx+'_'+csfx); t=cs.appendChild(document.createElement('command')); t.setAttribute('id',cpfx+'_'+csfx); t.setAttribute('oncommand','fireflix.on_'+cpfx+"('"+csfx+"',event)"); } } return mp; }, flickr_failure: function(x,s,c,m) { |