<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[27615] trunk/src/wp-includes: Add MCE views for audio and video shortcodes.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/27615">27615</a></dd>
<dt>Author</dt> <dd>wonderboymusic</dd>
<dt>Date</dt> <dd>2014-03-19 07:01:56 +0000 (Wed, 19 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add MCE views for audio and video shortcodes. When the shortcode does not contain a source that supports native playback, just show the filename.

* Remove the audio/video shortcode parsing from the `wpgallery` plugin.
* Make `mce-view` a dependency of `media-audiovideo`
* Introduce `wp.mce.video`, `wp.mce.audio`, `wp.mce.media`, and `wp.mce.media.View`
* Rename `wp.media.audio|video.shortcode()` to `wp.media.audio|video.update()` since it is called on Update and returns a `wp.shortcode` object now.
* In `wp.mce.View.render()`, fire a `ready` event when the placeholder is being parsed and pass the current node to the event handler.

See <a href="http://core.trac.wordpress.org/ticket/27389">#27389</a>, <a href="http://core.trac.wordpress.org/ticket/27437">#27437</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjsmceviewjs">trunk/src/wp-includes/js/mce-view.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaaudiovideojs">trunk/src/wp-includes/js/media-audiovideo.js</a></li>
<li><a href="#trunksrcwpincludesjstinymcepluginswpgallerypluginjs">trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js</a></li>
<li><a href="#trunksrcwpincludesjstinymceskinswordpresswpcontentcss">trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css</a></li>
<li><a href="#trunksrcwpincludesmediatemplatephp">trunk/src/wp-includes/media-template.php</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesjsmceviewjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/mce-view.js (27614 => 27615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/mce-view.js     2014-03-19 05:54:57 UTC (rev 27614)
+++ trunk/src/wp-includes/js/mce-view.js        2014-03-19 07:01:56 UTC (rev 27615)
</span><span class="lines">@@ -31,10 +31,14 @@
</span><span class="cx">                  var html = this.getHtml();
</span><span class="cx">                  // Search all tinymce editor instances and update the placeholders
</span><span class="cx">                  _.each( tinymce.editors, function( editor ) {
</span><del>-                               var doc;
</del><ins>+                                var doc, self = this;
</ins><span class="cx">                           if ( editor.plugins.wpview ) {
</span><span class="cx">                                  doc = editor.getDoc();
</span><del>-                                       $( doc ).find( '[data-wpview-text="' + this.encodedText + '"]' ).html( html );
</del><ins>+                                        $( doc ).find( '[data-wpview-text="' + this.encodedText + '"]' ).each(function (i, elem) {
+                                               var node = $( elem );
+                                               node.html( html );
+                                               $( self ).trigger( 'ready', elem );
+                                       });
</ins><span class="cx">                           }
</span><span class="cx">                  }, this );
</span><span class="cx">          }
</span><span class="lines">@@ -178,7 +182,7 @@
</span><span class="cx"> 
</span><span class="cx">          /**
</span><span class="cx">           * Refresh views after an update is made
</span><del>-                * 
</del><ins>+                 *
</ins><span class="cx">            * @param view {object} being refreshed
</span><span class="cx">           * @param text {string} textual representation of the view
</span><span class="cx">           */
</span><span class="lines">@@ -204,9 +208,9 @@
</span><span class="cx">                  return instances[ encodedText ];
</span><span class="cx">          },
</span><span class="cx"> 
</span><del>-               /** 
</del><ins>+                /**
</ins><span class="cx">            * render( scope )
</span><del>-                * 
</del><ins>+                 *
</ins><span class="cx">            * Renders any view instances inside a DOM node `scope`.
</span><span class="cx">           *
</span><span class="cx">           * View instances are detected by the presence of wrapper elements.
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaaudiovideojs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/media-audiovideo.js (27614 => 27615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/media-audiovideo.js     2014-03-19 05:54:57 UTC (rev 27614)
+++ trunk/src/wp-includes/js/media-audiovideo.js        2014-03-19 07:01:56 UTC (rev 27615)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-/* global _wpMediaViewsL10n */
</del><ins>+/* global _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */
</ins><span class="cx"> 
</span><span class="cx"> (function ($, _, Backbone) {
</span><span class="cx">  var media = wp.media, l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">                          video: ['ogg', 'webm']
</span><span class="cx">                  },
</span><span class="cx">                  'chrome' : {
</span><del>-                               audio: ['ogg', 'mpeg', 'x-ms-wma'],
</del><ins>+                                audio: ['ogg', 'mpeg'],
</ins><span class="cx">                           video: ['ogg', 'webm', 'mp4', 'm4v', 'mpeg']
</span><span class="cx">                  },
</span><span class="cx">                  'ff' : {
</span><span class="lines">@@ -227,20 +227,24 @@
</span><span class="cx">                  return frame;
</span><span class="cx">          },
</span><span class="cx"> 
</span><del>-               shortcode : function (shortcode) {
-                       var self = this;
</del><ins>+                update : function (model) {
+                       var self = this, content;
</ins><span class="cx"> 
</span><del>-                       _.each( wp.media.audio.defaults, function( value, key ) {
-                               shortcode[ key ] = self.coerce( shortcode, key );
</del><ins>+                        _.each( this.defaults, function( value, key ) {
+                               model[ key ] = self.coerce( model, key );
</ins><span class="cx"> 
</span><del>-                               if ( value === shortcode[ key ] ) {
-                                       delete shortcode[ key ];
</del><ins>+                                if ( value === model[ key ] ) {
+                                       delete model[ key ];
</ins><span class="cx">                           }
</span><span class="cx">                  });
</span><span class="cx"> 
</span><del>-                       return wp.shortcode.string({
-                               tag:     'audio',
-                               attrs:   shortcode
</del><ins>+                        content = model.content;
+                       delete model.content;
+
+                       return new wp.shortcode({
+                               tag: 'audio',
+                               attrs: model,
+                               content: content
</ins><span class="cx">                   });
</span><span class="cx">          }
</span><span class="cx">  };
</span><span class="lines">@@ -283,21 +287,23 @@
</span><span class="cx">                  return frame;
</span><span class="cx">          },
</span><span class="cx"> 
</span><del>-               shortcode : function (shortcode) {
-                       var self = this, content = shortcode.content;
-                       delete shortcode.content;
</del><ins>+                update : function (model) {
+                       var self = this, content;
</ins><span class="cx"> 
</span><span class="cx">                  _.each( this.defaults, function( value, key ) {
</span><del>-                               shortcode[ key ] = self.coerce( shortcode, key );
</del><ins>+                                model[ key ] = self.coerce( model, key );
</ins><span class="cx"> 
</span><del>-                               if ( value === shortcode[ key ] ) {
-                                       delete shortcode[ key ];
</del><ins>+                                if ( value === model[ key ] ) {
+                                       delete model[ key ];
</ins><span class="cx">                           }
</span><span class="cx">                  });
</span><span class="cx"> 
</span><del>-                       return wp.shortcode.string({
-                               tag:     'video',
-                               attrs:   shortcode,
</del><ins>+                        content = model.content;
+                       delete model.content;
+
+                       return new wp.shortcode({
+                               tag: 'video',
+                               attrs: model,
</ins><span class="cx">                           content: content
</span><span class="cx">                  });
</span><span class="cx">          }
</span><span class="lines">@@ -972,6 +978,125 @@
</span><span class="cx">          }
</span><span class="cx">  } );
</span><span class="cx"> 
</span><ins>+       wp.mce.media = {
+               toView:  function( content ) {
+                       var match = wp.shortcode.next( this.shortcode, content );
+
+                       if ( ! match ) {
+                               return;
+                       }
+
+                       return {
+                               index:   match.index,
+                               content: match.content,
+                               options: {
+                                       shortcode: match.shortcode
+                               }
+                       };
+               },
+
+               edit: function( node ) {
+                       var p,
+                               media = wp.media[ this.shortcode ],
+                               self = this,
+                               frame, data;
+
+                       wp.media.mixin.pauseAllPlayers();
+
+                       data = window.decodeURIComponent( $( node ).data('wpview-text') );
+                       frame = media.edit( data );
+                       frame.on( 'close', function () {
+                               frame.detach();
+                       } );
+                       frame.state( self.shortcode + '-details' ).on( 'update', function( selection ) {
+                               var shortcode = wp.media[ self.shortcode ].update( selection ).string();
+                               $( node ).attr( 'data-wpview-text', window.encodeURIComponent( shortcode ) );
+                               wp.mce.views.refreshView( self, shortcode );
+                               frame.detach();
+                       } );
+                       frame.open();
+               }
+       };
+
+       wp.mce.media.View = wp.mce.View.extend({
+               initialize: function( options ) {
+                       this.shortcode = options.shortcode;
+                       _.bindAll( this, 'setPlayer' );
+                       $(this).on( 'ready', this.setPlayer );
+               },
+
+               setPlayer: function (e, node) {
+                       // if the ready event fires on an empty node
+                       if ( ! node ) {
+                               return;
+                       }
+
+                       var self = this,
+                               media,
+                               settings = {},
+                               className = '.wp-' +  this.shortcode.tag + '-shortcode';
+
+                       if ( this.player ) {
+                               this.unsetPlayer();
+                       }
+
+                       media = $( node ).find( className );
+
+                       if ( ! _.isUndefined( window._wpmejsSettings ) ) {
+                               settings.pluginPath = _wpmejsSettings.pluginPath;
+                       }
+
+                       if ( ! this.isCompatible( media ) ) {
+                               media.closest( '.wpview-wrap' ).addClass( 'wont-play' );
+                               if ( ! media.parent().hasClass( 'wpview-wrap' ) ) {
+                                       media.parent().replaceWith( media );
+                               }
+                               media.replaceWith( '<p>' + media.find( 'source' ).eq(0).prop( 'src' ) + '</p>' );
+                               return;
+                       } else {
+                               media.closest( '.wpview-wrap' ).removeClass( 'wont-play' );
+                               if ( this.ua.is( 'ff' ) ) {
+                                       media.prop( 'preload', 'metadata' );
+                               } else {
+                                       media.prop( 'preload', 'none' );
+                               }
+                       }
+
+                       media = wp.media.view.MediaDetails.prepareSrc( media.get(0) );
+
+                       // Thanks, Firefox!
+                       setTimeout(function () {
+                               self.player = new MediaElementPlayer( media, settings );
+                       }, 50);
+               },
+
+               getHtml: function() {
+                       var attrs = this.shortcode.attrs.named;
+                       return this.template({ model: attrs });
+               }
+       });
+       _.extend( wp.mce.media.View.prototype, wp.media.mixin );
+
+       wp.mce.video = _.extend( {}, wp.mce.media, {
+               shortcode: 'video',
+               View: wp.mce.media.View.extend({
+                       className: 'editor-video',
+                       template:  media.template('editor-video')
+               })
+       } );
+
+       wp.mce.views.register( 'video', wp.mce.video );
+
+       wp.mce.audio = _.extend( {}, wp.mce.media, {
+               shortcode: 'audio',
+               View: wp.mce.media.View.extend({
+                       className: 'editor-audio',
+                       template:  media.template('editor-audio')
+               })
+       } );
+
+       wp.mce.views.register( 'audio', wp.mce.audio );
+
</ins><span class="cx">   function init() {
</span><span class="cx">          $(document.body)
</span><span class="cx">                  .on( 'click', '.wp-switch-editor', wp.media.mixin.pauseAllPlayers )
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymcepluginswpgallerypluginjs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js (27614 => 27615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js     2014-03-19 05:54:57 UTC (rev 27614)
+++ trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js        2014-03-19 07:01:56 UTC (rev 27615)
</span><span class="lines">@@ -25,8 +25,8 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function replaceAVShortcodes( content ) {
</span><del>-               var testRegex = /\[(video-playlist|audio|video|playlist)[^\]]*\]/,
-                       replaceRegex = /\[(video-playlist|audio|video|playlist)[^\]]*\]([\s\S]*?\[\/\1\])?/;
</del><ins>+                var testRegex = /\[(video-playlist|playlist)[^\]]*\]/,
+                       replaceRegex = /\[(video-playlist|playlist)[^\]]*\]([\s\S]*?\[\/\1\])?/;
</ins><span class="cx"> 
</span><span class="cx">          while ( testRegex.test( content ) ) {
</span><span class="cx">                  content = content.replace( replaceRegex, replaceCallback );
</span><span class="lines">@@ -92,31 +92,6 @@
</span><span class="cx">                          editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
</span><span class="cx">                          frame.detach();
</span><span class="cx">                  });
</span><del>-               } else if ( editor.dom.hasClass( node, 'wp-video' ) ) {
-                       frame = wp.media.video.edit( data );
-                       frame.on( 'close', function () {
-                               frame.detach();
-                       } );
-                       frame.state( 'video-details' ).on(
-                               'update replace add-source select-poster-image add-track',
-                               function ( selection ) {
-                                       var shortcode = wp.media.video.shortcode( selection );
-                                       editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
-                                       frame.detach();
-                               }
-                       );
-                       frame.open();
-               } else if ( editor.dom.hasClass( node, 'wp-audio' ) ) {
-                       frame = wp.media.audio.edit( data );
-                       frame.on( 'close', function () {
-                               frame.detach();
-                       } );
-                       frame.state( 'audio-details' ).on( 'update replace add-source', function ( selection ) {
-                               var shortcode = wp.media.audio.shortcode( selection );
-                               editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
-                               frame.detach();
-                       } );
-                       frame.open();
</del><span class="cx">           } else {
</span><span class="cx">                  // temp
</span><span class="cx">                  window.console && window.console.log( 'Edit AV shortcode ' + data );
</span><span class="lines">@@ -177,10 +152,6 @@
</span><span class="cx">          if ( node.nodeName === 'IMG' && dom.getAttrib( node, 'data-wp-media' ) ) {
</span><span class="cx">                  if ( dom.hasClass( node, 'wp-gallery' ) ) {
</span><span class="cx">                          event.name = 'gallery';
</span><del>-                       } else if ( dom.hasClass( node, 'wp-video' ) ) {
-                               event.name = 'video';
-                       } else if ( dom.hasClass( node, 'wp-audio' ) ) {
-                               event.name = 'audio';
</del><span class="cx">                   } else if ( dom.hasClass( node, 'wp-playlist' ) ) {
</span><span class="cx">                          event.name = 'playlist';
</span><span class="cx">                  } else if ( dom.hasClass( node, 'wp-video-playlist' ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesjstinymceskinswordpresswpcontentcss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css (27614 => 27615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css  2014-03-19 05:54:57 UTC (rev 27614)
+++ trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css     2014-03-19 07:01:56 UTC (rev 27615)
</span><span class="lines">@@ -141,15 +141,6 @@
</span><span class="cx">  background-image: url(images/gallery.png);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.mce-content-body img.wp-media.wp-video {
-       background-image: url(images/video.png);
-}
-
-.mce-content-body img.wp-media.wp-audio {
-       height: 70px;
-       background-image: url(images/audio.png);
-}
-
</del><span class="cx"> .mce-content-body img.wp-media.wp-playlist {
</span><span class="cx">  background-image: url("images/playlist-audio.png");
</span><span class="cx"> }
</span><span class="lines">@@ -223,44 +214,81 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Gallery preview
</del><ins>+ * Media previews
</ins><span class="cx">  */
</span><del>-.wpview-type-gallery {
</del><ins>+.wpview-type-gallery,
+.wpview-type-audio,
+.wpview-type-video {
</ins><span class="cx">     position: relative;
</span><span class="cx">     margin-bottom: 16px;
</span><span class="cx">  cursor: pointer;
</span><span class="cx">  border: 1px solid transparent;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>- .wpview-type-gallery:after {
</del><ins>+.wpview-type-audio {
+       padding: 24px 0 0;
+}
+
+.wpview-type-video {
+       padding: 0;
+}
+
+.wont-play {
+       padding: 4px 0;
+}
+
+.wont-play p {
+       font-size: 13px;
+       line-height: 1.3;
+       display: block;
+       width: 70%;
+       margin: 0 15%;
+       text-align: center;
+}
+
+.wpview-type-gallery:after {
</ins><span class="cx">     content: '';
</span><span class="cx">  display: table;
</span><span class="cx">     clear: both;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>- .wpview-type-gallery.selected {
</del><ins>+.wpview-type-gallery.selected,
+.wpview-type-audio,
+.wpview-type-video {
</ins><span class="cx">   background-color: #f2f8ff;
</span><span class="cx">  border-color: #777;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.wpview-type-gallery .toolbar {
-    position: absolute;
-    top: 0;
-    right: 0;
-    background-color: #333;
-    color: white;
</del><ins>+.wpview-type-gallery .toolbar,
+.wpview-type-audio .toolbar,
+.wpview-type-video .toolbar {
+       position: absolute;
+       top: 0;
+       right: 0;
+       background-color: #333;
+       color: white;
</ins><span class="cx">   display: none;
</span><ins>+       z-index: 100;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.wpview-type-video .toolbar div,
</ins><span class="cx"> .wpview-type-gallery .toolbar div,
</span><span class="cx"> #wp-image-toolbar div {
</span><span class="cx">  margin: 5px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.wpview-type-audio .toolbar div {
+       margin: 2px 5px;
+}
+
+.wpview-type-audio .toolbar,
+.wpview-type-video .toolbar,
</ins><span class="cx"> .wpview-type-gallery.selected .toolbar {
</span><span class="cx">  display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.wpview-type-audio .toolbar span,
+.wpview-type-video .toolbar span,
</ins><span class="cx"> .wpview-type-gallery .toolbar span {
</span><span class="cx">  cursor: pointer;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunksrcwpincludesmediatemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/media-template.php (27614 => 27615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/media-template.php 2014-03-19 05:54:57 UTC (rev 27614)
+++ trunk/src/wp-includes/media-template.php    2014-03-19 07:01:56 UTC (rev 27615)
</span><span class="lines">@@ -961,6 +961,23 @@
</span><span class="cx">                  <# } ); #>
</span><span class="cx">          </div>
</span><span class="cx">  </script>
</span><ins>+
+       <script type="text/html" id="tmpl-editor-audio">
+               <div class="toolbar">
+                       <div class="dashicons dashicons-format-audio edit"></div>
+                       <div class="dashicons dashicons-no-alt remove"></div>
+               </div>
+               <?php wp_underscore_audio_template() ?>
+       </script>
+
+       <script type="text/html" id="tmpl-editor-video">
+               <div class="toolbar">
+                       <div class="dashicons dashicons-format-video edit"></div>
+                       <div class="dashicons dashicons-no-alt remove"></div>
+               </div>
+               <?php wp_underscore_video_template() ?>
+       </script>
+
</ins><span class="cx">   <?php
</span><span class="cx"> 
</span><span class="cx">  /**
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/script-loader.php (27614 => 27615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/script-loader.php  2014-03-19 05:54:57 UTC (rev 27614)
+++ trunk/src/wp-includes/script-loader.php     2014-03-19 07:01:56 UTC (rev 27615)
</span><span class="lines">@@ -396,7 +396,7 @@
</span><span class="cx">  // Both rely on numerous settings, styles, and templates to operate correctly.
</span><span class="cx">  $scripts->add( 'media-views',  "/wp-includes/js/media-views$suffix.js",  array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement', 'image-edit' ), false, 1 );
</span><span class="cx">  $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
</span><del>-       $scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor' ), false, 1 );
</del><ins>+        $scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor', 'mce-view' ), false, 1 );
</ins><span class="cx">   $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 );
</span><span class="cx"> 
</span><span class="cx">  if ( is_admin() ) {
</span></span></pre>
</div>
</div>

</body>
</html>