X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/607b7e02d77e7326161e8ec15639052d2040f745..refs/tags/wordpress-4.7.1:/wp-includes/js/media-editor.js diff --git a/wp-includes/js/media-editor.js b/wp-includes/js/media-editor.js index aa407466..3852543a 100644 --- a/wp-includes/js/media-editor.js +++ b/wp-includes/js/media-editor.js @@ -48,28 +48,9 @@ * @returns {Object} Joined props */ props: function( props, attachment ) { - var link, linkUrl, size, sizes, fallbacks, + var link, linkUrl, size, sizes, defaultProps = wp.media.view.settings.defaultProps; - // Final fallbacks run after all processing has been completed. - fallbacks = function( props ) { - // Generate alt fallbacks and strip tags. - if ( 'image' === props.type && ! props.alt ) { - if ( props.caption ) { - props.alt = props.caption; - } else if ( props.title !== props.url ) { - props.alt = props.title; - } else { - props.alt = ''; - } - - props.alt = props.alt.replace( /<\/?[^>]+>/g, '' ); - props.alt = props.alt.replace( /[\r\n]+/g, ' ' ); - } - - return props; - }; - props = props ? _.clone( props ) : {}; if ( attachment && attachment.type ) { @@ -87,7 +68,7 @@ // All attachment-specific settings follow. if ( ! attachment ) { - return fallbacks( props ); + return props; } props.title = props.title || attachment.title; @@ -123,7 +104,7 @@ props.rel = props.rel || 'attachment wp-att-' + attachment.id; } - return fallbacks( props ); + return props; }, /** * Create link markup that is suitable for passing to the editor @@ -1111,13 +1092,6 @@ event.preventDefault(); - // Remove focus from the `.insert-media` button. - // Prevents Opera from showing the outline of the button - // above the modal. - // - // See: https://core.trac.wordpress.org/ticket/22445 - elem.blur(); - if ( elem.hasClass( 'gallery' ) ) { options.state = 'gallery'; options.title = wp.media.view.l10n.createGalleryTitle;