Ticket #24011: 24011.17.diff
| File 24011.17.diff, 4.9 KB (added by , 13 years ago) |
|---|
-
wp-admin/css/wp-admin.css
4109 4109 } 4110 4110 4111 4111 .wp-post-format-show-ui.wp-format-image .attachment-display-settings, 4112 .wp-post-format-show-ui.wp-format-status #titlewrap,4113 4112 .wp-post-format-show-ui.wp-format-image #insert-media-button, 4114 4113 .wp-post-format-show-ui.wp-format-audio #insert-media-button, 4115 4114 .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']; … … 140 140 insertMediaButton.fadeToggle( 200 ).css( 'display', 'inline-block' ); 141 141 } 142 142 // Animate the title going away or coming back 143 formatTo = -1 < $.inArray( format, noTitleFormats );144 formatFrom = -1 < $.inArray( postFormats.currentPostFormat, noTitleFormats );143 formatTo = -1 < $.inArray( format, optionalTitleFormats ); 144 formatFrom = -1 < $.inArray( postFormats.currentPostFormat, optionalTitleFormats ); 145 145 if ( formatFrom ? !formatTo : formatTo ) { // XOR 146 $( '#titlewrap' ).fadeToggle( 200 ); 146 var o = formatTo ? 0.5 : 1; 147 titlePrompt.text( titlePrompt.data('title' + ( formatTo ? '-optional' : '' ) ) ); 148 $( '#titlewrap' ).animate( {opacity: o}, 200 ); 147 149 } 148 150 149 151 // Animate the fields moving going away or coming in … … 168 170 } 169 171 170 172 resizeContent( format ); 171 postTitle.focus(); 173 if( -1 < $.inArray( format, optionalTitleFormats ) ) 174 if( $('#content:visible').size() ) 175 $('#content').focus(); 176 else 177 tinyMCE.activeEditor.focus(); 178 else 179 postTitle.focus(); 172 180 173 181 if ( '' === postTitle.val() ) { 174 182 titlePrompt.removeClass( 'screen-reader-text' ); … … 245 253 $(this).closest( 'p' ).find( 'span' ).toggle(); 246 254 }); 247 255 256 // Set opacity of title on focus 257 var optionalTitleFormatsSelector = '.wp-format-' + optionalTitleFormats.join( ' #title,.wp-format-' ) + ' #title'; 258 $( 'html' ).on( 'focusin', optionalTitleFormatsSelector, function(e) { 259 $( '#titlewrap' ).animate( {opacity:1}, 200 ); 260 }).on( 'focusout', optionalTitleFormatsSelector, function(e) { 261 $( '#titlewrap' ).animate( {opacity:.5}, 200 ); 262 }); 263 $( optionalTitleFormatsSelector ).parents( '#titlewrap' ).animate( {opacity:.5}, 200 ); 264 248 265 // Media selection 249 266 $( '.wp-format-media-select' ).click( function (e) { 250 267 e.preventDefault(); -
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, 'required' ); 425 $title_optional_prompt = apply_filters( 'enter_title_here', __( 'Enter title here (optional)' ), $post, 'optional' ); 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-includes/class-wp-editor.php
733 733 734 734 <div id="wp-fullscreen-wrap" style="width:<?php echo $dfw_width; ?>px;"> 735 735 <?php if ( post_type_supports($post->post_type, 'title') ) { ?> 736 <label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>736 <label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post, 'required' ); ?></label> 737 737 <input type="text" id="wp-fullscreen-title" value="" autocomplete="off" /> 738 738 <?php } ?> 739 739