comparison plugins.js @ 19:fc577e5b2f4a

add pusbub config plugins
author Sonny Piers <sonny.piers@gmail.com>
date Sat, 28 Jan 2012 01:24:36 +0100
parents 6707f450549e
children b6e4bc19ff5a
comparison
equal deleted inserted replaced
18:48bc65a0e0f1 19:fc577e5b2f4a
183 return "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub+"'><retract node='"+aNode+"'><item id='"+aItem+"'/></retract></pubsub></iq>"; 183 return "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub+"'><retract node='"+aNode+"'><item id='"+aItem+"'/></retract></pubsub></iq>";
184 }, 184 },
185 'delete': function(aTo, aNode, aURI) { 185 'delete': function(aTo, aNode, aURI) {
186 return "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub_owner+"'><delete node='"+aNode+"'/></pubsub></iq>"; 186 return "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub_owner+"'><delete node='"+aNode+"'/></pubsub></iq>";
187 }, 187 },
188 config: function(aTo, aNode, aFields) {
189 var iq = "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub+"'><configure node='"+aNode+"'><x xmlns='"+Lightstring.NS.x+"' type='submit'>";
190 if(aFields) {
191 aFields.forEach(function(field) {
192 iq += field;
193 });
194 }
195 iq += "</x></configure></pubsub></iq>";
196 return iq;
197 },
188 create: function(aTo, aNode, aFields) { 198 create: function(aTo, aNode, aFields) {
189 var iq = "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub+"'><create node='"+aNode+"'/>"; 199 var iq = "<iq type='set' to='"+aTo+"'><pubsub xmlns='"+Lightstring.NS.pubsub+"'><create node='"+aNode+"'/>";
190 if(aFields) { 200 if(aFields) {
191 iq += "<configure><x xmlns='"+Lightstring.NS.x+"' type='submit'>" 201 iq += "<configure><x xmlns='"+Lightstring.NS.x+"' type='submit'>"
192 aFields.forEach(function(field) { 202 aFields.forEach(function(field) {