wp/wp-includes/media-template.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    26 	foreach ( array( 'autoplay', 'loop' ) as $attr ) :
    26 	foreach ( array( 'autoplay', 'loop' ) as $attr ) :
    27 		?>
    27 		?>
    28 	if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {
    28 	if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {
    29 		#> <?php echo $attr; ?><#
    29 		#> <?php echo $attr; ?><#
    30 	}
    30 	}
    31 	<?php endforeach ?>#>
    31 	<?php endforeach; ?>#>
    32 >
    32 >
    33 	<# if ( ! _.isEmpty( data.model.src ) ) { #>
    33 	<# if ( ! _.isEmpty( data.model.src ) ) { #>
    34 	<source src="{{ data.model.src }}" type="{{ wp.media.view.settings.embedMimes[ data.model.src.split('.').pop() ] }}" />
    34 	<source src="{{ data.model.src }}" type="{{ wp.media.view.settings.embedMimes[ data.model.src.split('.').pop() ] }}" />
    35 	<# } #>
    35 	<# } #>
    36 
    36 
   121 	foreach ( array( 'autoplay', 'loop' ) as $attr ) :
   121 	foreach ( array( 'autoplay', 'loop' ) as $attr ) :
   122 		?>
   122 		?>
   123 	if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {
   123 	if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {
   124 		#> <?php echo $attr; ?><#
   124 		#> <?php echo $attr; ?><#
   125 	}
   125 	}
   126 	<?php endforeach ?>#>
   126 	<?php endforeach; ?>#>
   127 >
   127 >
   128 	<# if ( ! _.isEmpty( data.model.src ) ) {
   128 	<# if ( ! _.isEmpty( data.model.src ) ) {
   129 		if ( isYouTube ) { #>
   129 		if ( isYouTube ) { #>
   130 		<source src="{{ data.model.src }}" type="video/youtube" />
   130 		<source src="{{ data.model.src }}" type="video/youtube" />
   131 		<# } else if ( isVimeo ) { #>
   131 		<# } else if ( isVimeo ) { #>
   156 function wp_print_media_templates() {
   156 function wp_print_media_templates() {
   157 	$class = 'media-modal wp-core-ui';
   157 	$class = 'media-modal wp-core-ui';
   158 
   158 
   159 	$alt_text_description = sprintf(
   159 	$alt_text_description = sprintf(
   160 		/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */
   160 		/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */
   161 		__( '<a href="%1$s" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
   161 		__( '<a href="%1$s" %2$s>Learn how to describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
   162 		esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
   162 		esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
   163 		'target="_blank" rel="noopener"',
   163 		'target="_blank" rel="noopener"',
   164 		sprintf(
   164 		sprintf(
   165 			'<span class="screen-reader-text"> %s</span>',
   165 			'<span class="screen-reader-text"> %s</span>',
   166 			/* translators: Accessibility text. */
   166 			/* translators: Accessibility text. */
   318 	</script>
   318 	</script>
   319 
   319 
   320 	<?php // Template for the uploading status UI. ?>
   320 	<?php // Template for the uploading status UI. ?>
   321 	<script type="text/html" id="tmpl-uploader-status">
   321 	<script type="text/html" id="tmpl-uploader-status">
   322 		<h2><?php _e( 'Uploading' ); ?></h2>
   322 		<h2><?php _e( 'Uploading' ); ?></h2>
   323 		<button type="button" class="button-link upload-dismiss-errors"><span class="screen-reader-text"><?php _e( 'Dismiss Errors' ); ?></span></button>
       
   324 
   323 
   325 		<div class="media-progress-bar"><div></div></div>
   324 		<div class="media-progress-bar"><div></div></div>
   326 		<div class="upload-details">
   325 		<div class="upload-details">
   327 			<span class="upload-count">
   326 			<span class="upload-count">
   328 				<span class="upload-index"></span> / <span class="upload-total"></span>
   327 				<span class="upload-index"></span> / <span class="upload-total"></span>
   329 			</span>
   328 			</span>
   330 			<span class="upload-detail-separator">&ndash;</span>
   329 			<span class="upload-detail-separator">&ndash;</span>
   331 			<span class="upload-filename"></span>
   330 			<span class="upload-filename"></span>
   332 		</div>
   331 		</div>
   333 		<div class="upload-errors"></div>
   332 		<div class="upload-errors"></div>
       
   333 		<button type="button" class="button upload-dismiss-errors"><?php _e( 'Dismiss errors' ); ?></button>
   334 	</script>
   334 	</script>
   335 
   335 
   336 	<?php // Template for the uploading status errors. ?>
   336 	<?php // Template for the uploading status errors. ?>
   337 	<script type="text/html" id="tmpl-uploader-status-error">
   337 	<script type="text/html" id="tmpl-uploader-status-error">
   338 		<span class="upload-error-filename">{{{ data.filename }}}</span>
   338 		<span class="upload-error-filename">{{{ data.filename }}}</span>
  1275 					<label for="audio-details-<?php echo $type . '-source'; ?>" class="name"><?php echo strtoupper( $type ); ?></label>
  1275 					<label for="audio-details-<?php echo $type . '-source'; ?>" class="name"><?php echo strtoupper( $type ); ?></label>
  1276 					<input type="text" id="audio-details-<?php echo $type . '-source'; ?>" readonly data-setting="<?php echo $type; ?>" value="{{ data.model.<?php echo $type; ?> }}" />
  1276 					<input type="text" id="audio-details-<?php echo $type . '-source'; ?>" readonly data-setting="<?php echo $type; ?>" value="{{ data.model.<?php echo $type; ?> }}" />
  1277 					<button type="button" class="button-link remove-setting"><?php _e( 'Remove audio source' ); ?></button>
  1277 					<button type="button" class="button-link remove-setting"><?php _e( 'Remove audio source' ); ?></button>
  1278 				</span>
  1278 				</span>
  1279 				<# } #>
  1279 				<# } #>
  1280 				<?php endforeach ?>
  1280 				<?php endforeach; ?>
  1281 
  1281 
  1282 				<# if ( ! _.isEmpty( html5types ) ) { #>
  1282 				<# if ( ! _.isEmpty( html5types ) ) { #>
  1283 				<fieldset class="setting-group">
  1283 				<fieldset class="setting-group">
  1284 					<legend class="name"><?php _e( 'Add alternate sources for maximum HTML5 playback' ); ?></legend>
  1284 					<legend class="name"><?php _e( 'Add alternate sources for maximum HTML5 playback' ); ?></legend>
  1285 					<span class="setting">
  1285 					<span class="setting">
  1365 					<label for="video-details-<?php echo $type . '-source'; ?>" class="name"><?php echo strtoupper( $type ); ?></label>
  1365 					<label for="video-details-<?php echo $type . '-source'; ?>" class="name"><?php echo strtoupper( $type ); ?></label>
  1366 					<input type="text" id="video-details-<?php echo $type . '-source'; ?>" readonly data-setting="<?php echo $type; ?>" value="{{ data.model.<?php echo $type; ?> }}" />
  1366 					<input type="text" id="video-details-<?php echo $type . '-source'; ?>" readonly data-setting="<?php echo $type; ?>" value="{{ data.model.<?php echo $type; ?> }}" />
  1367 					<button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button>
  1367 					<button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button>
  1368 				</span>
  1368 				</span>
  1369 				<# } #>
  1369 				<# } #>
  1370 				<?php endforeach ?>
  1370 				<?php endforeach; ?>
  1371 				</div>
  1371 				</div>
  1372 
  1372 
  1373 				<# if ( ! _.isEmpty( html5types ) ) { #>
  1373 				<# if ( ! _.isEmpty( html5types ) ) { #>
  1374 				<fieldset class="setting-group">
  1374 				<fieldset class="setting-group">
  1375 					<legend class="name"><?php _e( 'Add alternate sources for maximum HTML5 playback' ); ?></legend>
  1375 					<legend class="name"><?php _e( 'Add alternate sources for maximum HTML5 playback' ); ?></legend>
  1477 		<# } #>
  1477 		<# } #>
  1478 	</script>
  1478 	</script>
  1479 
  1479 
  1480 	<?php // Template for the Crop area layout, used for example in the Customizer. ?>
  1480 	<?php // Template for the Crop area layout, used for example in the Customizer. ?>
  1481 	<script type="text/html" id="tmpl-crop-content">
  1481 	<script type="text/html" id="tmpl-crop-content">
  1482 		<img class="crop-image" src="{{ data.url }}" alt="<?php esc_attr_e( 'Image crop area preview. Requires mouse interaction.' ); ?>">
  1482 		<img class="crop-image" src="{{ data.url }}" alt="<?php esc_attr_e( 'Image crop area preview. Requires mouse interaction.' ); ?>" />
  1483 		<div class="upload-errors"></div>
  1483 		<div class="upload-errors"></div>
  1484 	</script>
  1484 	</script>
  1485 
  1485 
  1486 	<?php // Template for the Site Icon preview, used for example in the Customizer. ?>
  1486 	<?php // Template for the Site Icon preview, used for example in the Customizer. ?>
  1487 	<script type="text/html" id="tmpl-site-icon-preview">
  1487 	<script type="text/html" id="tmpl-site-icon-preview">