# HG changeset patch # User Sonny Piers # Date 1340880664 -7200 # Node ID 704ce44c1a22c9dbdfc58c32f709af289fc2be78 # Parent c06ec02217ee6e905e07f9d084409f51e3dab18b Add several properties to the Lightstring.Stanza object diff --git a/stanza.js b/stanza.js --- a/stanza.js +++ b/stanza.js @@ -32,4 +32,37 @@ Lightstring.Stanza = function(aStanza) { }; Lightstring.Stanza.prototype.toString = function() { return Lightstring.serialize(this.el); -}; \ No newline at end of file +}; + +Object.defineProperty(Lightstring.Stanza.prototype, "from", { + get : function(){ + return this.el.getAttribute('from'); + }, + // set : function(newValue){ bValue = newValue; }, + enumerable : true, + configurable : true +}); +Object.defineProperty(Lightstring.Stanza.prototype, "name", { + get : function(){ + return this.el.localName; + }, + // set : function(newValue){ bValue = newValue; }, + enumerable : true, + configurable : true +}); +Object.defineProperty(Lightstring.Stanza.prototype, "id", { + get : function(){ + return this.el.getAttribute('id'); + }, + // set : function(newValue){ bValue = newValue; }, + enumerable : true, + configurable : true +}); +Object.defineProperty(Lightstring.Stanza.prototype, "to", { + get : function(){ + return this.el.getAttribute('to'); + }, + // set : function(newValue){ bValue = newValue; }, + enumerable : true, + configurable : true +}); \ No newline at end of file