| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * WordPress media templates. |
|---|
| 4 | * |
|---|
| 5 | * @package WordPress |
|---|
| 6 | * @subpackage Media |
|---|
| 7 | * @since 3.5.0 |
|---|
| 8 | */ |
|---|
| 9 | |
|---|
| 10 | /** |
|---|
| 11 | * Output the markup for a audio tag to be used in an Underscore template |
|---|
| 12 | * when data.model is passed. |
|---|
| 13 | * |
|---|
| 14 | * @since 3.9.0 |
|---|
| 15 | */ |
|---|
| 16 | function wp_underscore_audio_template() { |
|---|
| 17 | $audio_types = wp_get_audio_extensions(); |
|---|
| 18 | ?> |
|---|
| 19 | <audio style="visibility: hidden" |
|---|
| 20 | controls |
|---|
| 21 | class="wp-audio-shortcode" |
|---|
| 22 | width="{{ _.isUndefined( data.model.width ) ? 400 : data.model.width }}" |
|---|
| 23 | preload="{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}" |
|---|
| 24 | <# |
|---|
| 25 | <?php foreach ( array( 'autoplay', 'loop' ) as $attr ): |
|---|
| 26 | ?>if ( ! _.isUndefined( data.model.<?php echo $attr ?> ) && data.model.<?php echo $attr ?> ) { |
|---|
| 27 | #> <?php echo $attr ?><# |
|---|
| 28 | } |
|---|
| 29 | <?php endforeach ?>#> |
|---|
| 30 | > |
|---|
| 31 | <# if ( ! _.isEmpty( data.model.src ) ) { #> |
|---|
| 32 | <source src="{{ data.model.src }}" type="{{ wp.media.view.settings.embedMimes[ data.model.src.split('.').pop() ] }}" /> |
|---|
| 33 | <# } #> |
|---|
| 34 | |
|---|
| 35 | <?php foreach ( $audio_types as $type ): |
|---|
| 36 | ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) { #> |
|---|
| 37 | <source src="{{ data.model.<?php echo $type ?> }}" type="{{ wp.media.view.settings.embedMimes[ '<?php echo $type ?>' ] }}" /> |
|---|
| 38 | <# } #> |
|---|
| 39 | <?php endforeach; |
|---|
| 40 | ?></audio> |
|---|
| 41 | <?php |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | /** |
|---|
| 45 | * Output the markup for a video tag to be used in an Underscore template |
|---|
| 46 | * when data.model is passed. |
|---|
| 47 | * |
|---|
| 48 | * @since 3.9.0 |
|---|
| 49 | */ |
|---|
| 50 | function wp_underscore_video_template() { |
|---|
| 51 | $video_types = wp_get_video_extensions(); |
|---|
| 52 | ?> |
|---|
| 53 | <# var w_rule = '', classes = [], |
|---|
| 54 | w, h, settings = wp.media.view.settings, |
|---|
| 55 | isYouTube = isVimeo = false; |
|---|
| 56 | |
|---|
| 57 | if ( ! _.isEmpty( data.model.src ) ) { |
|---|
| 58 | isYouTube = data.model.src.match(/youtube|youtu\.be/); |
|---|
| 59 | isVimeo = -1 !== data.model.src.indexOf('vimeo'); |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | if ( settings.contentWidth && data.model.width >= settings.contentWidth ) { |
|---|
| 63 | w = settings.contentWidth; |
|---|
| 64 | } else { |
|---|
| 65 | w = data.model.width; |
|---|
| 66 | } |
|---|
| 67 | |
|---|
| 68 | if ( w !== data.model.width ) { |
|---|
| 69 | h = Math.ceil( ( data.model.height * w ) / data.model.width ); |
|---|
| 70 | } else { |
|---|
| 71 | h = data.model.height; |
|---|
| 72 | } |
|---|
| 73 | |
|---|
| 74 | if ( w ) { |
|---|
| 75 | w_rule = 'width: ' + w + 'px; '; |
|---|
| 76 | } |
|---|
| 77 | |
|---|
| 78 | if ( isYouTube ) { |
|---|
| 79 | classes.push( 'youtube-video' ); |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | if ( isVimeo ) { |
|---|
| 83 | classes.push( 'vimeo-video' ); |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | #> |
|---|
| 87 | <div style="{{ w_rule }}" class="wp-video"> |
|---|
| 88 | <video controls |
|---|
| 89 | class="wp-video-shortcode {{ classes.join( ' ' ) }}" |
|---|
| 90 | <# if ( w ) { #>width="{{ w }}"<# } #> |
|---|
| 91 | <# if ( h ) { #>height="{{ h }}"<# } #> |
|---|
| 92 | <?php |
|---|
| 93 | $props = array( 'poster' => '', 'preload' => 'metadata' ); |
|---|
| 94 | foreach ( $props as $key => $value ): |
|---|
| 95 | if ( empty( $value ) ) { |
|---|
| 96 | ?><# |
|---|
| 97 | if ( ! _.isUndefined( data.model.<?php echo $key ?> ) && data.model.<?php echo $key ?> ) { |
|---|
| 98 | #> <?php echo $key ?>="{{ data.model.<?php echo $key ?> }}"<# |
|---|
| 99 | } #> |
|---|
| 100 | <?php } else { |
|---|
| 101 | echo $key ?>="{{ _.isUndefined( data.model.<?php echo $key ?> ) ? '<?php echo $value ?>' : data.model.<?php echo $key ?> }}"<?php |
|---|
| 102 | } |
|---|
| 103 | endforeach; |
|---|
| 104 | ?><# |
|---|
| 105 | <?php foreach ( array( 'autoplay', 'loop' ) as $attr ): |
|---|
| 106 | ?> if ( ! _.isUndefined( data.model.<?php echo $attr ?> ) && data.model.<?php echo $attr ?> ) { |
|---|
| 107 | #> <?php echo $attr ?><# |
|---|
| 108 | } |
|---|
| 109 | <?php endforeach ?>#> |
|---|
| 110 | > |
|---|
| 111 | <# if ( ! _.isEmpty( data.model.src ) ) { |
|---|
| 112 | if ( isYouTube ) { #> |
|---|
| 113 | <source src="{{ data.model.src }}" type="video/youtube" /> |
|---|
| 114 | <# } else if ( isVimeo ) { #> |
|---|
| 115 | <source src="{{ data.model.src }}" type="video/vimeo" /> |
|---|
| 116 | <# } else { #> |
|---|
| 117 | <source src="{{ data.model.src }}" type="{{ settings.embedMimes[ data.model.src.split('.').pop() ] }}" /> |
|---|
| 118 | <# } |
|---|
| 119 | } #> |
|---|
| 120 | |
|---|
| 121 | <?php foreach ( $video_types as $type ): |
|---|
| 122 | ?><# if ( data.model.<?php echo $type ?> ) { #> |
|---|
| 123 | <source src="{{ data.model.<?php echo $type ?> }}" type="{{ settings.embedMimes[ '<?php echo $type ?>' ] }}" /> |
|---|
| 124 | <# } #> |
|---|
| 125 | <?php endforeach; ?> |
|---|
| 126 | {{{ data.model.content }}} |
|---|
| 127 | </video> |
|---|
| 128 | </div> |
|---|
| 129 | <?php |
|---|
| 130 | } |
|---|
| 131 | |
|---|
| 132 | /** |
|---|
| 133 | * Prints the templates used in the media manager. |
|---|
| 134 | * |
|---|
| 135 | * @since 3.5.0 |
|---|
| 136 | * |
|---|
| 137 | * @global bool $is_IE |
|---|
| 138 | */ |
|---|
| 139 | function wp_print_media_templates() { |
|---|
| 140 | global $is_IE; |
|---|
| 141 | $class = 'media-modal wp-core-ui'; |
|---|
| 142 | if ( $is_IE && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false ) |
|---|
| 143 | $class .= ' ie7'; |
|---|
| 144 | ?> |
|---|
| 145 | <!--[if lte IE 8]> |
|---|
| 146 | <style> |
|---|
| 147 | .attachment:focus { |
|---|
| 148 | outline: #1e8cbe solid; |
|---|
| 149 | } |
|---|
| 150 | .selected.attachment { |
|---|
| 151 | outline: #1e8cbe solid; |
|---|
| 152 | } |
|---|
| 153 | </style> |
|---|
| 154 | <![endif]--> |
|---|
| 155 | <script type="text/html" id="tmpl-media-frame"> |
|---|
| 156 | <div class="media-frame-menu"></div> |
|---|
| 157 | <div class="media-frame-title"></div> |
|---|
| 158 | <div class="media-frame-router"></div> |
|---|
| 159 | <div class="media-frame-content"></div> |
|---|
| 160 | <div class="media-frame-toolbar"></div> |
|---|
| 161 | <div class="media-frame-uploader"></div> |
|---|
| 162 | </script> |
|---|
| 163 | |
|---|
| 164 | <script type="text/html" id="tmpl-media-modal"> |
|---|
| 165 | <div class="<?php echo $class; ?>"> |
|---|
| 166 | <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close media panel' ); ?></span></span></button> |
|---|
| 167 | <div class="media-modal-content"></div> |
|---|
| 168 | </div> |
|---|
| 169 | <div class="media-modal-backdrop"></div> |
|---|
| 170 | </script> |
|---|
| 171 | |
|---|
| 172 | <script type="text/html" id="tmpl-uploader-window"> |
|---|
| 173 | <div class="uploader-window-content"> |
|---|
| 174 | <h1><?php _e( 'Drop files to upload' ); ?></h1> |
|---|
| 175 | </div> |
|---|
| 176 | </script> |
|---|
| 177 | |
|---|
| 178 | <script type="text/html" id="tmpl-uploader-editor"> |
|---|
| 179 | <div class="uploader-editor-content"> |
|---|
| 180 | <div class="uploader-editor-title"><?php _e( 'Drop files to upload' ); ?></div> |
|---|
| 181 | </div> |
|---|
| 182 | </script> |
|---|
| 183 | |
|---|
| 184 | <script type="text/html" id="tmpl-uploader-inline"> |
|---|
| 185 | <# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #> |
|---|
| 186 | <# if ( data.canClose ) { #> |
|---|
| 187 | <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close uploader' ); ?></span></button> |
|---|
| 188 | <# } #> |
|---|
| 189 | <div class="uploader-inline-content {{ messageClass }}"> |
|---|
| 190 | <# if ( data.message ) { #> |
|---|
| 191 | <h2 class="upload-message">{{ data.message }}</h2> |
|---|
| 192 | <# } #> |
|---|
| 193 | <?php if ( ! _device_can_upload() ) : ?> |
|---|
| 194 | <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> |
|---|
| 195 | <?php elseif ( is_multisite() && ! is_upload_space_available() ) : ?> |
|---|
| 196 | <h2 class="upload-instructions"><?php _e( 'Upload Limit Exceeded' ); ?></h2> |
|---|
| 197 | <?php |
|---|
| 198 | /** This action is documented in wp-admin/includes/media.php */ |
|---|
| 199 | do_action( 'upload_ui_over_quota' ); ?> |
|---|
| 200 | |
|---|
| 201 | <?php else : ?> |
|---|
| 202 | <div class="upload-ui"> |
|---|
| 203 | <h2 class="upload-instructions drop-instructions"><?php _e( 'Drop files anywhere to upload' ); ?></h2> |
|---|
| 204 | <p class="upload-instructions drop-instructions"><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p> |
|---|
| 205 | <button type="button" class="browser button button-hero"><?php _e( 'Select Files' ); ?></button> |
|---|
| 206 | </div> |
|---|
| 207 | |
|---|
| 208 | <div class="upload-inline-status"></div> |
|---|
| 209 | |
|---|
| 210 | <div class="post-upload-ui"> |
|---|
| 211 | <?php |
|---|
| 212 | /** This action is documented in wp-admin/includes/media.php */ |
|---|
| 213 | do_action( 'pre-upload-ui' ); |
|---|
| 214 | /** This action is documented in wp-admin/includes/media.php */ |
|---|
| 215 | do_action( 'pre-plupload-upload-ui' ); |
|---|
| 216 | |
|---|
| 217 | if ( 10 === remove_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' ) ) { |
|---|
| 218 | /** This action is documented in wp-admin/includes/media.php */ |
|---|
| 219 | do_action( 'post-plupload-upload-ui' ); |
|---|
| 220 | add_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' ); |
|---|
| 221 | } else { |
|---|
| 222 | /** This action is documented in wp-admin/includes/media.php */ |
|---|
| 223 | do_action( 'post-plupload-upload-ui' ); |
|---|
| 224 | } |
|---|
| 225 | |
|---|
| 226 | $max_upload_size = wp_max_upload_size(); |
|---|
| 227 | if ( ! $max_upload_size ) { |
|---|
| 228 | $max_upload_size = 0; |
|---|
| 229 | } |
|---|
| 230 | ?> |
|---|
| 231 | |
|---|
| 232 | <p class="max-upload-size"><?php |
|---|
| 233 | printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) ); |
|---|
| 234 | ?></p> |
|---|
| 235 | |
|---|
| 236 | <# if ( data.suggestedWidth && data.suggestedHeight ) { #> |
|---|
| 237 | <p class="suggested-dimensions"> |
|---|
| 238 | <?php _e( 'Suggested image dimensions:' ); ?> {{data.suggestedWidth}} × {{data.suggestedHeight}} |
|---|
| 239 | </p> |
|---|
| 240 | <# } #> |
|---|
| 241 | |
|---|
| 242 | <?php |
|---|
| 243 | /** This action is documented in wp-admin/includes/media.php */ |
|---|
| 244 | do_action( 'post-upload-ui' ); ?> |
|---|
| 245 | </div> |
|---|
| 246 | <?php endif; ?> |
|---|
| 247 | </div> |
|---|
| 248 | </script> |
|---|
| 249 | |
|---|
| 250 | <script type="text/html" id="tmpl-media-library-view-switcher"> |
|---|
| 251 | <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?>" class="view-list"> |
|---|
| 252 | <span class="screen-reader-text"><?php _e( 'List View' ); ?></span> |
|---|
| 253 | </a> |
|---|
| 254 | <a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', $_SERVER['REQUEST_URI'] ) ) ?>" class="view-grid current"> |
|---|
| 255 | <span class="screen-reader-text"><?php _e( 'Grid View' ); ?></span> |
|---|
| 256 | </a> |
|---|
| 257 | </script> |
|---|
| 258 | |
|---|
| 259 | <script type="text/html" id="tmpl-uploader-status"> |
|---|
| 260 | <h2><?php _e( 'Uploading' ); ?></h2> |
|---|
| 261 | <button type="button" class="button-link upload-dismiss-errors"><span class="screen-reader-text"><?php _e( 'Dismiss Errors' ); ?></span></button> |
|---|
| 262 | |
|---|
| 263 | <div class="media-progress-bar"><div></div></div> |
|---|
| 264 | <div class="upload-details"> |
|---|
| 265 | <span class="upload-count"> |
|---|
| 266 | <span class="upload-index"></span> / <span class="upload-total"></span> |
|---|
| 267 | </span> |
|---|
| 268 | <span class="upload-detail-separator">–</span> |
|---|
| 269 | <span class="upload-filename"></span> |
|---|
| 270 | </div> |
|---|
| 271 | <div class="upload-errors"></div> |
|---|
| 272 | </script> |
|---|
| 273 | |
|---|
| 274 | <script type="text/html" id="tmpl-uploader-status-error"> |
|---|
| 275 | <span class="upload-error-filename">{{{ data.filename }}}</span> |
|---|
| 276 | <span class="upload-error-message">{{ data.message }}</span> |
|---|
| 277 | </script> |
|---|
| 278 | |
|---|
| 279 | <script type="text/html" id="tmpl-edit-attachment-frame"> |
|---|
| 280 | <div class="edit-media-header"> |
|---|
| 281 | <button class="left dashicons <# if ( ! data.hasPrevious ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Edit previous media item' ); ?></span></button> |
|---|
| 282 | <button class="right dashicons <# if ( ! data.hasNext ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Edit next media item' ); ?></span></button> |
|---|
| 283 | </div> |
|---|
| 284 | <div class="media-frame-title"></div> |
|---|
| 285 | <div class="media-frame-content"></div> |
|---|
| 286 | </script> |
|---|
| 287 | |
|---|
| 288 | <script type="text/html" id="tmpl-attachment-details-two-column"> |
|---|
| 289 | <div class="attachment-media-view {{ data.orientation }}"> |
|---|
| 290 | <div class="thumbnail thumbnail-{{ data.type }}"> |
|---|
| 291 | <# if ( data.uploading ) { #> |
|---|
| 292 | <div class="media-progress-bar"><div></div></div> |
|---|
| 293 | <# } else if ( data.sizes && data.sizes.large ) { #> |
|---|
| 294 | <img class="details-image" src="{{ data.sizes.large.url }}" draggable="false" alt="" /> |
|---|
| 295 | <# } else if ( data.sizes && data.sizes.full ) { #> |
|---|
| 296 | <img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" alt="" /> |
|---|
| 297 | <# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #> |
|---|
| 298 | <img class="details-image icon" src="{{ data.icon }}" draggable="false" alt="" /> |
|---|
| 299 | <# } #> |
|---|
| 300 | |
|---|
| 301 | <# if ( 'audio' === data.type ) { #> |
|---|
| 302 | <div class="wp-media-wrapper"> |
|---|
| 303 | <audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none"> |
|---|
| 304 | <source type="{{ data.mime }}" src="{{ data.url }}"/> |
|---|
| 305 | </audio> |
|---|
| 306 | </div> |
|---|
| 307 | <# } else if ( 'video' === data.type ) { |
|---|
| 308 | var w_rule = ''; |
|---|
| 309 | if ( data.width ) { |
|---|
| 310 | w_rule = 'width: ' + data.width + 'px;'; |
|---|
| 311 | } else if ( wp.media.view.settings.contentWidth ) { |
|---|
| 312 | w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;'; |
|---|
| 313 | } |
|---|
| 314 | #> |
|---|
| 315 | <div style="{{ w_rule }}" class="wp-media-wrapper wp-video"> |
|---|
| 316 | <video controls="controls" class="wp-video-shortcode" preload="metadata" |
|---|
| 317 | <# if ( data.width ) { #>width="{{ data.width }}"<# } #> |
|---|
| 318 | <# if ( data.height ) { #>height="{{ data.height }}"<# } #> |
|---|
| 319 | <# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>> |
|---|
| 320 | <source type="{{ data.mime }}" src="{{ data.url }}"/> |
|---|
| 321 | </video> |
|---|
| 322 | </div> |
|---|
| 323 | <# } #> |
|---|
| 324 | |
|---|
| 325 | <div class="attachment-actions"> |
|---|
| 326 | <# if ( 'image' === data.type && ! data.uploading && data.sizes && data.can.save ) { #> |
|---|
| 327 | <button type="button" class="button edit-attachment"><?php _e( 'Edit Image' ); ?></button> |
|---|
| 328 | <# } else if ( 'pdf' === data.subtype && data.sizes ) { #> |
|---|
| 329 | <?php _e( 'Document Preview' ); ?> |
|---|
| 330 | <# } #> |
|---|
| 331 | </div> |
|---|
| 332 | </div> |
|---|
| 333 | </div> |
|---|
| 334 | <div class="attachment-info"> |
|---|
| 335 | <span class="settings-save-status"> |
|---|
| 336 | <span class="spinner"></span> |
|---|
| 337 | <span class="saved"><?php esc_html_e('Saved.'); ?></span> |
|---|
| 338 | </span> |
|---|
| 339 | <div class="details"> |
|---|
| 340 | <div class="filename"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div> |
|---|
| 341 | <div class="filename"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div> |
|---|
| 342 | <div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div> |
|---|
| 343 | |
|---|
| 344 | <div class="file-size"><strong><?php _e( 'File size:' ); ?></strong> {{ data.filesizeHumanReadable }}</div> |
|---|
| 345 | <# if ( 'image' === data.type && ! data.uploading ) { #> |
|---|
| 346 | <# if ( data.width && data.height ) { #> |
|---|
| 347 | <div class="dimensions"><strong><?php _e( 'Dimensions:' ); ?></strong> {{ data.width }} × {{ data.height }}</div> |
|---|
| 348 | <# } #> |
|---|
| 349 | <# } #> |
|---|
| 350 | |
|---|
| 351 | <# if ( data.fileLength ) { #> |
|---|
| 352 | <div class="file-length"><strong><?php _e( 'Length:' ); ?></strong> {{ data.fileLength }}</div> |
|---|
| 353 | <# } #> |
|---|
| 354 | |
|---|
| 355 | <# if ( 'audio' === data.type && data.meta.bitrate ) { #> |
|---|
| 356 | <div class="bitrate"> |
|---|
| 357 | <strong><?php _e( 'Bitrate:' ); ?></strong> {{ Math.round( data.meta.bitrate / 1000 ) }}kb/s |
|---|
| 358 | <# if ( data.meta.bitrate_mode ) { #> |
|---|
| 359 | {{ ' ' + data.meta.bitrate_mode.toUpperCase() }} |
|---|
| 360 | <# } #> |
|---|
| 361 | </div> |
|---|
| 362 | <# } #> |
|---|
| 363 | |
|---|
| 364 | <div class="compat-meta"> |
|---|
| 365 | <# if ( data.compat && data.compat.meta ) { #> |
|---|
| 366 | {{{ data.compat.meta }}} |
|---|
| 367 | <# } #> |
|---|
| 368 | </div> |
|---|
| 369 | </div> |
|---|
| 370 | |
|---|
| 371 | <div class="settings"> |
|---|
| 372 | <label class="setting" data-setting="url"> |
|---|
| 373 | <span class="name"><?php _e('URL'); ?></span> |
|---|
| 374 | <input type="text" value="{{ data.url }}" readonly /> |
|---|
| 375 | </label> |
|---|
| 376 | <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> |
|---|
| 377 | <?php if ( post_type_supports( 'attachment', 'title' ) ) : ?> |
|---|
| 378 | <label class="setting" data-setting="title"> |
|---|
| 379 | <span class="name"><?php _e('Title'); ?></span> |
|---|
| 380 | <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> |
|---|
| 381 | </label> |
|---|
| 382 | <?php endif; ?> |
|---|
| 383 | <# if ( 'audio' === data.type ) { #> |
|---|
| 384 | <?php foreach ( array( |
|---|
| 385 | 'artist' => __( 'Artist' ), |
|---|
| 386 | 'album' => __( 'Album' ), |
|---|
| 387 | ) as $key => $label ) : ?> |
|---|
| 388 | <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>"> |
|---|
| 389 | <span class="name"><?php echo $label ?></span> |
|---|
| 390 | <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" /> |
|---|
| 391 | </label> |
|---|
| 392 | <?php endforeach; ?> |
|---|
| 393 | <# } #> |
|---|
| 394 | <label class="setting" data-setting="caption"> |
|---|
| 395 | <span class="name"><?php _e( 'Caption' ); ?></span> |
|---|
| 396 | <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> |
|---|
| 397 | </label> |
|---|
| 398 | <# if ( 'image' === data.type ) { #> |
|---|
| 399 | <label class="setting" data-setting="alt"> |
|---|
| 400 | <span class="name"><?php _e( 'Alt Text' ); ?></span> |
|---|
| 401 | <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> |
|---|
| 402 | </label> |
|---|
| 403 | <# } #> |
|---|
| 404 | <label class="setting" data-setting="description"> |
|---|
| 405 | <span class="name"><?php _e('Description'); ?></span> |
|---|
| 406 | <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> |
|---|
| 407 | </label> |
|---|
| 408 | <label class="setting"> |
|---|
| 409 | <span class="name"><?php _e( 'Uploaded By' ); ?></span> |
|---|
| 410 | <span class="value">{{ data.authorName }}</span> |
|---|
| 411 | </label> |
|---|
| 412 | <# if ( data.uploadedToTitle ) { #> |
|---|
| 413 | <label class="setting"> |
|---|
| 414 | <span class="name"><?php _e( 'Uploaded To' ); ?></span> |
|---|
| 415 | <# if ( data.uploadedToLink ) { #> |
|---|
| 416 | <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span> |
|---|
| 417 | <# } else { #> |
|---|
| 418 | <span class="value">{{ data.uploadedToTitle }}</span> |
|---|
| 419 | <# } #> |
|---|
| 420 | </label> |
|---|
| 421 | <# } #> |
|---|
| 422 | <div class="attachment-compat"></div> |
|---|
| 423 | </div> |
|---|
| 424 | |
|---|
| 425 | <div class="actions"> |
|---|
| 426 | <a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> |
|---|
| 427 | <# if ( data.can.save ) { #> | |
|---|
| 428 | <a href="post.php?post={{ data.id }}&action=edit"><?php _e( 'Edit more details' ); ?></a> |
|---|
| 429 | <# } #> |
|---|
| 430 | <# if ( ! data.uploading && data.can.remove ) { #> | |
|---|
| 431 | <?php if ( MEDIA_TRASH ): ?> |
|---|
| 432 | <# if ( 'trash' === data.status ) { #> |
|---|
| 433 | <button type="button" class="button-link untrash-attachment"><?php _e( 'Untrash' ); ?></button> |
|---|
| 434 | <# } else { #> |
|---|
| 435 | <button type="button" class="button-link trash-attachment"><?php _ex( 'Trash', 'verb' ); ?></button> |
|---|
| 436 | <# } #> |
|---|
| 437 | <?php else: ?> |
|---|
| 438 | <button type="button" class="button-link delete-attachment"><?php _e( 'Delete Permanently' ); ?></button> |
|---|
| 439 | <?php endif; ?> |
|---|
| 440 | <# } #> |
|---|
| 441 | </div> |
|---|
| 442 | |
|---|
| 443 | </div> |
|---|
| 444 | </script> |
|---|
| 445 | |
|---|
| 446 | <script type="text/html" id="tmpl-attachment"> |
|---|
| 447 | <div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}"> |
|---|
| 448 | <div class="thumbnail"> |
|---|
| 449 | <# if ( data.uploading ) { #> |
|---|
| 450 | <div class="media-progress-bar"><div style="width: {{ data.percent }}%"></div></div> |
|---|
| 451 | <# } else if ( 'image' === data.type && data.sizes ) { #> |
|---|
| 452 | <div class="centered"> |
|---|
| 453 | <img src="{{ data.size.url }}" draggable="false" alt="" /> |
|---|
| 454 | </div> |
|---|
| 455 | <# } else { #> |
|---|
| 456 | <div class="centered"> |
|---|
| 457 | <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #> |
|---|
| 458 | <img src="{{ data.image.src }}" class="thumbnail" draggable="false" alt="" /> |
|---|
| 459 | <# } else if ( data.sizes && data.sizes.medium ) { #> |
|---|
| 460 | <img src="{{ data.sizes.medium.url }}" class="thumbnail" draggable="false" alt="" /> |
|---|
| 461 | <# } else { #> |
|---|
| 462 | <img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> |
|---|
| 463 | <# } #> |
|---|
| 464 | </div> |
|---|
| 465 | <div class="filename"> |
|---|
| 466 | <div>{{ data.filename }}</div> |
|---|
| 467 | </div> |
|---|
| 468 | <# } #> |
|---|
| 469 | </div> |
|---|
| 470 | <# if ( data.buttons.close ) { #> |
|---|
| 471 | <button type="button" class="button-link attachment-close media-modal-icon"><span class="screen-reader-text"><?php _e( 'Remove' ); ?></span></button> |
|---|
| 472 | <# } #> |
|---|
| 473 | </div> |
|---|
| 474 | <# if ( data.buttons.check ) { #> |
|---|
| 475 | <button type="button" class="button-link check" tabindex="-1"><span class="media-modal-icon"></span><span class="screen-reader-text"><?php _e( 'Deselect' ); ?></span></button> |
|---|
| 476 | <# } #> |
|---|
| 477 | <# |
|---|
| 478 | var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; |
|---|
| 479 | if ( data.describe ) { |
|---|
| 480 | if ( 'image' === data.type ) { #> |
|---|
| 481 | <input type="text" value="{{ data.caption }}" class="describe" data-setting="caption" |
|---|
| 482 | placeholder="<?php esc_attr_e('Caption this image…'); ?>" {{ maybeReadOnly }} /> |
|---|
| 483 | <# } else { #> |
|---|
| 484 | <input type="text" value="{{ data.title }}" class="describe" data-setting="title" |
|---|
| 485 | <# if ( 'video' === data.type ) { #> |
|---|
| 486 | placeholder="<?php esc_attr_e('Describe this video…'); ?>" |
|---|
| 487 | <# } else if ( 'audio' === data.type ) { #> |
|---|
| 488 | placeholder="<?php esc_attr_e('Describe this audio file…'); ?>" |
|---|
| 489 | <# } else { #> |
|---|
| 490 | placeholder="<?php esc_attr_e('Describe this media file…'); ?>" |
|---|
| 491 | <# } #> {{ maybeReadOnly }} /> |
|---|
| 492 | <# } |
|---|
| 493 | } #> |
|---|
| 494 | </script> |
|---|
| 495 | |
|---|
| 496 | <script type="text/html" id="tmpl-attachment-details"> |
|---|
| 497 | <h2> |
|---|
| 498 | <?php _e( 'Attachment Details' ); ?> |
|---|
| 499 | <span class="settings-save-status"> |
|---|
| 500 | <span class="spinner"></span> |
|---|
| 501 | <span class="saved"><?php esc_html_e('Saved.'); ?></span> |
|---|
| 502 | </span> |
|---|
| 503 | </h2> |
|---|
| 504 | <div class="attachment-info"> |
|---|
| 505 | <div class="thumbnail thumbnail-{{ data.type }}"> |
|---|
| 506 | <# if ( data.uploading ) { #> |
|---|
| 507 | <div class="media-progress-bar"><div></div></div> |
|---|
| 508 | <# } else if ( 'image' === data.type && data.sizes ) { #> |
|---|
| 509 | <img src="{{ data.size.url }}" draggable="false" alt="" /> |
|---|
| 510 | <# } else { #> |
|---|
| 511 | <img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> |
|---|
| 512 | <# } #> |
|---|
| 513 | </div> |
|---|
| 514 | <div class="details"> |
|---|
| 515 | <div class="filename">{{ data.filename }}</div> |
|---|
| 516 | <div class="uploaded">{{ data.dateFormatted }}</div> |
|---|
| 517 | |
|---|
| 518 | <div class="file-size">{{ data.filesizeHumanReadable }}</div> |
|---|
| 519 | <# if ( 'image' === data.type && ! data.uploading ) { #> |
|---|
| 520 | <# if ( data.width && data.height ) { #> |
|---|
| 521 | <div class="dimensions">{{ data.width }} × {{ data.height }}</div> |
|---|
| 522 | <# } #> |
|---|
| 523 | |
|---|
| 524 | <# if ( data.can.save && data.sizes ) { #> |
|---|
| 525 | <a class="edit-attachment" href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a> |
|---|
| 526 | <# } #> |
|---|
| 527 | <# } #> |
|---|
| 528 | |
|---|
| 529 | <# if ( data.fileLength ) { #> |
|---|
| 530 | <div class="file-length"><?php _e( 'Length:' ); ?> {{ data.fileLength }}</div> |
|---|
| 531 | <# } #> |
|---|
| 532 | |
|---|
| 533 | <# if ( ! data.uploading && data.can.remove ) { #> |
|---|
| 534 | <?php if ( MEDIA_TRASH ): ?> |
|---|
| 535 | <# if ( 'trash' === data.status ) { #> |
|---|
| 536 | <button type="button" class="button-link untrash-attachment"><?php _e( 'Untrash' ); ?></button> |
|---|
| 537 | <# } else { #> |
|---|
| 538 | <button type="button" class="button-link trash-attachment"><?php _ex( 'Trash', 'verb' ); ?></button> |
|---|
| 539 | <# } #> |
|---|
| 540 | <?php else: ?> |
|---|
| 541 | <button type="button" class="button-link delete-attachment"><?php _e( 'Delete Permanently' ); ?></button> |
|---|
| 542 | <?php endif; ?> |
|---|
| 543 | <# } #> |
|---|
| 544 | |
|---|
| 545 | <div class="compat-meta"> |
|---|
| 546 | <# if ( data.compat && data.compat.meta ) { #> |
|---|
| 547 | {{{ data.compat.meta }}} |
|---|
| 548 | <# } #> |
|---|
| 549 | </div> |
|---|
| 550 | </div> |
|---|
| 551 | </div> |
|---|
| 552 | |
|---|
| 553 | <label class="setting" data-setting="url"> |
|---|
| 554 | <span class="name"><?php _e('URL'); ?></span> |
|---|
| 555 | <input type="text" value="{{ data.url }}" readonly /> |
|---|
| 556 | </label> |
|---|
| 557 | <# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> |
|---|
| 558 | <?php if ( post_type_supports( 'attachment', 'title' ) ) : ?> |
|---|
| 559 | <label class="setting" data-setting="title"> |
|---|
| 560 | <span class="name"><?php _e('Title'); ?></span> |
|---|
| 561 | <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} /> |
|---|
| 562 | </label> |
|---|
| 563 | <?php endif; ?> |
|---|
| 564 | <# if ( 'audio' === data.type ) { #> |
|---|
| 565 | <?php foreach ( array( |
|---|
| 566 | 'artist' => __( 'Artist' ), |
|---|
| 567 | 'album' => __( 'Album' ), |
|---|
| 568 | ) as $key => $label ) : ?> |
|---|
| 569 | <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>"> |
|---|
| 570 | <span class="name"><?php echo $label ?></span> |
|---|
| 571 | <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" /> |
|---|
| 572 | </label> |
|---|
| 573 | <?php endforeach; ?> |
|---|
| 574 | <# } #> |
|---|
| 575 | <label class="setting" data-setting="caption"> |
|---|
| 576 | <span class="name"><?php _e('Caption'); ?></span> |
|---|
| 577 | <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea> |
|---|
| 578 | </label> |
|---|
| 579 | <# if ( 'image' === data.type ) { #> |
|---|
| 580 | <label class="setting" data-setting="alt"> |
|---|
| 581 | <span class="name"><?php _e('Alt Text'); ?></span> |
|---|
| 582 | <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} /> |
|---|
| 583 | </label> |
|---|
| 584 | <# } #> |
|---|
| 585 | <label class="setting" data-setting="description"> |
|---|
| 586 | <span class="name"><?php _e('Description'); ?></span> |
|---|
| 587 | <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea> |
|---|
| 588 | </label> |
|---|
| 589 | </script> |
|---|
| 590 | |
|---|
| 591 | <script type="text/html" id="tmpl-media-selection"> |
|---|
| 592 | <div class="selection-info"> |
|---|
| 593 | <span class="count"></span> |
|---|
| 594 | <# if ( data.editable ) { #> |
|---|
| 595 | <button type="button" class="button-link edit-selection"><?php _e( 'Edit Selection' ); ?></button> |
|---|
| 596 | <# } #> |
|---|
| 597 | <# if ( data.clearable ) { #> |
|---|
| 598 | <button type="button" class="button-link clear-selection"><?php _e( 'Clear' ); ?></button> |
|---|
| 599 | <# } #> |
|---|
| 600 | </div> |
|---|
| 601 | <div class="selection-view"></div> |
|---|
| 602 | </script> |
|---|
| 603 | |
|---|
| 604 | <script type="text/html" id="tmpl-attachment-display-settings"> |
|---|
| 605 | <h2><?php _e( 'Attachment Display Settings' ); ?></h2> |
|---|
| 606 | |
|---|
| 607 | <# if ( 'image' === data.type ) { #> |
|---|
| 608 | <label class="setting"> |
|---|
| 609 | <span><?php _e('Alignment'); ?></span> |
|---|
| 610 | <select class="alignment" |
|---|
| 611 | data-setting="align" |
|---|
| 612 | <# if ( data.userSettings ) { #> |
|---|
| 613 | data-user-setting="align" |
|---|
| 614 | <# } #>> |
|---|
| 615 | |
|---|
| 616 | <option value="left"> |
|---|
| 617 | <?php esc_html_e( 'Left' ); ?> |
|---|
| 618 | </option> |
|---|
| 619 | <option value="center"> |
|---|
| 620 | <?php esc_html_e( 'Center' ); ?> |
|---|
| 621 | </option> |
|---|
| 622 | <option value="right"> |
|---|
| 623 | <?php esc_html_e( 'Right' ); ?> |
|---|
| 624 | </option> |
|---|
| 625 | <option value="none" selected> |
|---|
| 626 | <?php esc_html_e( 'None' ); ?> |
|---|
| 627 | </option> |
|---|
| 628 | </select> |
|---|
| 629 | </label> |
|---|
| 630 | <# } #> |
|---|
| 631 | |
|---|
| 632 | <div class="setting"> |
|---|
| 633 | <label> |
|---|
| 634 | <# if ( data.model.canEmbed ) { #> |
|---|
| 635 | <span><?php _e('Embed or Link'); ?></span> |
|---|
| 636 | <# } else { #> |
|---|
| 637 | <span><?php _e('Link To'); ?></span> |
|---|
| 638 | <# } #> |
|---|
| 639 | |
|---|
| 640 | <select class="link-to" |
|---|
| 641 | data-setting="link" |
|---|
| 642 | <# if ( data.userSettings && ! data.model.canEmbed ) { #> |
|---|
| 643 | data-user-setting="urlbutton" |
|---|
| 644 | <# } #>> |
|---|
| 645 | |
|---|
| 646 | <# if ( data.model.canEmbed ) { #> |
|---|
| 647 | <option value="embed" selected> |
|---|
| 648 | <?php esc_html_e( 'Embed Media Player' ); ?> |
|---|
| 649 | </option> |
|---|
| 650 | <option value="file"> |
|---|
| 651 | <# } else { #> |
|---|
| 652 | <option value="none" selected> |
|---|
| 653 | <?php esc_html_e( 'None' ); ?> |
|---|
| 654 | </option> |
|---|
| 655 | <option value="file"> |
|---|
| 656 | <# } #> |
|---|
| 657 | <# if ( data.model.canEmbed ) { #> |
|---|
| 658 | <?php esc_html_e( 'Link to Media File' ); ?> |
|---|
| 659 | <# } else { #> |
|---|
| 660 | <?php esc_html_e( 'Media File' ); ?> |
|---|
| 661 | <# } #> |
|---|
| 662 | </option> |
|---|
| 663 | <option value="post"> |
|---|
| 664 | <# if ( data.model.canEmbed ) { #> |
|---|
| 665 | <?php esc_html_e( 'Link to Attachment Page' ); ?> |
|---|
| 666 | <# } else { #> |
|---|
| 667 | <?php esc_html_e( 'Attachment Page' ); ?> |
|---|
| 668 | <# } #> |
|---|
| 669 | </option> |
|---|
| 670 | <# if ( 'image' === data.type ) { #> |
|---|
| 671 | <option value="custom"> |
|---|
| 672 | <?php esc_html_e( 'Custom URL' ); ?> |
|---|
| 673 | </option> |
|---|
| 674 | <# } #> |
|---|
| 675 | </select> |
|---|
| 676 | </label> |
|---|
| 677 | <input type="text" class="link-to-custom" data-setting="linkUrl" /> |
|---|
| 678 | </div> |
|---|
| 679 | |
|---|
| 680 | <# if ( 'undefined' !== typeof data.sizes ) { #> |
|---|
| 681 | <label class="setting"> |
|---|
| 682 | <span><?php _e('Size'); ?></span> |
|---|
| 683 | <select class="size" name="size" |
|---|
| 684 | data-setting="size" |
|---|
| 685 | <# if ( data.userSettings ) { #> |
|---|
| 686 | data-user-setting="imgsize" |
|---|
| 687 | <# } #>> |
|---|
| 688 | <?php |
|---|
| 689 | /** This filter is documented in wp-admin/includes/media.php */ |
|---|
| 690 | $sizes = apply_filters( 'image_size_names_choose', array( |
|---|
| 691 | 'thumbnail' => __('Thumbnail'), |
|---|
| 692 | 'medium' => __('Medium'), |
|---|
| 693 | 'large' => __('Large'), |
|---|
| 694 | 'full' => __('Full Size'), |
|---|
| 695 | ) ); |
|---|
| 696 | |
|---|
| 697 | foreach ( $sizes as $value => $name ) : ?> |
|---|
| 698 | <# |
|---|
| 699 | var size = data.sizes['<?php echo esc_js( $value ); ?>']; |
|---|
| 700 | if ( size ) { #> |
|---|
| 701 | <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, 'full' ); ?>> |
|---|
| 702 | <?php echo esc_html( $name ); ?> – {{ size.width }} × {{ size.height }} |
|---|
| 703 | </option> |
|---|
| 704 | <# } #> |
|---|
| 705 | <?php endforeach; ?> |
|---|
| 706 | </select> |
|---|
| 707 | </label> |
|---|
| 708 | <# } #> |
|---|
| 709 | </script> |
|---|
| 710 | |
|---|
| 711 | <script type="text/html" id="tmpl-gallery-settings"> |
|---|
| 712 | <h2><?php _e( 'Gallery Settings' ); ?></h2> |
|---|
| 713 | |
|---|
| 714 | <label class="setting"> |
|---|
| 715 | <span><?php _e('Link To'); ?></span> |
|---|
| 716 | <select class="link-to" |
|---|
| 717 | data-setting="link" |
|---|
| 718 | <# if ( data.userSettings ) { #> |
|---|
| 719 | data-user-setting="urlbutton" |
|---|
| 720 | <# } #>> |
|---|
| 721 | |
|---|
| 722 | <option value="post" <# if ( ! wp.media.galleryDefaults.link || 'post' == wp.media.galleryDefaults.link ) { |
|---|
| 723 | #>selected="selected"<# } |
|---|
| 724 | #>> |
|---|
| 725 | <?php esc_html_e( 'Attachment Page' ); ?> |
|---|
| 726 | </option> |
|---|
| 727 | <option value="file" <# if ( 'file' == wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>> |
|---|
| 728 | <?php esc_html_e( 'Media File' ); ?> |
|---|
| 729 | </option> |
|---|
| 730 | <option value="none" <# if ( 'none' == wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>> |
|---|
| 731 | <?php esc_html_e( 'None' ); ?> |
|---|
| 732 | </option> |
|---|
| 733 | </select> |
|---|
| 734 | </label> |
|---|
| 735 | |
|---|
| 736 | <label class="setting"> |
|---|
| 737 | <span><?php _e('Columns'); ?></span> |
|---|
| 738 | <select class="columns" name="columns" |
|---|
| 739 | data-setting="columns"> |
|---|
| 740 | <?php for ( $i = 1; $i <= 9; $i++ ) : ?> |
|---|
| 741 | <option value="<?php echo esc_attr( $i ); ?>" <# |
|---|
| 742 | if ( <?php echo $i ?> == wp.media.galleryDefaults.columns ) { #>selected="selected"<# } |
|---|
| 743 | #>> |
|---|
| 744 | <?php echo esc_html( $i ); ?> |
|---|
| 745 | </option> |
|---|
| 746 | <?php endfor; ?> |
|---|
| 747 | </select> |
|---|
| 748 | </label> |
|---|
| 749 | |
|---|
| 750 | <label class="setting"> |
|---|
| 751 | <span><?php _e( 'Random Order' ); ?></span> |
|---|
| 752 | <input type="checkbox" data-setting="_orderbyRandom" /> |
|---|
| 753 | </label> |
|---|
| 754 | |
|---|
| 755 | <label class="setting size"> |
|---|
| 756 | <span><?php _e( 'Size' ); ?></span> |
|---|
| 757 | <select class="size" name="size" |
|---|
| 758 | data-setting="size" |
|---|
| 759 | <# if ( data.userSettings ) { #> |
|---|
| 760 | data-user-setting="imgsize" |
|---|
| 761 | <# } #> |
|---|
| 762 | > |
|---|
| 763 | <?php |
|---|
| 764 | // This filter is documented in wp-admin/includes/media.php |
|---|
| 765 | $size_names = apply_filters( 'image_size_names_choose', array( |
|---|
| 766 | 'thumbnail' => __( 'Thumbnail' ), |
|---|
| 767 | 'medium' => __( 'Medium' ), |
|---|
| 768 | 'large' => __( 'Large' ), |
|---|
| 769 | 'full' => __( 'Full Size' ), |
|---|
| 770 | ) ); |
|---|
| 771 | |
|---|
| 772 | foreach ( $size_names as $size => $label ) : ?> |
|---|
| 773 | <option value="<?php echo esc_attr( $size ); ?>"> |
|---|
| 774 | <?php echo esc_html( $label ); ?> |
|---|
| 775 | </option> |
|---|
| 776 | <?php endforeach; ?> |
|---|
| 777 | </select> |
|---|
| 778 | </label> |
|---|
| 779 | </script> |
|---|
| 780 | |
|---|
| 781 | <script type="text/html" id="tmpl-playlist-settings"> |
|---|
| 782 | <h2><?php _e( 'Playlist Settings' ); ?></h2> |
|---|
| 783 | |
|---|
| 784 | <# var emptyModel = _.isEmpty( data.model ), |
|---|
| 785 | isVideo = 'video' === data.controller.get('library').props.get('type'); #> |
|---|
| 786 | |
|---|
| 787 | <label class="setting"> |
|---|
| 788 | <input type="checkbox" data-setting="tracklist" <# if ( emptyModel ) { #> |
|---|
| 789 | checked="checked" |
|---|
| 790 | <# } #> /> |
|---|
| 791 | <# if ( isVideo ) { #> |
|---|
| 792 | <span><?php _e( 'Show Video List' ); ?></span> |
|---|
| 793 | <# } else { #> |
|---|
| 794 | <span><?php _e( 'Show Tracklist' ); ?></span> |
|---|
| 795 | <# } #> |
|---|
| 796 | </label> |
|---|
| 797 | |
|---|
| 798 | <# if ( ! isVideo ) { #> |
|---|
| 799 | <label class="setting"> |
|---|
| 800 | <input type="checkbox" data-setting="artists" <# if ( emptyModel ) { #> |
|---|
| 801 | checked="checked" |
|---|
| 802 | <# } #> /> |
|---|
| 803 | <span><?php _e( 'Show Artist Name in Tracklist' ); ?></span> |
|---|
| 804 | </label> |
|---|
| 805 | <# } #> |
|---|
| 806 | |
|---|
| 807 | <label class="setting"> |
|---|
| 808 | <input type="checkbox" data-setting="images" <# if ( emptyModel ) { #> |
|---|
| 809 | checked="checked" |
|---|
| 810 | <# } #> /> |
|---|
| 811 | <span><?php _e( 'Show Images' ); ?></span> |
|---|
| 812 | </label> |
|---|
| 813 | </script> |
|---|
| 814 | |
|---|
| 815 | <script type="text/html" id="tmpl-embed-link-settings"> |
|---|
| 816 | <label class="setting link-text"> |
|---|
| 817 | <span><?php _e( 'Link Text' ); ?></span> |
|---|
| 818 | <input type="text" class="alignment" data-setting="linkText" /> |
|---|
| 819 | </label> |
|---|
| 820 | <div class="embed-container" style="display: none;"> |
|---|
| 821 | <div class="embed-preview"></div> |
|---|
| 822 | </div> |
|---|
| 823 | </script> |
|---|
| 824 | |
|---|
| 825 | <script type="text/html" id="tmpl-embed-image-settings"> |
|---|
| 826 | <div class="thumbnail"> |
|---|
| 827 | <img src="{{ data.model.url }}" draggable="false" alt="" /> |
|---|
| 828 | </div> |
|---|
| 829 | |
|---|
| 830 | <?php |
|---|
| 831 | /** This filter is documented in wp-admin/includes/media.php */ |
|---|
| 832 | if ( ! apply_filters( 'disable_captions', '' ) ) : ?> |
|---|
| 833 | <label class="setting caption"> |
|---|
| 834 | <span><?php _e('Caption'); ?></span> |
|---|
| 835 | <textarea data-setting="caption" /> |
|---|
| 836 | </label> |
|---|
| 837 | <?php endif; ?> |
|---|
| 838 | |
|---|
| 839 | <label class="setting alt-text"> |
|---|
| 840 | <span><?php _e('Alt Text'); ?></span> |
|---|
| 841 | <input type="text" data-setting="alt" /> |
|---|
| 842 | </label> |
|---|
| 843 | |
|---|
| 844 | <div class="setting align"> |
|---|
| 845 | <span><?php _e('Align'); ?></span> |
|---|
| 846 | <div class="button-group button-large" data-setting="align"> |
|---|
| 847 | <button class="button" value="left"> |
|---|
| 848 | <?php esc_html_e( 'Left' ); ?> |
|---|
| 849 | </button> |
|---|
| 850 | <button class="button" value="center"> |
|---|
| 851 | <?php esc_html_e( 'Center' ); ?> |
|---|
| 852 | </button> |
|---|
| 853 | <button class="button" value="right"> |
|---|
| 854 | <?php esc_html_e( 'Right' ); ?> |
|---|
| 855 | </button> |
|---|
| 856 | <button class="button active" value="none"> |
|---|
| 857 | <?php esc_html_e( 'None' ); ?> |
|---|
| 858 | </button> |
|---|
| 859 | </div> |
|---|
| 860 | </div> |
|---|
| 861 | |
|---|
| 862 | <div class="setting link-to"> |
|---|
| 863 | <span><?php _e('Link To'); ?></span> |
|---|
| 864 | <div class="button-group button-large" data-setting="link"> |
|---|
| 865 | <button class="button" value="file"> |
|---|
| 866 | <?php esc_html_e( 'Image URL' ); ?> |
|---|
| 867 | </button> |
|---|
| 868 | <button class="button" value="custom"> |
|---|
| 869 | <?php esc_html_e( 'Custom URL' ); ?> |
|---|
| 870 | </button> |
|---|
| 871 | <button class="button active" value="none"> |
|---|
| 872 | <?php esc_html_e( 'None' ); ?> |
|---|
| 873 | </button> |
|---|
| 874 | </div> |
|---|
| 875 | <input type="text" class="link-to-custom" data-setting="linkUrl" /> |
|---|
| 876 | </div> |
|---|
| 877 | </script> |
|---|
| 878 | |
|---|
| 879 | <script type="text/html" id="tmpl-image-details"> |
|---|
| 880 | <div class="media-embed"> |
|---|
| 881 | <div class="embed-media-settings"> |
|---|
| 882 | <div class="column-image"> |
|---|
| 883 | <div class="image"> |
|---|
| 884 | <img src="{{ data.model.url }}" draggable="false" alt="" /> |
|---|
| 885 | |
|---|
| 886 | <# if ( data.attachment && window.imageEdit ) { #> |
|---|
| 887 | <div class="actions"> |
|---|
| 888 | <input type="button" class="edit-attachment button" value="<?php esc_attr_e( 'Edit Original' ); ?>" /> |
|---|
| 889 | <input type="button" class="replace-attachment button" value="<?php esc_attr_e( 'Replace' ); ?>" /> |
|---|
| 890 | </div> |
|---|
| 891 | <# else if ( data.attachment && window.imageEdit ) { #> |
|---|
| 892 | <div class="actions"> |
|---|
| 893 | <input type="button" class="replace-attachment button" value="<?php esc_attr_e( 'Replace' ); ?>" /> |
|---|
| 894 | </div> |
|---|
| 895 | <# } #> |
|---|
| 896 | </div> |
|---|
| 897 | </div> |
|---|
| 898 | <div class="column-settings"> |
|---|
| 899 | <?php |
|---|
| 900 | /** This filter is documented in wp-admin/includes/media.php */ |
|---|
| 901 | if ( ! apply_filters( 'disable_captions', '' ) ) : ?> |
|---|
| 902 | <label class="setting caption"> |
|---|
| 903 | <span><?php _e('Caption'); ?></span> |
|---|
| 904 | <textarea data-setting="caption">{{ data.model.caption }}</textarea> |
|---|
| 905 | </label> |
|---|
| 906 | <?php endif; ?> |
|---|
| 907 | |
|---|
| 908 | <label class="setting alt-text"> |
|---|
| 909 | <span><?php _e('Alternative Text'); ?></span> |
|---|
| 910 | <input type="text" data-setting="alt" value="{{ data.model.alt }}" /> |
|---|
| 911 | </label> |
|---|
| 912 | |
|---|
| 913 | <h2><?php _e( 'Display Settings' ); ?></h2> |
|---|
| 914 | <div class="setting align"> |
|---|
| 915 | <span><?php _e('Align'); ?></span> |
|---|
| 916 | <div class="button-group button-large" data-setting="align"> |
|---|
| 917 | <button class="button" value="left"> |
|---|
| 918 | <?php esc_html_e( 'Left' ); ?> |
|---|
| 919 | </button> |
|---|
| 920 | <button class="button" value="center"> |
|---|
| 921 | <?php esc_html_e( 'Center' ); ?> |
|---|
| 922 | </button> |
|---|
| 923 | <button class="button" value="right"> |
|---|
| 924 | <?php esc_html_e( 'Right' ); ?> |
|---|
| 925 | </button> |
|---|
| 926 | <button class="button active" value="none"> |
|---|
| 927 | <?php esc_html_e( 'None' ); ?> |
|---|
| 928 | </button> |
|---|
| 929 | </div> |
|---|
| 930 | </div> |
|---|
| 931 | |
|---|
| 932 | <# if ( data.attachment ) { #> |
|---|
| 933 | <# if ( 'undefined' !== typeof data.attachment.sizes ) { #> |
|---|
| 934 | <label class="setting size"> |
|---|
| 935 | <span><?php _e('Size'); ?></span> |
|---|
| 936 | <select class="size" name="size" |
|---|
| 937 | data-setting="size" |
|---|
| 938 | <# if ( data.userSettings ) { #> |
|---|
| 939 | data-user-setting="imgsize" |
|---|
| 940 | <# } #>> |
|---|
| 941 | <?php |
|---|
| 942 | /** This filter is documented in wp-admin/includes/media.php */ |
|---|
| 943 | $sizes = apply_filters( 'image_size_names_choose', array( |
|---|
| 944 | 'thumbnail' => __('Thumbnail'), |
|---|
| 945 | 'medium' => __('Medium'), |
|---|
| 946 | 'large' => __('Large'), |
|---|
| 947 | 'full' => __('Full Size'), |
|---|
| 948 | ) ); |
|---|
| 949 | |
|---|
| 950 | foreach ( $sizes as $value => $name ) : ?> |
|---|
| 951 | <# |
|---|
| 952 | var size = data.sizes['<?php echo esc_js( $value ); ?>']; |
|---|
| 953 | if ( size ) { #> |
|---|
| 954 | <option value="<?php echo esc_attr( $value ); ?>"> |
|---|
| 955 | <?php echo esc_html( $name ); ?> – {{ size.width }} × {{ size.height }} |
|---|
| 956 | </option> |
|---|
| 957 | <# } #> |
|---|
| 958 | <?php endforeach; ?> |
|---|
| 959 | <option value="<?php echo esc_attr( 'custom' ); ?>"> |
|---|
| 960 | <?php _e( 'Custom Size' ); ?> |
|---|
| 961 | </option> |
|---|
| 962 | </select> |
|---|
| 963 | </label> |
|---|
| 964 | <# } #> |
|---|
| 965 | <div class="custom-size<# if ( data.model.size !== 'custom' ) { #> hidden<# } #>"> |
|---|
| 966 | <label><span><?php _e( 'Width' ); ?> <small>(px)</small></span> <input data-setting="customWidth" type="number" step="1" value="{{ data.model.customWidth }}" /></label><span class="sep">×</span><label><span><?php _e( 'Height' ); ?> <small>(px)</small></span><input data-setting="customHeight" type="number" step="1" value="{{ data.model.customHeight }}" /></label> |
|---|
| 967 | </div> |
|---|
| 968 | <# } #> |
|---|
| 969 | |
|---|
| 970 | <div class="setting link-to"> |
|---|
| 971 | <span><?php _e('Link To'); ?></span> |
|---|
| 972 | <select data-setting="link"> |
|---|
| 973 | <# if ( data.attachment ) { #> |
|---|
| 974 | <option value="file"> |
|---|
| 975 | <?php esc_html_e( 'Media File' ); ?> |
|---|
| 976 | </option> |
|---|
| 977 | <option value="post"> |
|---|
| 978 | <?php esc_html_e( 'Attachment Page' ); ?> |
|---|
| 979 | </option> |
|---|
| 980 | <# } else { #> |
|---|
| 981 | <option value="file"> |
|---|
| 982 | <?php esc_html_e( 'Image URL' ); ?> |
|---|
| 983 | </option> |
|---|
| 984 | <# } #> |
|---|
| 985 | <option value="custom"> |
|---|
| 986 | <?php esc_html_e( 'Custom URL' ); ?> |
|---|
| 987 | </option> |
|---|
| 988 | <option value="none"> |
|---|
| 989 | <?php esc_html_e( 'None' ); ?> |
|---|
| 990 | </option> |
|---|
| 991 | </select> |
|---|
| 992 | <input type="text" class="link-to-custom" data-setting="linkUrl" /> |
|---|
| 993 | </div> |
|---|
| 994 | <div class="advanced-section"> |
|---|
| 995 | <h2><button type="button" class="button-link advanced-toggle"><?php _e( 'Advanced Options' ); ?></button></h2> |
|---|
| 996 | <div class="advanced-settings hidden"> |
|---|
| 997 | <div class="advanced-image"> |
|---|
| 998 | <label class="setting title-text"> |
|---|
| 999 | <span><?php _e('Image Title Attribute'); ?></span> |
|---|
| 1000 | <input type="text" data-setting="title" value="{{ data.model.title }}" /> |
|---|
| 1001 | </label> |
|---|
| 1002 | <label class="setting extra-classes"> |
|---|
| 1003 | <span><?php _e('Image CSS Class'); ?></span> |
|---|
| 1004 | <input type="text" data-setting="extraClasses" value="{{ data.model.extraClasses }}" /> |
|---|
| 1005 | </label> |
|---|
| 1006 | </div> |
|---|
| 1007 | <div class="advanced-link"> |
|---|
| 1008 | <div class="setting link-target"> |
|---|
| 1009 | <label><input type="checkbox" data-setting="linkTargetBlank" value="_blank" <# if ( data.model.linkTargetBlank ) { #>checked="checked"<# } #>><?php _e( 'Open link in a new tab' ); ?></label> |
|---|
| 1010 | </div> |
|---|
| 1011 | <label class="setting link-rel"> |
|---|
| 1012 | <span><?php _e('Link Rel'); ?></span> |
|---|
| 1013 | <input type="text" data-setting="linkRel" value="{{ data.model.linkClassName }}" /> |
|---|
| 1014 | </label> |
|---|
| 1015 | <label class="setting link-class-name"> |
|---|
| 1016 | <span><?php _e('Link CSS Class'); ?></span> |
|---|
| 1017 | <input type="text" data-setting="linkClassName" value="{{ data.model.linkClassName }}" /> |
|---|
| 1018 | </label> |
|---|
| 1019 | </div> |
|---|
| 1020 | </div> |
|---|
| 1021 | </div> |
|---|
| 1022 | </div> |
|---|
| 1023 | </div> |
|---|
| 1024 | </div> |
|---|
| 1025 | </script> |
|---|
| 1026 | |
|---|
| 1027 | <script type="text/html" id="tmpl-image-editor"> |
|---|
| 1028 | <div id="media-head-{{ data.id }}"></div> |
|---|
| 1029 | <div id="image-editor-{{ data.id }}"></div> |
|---|
| 1030 | </script> |
|---|
| 1031 | |
|---|
| 1032 | <script type="text/html" id="tmpl-audio-details"> |
|---|
| 1033 | <# var ext, html5types = { |
|---|
| 1034 | mp3: wp.media.view.settings.embedMimes.mp3, |
|---|
| 1035 | ogg: wp.media.view.settings.embedMimes.ogg |
|---|
| 1036 | }; #> |
|---|
| 1037 | |
|---|
| 1038 | <?php $audio_types = wp_get_audio_extensions(); ?> |
|---|
| 1039 | <div class="media-embed media-embed-details"> |
|---|
| 1040 | <div class="embed-media-settings embed-audio-settings"> |
|---|
| 1041 | <?php wp_underscore_audio_template() ?> |
|---|
| 1042 | |
|---|
| 1043 | <# if ( ! _.isEmpty( data.model.src ) ) { |
|---|
| 1044 | ext = data.model.src.split('.').pop(); |
|---|
| 1045 | if ( html5types[ ext ] ) { |
|---|
| 1046 | delete html5types[ ext ]; |
|---|
| 1047 | } |
|---|
| 1048 | #> |
|---|
| 1049 | <label class="setting"> |
|---|
| 1050 | <span>SRC</span> |
|---|
| 1051 | <input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" /> |
|---|
| 1052 | <button type="button" class="button-link remove-setting"><?php _e( 'Remove audio source' ); ?></button> |
|---|
| 1053 | </label> |
|---|
| 1054 | <# } #> |
|---|
| 1055 | <?php |
|---|
| 1056 | |
|---|
| 1057 | foreach ( $audio_types as $type ): |
|---|
| 1058 | ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) { |
|---|
| 1059 | if ( ! _.isUndefined( html5types.<?php echo $type ?> ) ) { |
|---|
| 1060 | delete html5types.<?php echo $type ?>; |
|---|
| 1061 | } |
|---|
| 1062 | #> |
|---|
| 1063 | <label class="setting"> |
|---|
| 1064 | <span><?php echo strtoupper( $type ) ?></span> |
|---|
| 1065 | <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" /> |
|---|
| 1066 | <button type="button" class="button-link remove-setting"><?php _e( 'Remove audio source' ); ?></button> |
|---|
| 1067 | </label> |
|---|
| 1068 | <# } #> |
|---|
| 1069 | <?php endforeach ?> |
|---|
| 1070 | |
|---|
| 1071 | <# if ( ! _.isEmpty( html5types ) ) { #> |
|---|
| 1072 | <div class="setting"> |
|---|
| 1073 | <span><?php _e( 'Add alternate sources for maximum HTML5 playback:' ) ?></span> |
|---|
| 1074 | <div class="button-large"> |
|---|
| 1075 | <# _.each( html5types, function (mime, type) { #> |
|---|
| 1076 | <button class="button add-media-source" data-mime="{{ mime }}">{{ type }}</button> |
|---|
| 1077 | <# } ) #> |
|---|
| 1078 | </div> |
|---|
| 1079 | </div> |
|---|
| 1080 | <# } #> |
|---|
| 1081 | |
|---|
| 1082 | <div class="setting preload"> |
|---|
| 1083 | <span><?php _e( 'Preload' ); ?></span> |
|---|
| 1084 | <div class="button-group button-large" data-setting="preload"> |
|---|
| 1085 | <button class="button" value="auto"><?php _ex( 'Auto', 'auto preload' ); ?></button> |
|---|
| 1086 | <button class="button" value="metadata"><?php _e( 'Metadata' ); ?></button> |
|---|
| 1087 | <button class="button active" value="none"><?php _e( 'None' ); ?></button> |
|---|
| 1088 | </div> |
|---|
| 1089 | </div> |
|---|
| 1090 | |
|---|
| 1091 | <label class="setting checkbox-setting"> |
|---|
| 1092 | <input type="checkbox" data-setting="autoplay" /> |
|---|
| 1093 | <span><?php _e( 'Autoplay' ); ?></span> |
|---|
| 1094 | </label> |
|---|
| 1095 | |
|---|
| 1096 | <label class="setting checkbox-setting"> |
|---|
| 1097 | <input type="checkbox" data-setting="loop" /> |
|---|
| 1098 | <span><?php _e( 'Loop' ); ?></span> |
|---|
| 1099 | </label> |
|---|
| 1100 | </div> |
|---|
| 1101 | </div> |
|---|
| 1102 | </script> |
|---|
| 1103 | |
|---|
| 1104 | <script type="text/html" id="tmpl-video-details"> |
|---|
| 1105 | <# var ext, html5types = { |
|---|
| 1106 | mp4: wp.media.view.settings.embedMimes.mp4, |
|---|
| 1107 | ogv: wp.media.view.settings.embedMimes.ogv, |
|---|
| 1108 | webm: wp.media.view.settings.embedMimes.webm |
|---|
| 1109 | }; #> |
|---|
| 1110 | |
|---|
| 1111 | <?php $video_types = wp_get_video_extensions(); ?> |
|---|
| 1112 | <div class="media-embed media-embed-details"> |
|---|
| 1113 | <div class="embed-media-settings embed-video-settings"> |
|---|
| 1114 | <div class="wp-video-holder"> |
|---|
| 1115 | <# |
|---|
| 1116 | var w = ! data.model.width || data.model.width > 640 ? 640 : data.model.width, |
|---|
| 1117 | h = ! data.model.height ? 360 : data.model.height; |
|---|
| 1118 | |
|---|
| 1119 | if ( data.model.width && w !== data.model.width ) { |
|---|
| 1120 | h = Math.ceil( ( h * w ) / data.model.width ); |
|---|
| 1121 | } |
|---|
| 1122 | #> |
|---|
| 1123 | |
|---|
| 1124 | <?php wp_underscore_video_template() ?> |
|---|
| 1125 | |
|---|
| 1126 | <# if ( ! _.isEmpty( data.model.src ) ) { |
|---|
| 1127 | ext = data.model.src.split('.').pop(); |
|---|
| 1128 | if ( html5types[ ext ] ) { |
|---|
| 1129 | delete html5types[ ext ]; |
|---|
| 1130 | } |
|---|
| 1131 | #> |
|---|
| 1132 | <label class="setting"> |
|---|
| 1133 | <span>SRC</span> |
|---|
| 1134 | <input type="text" disabled="disabled" data-setting="src" value="{{ data.model.src }}" /> |
|---|
| 1135 | <button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button> |
|---|
| 1136 | </label> |
|---|
| 1137 | <# } #> |
|---|
| 1138 | <?php foreach ( $video_types as $type ): |
|---|
| 1139 | ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) { |
|---|
| 1140 | if ( ! _.isUndefined( html5types.<?php echo $type ?> ) ) { |
|---|
| 1141 | delete html5types.<?php echo $type ?>; |
|---|
| 1142 | } |
|---|
| 1143 | #> |
|---|
| 1144 | <label class="setting"> |
|---|
| 1145 | <span><?php echo strtoupper( $type ) ?></span> |
|---|
| 1146 | <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" /> |
|---|
| 1147 | <button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button> |
|---|
| 1148 | </label> |
|---|
| 1149 | <# } #> |
|---|
| 1150 | <?php endforeach ?> |
|---|
| 1151 | </div> |
|---|
| 1152 | |
|---|
| 1153 | <# if ( ! _.isEmpty( html5types ) ) { #> |
|---|
| 1154 | <div class="setting"> |
|---|
| 1155 | <span><?php _e( 'Add alternate sources for maximum HTML5 playback:' ); ?></span> |
|---|
| 1156 | <div class="button-large"> |
|---|
| 1157 | <# _.each( html5types, function (mime, type) { #> |
|---|
| 1158 | <button class="button add-media-source" data-mime="{{ mime }}">{{ type }}</button> |
|---|
| 1159 | <# } ) #> |
|---|
| 1160 | </div> |
|---|
| 1161 | </div> |
|---|
| 1162 | <# } #> |
|---|
| 1163 | |
|---|
| 1164 | <# if ( ! _.isEmpty( data.model.poster ) ) { #> |
|---|
| 1165 | <label class="setting"> |
|---|
| 1166 | <span><?php _e( 'Poster Image' ); ?></span> |
|---|
| 1167 | <input type="text" disabled="disabled" data-setting="poster" value="{{ data.model.poster }}" /> |
|---|
| 1168 | <button type="button" class="button-link remove-setting"><?php _e( 'Remove poster image' ); ?></button> |
|---|
| 1169 | </label> |
|---|
| 1170 | <# } #> |
|---|
| 1171 | <div class="setting preload"> |
|---|
| 1172 | <span><?php _e( 'Preload' ); ?></span> |
|---|
| 1173 | <div class="button-group button-large" data-setting="preload"> |
|---|
| 1174 | <button class="button" value="auto"><?php _ex( 'Auto', 'auto preload' ); ?></button> |
|---|
| 1175 | <button class="button" value="metadata"><?php _e( 'Metadata' ); ?></button> |
|---|
| 1176 | <button class="button active" value="none"><?php _e( 'None' ); ?></button> |
|---|
| 1177 | </div> |
|---|
| 1178 | </div> |
|---|
| 1179 | |
|---|
| 1180 | <label class="setting checkbox-setting"> |
|---|
| 1181 | <input type="checkbox" data-setting="autoplay" /> |
|---|
| 1182 | <span><?php _e( 'Autoplay' ); ?></span> |
|---|
| 1183 | </label> |
|---|
| 1184 | |
|---|
| 1185 | <label class="setting checkbox-setting"> |
|---|
| 1186 | <input type="checkbox" data-setting="loop" /> |
|---|
| 1187 | <span><?php _e( 'Loop' ); ?></span> |
|---|
| 1188 | </label> |
|---|
| 1189 | |
|---|
| 1190 | <label class="setting" data-setting="content"> |
|---|
| 1191 | <span><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></span> |
|---|
| 1192 | <# |
|---|
| 1193 | var content = ''; |
|---|
| 1194 | if ( ! _.isEmpty( data.model.content ) ) { |
|---|
| 1195 | var tracks = jQuery( data.model.content ).filter( 'track' ); |
|---|
| 1196 | _.each( tracks.toArray(), function (track) { |
|---|
| 1197 | content += track.outerHTML; #> |
|---|
| 1198 | <p> |
|---|
| 1199 | <input class="content-track" type="text" value="{{ track.outerHTML }}" /> |
|---|
| 1200 | <button type="button" class="button-link remove-setting remove-track"><?php _ex( 'Remove video track', 'media' ); ?></button> |
|---|
| 1201 | </p> |
|---|
| 1202 | <# } ); #> |
|---|
| 1203 | <# } else { #> |
|---|
| 1204 | <em><?php _e( 'There are no associated subtitles.' ); ?></em> |
|---|
| 1205 | <# } #> |
|---|
| 1206 | <textarea class="hidden content-setting">{{ content }}</textarea> |
|---|
| 1207 | </label> |
|---|
| 1208 | </div> |
|---|
| 1209 | </div> |
|---|
| 1210 | </script> |
|---|
| 1211 | |
|---|
| 1212 | <script type="text/html" id="tmpl-editor-gallery"> |
|---|
| 1213 | <# if ( data.attachments.length ) { #> |
|---|
| 1214 | <div class="gallery gallery-columns-{{ data.columns }}"> |
|---|
| 1215 | <# _.each( data.attachments, function( attachment, index ) { #> |
|---|
| 1216 | <dl class="gallery-item"> |
|---|
| 1217 | <dt class="gallery-icon"> |
|---|
| 1218 | <# if ( attachment.thumbnail ) { #> |
|---|
| 1219 | <img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" alt="" /> |
|---|
| 1220 | <# } else { #> |
|---|
| 1221 | <img src="{{ attachment.url }}" alt="" /> |
|---|
| 1222 | <# } #> |
|---|
| 1223 | </dt> |
|---|
| 1224 | <# if ( attachment.caption ) { #> |
|---|
| 1225 | <dd class="wp-caption-text gallery-caption"> |
|---|
| 1226 | {{{ data.verifyHTML( attachment.caption ) }}} |
|---|
| 1227 | </dd> |
|---|
| 1228 | <# } #> |
|---|
| 1229 | </dl> |
|---|
| 1230 | <# if ( index % data.columns === data.columns - 1 ) { #> |
|---|
| 1231 | <br style="clear: both;"> |
|---|
| 1232 | <# } #> |
|---|
| 1233 | <# } ); #> |
|---|
| 1234 | </div> |
|---|
| 1235 | <# } else { #> |
|---|
| 1236 | <div class="wpview-error"> |
|---|
| 1237 | <div class="dashicons dashicons-format-gallery"></div><p><?php _e( 'No items found.' ); ?></p> |
|---|
| 1238 | </div> |
|---|
| 1239 | <# } #> |
|---|
| 1240 | </script> |
|---|
| 1241 | |
|---|
| 1242 | <script type="text/html" id="tmpl-crop-content"> |
|---|
| 1243 | <img class="crop-image" src="{{ data.url }}" alt="<?php esc_attr_e( 'Image crop area preview. Requires mouse interaction.' ); ?>"> |
|---|
| 1244 | <div class="upload-errors"></div> |
|---|
| 1245 | </script> |
|---|
| 1246 | |
|---|
| 1247 | <script type="text/html" id="tmpl-site-icon-preview"> |
|---|
| 1248 | <h2><?php _e( 'Preview' ); ?></h2> |
|---|
| 1249 | <strong aria-hidden="true"><?php _e( 'As a browser icon' ); ?></strong> |
|---|
| 1250 | <div class="favicon-preview"> |
|---|
| 1251 | <img src="<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>" class="browser-preview" width="182" height="" alt="" /> |
|---|
| 1252 | |
|---|
| 1253 | <div class="favicon"> |
|---|
| 1254 | <img id="preview-favicon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>"/> |
|---|
| 1255 | </div> |
|---|
| 1256 | <span class="browser-title" aria-hidden="true"><?php bloginfo( 'name' ); ?></span> |
|---|
| 1257 | </div> |
|---|
| 1258 | |
|---|
| 1259 | <strong aria-hidden="true"><?php _e( 'As an app icon' ); ?></strong> |
|---|
| 1260 | <div class="app-icon-preview"> |
|---|
| 1261 | <img id="preview-app-icon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>"/> |
|---|
| 1262 | </div> |
|---|
| 1263 | </script> |
|---|
| 1264 | |
|---|
| 1265 | <?php |
|---|
| 1266 | |
|---|
| 1267 | /** |
|---|
| 1268 | * Fires when the custom Backbone media templates are printed. |
|---|
| 1269 | * |
|---|
| 1270 | * @since 3.5.0 |
|---|
| 1271 | */ |
|---|
| 1272 | do_action( 'print_media_templates' ); |
|---|
| 1273 | } |
|---|