Mercurial > eldonilo > blog
changeset 1:82905edac9d8
Fix some things.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 12 Jul 2011 17:47:32 +0200 |
parents | f62b5c395a48 |
children | eb5b6d3ab09b |
files | atom.js blog.js date.js server.js theme.css |
diffstat | 5 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/atom.js +++ b/atom.js @@ -54,7 +54,7 @@ parsers[ns.atom] = function(id, xml) { cite.appendChild(a); var img = document.createElementNS(ns.xhtml, 'img'); - img.src = 'http://linkmauve.fr/avatar/' + atomJID.bare; + img.src = 'http://eldonilo.linkmauve.fr/avatar/' + atomJID.bare; aside.appendChild(img); } else cite.appendChild(document.createTextNode(atomName));
--- a/blog.js +++ b/blog.js @@ -70,7 +70,7 @@ var updateMessage = function(name, id) { if (typeof div != 'object') continue; - if (div.getAttributeNS(ns.idq, 'jid') === name) { + if (div.getAttributeNS(ns.e, 'jid') === name) { container = div; break; } @@ -78,7 +78,7 @@ var updateMessage = function(name, id) { if (!container) { var container = document.createElementNS(ns.xhtml, 'div'); - container.setAttributeNS(ns.idq, 'jid', name); + container.setAttributeNS(ns.e, 'jid', name); messages.appendChild(container); } @@ -88,7 +88,7 @@ var updateMessage = function(name, id) { if (typeof article != 'object') continue; - if (article.getAttributeNS(ns.idq, 'id') === id) { + if (article.getAttributeNS(ns.e, 'id') === id) { container.replaceChild(html(name, id), article); return; } @@ -107,7 +107,7 @@ var updateMessage = function(name, id) { continue; var ad = new Date(); - ad.set8601(a.getAttributeNS(ns.idq, 'date')); + ad.set8601(a.getAttributeNS(ns.e, 'date')); if (ad < d) { toInsert = a;
--- a/date.js +++ b/date.js @@ -57,7 +57,7 @@ Date.prototype.getRelative = function(){ return Math.round(month)+" months ago"; if (day == 1) - return "today"; + return "yesterday"; if (day > 1) return Math.round(day)+" days ago";
--- a/server.js +++ b/server.js @@ -147,7 +147,7 @@ cl.on('stanza', function(stanza) { } }); -var parseAtom = function(atom, id) { +var parseAtom = function(atom, id, jid) { var article = new Element('article', {'e:id': id, 'e:date': '2011-06-02T10:59:39Z'}); var avatar = article.c('aside').c('img') @@ -209,7 +209,7 @@ var parseAtom = function(atom, id) { var href = new JID; href.uri = link.attrs.href; - article.c('a', {href: '?jid=' + href.bare + ';node=' + href.query.node/* + ';comments=' + params.jid + '/' + params.node*/}).t('Comments !'); + article.c('a', {href: '?jid=' + href.bare + ';node=' + href.query.node + ';origjid=' + jid.bare + ';orignode=' + jid.resource + ';origitem=' + id}).t('Comments !'); break; } } catch (e) { } @@ -229,7 +229,7 @@ var generatePage = function(jid) { for (var i in s) { r = s[i]; delete s[i]; - makePage(r.res, jid.full, form, data, r.noscript); + makePage(r.res, jid, form, data, r.noscript); } }; @@ -238,10 +238,10 @@ var makePage = function(res, jid, form, for (var id in data) { var item = data[id]; - var article = parseAtom(item, id); + var article = parseAtom(item, id, jid); body = article + body; } - body = '<div e:jid="' + jid + '">' + body; + body = '<div e:jid="' + jid.full + '">' + body; home(res, form['pubsub#title'], form['pubsub#description'], body, 'Node created the <time>' + form['pubsub#creation_date'] + '</time> by <cite>' + form['pubsub#creator'] + '</cite> with <a href="http://linkmauve.fr/dev/eldonilo/blog">Eldonilo blog</a>.', noscript); };