# HG changeset patch # User Emmanuel Gil Peyrot # Date 1320253201 25200 # Node ID 360186772aa3b923e458b7343c003a73cd0fde18 # Parent 42d3f454d4b4cf7193c5e1a78f8423ef54312385 Don’t hardcode avatars URL. diff -r 42d3f454d4b4 -r 360186772aa3 atom.js --- a/atom.js Wed Nov 02 09:53:37 2011 -0700 +++ b/atom.js Wed Nov 02 10:00:01 2011 -0700 @@ -67,7 +67,7 @@ cite.appendChild(a); var img = document.createElementNS(ns.xhtml, 'img'); - img.src = 'http://eldonilo.linkmauve.fr/avatar/' + atomJID.bare; + img.src = config.avatarRoot + atomJID.bare; aside.appendChild(img); } else cite.appendChild(document.createTextNode(atomName)); diff -r 42d3f454d4b4 -r 360186772aa3 configuration.js --- a/configuration.js Wed Nov 02 09:53:37 2011 -0700 +++ b/configuration.js Wed Nov 02 10:00:01 2011 -0700 @@ -30,6 +30,7 @@ // Root of the webservice, and Atom HTTP service. config.webRoot = '/blog/'; config.atomRoot = '/atom/'; +config.avatarRoot = '/avatar/'; // These are the host and the port on which the web service will // listen. If you want IPv4 connection only, instead of both IPv4 and diff -r 42d3f454d4b4 -r 360186772aa3 server.js --- a/server.js Wed Nov 02 09:53:37 2011 -0700 +++ b/server.js Wed Nov 02 10:00:01 2011 -0700 @@ -171,7 +171,8 @@ try{ var uri = author.getChild('uri', ns.atom).getText(); footer.c('cite').c('a', {href: uri}).t(name).up(); - avatar.attrs.src = '/avatar/' + uri.substring(5); + avatar.attrs.src = config.avatarRoot + uri.substring(5); + avatar.attrs.alt = uri.substring(5); } catch (e) { footer.c('cite').t(name); }