Ticket #24046: 24046-omnipresent-fades.2.diff
File 24046-omnipresent-fades.2.diff, 5.8 KB (added by , 12 years ago) |
---|
-
wp-admin/css/wp-admin.css
body .ui-tooltip { 4113 4113 position: relative; 4114 4114 text-decoration: none; 4115 4115 text-align: center; 4116 transition: opacity 0.2s linear; 4117 opacity: 0.4; 4118 } 4119 4120 .post-format-options:hover a, 4121 .post-format-options a.active { 4122 opacity: 1.0; 4116 4123 } 4117 4124 4118 4125 .post-format-options a div { -
wp-admin/edit-form-advanced.php
if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'enable_ 135 135 wp_enqueue_script( 'wp-mediaelement' ); 136 136 wp_enqueue_style( 'wp-mediaelement' ); 137 137 $post_format = get_post_format(); 138 $post_format_set_class = 'post-format-set';139 138 140 139 if ( ! $post_format ) { 141 140 $post_format = 'standard'; 142 141 143 142 if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) ) 144 143 $post_format = $_REQUEST['format']; 145 elseif ( 'auto-draft' == $post->post_status )146 $post_format_set_class = '';147 144 } 148 145 149 146 $user_wants = get_user_option( 'post_formats_' . $post_type ); -
wp-admin/includes/post-formats.php
wp_nonce_field( 'show-post-format-ui_' . $post_type, 'show_post_format_ui_nonce' 10 10 11 11 ?> 12 12 <div class="wp-post-format-ui<?php if ( ! $show_post_format_ui ) echo ' no-ui' ?>"> 13 <div class="post-format-change"><span class="icon <?php echo esc_attr( $post_format ); ?>"></span> <span class="post-format-description"><?php echo $all_post_formats[$post_format]['description']; ?></span> <a href="#"><?php _e('Change format'); ?></a></div>13 <div class="post-format-change"><span class="icon <?php echo esc_attr( $post_format ); ?>"></span> <span class="post-format-description"><?php echo $all_post_formats[$post_format]['description']; ?></span></div> 14 14 <div class="post-formats-fields"> 15 15 16 16 <input type="hidden" name="post_format" id="post_format" value="<?php echo esc_attr( $post_format ); ?>" /> … … wp_nonce_field( 'show-post-format-ui_' . $post_type, 'show_post_format_ui_nonce' 144 144 </div> 145 145 </div> 146 146 </div> 147 </div> 148 No newline at end of file 147 </div> -
wp-admin/js/post-formats.js
window.wp = window.wp || {}; 4 4 var container, $container, mediaFrame, lastMimeType, mediaPreview, lastHeight = 360, content, insertMediaButton, 5 5 initialFormat = 'standard', 6 6 shortClass = 'short-format', 7 noTitleFormats = ['status'], 8 noMediaFormats = ['status', 'aside'], 7 9 shortContentFormats = ['status', 'aside'], 8 10 noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery'], 9 11 $screenIcon = $( '.icon32' ); 10 12 11 13 12 14 function switchFormatClass( format ) { 15 $('#post_format').val(format); 16 $('.post-format-change').show().find('span.icon').removeClass(postFormats.currentPostFormat).addClass(format); 13 17 container.get(0).className = container.get(0).className.replace( /\s?\bwp-format-[^ ]+/g, '' ); 14 18 container.addClass('wp-format-' + format); 15 19 $screenIcon.get(0).className = $screenIcon.get(0).className.replace( /\s?\bwp-format-[^ ]+/g, '' ); … … window.wp = window.wp || {}; 45 49 } 46 50 47 51 function switchFormat($this) { 48 var editor, body, 52 var editor, body, formatTo, formatFrom, 49 53 parent = $this.parent(), 50 54 format = $this.data('wp-format'), 51 55 description = $('.post-format-description'), 52 56 postTitle = $('#title'); 53 57 58 if ( format === postFormats.currentPostFormat ) 59 return; 60 54 61 if ( typeof container === 'undefined' ) 55 62 container = $('#post-body-content'); 56 63 57 parent. slideUp().find('a.active').removeClass('active');64 parent.find('a.active').removeClass('active'); 58 65 $this.addClass('active'); 59 $('#post_format').val(format);60 $('.post-format-change').show().find('span.icon').removeClass(postFormats.currentPostFormat).addClass(format);61 66 62 if ( -1 < $.inArray( format, noUIFormats ) ) { 67 // Animate the media button going away or coming back 68 formatTo = -1 < $.inArray( format, noMediaFormats ); 69 formatFrom = -1 < $.inArray( postFormats.currentPostFormat, noMediaFormats ); 70 if ( formatFrom ? !formatTo : formatTo ) // XOR 71 insertMediaButton.fadeToggle( 200 ); 72 73 // Animate the title going away or coming back 74 formatTo = -1 < $.inArray( format, noTitleFormats ); 75 formatFrom = -1 < $.inArray( postFormats.currentPostFormat, noTitleFormats ); 76 if ( formatFrom ? !formatTo : formatTo ) // XOR 77 $('#titlewrap').fadeToggle( 200 ); 78 79 console.log( format ); 80 console.log( postFormats.currentPostFormat ); 81 console.log( noUIFormats ); 82 83 if ( -1 < $.inArray( format, noUIFormats ) && -1 < $.inArray( postFormats.currentPostFormat, noUIFormats ) ) { 63 84 switchFormatClass( format ); // No slide 64 $container. hide();85 $container.slideUp(); 65 86 } else { 66 $container.slideUp( 200, function(){87 $container.slideUp( 400, function(){ 67 88 switchFormatClass( format ); 68 $container.slideDown( 400 ); 89 if ( -1 == $.inArray( format, noUIFormats ) ) 90 $container.slideDown( 400 ); 69 91 }); 70 92 } 71 93 … … window.wp = window.wp || {}; 119 141 }); 120 142 }); 121 143 122 $('.post-format-change a').click(function() {123 $('.post-formats-fields, .post-format-change').slideUp();124 $('.post-format-options').slideDown();125 return false;126 });127 128 144 // Post formats selection 129 145 $('.post-format-options').on( 'click', 'a', function (e) { 130 146 e.preventDefault();