<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23101] trunk/wp-includes: Break wp_print_media_templates() into wp-includes/media-template.php and lazy-load that file through wp_enqueue_media().</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23101">23101</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-12-06 07:10:20 +0000 (Thu, 06 Dec 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Break wp_print_media_templates() into wp-includes/media-template.php and lazy-load that file through wp_enqueue_media(). fixes <a href="http://core.trac.wordpress.org/ticket/22778">#22778</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesmediaphp">trunk/wp-includes/media.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpincludesmediatemplatephp">trunk/wp-includes/media-template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesmediatemplatephpfromrev23097trunkwpincludesmediaphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-includes/media-template.php (from rev 23097, trunk/wp-includes/media.php) (0 => 23101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/media-template.php                                (rev 0)
+++ trunk/wp-includes/media-template.php        2012-12-06 07:10:20 UTC (rev 23101)
</span><span class="lines">@@ -0,0 +1,467 @@
</span><ins>+&lt;?php
+/**
+ * WordPress media templates.
+ *
+ * @package WordPress
+ * @subpackage Media
+ * @since 3.5.0
+ */
+
+/**
+ * Prints the templates used in the media manager.
+ *
+ * @since 3.5.0
+ */
+function wp_print_media_templates() {
+        global $is_IE;
+        $class = 'media-modal wp-core-ui';
+        if ( $is_IE &amp;&amp; strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false )
+                $class .= ' ie7';
+        ?&gt;
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-media-frame&quot;&gt;
+                &lt;div class=&quot;media-frame-menu&quot;&gt;&lt;/div&gt;
+                &lt;div class=&quot;media-frame-title&quot;&gt;&lt;/div&gt;
+                &lt;div class=&quot;media-frame-router&quot;&gt;&lt;/div&gt;
+                &lt;div class=&quot;media-frame-content&quot;&gt;&lt;/div&gt;
+                &lt;div class=&quot;media-frame-toolbar&quot;&gt;&lt;/div&gt;
+                &lt;div class=&quot;media-frame-uploader&quot;&gt;&lt;/div&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-media-modal&quot;&gt;
+                &lt;div class=&quot;&lt;?php echo $class; ?&gt;&quot;&gt;
+                        &lt;a class=&quot;media-modal-close&quot; href=&quot;#&quot; title=&quot;&lt;?php esc_attr_e('Close'); ?&gt;&quot;&gt;&lt;span class=&quot;media-modal-icon&quot;&gt;&lt;/span&gt;&lt;/a&gt;
+                        &lt;div class=&quot;media-modal-content&quot;&gt;&lt;/div&gt;
+                &lt;/div&gt;
+                &lt;div class=&quot;media-modal-backdrop&quot;&gt;&lt;/div&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-uploader-window&quot;&gt;
+                &lt;div class=&quot;uploader-window-content&quot;&gt;
+                        &lt;h3&gt;&lt;?php _e( 'Drop files to upload' ); ?&gt;&lt;/h3&gt;
+                &lt;/div&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-uploader-inline&quot;&gt;
+                &lt;# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #&gt;
+                &lt;div class=&quot;uploader-inline-content {{ messageClass }}&quot;&gt;
+                &lt;# if ( data.message ) { #&gt;
+                        &lt;h3 class=&quot;upload-message&quot;&gt;{{ data.message }}&lt;/h3&gt;
+                &lt;# } #&gt;
+                &lt;?php if ( ! _device_can_upload() ) : ?&gt;
+                        &lt;h3 class=&quot;upload-instructions&quot;&gt;&lt;?php _e('The web browser on your device cannot be used to upload files. You may be able to use the &lt;a href=&quot;http://wordpress.org/extend/mobile/&quot;&gt;native app for your device&lt;/a&gt; instead.'); ?&gt;&lt;/h3&gt;
+                &lt;?php elseif ( is_multisite() &amp;&amp; ! is_upload_space_available() ) : ?&gt;
+                        &lt;h3 class=&quot;upload-instructions&quot;&gt;&lt;?php _e( 'Upload Limit Exceeded' ); ?&gt;&lt;/h3&gt;
+                        &lt;?php do_action( 'upload_ui_over_quota' ); ?&gt;
+
+                &lt;?php else : ?&gt;
+                        &lt;div class=&quot;upload-ui&quot;&gt;
+                                &lt;h3 class=&quot;upload-instructions drop-instructions&quot;&gt;&lt;?php _e( 'Drop files anywhere to upload' ); ?&gt;&lt;/h3&gt;
+                                &lt;a href=&quot;#&quot; class=&quot;browser button button-hero&quot;&gt;&lt;?php _e( 'Select Files' ); ?&gt;&lt;/a&gt;
+                        &lt;/div&gt;
+
+                        &lt;div class=&quot;upload-inline-status&quot;&gt;&lt;/div&gt;
+
+                        &lt;div class=&quot;post-upload-ui&quot;&gt;
+                                &lt;?php
+                                do_action( 'pre-upload-ui' );
+                                do_action( 'pre-plupload-upload-ui' );
+
+                                if ( 10 === remove_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' ) ) {
+                                        do_action( 'post-plupload-upload-ui' );
+                                        add_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' );
+                                } else {
+                                        do_action( 'post-plupload-upload-ui' );
+                                }
+
+                                $upload_size_unit = $max_upload_size = wp_max_upload_size();
+                                $byte_sizes = array( 'KB', 'MB', 'GB' );
+
+                                for ( $u = -1; $upload_size_unit &gt; 1024 &amp;&amp; $u &lt; count( $byte_sizes ) - 1; $u++ ) {
+                                        $upload_size_unit /= 1024;
+                                }
+
+                                if ( $u &lt; 0 ) {
+                                        $upload_size_unit = 0;
+                                        $u = 0;
+                                } else {
+                                        $upload_size_unit = (int) $upload_size_unit;
+                                }
+
+                                ?&gt;
+
+                                &lt;p class=&quot;max-upload-size&quot;&gt;&lt;?php
+                                        printf( __( 'Maximum upload file size: %d%s.' ), esc_html($upload_size_unit), esc_html($byte_sizes[$u]) );
+                                ?&gt;&lt;/p&gt;
+
+                                &lt;?php if ( ( $GLOBALS['is_IE'] || $GLOBALS['is_opera']) &amp;&amp; $max_upload_size &gt; 100 * 1024 * 1024 ) :
+                                        $browser_uploader = admin_url( 'media-new.php?browser-uploader&amp;post_id=' ) . '{{ data.postId }}';
+                                        ?&gt;
+                                        &lt;p class=&quot;big-file-warning&quot;&gt;&lt;?php printf( __( 'Your browser has some limitations uploading large files with the multi-file uploader. Please use the &lt;a href=&quot;%1$s&quot; target=&quot;%2$s&quot;&gt;browser uploader&lt;/a&gt; for files over 100MB.' ),
+                                                $browser_uploader, '_blank' ); ?&gt;&lt;/p&gt;
+                                &lt;?php endif; ?&gt;
+
+                                &lt;?php do_action( 'post-upload-ui' ); ?&gt;
+                        &lt;/div&gt;
+                &lt;?php endif; ?&gt;
+                &lt;/div&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-uploader-status&quot;&gt;
+                &lt;h3&gt;&lt;?php _e( 'Uploading' ); ?&gt;&lt;/h3&gt;
+                &lt;a class=&quot;upload-dismiss-errors&quot; href=&quot;#&quot;&gt;&lt;?php _e('Dismiss Errors'); ?&gt;&lt;/a&gt;
+
+                &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
+                &lt;div class=&quot;upload-details&quot;&gt;
+                        &lt;span class=&quot;upload-count&quot;&gt;
+                                &lt;span class=&quot;upload-index&quot;&gt;&lt;/span&gt; / &lt;span class=&quot;upload-total&quot;&gt;&lt;/span&gt;
+                        &lt;/span&gt;
+                        &lt;span class=&quot;upload-detail-separator&quot;&gt;&amp;ndash;&lt;/span&gt;
+                        &lt;span class=&quot;upload-filename&quot;&gt;&lt;/span&gt;
+                &lt;/div&gt;
+                &lt;div class=&quot;upload-errors&quot;&gt;&lt;/div&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-uploader-status-error&quot;&gt;
+                &lt;span class=&quot;upload-error-label&quot;&gt;&lt;?php _e('Error'); ?&gt;&lt;/span&gt;
+                &lt;span class=&quot;upload-error-filename&quot;&gt;{{{ data.filename }}}&lt;/span&gt;
+                &lt;span class=&quot;upload-error-message&quot;&gt;{{ data.message }}&lt;/span&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachment&quot;&gt;
+                &lt;div class=&quot;attachment-preview type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}&quot;&gt;
+                        &lt;# if ( data.uploading ) { #&gt;
+                                &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
+                        &lt;# } else if ( 'image' === data.type ) { #&gt;
+                                &lt;div class=&quot;thumbnail&quot;&gt;
+                                        &lt;div class=&quot;centered&quot;&gt;
+                                                &lt;img src=&quot;{{ data.size.url }}&quot; draggable=&quot;false&quot; /&gt;
+                                        &lt;/div&gt;
+                                &lt;/div&gt;
+                        &lt;# } else { #&gt;
+                                &lt;img src=&quot;{{ data.icon }}&quot; class=&quot;icon&quot; draggable=&quot;false&quot; /&gt;
+                                &lt;div class=&quot;filename&quot;&gt;
+                                        &lt;div&gt;{{ data.filename }}&lt;/div&gt;
+                                &lt;/div&gt;
+                        &lt;# } #&gt;
+
+                        &lt;# if ( data.buttons.close ) { #&gt;
+                                &lt;a class=&quot;close media-modal-icon&quot; href=&quot;#&quot; title=&quot;&lt;?php _e('Remove'); ?&gt;&quot;&gt;&lt;/a&gt;
+                        &lt;# } #&gt;
+
+                        &lt;# if ( data.buttons.check ) { #&gt;
+                                &lt;a class=&quot;check&quot; href=&quot;#&quot; title=&quot;&lt;?php _e('Deselect'); ?&gt;&quot;&gt;&lt;div class=&quot;media-modal-icon&quot;&gt;&lt;/div&gt;&lt;/a&gt;
+                        &lt;# } #&gt;
+                &lt;/div&gt;
+                &lt;#
+                var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly';
+                if ( data.describe ) { #&gt;
+                        &lt;# if ( 'image' === data.type ) { #&gt;
+                                &lt;input type=&quot;text&quot; value=&quot;{{ data.caption }}&quot; class=&quot;describe&quot; data-setting=&quot;caption&quot;
+                                        placeholder=&quot;&lt;?php esc_attr_e('Describe this image&amp;hellip;'); ?&gt;&quot; {{ maybeReadOnly }} /&gt;
+                        &lt;# } else { #&gt;
+                                &lt;input type=&quot;text&quot; value=&quot;{{ data.title }}&quot; class=&quot;describe&quot; data-setting=&quot;title&quot;
+                                        &lt;# if ( 'video' === data.type ) { #&gt;
+                                                placeholder=&quot;&lt;?php esc_attr_e('Describe this video&amp;hellip;'); ?&gt;&quot;
+                                        &lt;# } else if ( 'audio' === data.type ) { #&gt;
+                                                placeholder=&quot;&lt;?php esc_attr_e('Describe this audio file&amp;hellip;'); ?&gt;&quot;
+                                        &lt;# } else { #&gt;
+                                                placeholder=&quot;&lt;?php esc_attr_e('Describe this media file&amp;hellip;'); ?&gt;&quot;
+                                        &lt;# } #&gt; {{ maybeReadOnly }} /&gt;
+                        &lt;# } #&gt;
+                &lt;# } #&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachment-details&quot;&gt;
+                &lt;h3&gt;
+                        &lt;?php _e('Attachment Details'); ?&gt;
+
+                        &lt;span class=&quot;settings-save-status&quot;&gt;
+                                &lt;span class=&quot;spinner&quot;&gt;&lt;/span&gt;
+                                &lt;span class=&quot;saved&quot;&gt;&lt;?php esc_html_e('Saved.'); ?&gt;&lt;/span&gt;
+                        &lt;/span&gt;
+                &lt;/h3&gt;
+                &lt;div class=&quot;attachment-info&quot;&gt;
+                        &lt;div class=&quot;thumbnail&quot;&gt;
+                                &lt;# if ( data.uploading ) { #&gt;
+                                        &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
+                                &lt;# } else if ( 'image' === data.type ) { #&gt;
+                                        &lt;img src=&quot;{{ data.size.url }}&quot; draggable=&quot;false&quot; /&gt;
+                                &lt;# } else { #&gt;
+                                        &lt;img src=&quot;{{ data.icon }}&quot; class=&quot;icon&quot; draggable=&quot;false&quot; /&gt;
+                                &lt;# } #&gt;
+                        &lt;/div&gt;
+                        &lt;div class=&quot;details&quot;&gt;
+                                &lt;div class=&quot;filename&quot;&gt;{{ data.filename }}&lt;/div&gt;
+                                &lt;div class=&quot;uploaded&quot;&gt;{{ data.dateFormatted }}&lt;/div&gt;
+
+                                &lt;# if ( 'image' === data.type &amp;&amp; ! data.uploading ) { #&gt;
+                                        &lt;# if ( data.width &amp;&amp; data.height ) { #&gt;
+                                                &lt;div class=&quot;dimensions&quot;&gt;{{ data.width }} &amp;times; {{ data.height }}&lt;/div&gt;
+                                        &lt;# } #&gt;
+
+                                        &lt;# if ( data.can.save ) { #&gt;
+                                                &lt;a class=&quot;edit-attachment&quot; href=&quot;{{ data.editLink }}&amp;amp;image-editor&quot; target=&quot;_blank&quot;&gt;&lt;?php _e( 'Edit Image' ); ?&gt;&lt;/a&gt;
+                                                &lt;a class=&quot;refresh-attachment&quot; href=&quot;#&quot;&gt;&lt;?php _e( 'Refresh' ); ?&gt;&lt;/a&gt;
+                                        &lt;# } #&gt;
+                                &lt;# } #&gt;
+
+                                &lt;# if ( ! data.uploading &amp;&amp; data.can.remove ) { #&gt;
+                                        &lt;a class=&quot;delete-attachment&quot; href=&quot;#&quot;&gt;&lt;?php _e( 'Delete Permanently' ); ?&gt;&lt;/a&gt;
+                                &lt;# } #&gt;
+
+                                &lt;div class=&quot;compat-meta&quot;&gt;
+                                        &lt;# if ( data.compat &amp;&amp; data.compat.meta ) { #&gt;
+                                                {{{ data.compat.meta }}}
+                                        &lt;# } #&gt;
+                                &lt;/div&gt;
+                        &lt;/div&gt;
+                &lt;/div&gt;
+
+                &lt;# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #&gt;
+                        &lt;label class=&quot;setting&quot; data-setting=&quot;title&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Title'); ?&gt;&lt;/span&gt;
+                                &lt;input type=&quot;text&quot; value=&quot;{{ data.title }}&quot; {{ maybeReadOnly }} /&gt;
+                        &lt;/label&gt;
+                        &lt;label class=&quot;setting&quot; data-setting=&quot;caption&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Caption'); ?&gt;&lt;/span&gt;
+                                &lt;textarea {{ maybeReadOnly }}&gt;{{ data.caption }}&lt;/textarea&gt;
+                        &lt;/label&gt;
+                &lt;# if ( 'image' === data.type ) { #&gt;
+                        &lt;label class=&quot;setting&quot; data-setting=&quot;alt&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Alt Text'); ?&gt;&lt;/span&gt;
+                                &lt;input type=&quot;text&quot; value=&quot;{{ data.alt }}&quot; {{ maybeReadOnly }} /&gt;
+                        &lt;/label&gt;
+                &lt;# } #&gt;
+                        &lt;label class=&quot;setting&quot; data-setting=&quot;description&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Description'); ?&gt;&lt;/span&gt;
+                                &lt;textarea {{ maybeReadOnly }}&gt;{{ data.description }}&lt;/textarea&gt;
+                        &lt;/label&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-media-selection&quot;&gt;
+                &lt;div class=&quot;selection-info&quot;&gt;
+                        &lt;span class=&quot;count&quot;&gt;&lt;/span&gt;
+                        &lt;# if ( data.editable ) { #&gt;
+                                &lt;a class=&quot;edit-selection&quot; href=&quot;#&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/a&gt;
+                        &lt;# } #&gt;
+                        &lt;# if ( data.clearable ) { #&gt;
+                                &lt;a class=&quot;clear-selection&quot; href=&quot;#&quot;&gt;&lt;?php _e('Clear'); ?&gt;&lt;/a&gt;
+                        &lt;# } #&gt;
+                &lt;/div&gt;
+                &lt;div class=&quot;selection-view&quot;&gt;&lt;/div&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachment-display-settings&quot;&gt;
+                &lt;h3&gt;&lt;?php _e('Attachment Display Settings'); ?&gt;&lt;/h3&gt;
+
+                &lt;# if ( 'image' === data.type ) { #&gt;
+                        &lt;label class=&quot;setting&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Alignment'); ?&gt;&lt;/span&gt;
+                                &lt;select class=&quot;alignment&quot;
+                                        data-setting=&quot;align&quot;
+                                        &lt;# if ( data.userSettings ) { #&gt;
+                                                data-user-setting=&quot;align&quot;
+                                        &lt;# } #&gt;&gt;
+
+                                        &lt;option value=&quot;left&quot;&gt;
+                                                &lt;?php esc_attr_e('Left'); ?&gt;
+                                        &lt;/option&gt;
+                                        &lt;option value=&quot;center&quot;&gt;
+                                                &lt;?php esc_attr_e('Center'); ?&gt;
+                                        &lt;/option&gt;
+                                        &lt;option value=&quot;right&quot;&gt;
+                                                &lt;?php esc_attr_e('Right'); ?&gt;
+                                        &lt;/option&gt;
+                                        &lt;option value=&quot;none&quot; selected&gt;
+                                                &lt;?php esc_attr_e('None'); ?&gt;
+                                        &lt;/option&gt;
+                                &lt;/select&gt;
+                        &lt;/label&gt;
+                &lt;# } #&gt;
+
+                &lt;div class=&quot;setting&quot;&gt;
+                        &lt;label&gt;
+                                &lt;span&gt;&lt;?php _e('Link To'); ?&gt;&lt;/span&gt;
+                                &lt;select class=&quot;link-to&quot;
+                                        data-setting=&quot;link&quot;
+                                        &lt;# if ( data.userSettings ) { #&gt;
+                                                data-user-setting=&quot;urlbutton&quot;
+                                        &lt;# } #&gt;&gt;
+
+                                        &lt;option value=&quot;custom&quot;&gt;
+                                                &lt;?php esc_attr_e('Custom URL'); ?&gt;
+                                        &lt;/option&gt;
+                                        &lt;option value=&quot;post&quot; selected&gt;
+                                                &lt;?php esc_attr_e('Attachment Page'); ?&gt;
+                                        &lt;/option&gt;
+                                        &lt;option value=&quot;file&quot;&gt;
+                                                &lt;?php esc_attr_e('Media File'); ?&gt;
+                                        &lt;/option&gt;
+                                        &lt;option value=&quot;none&quot;&gt;
+                                                &lt;?php esc_attr_e('None'); ?&gt;
+                                        &lt;/option&gt;
+                                &lt;/select&gt;
+                        &lt;/label&gt;
+                        &lt;input type=&quot;text&quot; class=&quot;link-to-custom&quot; data-setting=&quot;linkUrl&quot; /&gt;
+                &lt;/div&gt;
+
+                &lt;# if ( 'undefined' !== typeof data.sizes ) { #&gt;
+                        &lt;label class=&quot;setting&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Size'); ?&gt;&lt;/span&gt;
+                                &lt;select class=&quot;size&quot; name=&quot;size&quot;
+                                        data-setting=&quot;size&quot;
+                                        &lt;# if ( data.userSettings ) { #&gt;
+                                                data-user-setting=&quot;imgsize&quot;
+                                        &lt;# } #&gt;&gt;
+                                        &lt;?php
+
+                                        $sizes = apply_filters( 'image_size_names_choose', array(
+                                                'thumbnail' =&gt; __('Thumbnail'),
+                                                'medium'    =&gt; __('Medium'),
+                                                'large'     =&gt; __('Large'),
+                                                'full'      =&gt; __('Full Size'),
+                                        ) );
+
+                                        foreach ( $sizes as $value =&gt; $name ) : ?&gt;
+                                                &lt;#
+                                                var size = data.sizes['&lt;?php echo esc_js( $value ); ?&gt;'];
+                                                if ( size ) { #&gt;
+                                                        &lt;option value=&quot;&lt;?php echo esc_attr( $value ); ?&gt;&quot; &lt;?php selected( $value, 'full' ); ?&gt;&gt;
+                                                                &lt;?php echo esc_html( $name ); ?&gt; &amp;ndash; {{ size.width }} &amp;times; {{ size.height }}
+                                                        &lt;/option&gt;
+                                                &lt;# } #&gt;
+                                        &lt;?php endforeach; ?&gt;
+                                &lt;/select&gt;
+                        &lt;/label&gt;
+                &lt;# } #&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-gallery-settings&quot;&gt;
+                &lt;h3&gt;&lt;?php _e('Gallery Settings'); ?&gt;&lt;/h3&gt;
+
+                &lt;label class=&quot;setting&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Link To'); ?&gt;&lt;/span&gt;
+                        &lt;select class=&quot;link-to&quot;
+                                data-setting=&quot;link&quot;
+                                &lt;# if ( data.userSettings ) { #&gt;
+                                        data-user-setting=&quot;urlbutton&quot;
+                                &lt;# } #&gt;&gt;
+
+                                &lt;option value=&quot;post&quot; selected&gt;
+                                        &lt;?php esc_attr_e('Attachment Page'); ?&gt;
+                                &lt;/option&gt;
+                                &lt;option value=&quot;file&quot;&gt;
+                                        &lt;?php esc_attr_e('Media File'); ?&gt;
+                                &lt;/option&gt;
+                        &lt;/select&gt;
+                &lt;/label&gt;
+
+                &lt;label class=&quot;setting&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Columns'); ?&gt;&lt;/span&gt;
+                        &lt;select class=&quot;columns&quot; name=&quot;columns&quot;
+                                data-setting=&quot;columns&quot;&gt;
+                                &lt;?php for ( $i = 1; $i &lt;= 9; $i++ ) : ?&gt;
+                                        &lt;option value=&quot;&lt;?php echo esc_attr( $i ); ?&gt;&quot; &lt;?php selected( $i, 3 ); ?&gt;&gt;
+                                                &lt;?php echo esc_html( $i ); ?&gt;
+                                        &lt;/option&gt;
+                                &lt;?php endfor; ?&gt;
+                        &lt;/select&gt;
+                &lt;/label&gt;
+
+                &lt;label class=&quot;setting&quot;&gt;
+                        &lt;span&gt;&lt;?php _ex( 'Random', 'Gallery order' ); ?&gt;&lt;/span&gt;
+                        &lt;input type=&quot;checkbox&quot; data-setting=&quot;_orderbyRandom&quot; /&gt;
+                &lt;/label&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-embed-link-settings&quot;&gt;
+                &lt;label class=&quot;setting&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Title'); ?&gt;&lt;/span&gt;
+                        &lt;input type=&quot;text&quot; class=&quot;alignment&quot; data-setting=&quot;title&quot; /&gt;
+                &lt;/label&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-embed-image-settings&quot;&gt;
+                &lt;div class=&quot;thumbnail&quot;&gt;
+                        &lt;img src=&quot;{{ data.model.url }}&quot; draggable=&quot;false&quot; /&gt;
+                &lt;/div&gt;
+
+                &lt;?php if ( ! apply_filters( 'disable_captions', '' ) ) : ?&gt;
+                        &lt;label class=&quot;setting caption&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Caption'); ?&gt;&lt;/span&gt;
+                                &lt;textarea data-setting=&quot;caption&quot; /&gt;
+                        &lt;/label&gt;
+                &lt;?php endif; ?&gt;
+
+                &lt;label class=&quot;setting alt-text&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Alt Text'); ?&gt;&lt;/span&gt;
+                        &lt;input type=&quot;text&quot; data-setting=&quot;alt&quot; /&gt;
+                &lt;/label&gt;
+
+                &lt;div class=&quot;setting align&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Align'); ?&gt;&lt;/span&gt;
+                        &lt;div class=&quot;button-group button-large&quot; data-setting=&quot;align&quot;&gt;
+                                &lt;button class=&quot;button&quot; value=&quot;left&quot;&gt;
+                                        &lt;?php esc_attr_e('Left'); ?&gt;
+                                &lt;/button&gt;
+                                &lt;button class=&quot;button&quot; value=&quot;center&quot;&gt;
+                                        &lt;?php esc_attr_e('Center'); ?&gt;
+                                &lt;/button&gt;
+                                &lt;button class=&quot;button&quot; value=&quot;right&quot;&gt;
+                                        &lt;?php esc_attr_e('Right'); ?&gt;
+                                &lt;/button&gt;
+                                &lt;button class=&quot;button active&quot; value=&quot;none&quot;&gt;
+                                        &lt;?php esc_attr_e('None'); ?&gt;
+                                &lt;/button&gt;
+                        &lt;/div&gt;
+                &lt;/div&gt;
+
+                &lt;div class=&quot;setting link-to&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Link To'); ?&gt;&lt;/span&gt;
+                        &lt;div class=&quot;button-group button-large&quot; data-setting=&quot;link&quot;&gt;
+                                &lt;button class=&quot;button&quot; value=&quot;file&quot;&gt;
+                                        &lt;?php esc_attr_e('Image URL'); ?&gt;
+                                &lt;/button&gt;
+                                &lt;button class=&quot;button&quot; value=&quot;custom&quot;&gt;
+                                        &lt;?php esc_attr_e('Custom URL'); ?&gt;
+                                &lt;/button&gt;
+                                &lt;button class=&quot;button active&quot; value=&quot;none&quot;&gt;
+                                        &lt;?php esc_attr_e('None'); ?&gt;
+                                &lt;/button&gt;
+                        &lt;/div&gt;
+                        &lt;input type=&quot;text&quot; class=&quot;link-to-custom&quot; data-setting=&quot;linkUrl&quot; /&gt;
+                &lt;/div&gt;
+        &lt;/script&gt;
+
+        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachments-css&quot;&gt;
+                &lt;style type=&quot;text/css&quot; id=&quot;{{ data.id }}-css&quot;&gt;
+                        #{{ data.id }} {
+                                padding: 0 {{ data.gutter }}px;
+                        }
+
+                        #{{ data.id }} .attachment {
+                                margin: {{ data.gutter }}px;
+                                width: {{ data.edge }}px;
+                        }
+
+                        #{{ data.id }} .attachment-preview,
+                        #{{ data.id }} .attachment-preview .thumbnail {
+                                width: {{ data.edge }}px;
+                                height: {{ data.edge }}px;
+                        }
+
+                        #{{ data.id }} .portrait .thumbnail img {
+                                max-width: {{ data.edge }}px;
+                                height: auto;
+                        }
+
+                        #{{ data.id }} .landscape .thumbnail img {
+                                width: auto;
+                                max-height: {{ data.edge }}px;
+                        }
+                &lt;/style&gt;
+        &lt;/script&gt;
+        &lt;?php
+
+        do_action( 'print_media_templates' );
+}
</ins></span></pre></div>
<a id="trunkwpincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/media.php (23100 => 23101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/media.php        2012-12-06 07:00:41 UTC (rev 23100)
+++ trunk/wp-includes/media.php        2012-12-06 07:10:20 UTC (rev 23101)
</span><span class="lines">@@ -3,6 +3,7 @@
</span><span class="cx">  * WordPress API for media display.
</span><span class="cx">  *
</span><span class="cx">  * @package WordPress
</span><ins>+ * @subpackage Media
</ins><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -1528,467 +1529,10 @@
</span><span class="cx">         wp_enqueue_script( 'media-editor' );
</span><span class="cx">         wp_enqueue_style( 'media-views' );
</span><span class="cx">         wp_plupload_default_settings();
</span><ins>+
+        require_once ABSPATH . WPINC . '/media-template.php';
</ins><span class="cx">         add_action( 'admin_footer', 'wp_print_media_templates' );
</span><span class="cx">         add_action( 'wp_footer', 'wp_print_media_templates' );
</span><span class="cx"> 
</span><span class="cx">         do_action( 'wp_enqueue_media' );
</span><span class="cx"> }
</span><del>-
-/**
- * Prints the templates used in the media manager.
- *
- * @since 3.5.0
- */
-function wp_print_media_templates() {
-        global $is_IE;
-        $class = 'media-modal wp-core-ui';
-        if ( $is_IE &amp;&amp; strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false )
-                $class .= ' ie7';
-        ?&gt;
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-media-frame&quot;&gt;
-                &lt;div class=&quot;media-frame-menu&quot;&gt;&lt;/div&gt;
-                &lt;div class=&quot;media-frame-title&quot;&gt;&lt;/div&gt;
-                &lt;div class=&quot;media-frame-router&quot;&gt;&lt;/div&gt;
-                &lt;div class=&quot;media-frame-content&quot;&gt;&lt;/div&gt;
-                &lt;div class=&quot;media-frame-toolbar&quot;&gt;&lt;/div&gt;
-                &lt;div class=&quot;media-frame-uploader&quot;&gt;&lt;/div&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-media-modal&quot;&gt;
-                &lt;div class=&quot;&lt;?php echo $class; ?&gt;&quot;&gt;
-                        &lt;a class=&quot;media-modal-close&quot; href=&quot;#&quot; title=&quot;&lt;?php esc_attr_e('Close'); ?&gt;&quot;&gt;&lt;span class=&quot;media-modal-icon&quot;&gt;&lt;/span&gt;&lt;/a&gt;
-                        &lt;div class=&quot;media-modal-content&quot;&gt;&lt;/div&gt;
-                &lt;/div&gt;
-                &lt;div class=&quot;media-modal-backdrop&quot;&gt;&lt;/div&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-uploader-window&quot;&gt;
-                &lt;div class=&quot;uploader-window-content&quot;&gt;
-                        &lt;h3&gt;&lt;?php _e( 'Drop files to upload' ); ?&gt;&lt;/h3&gt;
-                &lt;/div&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-uploader-inline&quot;&gt;
-                &lt;# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #&gt;
-                &lt;div class=&quot;uploader-inline-content {{ messageClass }}&quot;&gt;
-                &lt;# if ( data.message ) { #&gt;
-                        &lt;h3 class=&quot;upload-message&quot;&gt;{{ data.message }}&lt;/h3&gt;
-                &lt;# } #&gt;
-                &lt;?php if ( ! _device_can_upload() ) : ?&gt;
-                        &lt;h3 class=&quot;upload-instructions&quot;&gt;&lt;?php _e('The web browser on your device cannot be used to upload files. You may be able to use the &lt;a href=&quot;http://wordpress.org/extend/mobile/&quot;&gt;native app for your device&lt;/a&gt; instead.'); ?&gt;&lt;/h3&gt;
-                &lt;?php elseif ( is_multisite() &amp;&amp; ! is_upload_space_available() ) : ?&gt;
-                        &lt;h3 class=&quot;upload-instructions&quot;&gt;&lt;?php _e( 'Upload Limit Exceeded' ); ?&gt;&lt;/h3&gt;
-                        &lt;?php do_action( 'upload_ui_over_quota' ); ?&gt;
-
-                &lt;?php else : ?&gt;
-                        &lt;div class=&quot;upload-ui&quot;&gt;
-                                &lt;h3 class=&quot;upload-instructions drop-instructions&quot;&gt;&lt;?php _e( 'Drop files anywhere to upload' ); ?&gt;&lt;/h3&gt;
-                                &lt;a href=&quot;#&quot; class=&quot;browser button button-hero&quot;&gt;&lt;?php _e( 'Select Files' ); ?&gt;&lt;/a&gt;
-                        &lt;/div&gt;
-
-                        &lt;div class=&quot;upload-inline-status&quot;&gt;&lt;/div&gt;
-
-                        &lt;div class=&quot;post-upload-ui&quot;&gt;
-                                &lt;?php
-                                do_action( 'pre-upload-ui' );
-                                do_action( 'pre-plupload-upload-ui' );
-
-                                if ( 10 === remove_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' ) ) {
-                                        do_action( 'post-plupload-upload-ui' );
-                                        add_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' );
-                                } else {
-                                        do_action( 'post-plupload-upload-ui' );
-                                }
-
-                                $upload_size_unit = $max_upload_size = wp_max_upload_size();
-                                $byte_sizes = array( 'KB', 'MB', 'GB' );
-
-                                for ( $u = -1; $upload_size_unit &gt; 1024 &amp;&amp; $u &lt; count( $byte_sizes ) - 1; $u++ ) {
-                                        $upload_size_unit /= 1024;
-                                }
-
-                                if ( $u &lt; 0 ) {
-                                        $upload_size_unit = 0;
-                                        $u = 0;
-                                } else {
-                                        $upload_size_unit = (int) $upload_size_unit;
-                                }
-
-                                ?&gt;
-
-                                &lt;p class=&quot;max-upload-size&quot;&gt;&lt;?php
-                                        printf( __( 'Maximum upload file size: %d%s.' ), esc_html($upload_size_unit), esc_html($byte_sizes[$u]) );
-                                ?&gt;&lt;/p&gt;
-
-                                &lt;?php if ( ( $GLOBALS['is_IE'] || $GLOBALS['is_opera']) &amp;&amp; $max_upload_size &gt; 100 * 1024 * 1024 ) :
-                                        $browser_uploader = admin_url( 'media-new.php?browser-uploader&amp;post_id=' ) . '{{ data.postId }}';
-                                        ?&gt;
-                                        &lt;p class=&quot;big-file-warning&quot;&gt;&lt;?php printf( __( 'Your browser has some limitations uploading large files with the multi-file uploader. Please use the &lt;a href=&quot;%1$s&quot; target=&quot;%2$s&quot;&gt;browser uploader&lt;/a&gt; for files over 100MB.' ),
-                                                $browser_uploader, '_blank' ); ?&gt;&lt;/p&gt;
-                                &lt;?php endif; ?&gt;
-
-                                &lt;?php do_action( 'post-upload-ui' ); ?&gt;
-                        &lt;/div&gt;
-                &lt;?php endif; ?&gt;
-                &lt;/div&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-uploader-status&quot;&gt;
-                &lt;h3&gt;&lt;?php _e( 'Uploading' ); ?&gt;&lt;/h3&gt;
-                &lt;a class=&quot;upload-dismiss-errors&quot; href=&quot;#&quot;&gt;&lt;?php _e('Dismiss Errors'); ?&gt;&lt;/a&gt;
-
-                &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
-                &lt;div class=&quot;upload-details&quot;&gt;
-                        &lt;span class=&quot;upload-count&quot;&gt;
-                                &lt;span class=&quot;upload-index&quot;&gt;&lt;/span&gt; / &lt;span class=&quot;upload-total&quot;&gt;&lt;/span&gt;
-                        &lt;/span&gt;
-                        &lt;span class=&quot;upload-detail-separator&quot;&gt;&amp;ndash;&lt;/span&gt;
-                        &lt;span class=&quot;upload-filename&quot;&gt;&lt;/span&gt;
-                &lt;/div&gt;
-                &lt;div class=&quot;upload-errors&quot;&gt;&lt;/div&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-uploader-status-error&quot;&gt;
-                &lt;span class=&quot;upload-error-label&quot;&gt;&lt;?php _e('Error'); ?&gt;&lt;/span&gt;
-                &lt;span class=&quot;upload-error-filename&quot;&gt;{{{ data.filename }}}&lt;/span&gt;
-                &lt;span class=&quot;upload-error-message&quot;&gt;{{ data.message }}&lt;/span&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachment&quot;&gt;
-                &lt;div class=&quot;attachment-preview type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}&quot;&gt;
-                        &lt;# if ( data.uploading ) { #&gt;
-                                &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
-                        &lt;# } else if ( 'image' === data.type ) { #&gt;
-                                &lt;div class=&quot;thumbnail&quot;&gt;
-                                        &lt;div class=&quot;centered&quot;&gt;
-                                                &lt;img src=&quot;{{ data.size.url }}&quot; draggable=&quot;false&quot; /&gt;
-                                        &lt;/div&gt;
-                                &lt;/div&gt;
-                        &lt;# } else { #&gt;
-                                &lt;img src=&quot;{{ data.icon }}&quot; class=&quot;icon&quot; draggable=&quot;false&quot; /&gt;
-                                &lt;div class=&quot;filename&quot;&gt;
-                                        &lt;div&gt;{{ data.filename }}&lt;/div&gt;
-                                &lt;/div&gt;
-                        &lt;# } #&gt;
-
-                        &lt;# if ( data.buttons.close ) { #&gt;
-                                &lt;a class=&quot;close media-modal-icon&quot; href=&quot;#&quot; title=&quot;&lt;?php _e('Remove'); ?&gt;&quot;&gt;&lt;/a&gt;
-                        &lt;# } #&gt;
-
-                        &lt;# if ( data.buttons.check ) { #&gt;
-                                &lt;a class=&quot;check&quot; href=&quot;#&quot; title=&quot;&lt;?php _e('Deselect'); ?&gt;&quot;&gt;&lt;div class=&quot;media-modal-icon&quot;&gt;&lt;/div&gt;&lt;/a&gt;
-                        &lt;# } #&gt;
-                &lt;/div&gt;
-                &lt;#
-                var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly';
-                if ( data.describe ) { #&gt;
-                        &lt;# if ( 'image' === data.type ) { #&gt;
-                                &lt;input type=&quot;text&quot; value=&quot;{{ data.caption }}&quot; class=&quot;describe&quot; data-setting=&quot;caption&quot;
-                                        placeholder=&quot;&lt;?php esc_attr_e('Describe this image&amp;hellip;'); ?&gt;&quot; {{ maybeReadOnly }} /&gt;
-                        &lt;# } else { #&gt;
-                                &lt;input type=&quot;text&quot; value=&quot;{{ data.title }}&quot; class=&quot;describe&quot; data-setting=&quot;title&quot;
-                                        &lt;# if ( 'video' === data.type ) { #&gt;
-                                                placeholder=&quot;&lt;?php esc_attr_e('Describe this video&amp;hellip;'); ?&gt;&quot;
-                                        &lt;# } else if ( 'audio' === data.type ) { #&gt;
-                                                placeholder=&quot;&lt;?php esc_attr_e('Describe this audio file&amp;hellip;'); ?&gt;&quot;
-                                        &lt;# } else { #&gt;
-                                                placeholder=&quot;&lt;?php esc_attr_e('Describe this media file&amp;hellip;'); ?&gt;&quot;
-                                        &lt;# } #&gt; {{ maybeReadOnly }} /&gt;
-                        &lt;# } #&gt;
-                &lt;# } #&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachment-details&quot;&gt;
-                &lt;h3&gt;
-                        &lt;?php _e('Attachment Details'); ?&gt;
-
-                        &lt;span class=&quot;settings-save-status&quot;&gt;
-                                &lt;span class=&quot;spinner&quot;&gt;&lt;/span&gt;
-                                &lt;span class=&quot;saved&quot;&gt;&lt;?php esc_html_e('Saved.'); ?&gt;&lt;/span&gt;
-                        &lt;/span&gt;
-                &lt;/h3&gt;
-                &lt;div class=&quot;attachment-info&quot;&gt;
-                        &lt;div class=&quot;thumbnail&quot;&gt;
-                                &lt;# if ( data.uploading ) { #&gt;
-                                        &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
-                                &lt;# } else if ( 'image' === data.type ) { #&gt;
-                                        &lt;img src=&quot;{{ data.size.url }}&quot; draggable=&quot;false&quot; /&gt;
-                                &lt;# } else { #&gt;
-                                        &lt;img src=&quot;{{ data.icon }}&quot; class=&quot;icon&quot; draggable=&quot;false&quot; /&gt;
-                                &lt;# } #&gt;
-                        &lt;/div&gt;
-                        &lt;div class=&quot;details&quot;&gt;
-                                &lt;div class=&quot;filename&quot;&gt;{{ data.filename }}&lt;/div&gt;
-                                &lt;div class=&quot;uploaded&quot;&gt;{{ data.dateFormatted }}&lt;/div&gt;
-
-                                &lt;# if ( 'image' === data.type &amp;&amp; ! data.uploading ) { #&gt;
-                                        &lt;# if ( data.width &amp;&amp; data.height ) { #&gt;
-                                                &lt;div class=&quot;dimensions&quot;&gt;{{ data.width }} &amp;times; {{ data.height }}&lt;/div&gt;
-                                        &lt;# } #&gt;
-
-                                        &lt;# if ( data.can.save ) { #&gt;
-                                                &lt;a class=&quot;edit-attachment&quot; href=&quot;{{ data.editLink }}&amp;amp;image-editor&quot; target=&quot;_blank&quot;&gt;&lt;?php _e( 'Edit Image' ); ?&gt;&lt;/a&gt;
-                                                &lt;a class=&quot;refresh-attachment&quot; href=&quot;#&quot;&gt;&lt;?php _e( 'Refresh' ); ?&gt;&lt;/a&gt;
-                                        &lt;# } #&gt;
-                                &lt;# } #&gt;
-
-                                &lt;# if ( ! data.uploading &amp;&amp; data.can.remove ) { #&gt;
-                                        &lt;a class=&quot;delete-attachment&quot; href=&quot;#&quot;&gt;&lt;?php _e( 'Delete Permanently' ); ?&gt;&lt;/a&gt;
-                                &lt;# } #&gt;
-
-                                &lt;div class=&quot;compat-meta&quot;&gt;
-                                        &lt;# if ( data.compat &amp;&amp; data.compat.meta ) { #&gt;
-                                                {{{ data.compat.meta }}}
-                                        &lt;# } #&gt;
-                                &lt;/div&gt;
-                        &lt;/div&gt;
-                &lt;/div&gt;
-
-                &lt;# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #&gt;
-                        &lt;label class=&quot;setting&quot; data-setting=&quot;title&quot;&gt;
-                                &lt;span&gt;&lt;?php _e('Title'); ?&gt;&lt;/span&gt;
-                                &lt;input type=&quot;text&quot; value=&quot;{{ data.title }}&quot; {{ maybeReadOnly }} /&gt;
-                        &lt;/label&gt;
-                        &lt;label class=&quot;setting&quot; data-setting=&quot;caption&quot;&gt;
-                                &lt;span&gt;&lt;?php _e('Caption'); ?&gt;&lt;/span&gt;
-                                &lt;textarea {{ maybeReadOnly }}&gt;{{ data.caption }}&lt;/textarea&gt;
-                        &lt;/label&gt;
-                &lt;# if ( 'image' === data.type ) { #&gt;
-                        &lt;label class=&quot;setting&quot; data-setting=&quot;alt&quot;&gt;
-                                &lt;span&gt;&lt;?php _e('Alt Text'); ?&gt;&lt;/span&gt;
-                                &lt;input type=&quot;text&quot; value=&quot;{{ data.alt }}&quot; {{ maybeReadOnly }} /&gt;
-                        &lt;/label&gt;
-                &lt;# } #&gt;
-                        &lt;label class=&quot;setting&quot; data-setting=&quot;description&quot;&gt;
-                                &lt;span&gt;&lt;?php _e('Description'); ?&gt;&lt;/span&gt;
-                                &lt;textarea {{ maybeReadOnly }}&gt;{{ data.description }}&lt;/textarea&gt;
-                        &lt;/label&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-media-selection&quot;&gt;
-                &lt;div class=&quot;selection-info&quot;&gt;
-                        &lt;span class=&quot;count&quot;&gt;&lt;/span&gt;
-                        &lt;# if ( data.editable ) { #&gt;
-                                &lt;a class=&quot;edit-selection&quot; href=&quot;#&quot;&gt;&lt;?php _e('Edit'); ?&gt;&lt;/a&gt;
-                        &lt;# } #&gt;
-                        &lt;# if ( data.clearable ) { #&gt;
-                                &lt;a class=&quot;clear-selection&quot; href=&quot;#&quot;&gt;&lt;?php _e('Clear'); ?&gt;&lt;/a&gt;
-                        &lt;# } #&gt;
-                &lt;/div&gt;
-                &lt;div class=&quot;selection-view&quot;&gt;&lt;/div&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachment-display-settings&quot;&gt;
-                &lt;h3&gt;&lt;?php _e('Attachment Display Settings'); ?&gt;&lt;/h3&gt;
-
-                &lt;# if ( 'image' === data.type ) { #&gt;
-                        &lt;label class=&quot;setting&quot;&gt;
-                                &lt;span&gt;&lt;?php _e('Alignment'); ?&gt;&lt;/span&gt;
-                                &lt;select class=&quot;alignment&quot;
-                                        data-setting=&quot;align&quot;
-                                        &lt;# if ( data.userSettings ) { #&gt;
-                                                data-user-setting=&quot;align&quot;
-                                        &lt;# } #&gt;&gt;
-
-                                        &lt;option value=&quot;left&quot;&gt;
-                                                &lt;?php esc_attr_e('Left'); ?&gt;
-                                        &lt;/option&gt;
-                                        &lt;option value=&quot;center&quot;&gt;
-                                                &lt;?php esc_attr_e('Center'); ?&gt;
-                                        &lt;/option&gt;
-                                        &lt;option value=&quot;right&quot;&gt;
-                                                &lt;?php esc_attr_e('Right'); ?&gt;
-                                        &lt;/option&gt;
-                                        &lt;option value=&quot;none&quot; selected&gt;
-                                                &lt;?php esc_attr_e('None'); ?&gt;
-                                        &lt;/option&gt;
-                                &lt;/select&gt;
-                        &lt;/label&gt;
-                &lt;# } #&gt;
-
-                &lt;div class=&quot;setting&quot;&gt;
-                        &lt;label&gt;
-                                &lt;span&gt;&lt;?php _e('Link To'); ?&gt;&lt;/span&gt;
-                                &lt;select class=&quot;link-to&quot;
-                                        data-setting=&quot;link&quot;
-                                        &lt;# if ( data.userSettings ) { #&gt;
-                                                data-user-setting=&quot;urlbutton&quot;
-                                        &lt;# } #&gt;&gt;
-
-                                        &lt;option value=&quot;custom&quot;&gt;
-                                                &lt;?php esc_attr_e('Custom URL'); ?&gt;
-                                        &lt;/option&gt;
-                                        &lt;option value=&quot;post&quot; selected&gt;
-                                                &lt;?php esc_attr_e('Attachment Page'); ?&gt;
-                                        &lt;/option&gt;
-                                        &lt;option value=&quot;file&quot;&gt;
-                                                &lt;?php esc_attr_e('Media File'); ?&gt;
-                                        &lt;/option&gt;
-                                        &lt;option value=&quot;none&quot;&gt;
-                                                &lt;?php esc_attr_e('None'); ?&gt;
-                                        &lt;/option&gt;
-                                &lt;/select&gt;
-                        &lt;/label&gt;
-                        &lt;input type=&quot;text&quot; class=&quot;link-to-custom&quot; data-setting=&quot;linkUrl&quot; /&gt;
-                &lt;/div&gt;
-
-                &lt;# if ( 'undefined' !== typeof data.sizes ) { #&gt;
-                        &lt;label class=&quot;setting&quot;&gt;
-                                &lt;span&gt;&lt;?php _e('Size'); ?&gt;&lt;/span&gt;
-                                &lt;select class=&quot;size&quot; name=&quot;size&quot;
-                                        data-setting=&quot;size&quot;
-                                        &lt;# if ( data.userSettings ) { #&gt;
-                                                data-user-setting=&quot;imgsize&quot;
-                                        &lt;# } #&gt;&gt;
-                                        &lt;?php
-
-                                        $sizes = apply_filters( 'image_size_names_choose', array(
-                                                'thumbnail' =&gt; __('Thumbnail'),
-                                                'medium'    =&gt; __('Medium'),
-                                                'large'     =&gt; __('Large'),
-                                                'full'      =&gt; __('Full Size'),
-                                        ) );
-
-                                        foreach ( $sizes as $value =&gt; $name ) : ?&gt;
-                                                &lt;#
-                                                var size = data.sizes['&lt;?php echo esc_js( $value ); ?&gt;'];
-                                                if ( size ) { #&gt;
-                                                        &lt;option value=&quot;&lt;?php echo esc_attr( $value ); ?&gt;&quot; &lt;?php selected( $value, 'full' ); ?&gt;&gt;
-                                                                &lt;?php echo esc_html( $name ); ?&gt; &amp;ndash; {{ size.width }} &amp;times; {{ size.height }}
-                                                        &lt;/option&gt;
-                                                &lt;# } #&gt;
-                                        &lt;?php endforeach; ?&gt;
-                                &lt;/select&gt;
-                        &lt;/label&gt;
-                &lt;# } #&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-gallery-settings&quot;&gt;
-                &lt;h3&gt;&lt;?php _e('Gallery Settings'); ?&gt;&lt;/h3&gt;
-
-                &lt;label class=&quot;setting&quot;&gt;
-                        &lt;span&gt;&lt;?php _e('Link To'); ?&gt;&lt;/span&gt;
-                        &lt;select class=&quot;link-to&quot;
-                                data-setting=&quot;link&quot;
-                                &lt;# if ( data.userSettings ) { #&gt;
-                                        data-user-setting=&quot;urlbutton&quot;
-                                &lt;# } #&gt;&gt;
-
-                                &lt;option value=&quot;post&quot; selected&gt;
-                                        &lt;?php esc_attr_e('Attachment Page'); ?&gt;
-                                &lt;/option&gt;
-                                &lt;option value=&quot;file&quot;&gt;
-                                        &lt;?php esc_attr_e('Media File'); ?&gt;
-                                &lt;/option&gt;
-                        &lt;/select&gt;
-                &lt;/label&gt;
-
-                &lt;label class=&quot;setting&quot;&gt;
-                        &lt;span&gt;&lt;?php _e('Columns'); ?&gt;&lt;/span&gt;
-                        &lt;select class=&quot;columns&quot; name=&quot;columns&quot;
-                                data-setting=&quot;columns&quot;&gt;
-                                &lt;?php for ( $i = 1; $i &lt;= 9; $i++ ) : ?&gt;
-                                        &lt;option value=&quot;&lt;?php echo esc_attr( $i ); ?&gt;&quot; &lt;?php selected( $i, 3 ); ?&gt;&gt;
-                                                &lt;?php echo esc_html( $i ); ?&gt;
-                                        &lt;/option&gt;
-                                &lt;?php endfor; ?&gt;
-                        &lt;/select&gt;
-                &lt;/label&gt;
-
-                &lt;label class=&quot;setting&quot;&gt;
-                        &lt;span&gt;&lt;?php _ex( 'Random', 'Gallery order' ); ?&gt;&lt;/span&gt;
-                        &lt;input type=&quot;checkbox&quot; data-setting=&quot;_orderbyRandom&quot; /&gt;
-                &lt;/label&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-embed-link-settings&quot;&gt;
-                &lt;label class=&quot;setting&quot;&gt;
-                        &lt;span&gt;&lt;?php _e('Title'); ?&gt;&lt;/span&gt;
-                        &lt;input type=&quot;text&quot; class=&quot;alignment&quot; data-setting=&quot;title&quot; /&gt;
-                &lt;/label&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-embed-image-settings&quot;&gt;
-                &lt;div class=&quot;thumbnail&quot;&gt;
-                        &lt;img src=&quot;{{ data.model.url }}&quot; draggable=&quot;false&quot; /&gt;
-                &lt;/div&gt;
-
-                &lt;?php if ( ! apply_filters( 'disable_captions', '' ) ) : ?&gt;
-                        &lt;label class=&quot;setting caption&quot;&gt;
-                                &lt;span&gt;&lt;?php _e('Caption'); ?&gt;&lt;/span&gt;
-                                &lt;textarea data-setting=&quot;caption&quot; /&gt;
-                        &lt;/label&gt;
-                &lt;?php endif; ?&gt;
-
-                &lt;label class=&quot;setting alt-text&quot;&gt;
-                        &lt;span&gt;&lt;?php _e('Alt Text'); ?&gt;&lt;/span&gt;
-                        &lt;input type=&quot;text&quot; data-setting=&quot;alt&quot; /&gt;
-                &lt;/label&gt;
-
-                &lt;div class=&quot;setting align&quot;&gt;
-                        &lt;span&gt;&lt;?php _e('Align'); ?&gt;&lt;/span&gt;
-                        &lt;div class=&quot;button-group button-large&quot; data-setting=&quot;align&quot;&gt;
-                                &lt;button class=&quot;button&quot; value=&quot;left&quot;&gt;
-                                        &lt;?php esc_attr_e('Left'); ?&gt;
-                                &lt;/button&gt;
-                                &lt;button class=&quot;button&quot; value=&quot;center&quot;&gt;
-                                        &lt;?php esc_attr_e('Center'); ?&gt;
-                                &lt;/button&gt;
-                                &lt;button class=&quot;button&quot; value=&quot;right&quot;&gt;
-                                        &lt;?php esc_attr_e('Right'); ?&gt;
-                                &lt;/button&gt;
-                                &lt;button class=&quot;button active&quot; value=&quot;none&quot;&gt;
-                                        &lt;?php esc_attr_e('None'); ?&gt;
-                                &lt;/button&gt;
-                        &lt;/div&gt;
-                &lt;/div&gt;
-
-                &lt;div class=&quot;setting link-to&quot;&gt;
-                        &lt;span&gt;&lt;?php _e('Link To'); ?&gt;&lt;/span&gt;
-                        &lt;div class=&quot;button-group button-large&quot; data-setting=&quot;link&quot;&gt;
-                                &lt;button class=&quot;button&quot; value=&quot;file&quot;&gt;
-                                        &lt;?php esc_attr_e('Image URL'); ?&gt;
-                                &lt;/button&gt;
-                                &lt;button class=&quot;button&quot; value=&quot;custom&quot;&gt;
-                                        &lt;?php esc_attr_e('Custom URL'); ?&gt;
-                                &lt;/button&gt;
-                                &lt;button class=&quot;button active&quot; value=&quot;none&quot;&gt;
-                                        &lt;?php esc_attr_e('None'); ?&gt;
-                                &lt;/button&gt;
-                        &lt;/div&gt;
-                        &lt;input type=&quot;text&quot; class=&quot;link-to-custom&quot; data-setting=&quot;linkUrl&quot; /&gt;
-                &lt;/div&gt;
-        &lt;/script&gt;
-
-        &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachments-css&quot;&gt;
-                &lt;style type=&quot;text/css&quot; id=&quot;{{ data.id }}-css&quot;&gt;
-                        #{{ data.id }} {
-                                padding: 0 {{ data.gutter }}px;
-                        }
-
-                        #{{ data.id }} .attachment {
-                                margin: {{ data.gutter }}px;
-                                width: {{ data.edge }}px;
-                        }
-
-                        #{{ data.id }} .attachment-preview,
-                        #{{ data.id }} .attachment-preview .thumbnail {
-                                width: {{ data.edge }}px;
-                                height: {{ data.edge }}px;
-                        }
-
-                        #{{ data.id }} .portrait .thumbnail img {
-                                max-width: {{ data.edge }}px;
-                                height: auto;
-                        }
-
-                        #{{ data.id }} .landscape .thumbnail img {
-                                width: auto;
-                                max-height: {{ data.edge }}px;
-                        }
-                &lt;/style&gt;
-        &lt;/script&gt;
-        &lt;?php
-
-        do_action( 'print_media_templates' );
-}
</del></span></pre>
</div>
</div>

</body>
</html>