WordPress 4.4
[autoinstalls/wordpress.git] / wp-includes / media-template.php
index 8edeb62ebf2df5863d388578ce0ec83c8cf3bc8c..8d7c758c500aeeec6ab48adf92b7ca3b31a6f2f5 100644 (file)
@@ -50,7 +50,7 @@ function wp_underscore_audio_template() {
 function wp_underscore_video_template() {
        $video_types = wp_get_video_extensions();
 ?>
-<#  var w_rule = h_rule = '', classes = [],
+<#  var w_rule = '', classes = [],
                w, h, settings = wp.media.view.settings,
                isYouTube = isVimeo = false;
 
@@ -69,14 +69,11 @@ function wp_underscore_video_template() {
                h = Math.ceil( ( data.model.height * w ) / data.model.width );
        } else {
                h = data.model.height;
-       }
+       }
 
        if ( w ) {
                w_rule = 'width: ' + w + 'px; ';
        }
-       if ( h ) {
-               h_rule = 'height: ' + h + 'px;';
-       }
 
        if ( isYouTube ) {
                classes.push( 'youtube-video' );
@@ -87,7 +84,7 @@ function wp_underscore_video_template() {
        }
 
 #>
-<div style="{{ w_rule }}{{ h_rule }}" class="wp-video">
+<div style="{{ w_rule }}" class="wp-video">
 <video controls
        class="wp-video-shortcode {{ classes.join( ' ' ) }}"
        <# if ( w ) { #>width="{{ w }}"<# } #>
@@ -174,7 +171,7 @@ function wp_print_media_templates() {
 
        <script type="text/html" id="tmpl-uploader-window">
                <div class="uploader-window-content">
-                       <h3><?php _e( 'Drop files to upload' ); ?></h3>
+                       <h1><?php _e( 'Drop files to upload' ); ?></h1>
                </div>
        </script>
 
@@ -191,19 +188,19 @@ function wp_print_media_templates() {
                <# } #>
                <div class="uploader-inline-content {{ messageClass }}">
                <# if ( data.message ) { #>
-                       <h3 class="upload-message">{{ data.message }}</h3>
+                       <h2 class="upload-message">{{ data.message }}</h2>
                <# } #>
                <?php if ( ! _device_can_upload() ) : ?>
-                       <h3 class="upload-instructions"><?php printf( __('The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.'), 'https://apps.wordpress.org/' ); ?></h3>
+                       <h2 class="upload-instructions"><?php printf( __( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ), 'https://apps.wordpress.org/' ); ?></h2>
                <?php elseif ( is_multisite() && ! is_upload_space_available() ) : ?>
-                       <h3 class="upload-instructions"><?php _e( 'Upload Limit Exceeded' ); ?></h3>
+                       <h2 class="upload-instructions"><?php _e( 'Upload Limit Exceeded' ); ?></h2>
                        <?php
                        /** This action is documented in wp-admin/includes/media.php */
                        do_action( 'upload_ui_over_quota' ); ?>
 
                <?php else : ?>
                        <div class="upload-ui">
-                               <h3 class="upload-instructions drop-instructions"><?php _e( 'Drop files anywhere to upload' ); ?></h3>
+                               <h2 class="upload-instructions drop-instructions"><?php _e( 'Drop files anywhere to upload' ); ?></h2>
                                <p class="upload-instructions drop-instructions"><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p>
                                <button type="button" class="browser button button-hero"><?php _e( 'Select Files' ); ?></button>
                        </div>
@@ -260,7 +257,7 @@ function wp_print_media_templates() {
        </script>
 
        <script type="text/html" id="tmpl-uploader-status">
-               <h3><?php _e( 'Uploading' ); ?></h3>
+               <h2><?php _e( 'Uploading' ); ?></h2>
                <button type="button" class="button-link upload-dismiss-errors"><span class="screen-reader-text"><?php _e( 'Dismiss Errors' ); ?></span></button>
 
                <div class="media-progress-bar"><div></div></div>
@@ -294,11 +291,11 @@ function wp_print_media_templates() {
                                <# if ( data.uploading ) { #>
                                        <div class="media-progress-bar"><div></div></div>
                                <# } else if ( 'image' === data.type && data.sizes && data.sizes.large ) { #>
-                                       <img class="details-image" src="{{ data.sizes.large.url }}" draggable="false" />
+                                       <img class="details-image" src="{{ data.sizes.large.url }}" draggable="false" alt="" />
                                <# } else if ( 'image' === data.type && data.sizes && data.sizes.full ) { #>
-                                       <img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" />
+                                       <img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" alt="" />
                                <# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #>
-                                       <img class="details-image icon" src="{{ data.icon }}" draggable="false" />
+                                       <img class="details-image icon" src="{{ data.icon }}" draggable="false" alt="" />
                                <# } #>
 
                                <# if ( 'audio' === data.type ) { #>
@@ -308,17 +305,14 @@ function wp_print_media_templates() {
                                        </audio>
                                </div>
                                <# } else if ( 'video' === data.type ) {
-                                       var w_rule = h_rule = '';
+                                       var w_rule = '';
                                        if ( data.width ) {
                                                w_rule = 'width: ' + data.width + 'px;';
                                        } else if ( wp.media.view.settings.contentWidth ) {
                                                w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;';
                                        }
-                                       if ( data.height ) {
-                                               h_rule = 'height: ' + data.height + 'px;';
-                                       }
                                #>
-                               <div style="{{ w_rule }}{{ h_rule }}" class="wp-media-wrapper wp-video">
+                               <div style="{{ w_rule }}" class="wp-media-wrapper wp-video">
                                        <video controls="controls" class="wp-video-shortcode" preload="metadata"
                                                <# if ( data.width ) { #>width="{{ data.width }}"<# } #>
                                                <# if ( data.height ) { #>height="{{ data.height }}"<# } #>
@@ -459,9 +453,9 @@ function wp_print_media_templates() {
                                <# } else { #>
                                        <div class="centered">
                                                <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>
-                                                       <img src="{{ data.image.src }}" class="thumbnail" draggable="false" />
+                                                       <img src="{{ data.image.src }}" class="thumbnail" draggable="false" alt="" />
                                                <# } else { #>
-                                                       <img src="{{ data.icon }}" class="icon" draggable="false" />
+                                                       <img src="{{ data.icon }}" class="icon" draggable="false" alt="" />
                                                <# } #>
                                        </div>
                                        <div class="filename">
@@ -496,22 +490,21 @@ function wp_print_media_templates() {
        </script>
 
        <script type="text/html" id="tmpl-attachment-details">
-               <h3>
-                       <?php _e('Attachment Details'); ?>
-
+               <h2>
+                       <?php _e( 'Attachment Details' ); ?>
                        <span class="settings-save-status">
                                <span class="spinner"></span>
                                <span class="saved"><?php esc_html_e('Saved.'); ?></span>
                        </span>
-               </h3>
+               </h2>
                <div class="attachment-info">
                        <div class="thumbnail thumbnail-{{ data.type }}">
                                <# if ( data.uploading ) { #>
                                        <div class="media-progress-bar"><div></div></div>
                                <# } else if ( 'image' === data.type && data.sizes ) { #>
-                                       <img src="{{ data.size.url }}" draggable="false" />
+                                       <img src="{{ data.size.url }}" draggable="false" alt="" />
                                <# } else { #>
-                                       <img src="{{ data.icon }}" class="icon" draggable="false" />
+                                       <img src="{{ data.icon }}" class="icon" draggable="false" alt="" />
                                <# } #>
                        </div>
                        <div class="details">
@@ -605,7 +598,7 @@ function wp_print_media_templates() {
        </script>
 
        <script type="text/html" id="tmpl-attachment-display-settings">
-               <h3><?php _e('Attachment Display Settings'); ?></h3>
+               <h2><?php _e( 'Attachment Display Settings' ); ?></h2>
 
                <# if ( 'image' === data.type ) { #>
                        <label class="setting">
@@ -652,7 +645,10 @@ function wp_print_media_templates() {
                                        </option>
                                        <option value="file">
                                <# } else { #>
-                                       <option value="file" selected>
+                                       <option value="none" selected>
+                                               <?php esc_attr_e('None'); ?>
+                                       </option>
+                                       <option value="file">
                                <# } #>
                                        <# if ( data.model.canEmbed ) { #>
                                                <?php esc_attr_e('Link to Media File'); ?>
@@ -671,9 +667,6 @@ function wp_print_media_templates() {
                                        <option value="custom">
                                                <?php esc_attr_e('Custom URL'); ?>
                                        </option>
-                                       <option value="none">
-                                               <?php esc_attr_e('None'); ?>
-                                       </option>
                                <# } #>
                                </select>
                        </label>
@@ -712,7 +705,7 @@ function wp_print_media_templates() {
        </script>
 
        <script type="text/html" id="tmpl-gallery-settings">
-               <h3><?php _e('Gallery Settings'); ?></h3>
+               <h2><?php _e( 'Gallery Settings' ); ?></h2>
 
                <label class="setting">
                        <span><?php _e('Link To'); ?></span>
@@ -782,7 +775,7 @@ function wp_print_media_templates() {
        </script>
 
        <script type="text/html" id="tmpl-playlist-settings">
-               <h3><?php _e( 'Playlist Settings' ); ?></h3>
+               <h2><?php _e( 'Playlist Settings' ); ?></h2>
 
                <# var emptyModel = _.isEmpty( data.model ),
                        isVideo = 'video' === data.controller.get('library').props.get('type'); #>
@@ -827,7 +820,7 @@ function wp_print_media_templates() {
 
        <script type="text/html" id="tmpl-embed-image-settings">
                <div class="thumbnail">
-                       <img src="{{ data.model.url }}" draggable="false" />
+                       <img src="{{ data.model.url }}" draggable="false" alt="" />
                </div>
 
                <?php
@@ -884,7 +877,7 @@ function wp_print_media_templates() {
                        <div class="embed-media-settings">
                                <div class="column-image">
                                        <div class="image">
-                                               <img src="{{ data.model.url }}" draggable="false" />
+                                               <img src="{{ data.model.url }}" draggable="false" alt="" />
 
                                                <# if ( data.attachment && window.imageEdit ) { #>
                                                        <div class="actions">
@@ -909,7 +902,7 @@ function wp_print_media_templates() {
                                                <input type="text" data-setting="alt" value="{{ data.model.alt }}" />
                                        </label>
 
-                                       <h3><?php _e( 'Display Settings' ); ?></h3>
+                                       <h2><?php _e( 'Display Settings' ); ?></h2>
                                        <div class="setting align">
                                                <span><?php _e('Align'); ?></span>
                                                <div class="button-group button-large" data-setting="align">
@@ -991,7 +984,7 @@ function wp_print_media_templates() {
                                                <input type="text" class="link-to-custom" data-setting="linkUrl" />
                                        </div>
                                        <div class="advanced-section">
-                                               <h3><button type="button" class="button-link advanced-toggle"><?php _e( 'Advanced Options' ); ?></button></h3>
+                                               <h2><button type="button" class="button-link advanced-toggle"><?php _e( 'Advanced Options' ); ?></button></h2>
                                                <div class="advanced-settings hidden">
                                                        <div class="advanced-image">
                                                                <label class="setting title-text">
@@ -1005,7 +998,7 @@ function wp_print_media_templates() {
                                                        </div>
                                                        <div class="advanced-link">
                                                                <div class="setting link-target">
-                                                                       <label><input type="checkbox" data-setting="linkTargetBlank" value="_blank" <# if ( data.model.linkTargetBlank ) { #>checked="checked"<# } #>><?php _e( 'Open link in a new window/tab' ); ?></label>
+                                                                       <label><input type="checkbox" data-setting="linkTargetBlank" value="_blank" <# if ( data.model.linkTargetBlank ) { #>checked="checked"<# } #>><?php _e( 'Open link in a new tab' ); ?></label>
                                                                </div>
                                                                <label class="setting link-rel">
                                                                        <span><?php _e('Link Rel'); ?></span>
@@ -1215,14 +1208,14 @@ function wp_print_media_templates() {
                                        <dl class="gallery-item">
                                                <dt class="gallery-icon">
                                                        <# if ( attachment.thumbnail ) { #>
-                                                               <img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" />
+                                                               <img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" alt="" />
                                                        <# } else { #>
-                                                               <img src="{{ attachment.url }}" />
+                                                               <img src="{{ attachment.url }}" alt="" />
                                                        <# } #>
                                                </dt>
                                                <# if ( attachment.caption ) { #>
                                                        <dd class="wp-caption-text gallery-caption">
-                                                               {{ attachment.caption }}
+                                                               {{{ data.verifyHTML( attachment.caption ) }}}
                                                        </dd>
                                                <# } #>
                                        </dl>
@@ -1239,7 +1232,7 @@ function wp_print_media_templates() {
        </script>
 
        <script type="text/html" id="tmpl-crop-content">
-               <img class="crop-image" src="{{ data.url }}">
+               <img class="crop-image" src="{{ data.url }}" alt="">
                <div class="upload-errors"></div>
        </script>
 
@@ -1247,7 +1240,7 @@ function wp_print_media_templates() {
                <h2><?php _e( 'Preview' ); ?></h2>
                <strong><?php _e( 'As a browser icon' ); ?></strong>
                <div class="favicon-preview">
-                       <img src="images/browser.png" class="browser-preview" width="182" height="" alt=""/>
+                       <img src="images/browser.png" class="browser-preview" width="182" height="" alt="" />
 
                        <div class="favicon">
                                <img id="preview-favicon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>"/>