Make WordPress Core


Ignore:
Timestamp:
03/31/2014 05:12:29 AM (11 years ago)
Author:
wonderboymusic
Message:

Favor escaping over interpolation in Underscore templates for media. Translate some strings directly instead of passing via JS.

Props nacin.
See #27574.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r27812 r27868  
    772772
    773773    <script type="text/html" id="tmpl-image-editor">
    774         <div id="media-head-{{{ data.id }}}"></div>
    775         <div id="image-editor-{{{ data.id }}}"></div>
     774        <div id="media-head-{{ data.id }}"></div>
     775        <div id="image-editor-{{ data.id }}"></div>
    776776    </script>
    777777
     
    796796                    <span>SRC</span>
    797797                    <input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" />
    798                     <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
     798                    <a class="remove-setting"><?php _e( 'Remove' ); ?></a>
    799799                </label>
    800800                <# } #>
     
    810810                    <span><?php echo strtoupper( $type ) ?></span>
    811811                    <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" />
    812                     <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
     812                    <a class="remove-setting"><?php _e( 'Remove' ); ?></a>
    813813                </label>
    814814                <# } #>
     
    817817                <# if ( ! _.isEmpty( html5types ) ) { #>
    818818                <div class="setting">
    819                     <span>{{{ wp.media.view.l10n.mediaHTML5Text }}}</span>
     819                    <span><?php _e( 'Add alternate sources for maximum HTML5 playback:' ) ?></span>
    820820                    <div class="button-large">
    821821                    <# _.each( html5types, function (mime, type) { #>
     
    887887                    <span>SRC</span>
    888888                    <input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" />
    889                     <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
     889                    <a class="remove-setting"><?php _e( 'Remove' ); ?></a>
    890890                </label>
    891891                <# } #>
     
    899899                    <span><?php echo strtoupper( $type ) ?></span>
    900900                    <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" />
    901                     <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
     901                    <a class="remove-setting"><?php _e( 'Remove' ); ?></a>
    902902                </label>
    903903                <# } #>
     
    907907                <# if ( ! _.isEmpty( html5types ) ) { #>
    908908                <div class="setting">
    909                     <span>{{{ wp.media.view.l10n.mediaHTML5Text }}}</span>
     909                    <span><?php _e( 'Add alternate sources for maximum HTML5 playback:' ); ?></span>
    910910                    <div class="button-large">
    911911                    <# _.each( html5types, function (mime, type) { #>
     
    920920                    <span><?php _e( 'Poster Image' ); ?></span>
    921921                    <input type="text" disabled="disabled" data-setting="poster" value="{{ data.model.poster }}" />
    922                     <a class="remove-setting">{{{ wp.media.view.l10n.remove }}}</a>
     922                    <a class="remove-setting"><?php _e( 'Remove' ); ?></a>
    923923                </label>
    924924                <# } #>
     
    953953                        <p>
    954954                            <input class="content-track" type="text" value="{{ track.outerHTML }}" />
    955                             <a class="remove-setting remove-track">{{{ wp.media.view.l10n.remove }}}</a>
     955                            <a class="remove-setting remove-track"><?php _e( 'Remove' ); ?></a>
    956956                        </p>
    957957                        <# } ); #>
     
    973973            <div class="dashicons dashicons-edit edit"></div><div class="dashicons dashicons-no-alt remove"></div>
    974974        </div>
    975         <div class="gallery gallery-columns-{{{ data.columns }}}">
     975        <div class="gallery gallery-columns-{{ data.columns }}">
    976976            <# _.each( data.attachments, function( attachment, index ) { #>
    977977                <dl class="gallery-item">
    978978                    <dt class="gallery-icon">
    979                         <img src="{{{ attachment.thumbnail.url }}}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" />
     979                        <img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" />
    980980                    </dt>
    981981                    <dd class="wp-caption-text gallery-caption">
     
    997997        </div>
    998998        <# if ( ! _.isEmpty( data.model.caption ) ) { #>
    999         <div class="track-details">{{{ data.model.caption }}}</div>
     999        <div class="track-details">{{ data.model.caption }}</div>
    10001000        <# } #>
    10011001        <?php wp_underscore_audio_template() ?>
     
    10091009        </div>
    10101010        <# if ( ! _.isEmpty( data.model.caption ) ) { #>
    1011         <div class="track-details">{{{ data.model.caption }}}</div>
     1011        <div class="track-details">{{ data.model.caption }}</div>
    10121012        <# } #>
    10131013        <?php wp_underscore_video_template() ?>
Note: See TracChangeset for help on using the changeset viewer.