Mercurial > eldonilo > blog
comparison blog.js @ 1:82905edac9d8
Fix some things.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 12 Jul 2011 17:47:32 +0200 |
parents | f62b5c395a48 |
children | f630f4b90564 |
comparison
equal
deleted
inserted
replaced
0:f62b5c395a48 | 1:82905edac9d8 |
---|---|
68 for (var i in divs) { | 68 for (var i in divs) { |
69 var div = divs[i] | 69 var div = divs[i] |
70 if (typeof div != 'object') | 70 if (typeof div != 'object') |
71 continue; | 71 continue; |
72 | 72 |
73 if (div.getAttributeNS(ns.idq, 'jid') === name) { | 73 if (div.getAttributeNS(ns.e, 'jid') === name) { |
74 container = div; | 74 container = div; |
75 break; | 75 break; |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 if (!container) { | 79 if (!container) { |
80 var container = document.createElementNS(ns.xhtml, 'div'); | 80 var container = document.createElementNS(ns.xhtml, 'div'); |
81 container.setAttributeNS(ns.idq, 'jid', name); | 81 container.setAttributeNS(ns.e, 'jid', name); |
82 messages.appendChild(container); | 82 messages.appendChild(container); |
83 } | 83 } |
84 | 84 |
85 var articles = container.getElementsByTagNameNS(ns.xhtml, 'article'); | 85 var articles = container.getElementsByTagNameNS(ns.xhtml, 'article'); |
86 for (var i in articles) { | 86 for (var i in articles) { |
87 var article = articles[i]; | 87 var article = articles[i]; |
88 if (typeof article != 'object') | 88 if (typeof article != 'object') |
89 continue; | 89 continue; |
90 | 90 |
91 if (article.getAttributeNS(ns.idq, 'id') === id) { | 91 if (article.getAttributeNS(ns.e, 'id') === id) { |
92 container.replaceChild(html(name, id), article); | 92 container.replaceChild(html(name, id), article); |
93 return; | 93 return; |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
105 var a = articles[i]; | 105 var a = articles[i]; |
106 if (typeof a != 'object') | 106 if (typeof a != 'object') |
107 continue; | 107 continue; |
108 | 108 |
109 var ad = new Date(); | 109 var ad = new Date(); |
110 ad.set8601(a.getAttributeNS(ns.idq, 'date')); | 110 ad.set8601(a.getAttributeNS(ns.e, 'date')); |
111 | 111 |
112 if (ad < d) { | 112 if (ad < d) { |
113 toInsert = a; | 113 toInsert = a; |
114 break; | 114 break; |
115 } | 115 } |