Ticket #41602: 41602.2.diff
File 41602.2.diff, 3.9 KB (added by , 7 years ago) |
---|
-
src/wp-includes/js/media-audiovideo.js
4 4 l10n = window._wpMediaViewsL10n || {}; 5 5 6 6 /** 7 * 8 * @summary Defines the wp.media.mixin object. 9 * 7 10 * @mixin 11 * 12 * @since 4.2.0 8 13 */ 9 14 wp.media.mixin = { 10 15 mejsSettings: baseSettings, 11 16 17 /** 18 * @summary Pauses and removes all players. 19 * 20 * @since 4.2.0 21 * 22 * @return {void} 23 */ 12 24 removeAllPlayers: function() { 13 25 var p; 14 26 … … 21 33 }, 22 34 23 35 /** 36 * @summary Removes the player. 37 * 24 38 * 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} 27 45 */ 28 46 removePlayer: function(t) { 29 47 var featureIndex, feature; … … 58 76 }, 59 77 60 78 /** 79 * 80 * @summary Removes and resets all players. 81 * 61 82 * Allows any class that has set 'player' to a MediaElementPlayer 62 * 83 * instance to remove the player when listening to events. 63 84 * 64 * Examples: modal closes, shortcode properties are removed, etc. 85 * Examples: modal closes, shortcode properties are removed, etc. 86 * 87 * @since 4.2.0 65 88 */ 66 89 unsetPlayers : function() { 67 90 if ( this.players && this.players.length ) { … … 75 98 }; 76 99 77 100 /** 78 * Autowire "collection"-type shortcodes 101 * @summary Shortcode modeling for playlists. 102 * 103 * @since 4.2.0 79 104 */ 80 105 wp.media.playlist = new wp.media.collection({ 81 106 tag: 'playlist', … … 92 117 }); 93 118 94 119 /** 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. 98 121 * 122 * `edit()` prepares the shortcode for the media modal. 123 * `shortcode()` builds the new shortcode after an update. 124 * 99 125 * @namespace 126 * 127 * @since 4.2.0 100 128 */ 101 129 wp.media.audio = { 102 130 coerce : wp.media.coerce, … … 110 138 width : 400 111 139 }, 112 140 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 */ 113 149 edit : function( data ) { 114 150 var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode; 115 151 … … 122 158 return frame; 123 159 }, 124 160 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 */ 125 169 shortcode : function( model ) { 126 170 var content; 127 171 … … 145 189 }; 146 190 147 191 /** 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. 151 193 * 194 * `edit()` prepares the shortcode for the media modal. 195 * `shortcode()` builds the new shortcode after update. 196 * 197 * @since 4.2.0 198 * 152 199 * @namespace 153 200 */ 154 201 wp.media.video = { … … 166 213 height : 360 167 214 }, 168 215 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 */ 169 224 edit : function( data ) { 170 225 var frame, 171 226 shortcode = wp.shortcode.next( 'video', data ).shortcode, … … 183 238 return frame; 184 239 }, 185 240 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 */ 186 249 shortcode : function( model ) { 187 250 var content; 188 251