annotate plugins/delay.js @ 109:cd1f57661439 default tip

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