Make WordPress Core

Changeset 41239


Ignore:
Timestamp:
08/11/2017 08:36:19 PM (7 years ago)
Author:
adamsilverstein
Message:

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

Add and improve JSDOC blocks.

Props nicollle, manuelaugustin.
Fixes #41602.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media/audiovideo.manifest.js

    r33337 r41239  
    44
    55/**
     6 *
     7 * @summary Defines the wp.media.mixin object.
     8 *
    69 * @mixin
     10 *
     11 * @since 4.2.0
    712 */
    813wp.media.mixin = {
    914    mejsSettings: baseSettings,
    1015
     16    /**
     17     * @summary Pauses and removes all players.
     18     *
     19     * @since 4.2.0
     20     *
     21     * @return {void}
     22     */
    1123    removeAllPlayers: function() {
    1224        var p;
     
    2133
    2234    /**
     35     * @summary Removes the player.
     36     *
    2337     * Override the MediaElement method for removing a player.
    24      *  MediaElement tries to pull the audio/video tag out of
    25      *  its container and re-add it to the DOM.
     38     * MediaElement tries to pull the audio/video tag out of
     39     * its container and re-add it to the DOM.
     40     *
     41     * @since 4.2.0
     42     *
     43     * @return {void}
    2644     */
    2745    removePlayer: function(t) {
     
    5876
    5977    /**
     78     *
     79     * @summary Removes and resets all players.
     80     *
    6081     * Allows any class that has set 'player' to a MediaElementPlayer
    61      *  instance to remove the player when listening to events.
    62      *
    63      *  Examples: modal closes, shortcode properties are removed, etc.
     82     * instance to remove the player when listening to events.
     83     *
     84     * Examples: modal closes, shortcode properties are removed, etc.
     85     *
     86     * @since 4.2.0
    6487     */
    6588    unsetPlayers : function() {
     
    7598
    7699/**
    77  * Autowire "collection"-type shortcodes
     100 * @summary Shortcode modeling for playlists.
     101 *
     102 * @since 4.2.0
    78103 */
    79104wp.media.playlist = new wp.media.collection({
     
    92117
    93118/**
    94  * Shortcode modeling for audio
    95  *  `edit()` prepares the shortcode for the media modal
    96  *  `shortcode()` builds the new shortcode after update
     119 * @summary Shortcode modeling for audio.
     120 *
     121 * `edit()` prepares the shortcode for the media modal.
     122 * `shortcode()` builds the new shortcode after an update.
    97123 *
    98124 * @namespace
     125 *
     126 * @since 4.2.0
    99127 */
    100128wp.media.audio = {
     
    110138    },
    111139
     140    /**
     141     * @summary Instantiates a new media object with the next matching shortcode.
     142     *
     143     * @since 4.2.0
     144     *
     145     * @param {string} data The text to apply the shortcode on.
     146     * @returns {wp.media} The media object.
     147     */
    112148    edit : function( data ) {
    113149        var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
     
    122158    },
    123159
     160    /**
     161     * @summary Generates an audio shortcode.
     162     *
     163     * @since 4.2.0
     164     *
     165     * @param {Array} model Array with attributes for the shortcode.
     166     * @returns {wp.shortcode} The audio shortcode object.
     167     */
    124168    shortcode : function( model ) {
    125169        var content;
     
    145189
    146190/**
    147  * Shortcode modeling for video
    148  *  `edit()` prepares the shortcode for the media modal
    149  *  `shortcode()` builds the new shortcode after update
     191 * @summary Shortcode modeling for video.
     192 *
     193 *  `edit()` prepares the shortcode for the media modal.
     194 *  `shortcode()` builds the new shortcode after update.
     195 *
     196 * @since 4.2.0
    150197 *
    151198 * @namespace
     
    166213    },
    167214
     215    /**
     216     * @summary Instantiates a new media object with the next matching shortcode.
     217     *
     218     * @since 4.2.0
     219     *
     220     * @param {string} data The text to apply the shortcode on.
     221     * @returns {wp.media} The media object.
     222     */
    168223    edit : function( data ) {
    169224        var frame,
     
    183238    },
    184239
     240    /**
     241     * @summary Generates an video shortcode.
     242     *
     243     * @since 4.2.0
     244     *
     245     * @param {Array} model Array with attributes for the shortcode.
     246     * @returns {wp.shortcode} The video shortcode object.
     247     */
    185248    shortcode : function( model ) {
    186249        var content;
Note: See TracChangeset for help on using the changeset viewer.