Răsfoiți Sursa

updates #1100 More jsdoc docstrings

JC Brand 7 ani în urmă
părinte
comite
72001cb9df
2 a modificat fișierele cu 39 adăugiri și 12 ștergeri
  1. 1 1
      Makefile
  2. 38 11
      src/converse-disco.js

+ 1 - 1
Makefile

@@ -239,4 +239,4 @@ html:
 
 .PHONY: apidoc
 apidoc:
-	$(JSDOC) -d docs/html/api src/converse-disco.js 
+	$(JSDOC) -d docs/html/api src/*.js

+ 38 - 11
src/converse-disco.js

@@ -301,16 +301,6 @@
                          * @namespace
                          */
                         '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)
                              * @function
@@ -334,6 +324,16 @@
                                 }
                                 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
                              * (i.e. instance of Converse.js).
@@ -346,17 +346,44 @@
                                 return plugin._identities;
                             }
                         },
-
+                        /**
+                         * The "features" grouping
+                         * @namespace
+                         */
                         '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) {
                                 for (var i=0; i<plugin._features.length; i++) {
                                     if (plugin._features[i] == name) { return false; }
                                 }
                                 plugin._features.push(name);
                             },
+                            /**
+                             * Clears all previously registered features.
+                             * @function
+                             *
+                             * @example
+                             * _converse.api.disco.own.features.clear();
+                             */
                             clear () {
                                 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 () {
                                 return plugin._features;
                             }