Mercurial > eldonilo > lightstring
comparison stanza.js @ 107:704ce44c1a22
Add several properties to the Lightstring.Stanza object
author | Sonny Piers <sonny@fastmail.net> |
---|---|
date | Thu, 28 Jun 2012 12:51:04 +0200 |
parents | c06ec02217ee |
children | 5cb4733c5189 |
comparison
equal
deleted
inserted
replaced
106:c06ec02217ee | 107:704ce44c1a22 |
---|---|
31 this.el = null;//TODO error | 31 this.el = null;//TODO error |
32 }; | 32 }; |
33 Lightstring.Stanza.prototype.toString = function() { | 33 Lightstring.Stanza.prototype.toString = function() { |
34 return Lightstring.serialize(this.el); | 34 return Lightstring.serialize(this.el); |
35 }; | 35 }; |
36 | |
37 Object.defineProperty(Lightstring.Stanza.prototype, "from", { | |
38 get : function(){ | |
39 return this.el.getAttribute('from'); | |
40 }, | |
41 // set : function(newValue){ bValue = newValue; }, | |
42 enumerable : true, | |
43 configurable : true | |
44 }); | |
45 Object.defineProperty(Lightstring.Stanza.prototype, "name", { | |
46 get : function(){ | |
47 return this.el.localName; | |
48 }, | |
49 // set : function(newValue){ bValue = newValue; }, | |
50 enumerable : true, | |
51 configurable : true | |
52 }); | |
53 Object.defineProperty(Lightstring.Stanza.prototype, "id", { | |
54 get : function(){ | |
55 return this.el.getAttribute('id'); | |
56 }, | |
57 // set : function(newValue){ bValue = newValue; }, | |
58 enumerable : true, | |
59 configurable : true | |
60 }); | |
61 Object.defineProperty(Lightstring.Stanza.prototype, "to", { | |
62 get : function(){ | |
63 return this.el.getAttribute('to'); | |
64 }, | |
65 // set : function(newValue){ bValue = newValue; }, | |
66 enumerable : true, | |
67 configurable : true | |
68 }); |