Mercurial > eldonilo > lightstring
comparison plugins/delay.js @ 108:5cb4733c5189
many api changes
author | Sonny Piers <sonny@fastmail.net> |
---|---|
date | Fri, 13 Jul 2012 15:26:18 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
107:704ce44c1a22 | 108:5cb4733c5189 |
---|---|
1 'use strict'; | |
2 | |
3 /** | |
4 Copyright (c) 2011, Sonny Piers <sonny at fastmail dot net> | |
5 Copyright (c) 2012, Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | |
6 | |
7 Permission to use, copy, modify, and/or distribute this software for any | |
8 purpose with or without fee is hereby granted, provided that the above | |
9 copyright notice and this permission notice appear in all copies. | |
10 | |
11 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
12 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
13 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
14 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
18 */ | |
19 | |
20 //////////// | |
21 //Presence// http://xmpp.org/rfcs/rfc6121.html#presence | |
22 //////////// | |
23 (function() { | |
24 Object.defineProperty(Lightstring.Stanza.prototype, "delay", { | |
25 get : function(){ | |
26 var delayEl = this.el.querySelector('delay'); | |
27 if (!delayEl) | |
28 return null; | |
29 | |
30 var delay = { | |
31 stamp: delayEl.getAttribute('stamp'), | |
32 from: delayEl.getAttribute('from'), | |
33 reason: delayEl.textContent | |
34 } | |
35 return delay; | |
36 }, | |
37 // set : function(newValue){ bValue = newValue; }, | |
38 enumerable : true, | |
39 configurable : true | |
40 }); | |
41 })(); |