Make WordPress Core

Ticket #41602: audiovideo-manifest.diff

File audiovideo-manifest.diff, 3.7 KB (added by nicollle, 7 years ago)

Added JS documentation of audiovideo.manifast.js

  • src/wp-includes/js/media/audiovideo.manifest.js

    diff --git src/wp-includes/js/media/audiovideo.manifest.js src/wp-includes/js/media/audiovideo.manifest.js
    index 7217e02170..8e23190348 100644
    var media = wp.media, 
    33        l10n = window._wpMediaViewsL10n || {};
    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;
    1325
    wp.media.mixin = { 
    2032        },
    2133
    2234        /**
     35         * @summary Removes the player.
     36         *
    2337         * Override the MediaElement method for removing a player.
    2438         *      MediaElement tries to pull the audio/video tag out of
    2539         *      its container and re-add it to the DOM.
     40         *
     41         * @since 4.2.0
     42         *
     43         * @return {void}
    2644         */
    2745        removePlayer: function(t) {
    2846                var featureIndex, feature;
    wp.media.mixin = { 
    5775        },
    5876
    5977        /**
     78         *
     79         * @summary Removes and resets all players.
     80         *
    6081         * Allows any class that has set 'player' to a MediaElementPlayer
    6182         *  instance to remove the player when listening to events.
    6283         *
    6384         *  Examples: modal closes, shortcode properties are removed, etc.
     85         *
     86         *  @since 4.2.0
    6487         */
    6588        unsetPlayers : function() {
    6689                if ( this.players && this.players.length ) {
    wp.media.mixin = { 
    7497};
    7598
    7699/**
    77  * Autowire "collection"-type shortcodes
     100 * @summary Autowire "collection"-type shortcodes
     101 *
     102 * @since 4.2.0
    78103 */
    79104wp.media.playlist = new wp.media.collection({
    80105        tag: 'playlist',
    wp.media.playlist = new wp.media.collection({ 
    91116});
    92117
    93118/**
    94  * Shortcode modeling for audio
     119 * @summary Shortcode modeling for audio
     120 *
    95121 *  `edit()` prepares the shortcode for the media modal
    96122 *  `shortcode()` builds the new shortcode after update
    97123 *
    98124 * @namespace
     125 *
     126 * @since 4.2.0
    99127 */
    100128wp.media.audio = {
    101129        coerce : wp.media.coerce,
    wp.media.audio = { 
    109137                width : 400
    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;
    114150
    wp.media.audio = { 
    121157                return frame;
    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;
    126170
    wp.media.audio = { 
    144188};
    145189
    146190/**
    147  * Shortcode modeling for video
     191 * @summary Shortcode modeling for video
     192 *
    148193 *  `edit()` prepares the shortcode for the media modal
    149194 *  `shortcode()` builds the new shortcode after update
    150195 *
     196 * @since 4.2.0
     197 *
    151198 * @namespace
    152199 */
    153200wp.media.video = {
    wp.media.video = { 
    164211                width : 640,
    165212                height : 360
    166213        },
    167 
     214        /**
     215         * @summary Instantiates a new media object with the next matching shortcode.
     216         *
     217         * @since 4.2.0
     218         *
     219         * @param {string} data The text to apply the shortcode on.
     220         * @returns {wp.media} The media object.
     221         */
    168222        edit : function( data ) {
    169223                var frame,
    170224                        shortcode = wp.shortcode.next( 'video', data ).shortcode,
    wp.media.video = { 
    182236                return frame;
    183237        },
    184238
     239        /**
     240         * @summary Generates an video shortcode.
     241         *
     242         * @since 4.2.0
     243         *
     244         * @param {Array} model Array with attributes for the shortcode.
     245         * @returns {wp.shortcode} The video shortcode object.
     246         */
    185247        shortcode : function( model ) {
    186248                var content;
    187249