Make WordPress Core

Ticket #41602: 41602.2.diff

File 41602.2.diff, 3.9 KB (added by afercia, 7 years ago)
  • src/wp-includes/js/media-audiovideo.js

     
    44        l10n = window._wpMediaViewsL10n || {};
    55
    66/**
     7 *
     8 * @summary Defines the wp.media.mixin object.
     9 *
    710 * @mixin
     11 *
     12 * @since 4.2.0
    813 */
    914wp.media.mixin = {
    1015        mejsSettings: baseSettings,
    1116
     17        /**
     18         * @summary Pauses and removes all players.
     19         *
     20         * @since 4.2.0
     21         *
     22         * @return {void}
     23         */
    1224        removeAllPlayers: function() {
    1325                var p;
    1426
     
    2133        },
    2234
    2335        /**
     36         * @summary Removes the player.
     37         *
    2438         * Override the MediaElement method for removing a player.
    25          *      MediaElement tries to pull the audio/video tag out of
    26          *      its container and re-add it to the DOM.
     39         * MediaElement tries to pull the audio/video tag out of
     40         * its container and re-add it to the DOM.
     41         *
     42         * @since 4.2.0
     43         *
     44         * @return {void}
    2745         */
    2846        removePlayer: function(t) {
    2947                var featureIndex, feature;
     
    5876        },
    5977
    6078        /**
     79         *
     80         * @summary Removes and resets all players.
     81         *
    6182         * Allows any class that has set 'player' to a MediaElementPlayer
    62          *  instance to remove the player when listening to events.
     83         * instance to remove the player when listening to events.
    6384         *
    64          *  Examples: modal closes, shortcode properties are removed, etc.
     85         * Examples: modal closes, shortcode properties are removed, etc.
     86         *
     87         * @since 4.2.0
    6588         */
    6689        unsetPlayers : function() {
    6790                if ( this.players && this.players.length ) {
     
    7598};
    7699
    77100/**
    78  * Autowire "collection"-type shortcodes
     101 * @summary Shortcode modeling for playlists.
     102 *
     103 * @since 4.2.0
    79104 */
    80105wp.media.playlist = new wp.media.collection({
    81106        tag: 'playlist',
     
    92117});
    93118
    94119/**
    95  * Shortcode modeling for audio
    96  *  `edit()` prepares the shortcode for the media modal
    97  *  `shortcode()` builds the new shortcode after update
     120 * @summary Shortcode modeling for audio.
    98121 *
     122 * `edit()` prepares the shortcode for the media modal.
     123 * `shortcode()` builds the new shortcode after an update.
     124 *
    99125 * @namespace
     126 *
     127 * @since 4.2.0
    100128 */
    101129wp.media.audio = {
    102130        coerce : wp.media.coerce,
     
    110138                width : 400
    111139        },
    112140
     141        /**
     142         * @summary Instantiates a new media object with the next matching shortcode.
     143         *
     144         * @since 4.2.0
     145         *
     146         * @param {string} data The text to apply the shortcode on.
     147         * @returns {wp.media} The media object.
     148         */
    113149        edit : function( data ) {
    114150                var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode;
    115151
     
    122158                return frame;
    123159        },
    124160
     161        /**
     162         * @summary Generates an audio shortcode.
     163         *
     164         * @since 4.2.0
     165         *
     166         * @param {Array} model Array with attributes for the shortcode.
     167         * @returns {wp.shortcode} The audio shortcode object.
     168         */
    125169        shortcode : function( model ) {
    126170                var content;
    127171
     
    145189};
    146190
    147191/**
    148  * Shortcode modeling for video
    149  *  `edit()` prepares the shortcode for the media modal
    150  *  `shortcode()` builds the new shortcode after update
     192 * @summary Shortcode modeling for video.
    151193 *
     194 *  `edit()` prepares the shortcode for the media modal.
     195 *  `shortcode()` builds the new shortcode after update.
     196 *
     197 * @since 4.2.0
     198 *
    152199 * @namespace
    153200 */
    154201wp.media.video = {
     
    166213                height : 360
    167214        },
    168215
     216        /**
     217         * @summary Instantiates a new media object with the next matching shortcode.
     218         *
     219         * @since 4.2.0
     220         *
     221         * @param {string} data The text to apply the shortcode on.
     222         * @returns {wp.media} The media object.
     223         */
    169224        edit : function( data ) {
    170225                var frame,
    171226                        shortcode = wp.shortcode.next( 'video', data ).shortcode,
     
    183238                return frame;
    184239        },
    185240
     241        /**
     242         * @summary Generates an video shortcode.
     243         *
     244         * @since 4.2.0
     245         *
     246         * @param {Array} model Array with attributes for the shortcode.
     247         * @returns {wp.shortcode} The video shortcode object.
     248         */
    186249        shortcode : function( model ) {
    187250                var content;
    188251