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