Commit 72001cb9 authored by JC Brand's avatar JC Brand

updates #1100 More jsdoc docstrings

parent 38499917
...@@ -239,4 +239,4 @@ html: ...@@ -239,4 +239,4 @@ html:
.PHONY: apidoc .PHONY: apidoc
apidoc: apidoc:
$(JSDOC) -d docs/html/api src/converse-disco.js $(JSDOC) -d docs/html/api src/*.js
...@@ -301,16 +301,6 @@ ...@@ -301,16 +301,6 @@
* @namespace * @namespace
*/ */
'identities': { 'identities': {
/**
* Clears all previously registered identities.
* @function
*
* @example
* _converse.api.disco.own.identities.clear();
*/
clear () {
plugin._identities = []
},
/** /**
* Lets you add new identities for this client (i.e. instance of Converse.js) * Lets you add new identities for this client (i.e. instance of Converse.js)
* @function * @function
...@@ -334,6 +324,16 @@ ...@@ -334,6 +324,16 @@
} }
plugin._identities.push({category: category, type: type, name: name, lang: lang}); plugin._identities.push({category: category, type: type, name: name, lang: lang});
}, },
/**
* Clears all previously registered identities.
* @function
*
* @example
* _converse.api.disco.own.identities.clear();
*/
clear () {
plugin._identities = []
},
/** /**
* Returns all of the identities registered for this client * Returns all of the identities registered for this client
* (i.e. instance of Converse.js). * (i.e. instance of Converse.js).
...@@ -346,17 +346,44 @@ ...@@ -346,17 +346,44 @@
return plugin._identities; return plugin._identities;
} }
}, },
/**
* The "features" grouping
* @namespace
*/
'features': { 'features': {
/**
* Lets you register new disco features for this client (i.e. instance of Converse.js)
* @function
*
* @param {String} name - e.g. http://jabber.org/protocol/caps
*
* @example
* _converse.api.disco.own.features.add("http://jabber.org/protocol/caps");
*/
add (name) { add (name) {
for (var i=0; i<plugin._features.length; i++) { for (var i=0; i<plugin._features.length; i++) {
if (plugin._features[i] == name) { return false; } if (plugin._features[i] == name) { return false; }
} }
plugin._features.push(name); plugin._features.push(name);
}, },
/**
* Clears all previously registered features.
* @function
*
* @example
* _converse.api.disco.own.features.clear();
*/
clear () { clear () {
plugin._features = [] plugin._features = []
}, },
/**
* Returns all of the features registered for this client
* (i.e. instance of Converse.js).
* @function
*
* @example
* const features = _converse.api.disco.own.features.get();
*/
get () { get () {
return plugin._features; return plugin._features;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment