Add MCE Views for audio and video. Please clear your browser cache so that you get the latest TinyMCE stylesheet.

* Move TinyMCE shortcode handling from `wpgallery` plugin to `mce-view.js`
* Force `preload="none"` when rendering media in the editor to ensure fast loading (I realize this sounds illogical)
* Move audio and video tag builder logic in `media-template.php` into PHP funcs that can be reused by any code passing `data.model` to an Underscore template
* Pause all players when moving between editor tabs and when moving from the editor to editing in the media modal.
* Rename `wp.media.audio|video.shortcode()` to the more appropriate `wp.media.audio|video.update()` that now returns a `wp.shortcode` object instead of a string.
* Add necessary MediaElement css files to `$mce_css`
* In `wp.mce.View.render()`, support multiple instances of the same shortcode
* When rendering `wp.mce.View`s, fire a ready event that passes the current MCE View root element as context 

See #27389.



git-svn-id: https://develop.svn.wordpress.org/trunk@27528 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-03-13 23:09:06 +00:00
parent 110e19a6a0
commit 1c7d92ba50
8 changed files with 386 additions and 183 deletions

View File

@@ -343,9 +343,16 @@ final class _WP_Editors {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$version = 'ver=' . $GLOBALS['wp_version'];
$dashicons = includes_url( "css/dashicons$suffix.css?$version" );
$mediaelement = includes_url( "js/mediaelement/mediaelementplayer.min.css?$version" );
$wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" );
// WordPress default stylesheet and dashicons
$mce_css = array( $dashicons, self::$baseurl . '/skins/wordpress/wp-content.css' );
$mce_css = array(
$dashicons,
$mediaelement,
$wpmediaelement,
self::$baseurl . '/skins/wordpress/wp-content.css'
);
// load editor_style.css if the current theme supports it
if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) {