Docs: Improve JavaScript documentation in audiovideo.manifest.js.

Add and improve JSDOC blocks.

Props nicollle, manuelaugustin.
Fixes #41602.


git-svn-id: https://develop.svn.wordpress.org/trunk@41239 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein 2017-08-11 20:36:19 +00:00
parent d570de32ca
commit 1306166cb9
1 changed files with 75 additions and 12 deletions

View File

@ -3,11 +3,23 @@ var media = wp.media,
l10n = window._wpMediaViewsL10n || {};
/**
*
* @summary Defines the wp.media.mixin object.
*
* @mixin
*
* @since 4.2.0
*/
wp.media.mixin = {
mejsSettings: baseSettings,
/**
* @summary Pauses and removes all players.
*
* @since 4.2.0
*
* @return {void}
*/
removeAllPlayers: function() {
var p;
@ -20,9 +32,15 @@ wp.media.mixin = {
},
/**
* @summary Removes the player.
*
* Override the MediaElement method for removing a player.
* MediaElement tries to pull the audio/video tag out of
* its container and re-add it to the DOM.
* MediaElement tries to pull the audio/video tag out of
* its container and re-add it to the DOM.
*
* @since 4.2.0
*
* @return {void}
*/
removePlayer: function(t) {
var featureIndex, feature;
@ -57,10 +75,15 @@ wp.media.mixin = {
},
/**
* Allows any class that has set 'player' to a MediaElementPlayer
* instance to remove the player when listening to events.
*
* Examples: modal closes, shortcode properties are removed, etc.
* @summary Removes and resets all players.
*
* Allows any class that has set 'player' to a MediaElementPlayer
* instance to remove the player when listening to events.
*
* Examples: modal closes, shortcode properties are removed, etc.
*
* @since 4.2.0
*/
unsetPlayers : function() {
if ( this.players && this.players.length ) {
@ -74,7 +97,9 @@ wp.media.mixin = {
};
/**
* Autowire "collection"-type shortcodes
* @summary Shortcode modeling for playlists.
*
* @since 4.2.0
*/
wp.media.playlist = new wp.media.collection({
tag: 'playlist',
@ -91,11 +116,14 @@ wp.media.playlist = new wp.media.collection({
});
/**
* Shortcode modeling for audio
* `edit()` prepares the shortcode for the media modal
* `shortcode()` builds the new shortcode after update
* @summary Shortcode modeling for audio.
*
* `edit()` prepares the shortcode for the media modal.
* `shortcode()` builds the new shortcode after an update.
*
* @namespace
*
* @since 4.2.0
*/
wp.media.audio = {
coerce : wp.media.coerce,
@ -109,6 +137,14 @@ wp.media.audio = {
width : 400
},
/**
* @summary Instantiates a new media object with the next matching shortcode.
*
* @since 4.2.0
*
* @param {string} data The text to apply the shortcode on.
* @returns {wp.media} The media object.
*/
edit : function( data ) {
var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
@ -121,6 +157,14 @@ wp.media.audio = {
return frame;
},
/**
* @summary Generates an audio shortcode.
*
* @since 4.2.0
*
* @param {Array} model Array with attributes for the shortcode.
* @returns {wp.shortcode} The audio shortcode object.
*/
shortcode : function( model ) {
var content;
@ -144,9 +188,12 @@ wp.media.audio = {
};
/**
* Shortcode modeling for video
* `edit()` prepares the shortcode for the media modal
* `shortcode()` builds the new shortcode after update
* @summary Shortcode modeling for video.
*
* `edit()` prepares the shortcode for the media modal.
* `shortcode()` builds the new shortcode after update.
*
* @since 4.2.0
*
* @namespace
*/
@ -165,6 +212,14 @@ wp.media.video = {
height : 360
},
/**
* @summary Instantiates a new media object with the next matching shortcode.
*
* @since 4.2.0
*
* @param {string} data The text to apply the shortcode on.
* @returns {wp.media} The media object.
*/
edit : function( data ) {
var frame,
shortcode = wp.shortcode.next( 'video', data ).shortcode,
@ -182,6 +237,14 @@ wp.media.video = {
return frame;
},
/**
* @summary Generates an video shortcode.
*
* @since 4.2.0
*
* @param {Array} model Array with attributes for the shortcode.
* @returns {wp.shortcode} The video shortcode object.
*/
shortcode : function( model ) {
var content;