Ticket #24291: 24291.14.diff
File 24291.14.diff, 6.4 KB (added by , 12 years ago) |
---|
-
wp-admin/css/wp-admin.css
body .ui-slider-tooltip { 4007 4007 overflow: hidden; 4008 4008 width: 40%; 4009 4009 height: auto; 4010 padding: 55px 0 20px;4011 4010 border: 1px dashed #dfdfdf; 4012 4011 background: #f5f5f5 url(../images/media-button-2x.png) no-repeat 50% 25%; 4012 box-sizing: border-box; 4013 4013 } 4014 4014 4015 4015 .wp-format-media-holder:hover { … … body .ui-slider-tooltip { 4020 4020 margin-bottom: 20px; 4021 4021 } 4022 4022 4023 #image-preview img { 4024 width: auto; 4025 max-height: 300px; 4026 } 4027 4028 .wp-format-image p.use-url-or-html { 4029 padding-top: 10px; 4030 clear: both; 4031 width: 40%; 4032 text-align: center; 4033 } 4034 4023 4035 .wp-format-status #titlewrap, 4024 4036 .wp-format-image .wp-media-buttons .insert-media, 4025 4037 .wp-format-audio .wp-media-buttons .insert-media, … … body .ui-slider-tooltip { 4036 4048 4037 4049 .wp-format-media-select { 4038 4050 display: block; 4039 height: 200px; 4051 height: 20px; 4052 padding: 55px 0 20px; 4040 4053 text-align: center; 4041 4054 } 4042 4055 … … body .ui-slider-tooltip { 4045 4058 max-height: 100%; 4046 4059 } 4047 4060 4048 .wp-format-media-select {4049 height: 20px;4050 }4051 4052 4061 .empty .wp-format-media-metaedit { 4053 4062 height: 20px; 4054 4063 display: block; … … body .ui-slider-tooltip { 4065 4074 #wp_format_video { 4066 4075 float: left; 4067 4076 margin-right: 23px; 4068 max-width: 50%;4077 max-width: 40%; 4069 4078 min-height: 97px; 4070 4079 } 4071 4080 -
wp-admin/includes/post-formats.php
wp_nonce_field( 'show-post-format-ui_' . $post_type, 'show_post_format_ui_nonce' 38 38 ?> 39 39 </div> 40 40 <?php endif ?> 41 <label for="wp_format_image"><?php42 if ( current_user_can( 'unfiltered_html' ) )43 _e( 'Image HTML or URL' );44 else45 _e( 'Image URL' );46 ?></label>47 <textarea id="wp_format_image" type="text" name="_format_image" class="widefat"><?php esc_html_e( $format_meta['image'] ); ?></textarea>48 41 <div data-format="image" class="wp-format-media-holder hide-if-no-js"> 49 42 <a href="#" class="wp-format-media-select" 50 43 data-choose="<?php esc_attr_e( 'Choose an Image' ); ?>" … … wp_nonce_field( 'show-post-format-ui_' . $post_type, 'show_post_format_ui_nonce' 52 45 <?php _e( 'Select / Upload Image' ); ?> 53 46 </a> 54 47 </div> 48 <div class="wp-format-image-textarea hide-if-js"> 49 <label for="wp_format_image"><?php 50 if ( current_user_can( 'unfiltered_html' ) ) 51 _e( 'Image HTML or URL' ); 52 else 53 _e( 'Image URL' ); 54 ?></label> 55 <textarea id="wp_format_image" type="text" name="_format_image" class="widefat"><?php esc_html_e( $format_meta['image'] ); ?></textarea> 56 </div> 57 <p class="use-url-or-html hide-if-no-js"><span><?php printf( __( '(or %suse an image URL or HTML%s)' ), '<a href="#">', '</a>' ); ?></span> 58 <span style="display: none"><?php printf( __( '(or %sselect/upload an image%s)' ), '<a href="#">', '</a>' ); ?></span></p> 55 59 </div> 56 60 57 61 <div class="field wp-format-link"> -
wp-admin/js/post-formats.js
window.wp = window.wp || {}; 17 17 shortContentFormats = ['status', 'aside'], 18 18 noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery']; 19 19 20 function imageFormatUploadProgress( uploader, file ) { 21 var $bar = $( '#' + uploader.settings.drop_element + ' .media-progress-bar div' ); 22 $bar.width( file.percent + '%' ); 23 } 24 25 function imageFormatUploadStart( uploader ) { 26 $( '#' + uploader.settings.drop_element + ' .wp-format-media-select' ).append('<div class="media-progress-bar"><div></div></div>'); 27 } 28 29 function imageFormatUploadSuccess( attachment ) { 30 var $holder, $field, html = wp.media.string.image({ 31 size : 'full', 32 align : false, 33 link : getUserSetting( 'urlbutton' ) 34 }, attachment.attributes ); 35 36 $holder = $('.wp-format-media-holder[data-format=image]'); 37 $( '.media-progress-bar', $holder ).remove(); 38 $field = $( '#wp_format_' + $holder.data( 'format' ) ); 39 40 // set the hidden input's value 41 $field.val( html ); 42 43 $( '#image-preview' ).remove(); 44 45 $holder.parent().prepend( ['<div id="image-preview" class="wp-format-media-preview">', 46 '<img src="', attachment.get('url'), '"', 47 attachment.get('width') ? ' width="' + attachment.get('width') + '"' : '', 48 attachment.get('height') ? ' height="' + attachment.get('height') + '"' : '', 49 ' />', 50 '</div>'].join( '' ) ); 51 } 52 53 var uploader = { 54 dropzone: $('.wp-format-media-holder[data-format=image]'), 55 success: imageFormatUploadSuccess, 56 plupload: {}, 57 params: {} 58 }; 59 uploader = new wp.Uploader( uploader ); 60 uploader.uploader.bind( 'BeforeUpload', imageFormatUploadStart ); 61 uploader.uploader.bind( 'UploadProgress', imageFormatUploadProgress ); 62 20 63 function switchFormatClass( format ) { 21 64 formatField.val( format ); 22 65 … … window.wp = window.wp || {}; 163 206 switchFormat( $( e.currentTarget ) ); 164 207 } ); 165 208 209 // Toggle select/upload and URL/HTML for images 210 $( '.use-url-or-html' ).on( 'click', 'a', function(e) { 211 e.preventDefault(); 212 $( '.wp-format-media-holder, .wp-format-image-textarea' ).toggle(); 213 $(this).closest( 'p' ).find( 'span' ).toggle(); 214 }); 215 166 216 // Media selection 167 217 $( '.wp-format-media-select' ).click( function (e) { 168 218 e.preventDefault(); … … window.wp = window.wp || {}; 242 292 mediaPreview( attachment ); 243 293 } else { 244 294 html = wp.media.string.image({ 245 align : getUserSetting( 'align' ),246 size : getUserSetting( 'imgsize' ),295 size: 'full', 296 align : false, 247 297 link : getUserSetting( 'urlbutton' ) 248 298 }, attachment); 249 299 -
wp-includes/script-loader.php
function wp_default_scripts( &$scripts ) { 407 407 'comma' => _x( ',', 'tag delimiter' ), 408 408 ) ); 409 409 410 $scripts->add( 'post-formats', "/wp-admin/js/post-formats$suffix.js", array( 'media-models' ), false, 1 );410 $scripts->add( 'post-formats', "/wp-admin/js/post-formats$suffix.js", array( 'media-models', 'wp-plupload' ), false, 1 ); 411 411 412 412 $scripts->add( 'link', "/wp-admin/js/link$suffix.js", array( 'wp-lists', 'postbox' ), false, 1 ); 413 413