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