Skip to content

Commit

Permalink
fix(doc): Update @event and @link in UI
Browse files Browse the repository at this point in the history
After some research, I found the right way to use @event in JsDoc:
1. An event definition should be: @event className@eventName
2. The link to the event should be:
   @link className#event:eventName

Reference: https://groups.google.com/g/jsdoc-users/c/-1Qle3ww8Rk/m/UjiibrcSkoUJ

Change-Id: I09ed999f44df815c2f9f558f7ddbfd2f4c7df426
  • Loading branch information
michellezhuogg committed Mar 19, 2021
1 parent 8d4fbf6 commit 99314b7
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 85 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/ui-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config = {
ui.configure(config);
```

Controls will fire a {@link shaka.ui.Controls.UIUpdatedEvent} event once the
Controls will fire a {@link shaka.ui.Controls#event:UIUpdatedEvent} event once the
config takes effect.
See the docs for {@link shaka.extern.UIConfiguration} for more information.

Expand Down
168 changes: 84 additions & 84 deletions ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,90 +261,6 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
this.elements_ = [];
}

/**
* @event shaka.ui.Controls.CastStatusChangedEvent
* @description Fired upon receiving a 'caststatuschanged' event from
* the cast proxy.
* @property {string} type
* 'caststatuschanged'
* @property {boolean} newStatus
* The new status of the application. True for 'is casting' and
* false otherwise.
* @exportDoc
*/


/**
* @event shaka.ui.Controls.SubMenuOpenEvent
* @description Fired when one of the overflow submenus is opened
* (e. g. language/resolution/subtitle selection).
* @property {string} type
* 'submenuopen'
* @exportDoc
*/


/**
* @event shaka.ui.Controls.CaptionSelectionUpdatedEvent
* @description Fired when the captions/subtitles menu has finished updating.
* @property {string} type
* 'captionselectionupdated'
* @exportDoc
*/


/**
* @event shaka.ui.Controls.ResolutionSelectionUpdatedEvent
* @description Fired when the resolution menu has finished updating.
* @property {string} type
* 'resolutionselectionupdated'
* @exportDoc
*/


/**
* @event shaka.ui.Controls.LanguageSelectionUpdatedEvent
* @description Fired when the audio language menu has finished updating.
* @property {string} type
* 'languageselectionupdated'
* @exportDoc
*/


/**
* @event shaka.ui.Controls.ErrorEvent
* @description Fired when something went wrong with the controls.
* @property {string} type
* 'error'
* @property {!shaka.util.Error} detail
* An object which contains details on the error. The error's 'category'
* and 'code' properties will identify the specific error that occurred.
* In an uncompiled build, you can also use the 'message' and 'stack'
* properties to debug.
* @exportDoc
*/


/**
* @event shaka.ui.Controls.TimeAndSeekRangeUpdatedEvent
* @description Fired when the time and seek range elements have finished
* updating.
* @property {string} type
* 'timeandseekrangeupdated'
* @exportDoc
*/


/**
* @event shaka.ui.Controls.UIUpdatedEvent
* @description Fired after a call to ui.configure() once the UI has finished
* updating.
* @property {string} type
* 'uiupdated'
* @exportDoc
*/


/**
* @param {string} name
* @param {!shaka.extern.IUIElement.Factory} factory
Expand Down Expand Up @@ -1521,6 +1437,90 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
}
};


/**
* @event shaka.ui.Controls#CastStatusChangedEvent
* @description Fired upon receiving a 'caststatuschanged' event from
* the cast proxy.
* @property {string} type
* 'caststatuschanged'
* @property {boolean} newStatus
* The new status of the application. True for 'is casting' and
* false otherwise.
* @exportDoc
*/


/**
* @event shaka.ui.Controls#SubMenuOpenEvent
* @description Fired when one of the overflow submenus is opened
* (e. g. language/resolution/subtitle selection).
* @property {string} type
* 'submenuopen'
* @exportDoc
*/


/**
* @event shaka.ui.Controls#CaptionSelectionUpdatedEvent
* @description Fired when the captions/subtitles menu has finished updating.
* @property {string} type
* 'captionselectionupdated'
* @exportDoc
*/


/**
* @event shaka.ui.Controls#ResolutionSelectionUpdatedEvent
* @description Fired when the resolution menu has finished updating.
* @property {string} type
* 'resolutionselectionupdated'
* @exportDoc
*/


/**
* @event shaka.ui.Controls#LanguageSelectionUpdatedEvent
* @description Fired when the audio language menu has finished updating.
* @property {string} type
* 'languageselectionupdated'
* @exportDoc
*/


/**
* @event shaka.ui.Controls#ErrorEvent
* @description Fired when something went wrong with the controls.
* @property {string} type
* 'error'
* @property {!shaka.util.Error} detail
* An object which contains details on the error. The error's 'category'
* and 'code' properties will identify the specific error that occurred.
* In an uncompiled build, you can also use the 'message' and 'stack'
* properties to debug.
* @exportDoc
*/


/**
* @event shaka.ui.Controls#TimeAndSeekRangeUpdatedEvent
* @description Fired when the time and seek range elements have finished
* updating.
* @property {string} type
* 'timeandseekrangeupdated'
* @exportDoc
*/


/**
* @event shaka.ui.Controls#UIUpdatedEvent
* @description Fired after a call to ui.configure() once the UI has finished
* updating.
* @property {string} type
* 'uiupdated'
* @exportDoc
*/

/** @private {!Map.<string, !shaka.extern.IUIElement.Factory>} */
shaka.ui.ControlsPanel.elementNamesToFactories_ = new Map();

Expand Down

0 comments on commit 99314b7

Please sign in to comment.