Add a "Beta Media" button to the post editor. Currently, it is only capable of inserting images. Other attachment types and galleries need not apply... yet.

* Added `wp.media.string.image( attachment, props )` for generating an image as a string from an attachment and relevant attachment display properties.
* Properly localized the gallery workflow.
* Added `Workflow.update()`, which closes the modal, triggers an `update` event, and resets the selection.
* Added `wp.mce.media` to manage the various media workflows for editors.

see #21813, #21814, #21390.


git-svn-id: https://develop.svn.wordpress.org/trunk@22036 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-09-27 04:09:43 +00:00
parent d849e65a30
commit 692d806fff
6 changed files with 160 additions and 56 deletions

View File

@@ -297,7 +297,7 @@ function wp_default_scripts( &$scripts ) {
'type' => 'characters' == _x( 'words', 'word count: words or characters?' ) ? 'c' : 'w',
) );
$scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), false, 1 );
$scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'mce-view' ), false, 1 );
$scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), 'r6', 1 );
@@ -317,12 +317,20 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'media-models', "/wp-includes/js/media-models$suffix.js", array( 'backbone', 'jquery' ), false, 1 );
$scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'media-models', 'wp-plupload' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'media-views', '_wpMediaViewsL10n', array(
'insertMedia' => __( 'Insert Media' ),
'selectMediaSingular' => __( 'Select a media file:' ),
'selectMediaMultiple' => __( 'Select one or more media files:' ),
'createNewGallery' => __( 'Create a new gallery' ),
'insertIntoPost' => __( 'Insert into post' ),
'addToGallery' => __( 'Add to gallery' ),
// Generic
'insertMedia' => __( 'Insert Media' ),
'selectMediaSingular' => __( 'Select a media file:' ),
'selectMediaMultiple' => __( 'Select one or more media files:' ),
// Library
'createNewGallery' => __( 'Create a new gallery' ),
'insertIntoPost' => __( 'Insert into post' ),
'addToGallery' => __( 'Add to gallery' ),
// Gallery
'returnToLibrary' => __( 'Return to media library' ),
'insertGalleryIntoPost' => __( 'Insert gallery into post' ),
'addImagesFromLibrary' => __( 'Add images from media library' ),
) );
$scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );