# HG changeset patch # User Emmanuel Gil Peyrot # Date 1310555514 -7200 # Node ID eb5b6d3ab09b5e14aea48ec3ca82b553f3581b93 # Parent 82905edac9d8077aea223878e79f64d3af43bee8 Better import of ns and jid; fix email and missing ns. diff --git a/atom.js b/atom.js --- a/atom.js +++ b/atom.js @@ -66,7 +66,7 @@ parsers[ns.atom] = function(id, xml) { if (atomEmail) { footer.appendChild(document.createTextNode(' (')); var a = document.createElementNS(ns.xhtml, 'a'); - a.href = atomEmail; + a.href = 'mailto:' + atomEmail; a.appendChild(document.createTextNode('email')); footer.appendChild(a); footer.appendChild(document.createTextNode(')')); diff --git a/jid.js b/jid.js --- a/jid.js +++ b/jid.js @@ -101,5 +101,5 @@ var JID = function(jid) { this.full = jid; }; -if (typeof exports === 'object') - exports.JID = JID; +if (module) + module.exports = JID; diff --git a/ns.js b/ns.js --- a/ns.js +++ b/ns.js @@ -12,5 +12,5 @@ var ns = { var parsers = {}; -if (typeof exports === 'object') - exports.ns = ns; +if (module) + module.exports = ns; diff --git a/server.js b/server.js --- a/server.js +++ b/server.js @@ -9,8 +9,8 @@ var http = require('http'); var fs = require('fs'); var xmpp = require('node-xmpp'); var Element = xmpp.Element; -var JID = require('./jid').JID; -var ns = require('./ns').ns; +var JID = require('./jid'); +var ns = require('./ns'); var forms = require('./forms'); require('./date'); @@ -133,7 +133,7 @@ cl.on('stanza', function(stanza) { if (payload) return handlePubSub(payload, stanza.attrs.from); - } else if (stanza.is('message')) { + } else if (stanza.is('message', ns.j)) { var type = stanza.attrs.type; if (type === 'error') return; @@ -177,7 +177,7 @@ var parseAtom = function(atom, id, jid) try { var email = author.getChild('email', ns.atom).getText(); - footer.t(', (').c('a', {href: email}).t('email').up().t(')'); + footer.t(' (').c('a', {href: 'mailto:' + email}).t('email').up().t(')'); } catch (e) { } footer.up(); } @@ -242,7 +242,7 @@ var makePage = function(res, jid, form, body = article + body; } body = '
' + body; - + home(res, form['pubsub#title'], form['pubsub#description'], body, 'Node created the by ' + form['pubsub#creator'] + ' with Eldonilo blog.', noscript); }; diff --git a/theme.css b/theme.css --- a/theme.css +++ b/theme.css @@ -86,6 +86,7 @@ body > section > div > article > h2 { color: #999; white-space: nowrap; overflow: hidden; + text-overflow: ellipsis; } body > section > div > article > aside { diff --git a/xml2json.js b/xml2json.js --- a/xml2json.js +++ b/xml2json.js @@ -3,7 +3,7 @@ License: http://creativecommons.org/licenses/LGPL/2.1/ Version: 0.9 Author: Stefan Goessner/2006 - Web: http://goessner.net/ + Web: http://goessner.net/ */ var Element = function() { this.getChildren = function(name, ns) {