Mercurial > eldonilo > blog
comparison nothing.js @ 13:161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Drop BOSH support and add WebSockets support.
The server-side is untested, may be broken.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 03 Nov 2011 14:23:10 -0700 |
parents | 4d7a67349089 |
children | 03be0717d3f8 |
comparison
equal
deleted
inserted
replaced
12:d67380657687 | 13:161d4ea1c3f8 |
---|---|
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 parsers[''] = function(id, xml) { | 3 parsers[''] = function(item) { |
4 var toDate = function() { | 4 var toDate = function() { |
5 return new Date(); | 5 return new Date(); |
6 }; | 6 }; |
7 | 7 |
8 var toHTML = function(xml, date) { | 8 var toHTML = function(item, date) { |
9 var article = document.createElementNS(ns.xhtml, 'article'); | 9 var article = document.createElementNS(ns.xhtml, 'article'); |
10 article.setAttributeNS(ns.e, 'id', id); | 10 article.setAttributeNS(ns.e, 'id', id); |
11 article.setAttributeNS(ns.e, 'date', date.to8601()); | 11 article.setAttributeNS(ns.e, 'date', date.to8601()); |
12 article.appendChild(document.createElementNS(ns.xhtml, 'h2').appendChild(document.createTextNode('This post is in an unknown namespace.'))); | 12 article.appendChild(document.createElementNS(ns.xhtml, 'h2').appendChild(document.createTextNode('This post is in an unknown namespace.'))); |
13 return article; | 13 return article; |
14 }; | 14 }; |
15 | 15 |
16 this.xml = xml; | 16 this.xml = item.payload; |
17 this.date = toDate(xml); | 17 this.date = toDate(); |
18 this.html = toHTML(xml, this.date); | 18 this.html = toHTML(item, this.date); |
19 } | 19 } |