First pass on TinyMCE attachment in-editor UI.

* Adds in-editor UI for image attachments. Most of this UI should be able to migrate to all images in a future commit.
* Removes the wpeditimage TinyMCE plugin from the default plugins array.
* Add `wp.media.fit`, a helper method to constrain dimensions based upon a maximum width and/or height.
* Add html attribute parsing and string generation utilities (currently stored in mce-views).
* Calling `remove` on a TinyMCE views now ensures that the the parent and references are removed as well.
* Fixes a bug where we weren't sending the full array of results to matches in wp.mce.view.

see #21390, #21812, #21813.



git-svn-id: https://develop.svn.wordpress.org/trunk@22012 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-09-26 14:12:54 +00:00
parent 4c29375d2c
commit 0dd940e0c1
6 changed files with 322 additions and 10 deletions

View File

@@ -323,7 +323,10 @@ function wp_default_scripts( &$scripts ) {
) );
$scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );
$scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'backbone', 'jquery' ), false, 1 );
$scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'mce-view', '_wpMceViewL10n', array(
'contentWidth' => isset( $GLOBALS['content_width'] ) ? $GLOBALS['content_width'] : 800,
) );
if ( is_admin() ) {
$scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ) );