Make WordPress Core


Ignore:
Timestamp:
07/15/2014 10:17:58 PM (10 years ago)
Author:
wonderboymusic
Message:

Simplify creation of audio, video, and playlist MCE views by placing them in iframe sandboxes.

Wins:

  • Eliminates duplication of code between PHP and JS
  • Views can load JS without messing with TinyMCE and scope
  • MEjs doesn't break when it loads a file plugin-mode. This allows any file type the MEjs supports to play in MCE views.
  • YouTube now works as the source for video.
  • Users can still style the views, editor stylesheets are included in these sandboxes.
  • Audio and Video URLs and [embed]s are no longer broken.
  • Remove the crazy compat code necessary to determine what file types play in what browser.
  • Remove unneeded Underscore templates.
  • Remove the compat code for playlists.

See #28905.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r29133 r29179  
    12171217    </script>
    12181218
    1219     <script type="text/html" id="tmpl-editor-audio">
    1220         <?php wp_underscore_audio_template() ?>
    1221     </script>
    1222 
    1223     <script type="text/html" id="tmpl-editor-video">
    1224         <?php wp_underscore_video_template() ?>
    1225     </script>
    1226 
    1227     <?php wp_underscore_playlist_templates() ?>
    1228 
    1229     <script type="text/html" id="tmpl-editor-playlist">
    1230         <# if ( data.tracks ) { #>
    1231             <div class="wp-playlist wp-{{ data.type }}-playlist wp-playlist-{{ data.style }}">
    1232                 <# if ( 'audio' === data.type ){ #>
    1233                 <div class="wp-playlist-current-item"></div>
    1234                 <# } #>
    1235                 <{{ data.type }} controls="controls" preload="none" <#
    1236                     if ( data.width ) { #> width="{{ data.width }}"<# }
    1237                     #><# if ( data.height ) { #> height="{{ data.height }}"<# } #>></{{ data.type }}>
    1238                 <div class="wp-playlist-next"></div>
    1239                 <div class="wp-playlist-prev"></div>
    1240             </div>
    1241         <# } else { #>
    1242             <div class="wpview-error">
    1243                 <div class="dashicons dashicons-video-alt3"></div><p><?php _e( 'No items found.' ); ?></p>
    1244             </div>
    1245         <# } #>
    1246     </script>
    1247 
    12481219    <script type="text/html" id="tmpl-crop-content">
    12491220        <img class="crop-image" src="{{ data.url }}">
Note: See TracChangeset for help on using the changeset viewer.