Ticket #24011: 24011.16.diff
File 24011.16.diff, 4.9 KB (added by , 8 years ago) |
---|
-
wp-admin/edit-form-advanced.php
419 419 <?php if ( post_type_supports($post_type, 'title') ) { ?> 420 420 <div id="titlediv"> 421 421 <div id="titlewrap"> 422 <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label> 422 <?php 423 // Third argument passed to filter denotes optional title field 424 $title_prompt = apply_filters( 'enter_title_here', __( 'Enter title here' ), $post, false ); 425 $title_optional_prompt = apply_filters( 'enter_title_here', __( 'Enter title here (optional)' ), $post, true ); 426 ?> 427 <label class="screen-reader-text" id="title-prompt-text" for="title" data-title="<?php echo esc_attr( $title_prompt ); ?>" data-title-optional="<?php echo esc_attr( $title_optional_prompt ); ?>"><?php echo in_array( $post_format, array( 'aside', 'status' ) ) ? $title_optional_prompt : $title_prompt; ?></label> 423 428 <input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" /> 424 429 </div> 425 430 <div class="inside"> -
wp-admin/css/wp-admin.css
4116 4116 } 4117 4117 4118 4118 .wp-post-format-show-ui.wp-format-image .attachment-display-settings, 4119 .wp-post-format-show-ui.wp-format-status #titlewrap,4120 4119 .wp-post-format-show-ui.wp-format-image #insert-media-button, 4121 4120 .wp-post-format-show-ui.wp-format-audio #insert-media-button, 4122 4121 .wp-post-format-show-ui.wp-format-video #insert-media-button, -
wp-admin/js/post-formats.js
13 13 lastHeight = 360, 14 14 initialFormat = 'standard', 15 15 shortClass = 'short-format', 16 noTitleFormats = ['status'],16 optionalTitleFormats = ['status', 'aside'], 17 17 noMediaFormats = ['status', 'aside', 'image', 'audio', 'video'], 18 18 shortContentFormats = ['status', 'aside'], 19 19 noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery']; … … 132 132 insertMediaButton.fadeToggle( 200 ).css( 'display', 'inline-block' ); 133 133 } 134 134 // Animate the title going away or coming back 135 formatTo = -1 < $.inArray( format, noTitleFormats );136 formatFrom = -1 < $.inArray( postFormats.currentPostFormat, noTitleFormats );135 formatTo = -1 < $.inArray( format, optionalTitleFormats ); 136 formatFrom = -1 < $.inArray( postFormats.currentPostFormat, optionalTitleFormats ); 137 137 if ( formatFrom ? !formatTo : formatTo ) { // XOR 138 $( '#titlewrap' ).fadeToggle( 200 ); 138 var o = formatTo ? 0.5 : 1; 139 titlePrompt.text( titlePrompt.data('title' + ( formatTo ? '-optional' : '' ) ) ); 140 $( '#titlewrap' ).animate( {opacity: o}, 200 ); 139 141 } 140 142 141 143 // Animate the fields moving going away or coming in … … 160 162 } 161 163 162 164 resizeContent( format ); 163 postTitle.focus(); 165 if( -1 < $.inArray( format, optionalTitleFormats ) ) 166 if( $('#content:visible').size() ) 167 $('#content').focus(); 168 else 169 tinyMCE.activeEditor.focus(); 170 else 171 postTitle.focus(); 164 172 165 173 if ( '' === postTitle.val() ) { 166 174 titlePrompt.removeClass( 'screen-reader-text' ); … … 237 245 $(this).closest( 'p' ).find( 'span' ).toggle(); 238 246 }); 239 247 248 // Set opacity of title on focus 249 var optionalTitleFormatsSelector = '.wp-format-' + optionalTitleFormats.join( ' #title,.wp-format-' ) + ' #title'; 250 $( 'html' ).on( 'focusin', optionalTitleFormatsSelector, function(e) { 251 $( '#titlewrap' ).animate( {opacity:1}, 200 ); 252 }).on( 'focusout', optionalTitleFormatsSelector, function(e) { 253 $( '#titlewrap' ).animate( {opacity:.5}, 200 ); 254 }); 255 $( optionalTitleFormatsSelector ).parents( '#titlewrap' ).animate( {opacity:.5}, 200 ); 256 240 257 // Media selection 241 258 $( '.wp-format-media-select' ).click( function (e) { 242 259 e.preventDefault(); -
wp-includes/class-wp-editor.php
732 732 733 733 <div id="wp-fullscreen-wrap" style="width:<?php echo $dfw_width; ?>px;"> 734 734 <?php if ( post_type_supports($post->post_type, 'title') ) { ?> 735 <label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>735 <label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post, false ); ?></label> 736 736 <input type="text" id="wp-fullscreen-title" value="" autocomplete="off" /> 737 737 <?php } ?> 738 738