Mercurial > eldonilo > lightstring
comparison plugins/ping.js @ 108:5cb4733c5189
many api changes
author | Sonny Piers <sonny@fastmail.net> |
---|---|
date | Fri, 13 Jul 2012 15:26:18 +0200 |
parents | c06ec02217ee |
children |
comparison
equal
deleted
inserted
replaced
107:704ce44c1a22 | 108:5cb4733c5189 |
---|---|
47 var stanza = Lightstring.stanzas.pong(from); | 47 var stanza = Lightstring.stanzas.pong(from); |
48 stanza.setAttribute('id', id); | 48 stanza.setAttribute('id', id); |
49 } | 49 } |
50 } | 50 } |
51 } | 51 } |
52 Object.defineProperties(Lightstring.Stanza.prototype, { | |
53 'ping': { | |
54 get : function() { | |
55 return !!(this.el.querySelector('ping')); | |
56 }, | |
57 set: function(aBool) { | |
58 if (this.ping) | |
59 return; | |
60 | |
61 var pingEl = Lightstring.doc.createElementNS(Lightstring.ns.ping, 'ping'); | |
62 this.el.appendChild(pingEl); | |
63 }, | |
64 enumerable : true, | |
65 configurable : true | |
66 }, | |
67 }); |