diff --git a/client/src/app-portal.js b/client/src/app-portal.js index fa67fdcab3..a031470fb4 100644 --- a/client/src/app-portal.js +++ b/client/src/app-portal.js @@ -31,7 +31,14 @@ function ( Dep, /** typeof module:acl-portal-manager.Class */ AclPortalManager ) { - return Dep.extend({ + /** + * A portal application class. + * @class + * @name Class + * @extends module:app.Class + * @memberOf module:app-portal + */ + return Dep.extend(/** @lends module:app-portal.Class# */{ /** * @inheritDoc diff --git a/client/src/app.js b/client/src/app.js index d29a61f086..02661fdde9 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -141,41 +141,49 @@ function ( /** * @private + * @type {boolean} */ useCache: false, /** * @private + * @type {module:models/user.Class} */ user: null, /** * @private + * @type {module:models/preferences.Class} */ preferences: null, /** * @private + * @type {module:models/settings.Class} */ settings: null, /** * @private + * @type {module:metadata.Class} */ metadata: null, /** * @private + * @type {module:language.Class} */ language: null, /** * @private + * @type {module:field-manager.Class} */ fieldManager: null, /** * @private + * @type {module:cache.Class} */ cache: null, @@ -185,17 +193,23 @@ function ( loader: null, /** + * An API URL. + * * @private */ apiUrl: 'api/v1', /** + * An auth credentials string. + * * @private + * @type {string|null} */ auth: null, /** * @private + * @type {module:controllers/base.Class} */ baseController: null, @@ -206,16 +220,19 @@ function ( /** * @private + * @type {module:router.Class} */ router: null, /** * @private + * @type {module:model-factory.Class} */ modelFactory: null, /** * @private + * @type {module:collection-factory.Class} */ collectionFactory: null, @@ -231,6 +248,7 @@ function ( /** * @private + * @type {module:view-helper.Class} */ viewHelper: null, @@ -238,16 +256,19 @@ function ( * A body view. * * @protected + * @type {string} */ masterView: 'views/site/master', /** * @private + * @type {Cache|null} */ responseCache: null, /** * @private + * @type {module:broadcast-channel.Class|null} */ broadcastChannel: null, diff --git a/client/src/broadcast-channel.js b/client/src/broadcast-channel.js index e99188ac0d..5082950edc 100644 --- a/client/src/broadcast-channel.js +++ b/client/src/broadcast-channel.js @@ -28,7 +28,10 @@ define('broadcast-channel', [], function () { - return class { + /** + * @memberOf module:broadcast-channel + */ + class Class { constructor() { this.object = null; @@ -37,6 +40,11 @@ define('broadcast-channel', [], function () { } } + /** + * Post a message. + * + * @param {string} message A message. + */ postMessage(message) { if (!this.object) { return; @@ -45,6 +53,17 @@ define('broadcast-channel', [], function () { this.object.postMessage(message); } + /** + * @callback module:broadcast-channel.Class~callback + * + * @param {Event} event An event. A message can be obtained from the `data` property. + */ + + /** + * Subscribe to a message. + * + * @param {module:broadcast-channel.Class~callback} callback A callback. + */ subscribe(callback) { if (!this.object) { return; @@ -52,5 +71,7 @@ define('broadcast-channel', [], function () { this.object.addEventListener('message', callback); } - }; + } + + return Class; });