Ticket #24046: 24046.diff
File 24046.diff, 17.4 KB (added by , 12 years ago) |
---|
-
wp-admin/css/wp-admin-rtl.css
table.diff td, table.diff th { 971 971 11.4 - Post format selection 972 972 ------------------------------------------------------------------------------*/ 973 973 974 .post-format-options a {975 border-left: 1px solid #ebebeb;976 border-right: none;977 }978 979 .post-format-options a:first-child {980 -webkit-border-bottom-left-radius: 0;981 -webkit-border-top-left-radius: 0;982 border-bottom-left-radius: 0;983 border-top-left-radius: 0;984 }985 974 986 .post-format-options a:last-child {987 -webkit-border-bottom-right-radius: 3px;988 -webkit-border-top-right-radius: 3px;989 border-bottom-right-radius: 3px;990 border-top-right-radius: 3px;991 }992 993 .post-format-tip {994 float: left;995 }996 975 997 976 /*------------------------------------------------------------------------------ 998 977 12.0 - Categories -
wp-admin/css/wp-admin.css
ul.cat-checklist { 3024 3024 3025 3025 #titlediv { 3026 3026 position: relative; 3027 margin-bottom: 10px;3027 margin-bottom: 5px; 3028 3028 } 3029 3029 3030 3030 #titlediv label { … … ul.cat-checklist { 3047 3047 height: 1.7em; 3048 3048 width: 100%; 3049 3049 outline: none; 3050 margin: 1px 0; 3050 3051 } 3051 3052 3052 3053 #titlediv #title-prompt-text, … … input#link_url { 3090 3091 line-height: 23px; 3091 3092 min-height: 23px; 3092 3093 margin-top: 5px; 3093 padding: 0 10px; 3094 border: 1px dotted #eee; 3095 padding: 6px 6px 5px; 3096 border-radius: 3px; 3097 background: #f9f9f9; 3094 3098 } 3095 3099 3096 3100 #edit-slug-box .cancel { … … body .ui-tooltip { 3930 3934 3931 3935 .post-formats-fields { 3932 3936 display: none; 3937 margin-bottom: 15px; 3933 3938 } 3934 3939 3935 3940 .wp-format-gallery .post-formats-fields, … … body .ui-tooltip { 4030 4035 min-height: 97px; 4031 4036 } 4032 4037 4033 #icon-edit.standard { 4038 #icon-edit.standard, 4039 .post-format-options .standard { 4034 4040 background: url(../images/post-formats32.png) no-repeat -3px -4px; 4035 4041 } 4036 4042 4037 #icon-edit.image { 4043 #icon-edit.image, 4044 .post-format-options .image { 4038 4045 background: url(../images/post-formats32.png) no-repeat -43px -4px; 4039 4046 } 4040 4047 4041 #icon-edit.gallery { 4048 #icon-edit.gallery, 4049 .post-format-options .gallery { 4042 4050 background: url(../images/post-formats32.png) no-repeat -83px -4px; 4043 4051 } 4044 4052 4045 #icon-edit.audio { 4053 #icon-edit.audio, 4054 .post-format-options .audio { 4046 4055 background: url(../images/post-formats32.png) no-repeat -123px -4px; 4047 4056 } 4048 4057 4049 #icon-edit.video { 4058 #icon-edit.video, 4059 .post-format-options .video { 4050 4060 background: url(../images/post-formats32.png) no-repeat -163px -4px; 4051 4061 } 4052 4062 4053 #icon-edit.chat { 4063 #icon-edit.chat, 4064 .post-format-options .chat { 4054 4065 background: url(../images/post-formats32.png) no-repeat -202px -4px; 4055 4066 } 4056 4067 4057 #icon-edit.status { 4068 #icon-edit.status, 4069 .post-format-options .status { 4058 4070 background: url(../images/post-formats32.png) no-repeat -242px -4px; 4059 4071 } 4060 4072 4061 #icon-edit.aside { 4073 #icon-edit.aside, 4074 .post-format-options .aside { 4062 4075 background: url(../images/post-formats32.png) no-repeat -282px -4px; 4063 4076 } 4064 4077 4065 #icon-edit.quote { 4078 #icon-edit.quote, 4079 .post-format-options .quote { 4066 4080 background: url(../images/post-formats32.png) no-repeat -322px -4px; 4067 4081 } 4068 4082 4069 #icon-edit.link { 4083 #icon-edit.link, 4084 .post-format-options .link { 4070 4085 background: url(../images/post-formats32.png) no-repeat -362px -4px; 4071 4086 } 4072 4087 4073 4088 .post-format-description { 4074 4089 color: #666; 4075 display: none; 4076 margin: 10px 0; 4090 font-size: 12px; 4077 4091 } 4078 4092 4079 4093 .post-format-options { 4080 height: 29px; 4081 background: #f9f9f9; 4082 border: 1px solid #dfdfdf; 4083 -webkit-border-radius: 3px; 4084 border-radius: 3px; 4085 margin: 0 0 9px 1px; 4094 height: 50px; 4095 margin: 13px 0 10px; 4086 4096 padding: 0; 4087 4097 } 4088 4098 4089 4099 .post-format-options a { 4090 border-right: 1px solid #ebebeb;4091 4100 display: inline-block; 4092 height: 16px; 4093 width: 16px; 4094 padding: 6px; 4101 height: 34px; 4102 margin-right: 33px; 4095 4103 position: relative; 4096 4104 text-decoration: none; 4105 text-align: center; 4097 4106 } 4098 4107 4099 .post-format-options a:first-child { 4100 -webkit-border-bottom-left-radius: 3px; 4101 -webkit-border-top-left-radius: 3px; 4102 border-bottom-left-radius: 3px; 4103 border-top-left-radius: 3px; 4108 .post-format-options a div { 4109 height: 34px; 4110 width: 34px; 4111 margin: 0 auto; 4104 4112 } 4105 4113 4106 .post-format-options a.active, 4107 .post-format-options a:focus, 4108 .post-format-options a:hover { 4109 background: #eee; 4110 -webkit-box-shadow: inset 0 0 10px #ddd; 4111 box-shadow: inset 0 0 10px #ddd; 4112 outline: none; 4113 opacity: 1; 4114 .post-format-title { 4115 color: #777; 4116 display: block; 4117 margin-top: 4px; 4118 text-decoration: underline; 4114 4119 } 4115 4120 4116 .post-format-options a div { 4117 height: 16px; 4118 width: 16px; 4119 opacity: 0.4; 4121 .post-format-change, 4122 .post-format-description { 4123 display: none; 4120 4124 } 4121 4125 4122 .post-format-options a.active div, 4123 .post-format-options a:focus div, 4124 .post-format-options a:hover div { 4125 opacity: 1; 4126 .post-format-set .post-format-options { 4127 display: none; 4126 4128 } 4127 4129 4128 .post-format-options .standard { 4130 .post-format-set .post-format-change { 4131 display: block; 4132 } 4133 4134 #poststuff .post-format-change { 4135 margin: 11px 0 13px; 4136 padding: 0; 4137 font-size: 1.5em; 4138 line-height: 18px; 4139 clear: left; 4140 } 4141 4142 .post-format-change span.icon { 4143 float: left; 4144 height: 16px; 4145 margin: 2px 5px 0 0; 4146 width: 16px; 4147 } 4148 4149 .post-format-change span.icon.standard { 4129 4150 background: url(../images/post-formats.png) no-repeat -8px -8px; 4130 4151 } 4131 4152 4132 .post-format- options.image {4153 .post-format-change span.icon.image { 4133 4154 background: url(../images/post-formats.png) no-repeat -40px -8px; 4134 4155 } 4135 4156 4136 .post-format- options.gallery {4157 .post-format-change span.icon.gallery { 4137 4158 background: url(../images/post-formats.png) no-repeat -72px -8px; 4138 4159 } 4139 4160 4140 .post-format- options.audio {4161 .post-format-change span.icon.audio { 4141 4162 background: url(../images/post-formats.png) no-repeat -104px -8px; 4142 4163 } 4143 4164 4144 .post-format- options.video {4165 .post-format-change span.icon.video { 4145 4166 background: url(../images/post-formats.png) no-repeat -136px -8px; 4146 4167 } 4147 4168 4148 .post-format- options.chat {4169 .post-format-change span.icon.chat { 4149 4170 background: url(../images/post-formats.png) no-repeat -168px -8px; 4150 4171 } 4151 4172 4152 .post-format- options.status {4173 .post-format-change span.icon.status { 4153 4174 background: url(../images/post-formats.png) no-repeat -200px -8px; 4154 4175 } 4155 4176 4156 .post-format- options.aside {4177 .post-format-change span.icon.aside { 4157 4178 background: url(../images/post-formats.png) no-repeat -232px -8px; 4158 4179 } 4159 4180 4160 .post-format- options.quote {4181 .post-format-change span.icon.quote { 4161 4182 background: url(../images/post-formats.png) no-repeat -264px -8px; 4162 4183 } 4163 4184 4164 .post-format- options.link {4185 .post-format-change span.icon.link { 4165 4186 background: url(../images/post-formats.png) no-repeat -296px -8px; 4166 4187 } 4167 4188 4168 .post-format-tip { 4169 color: #999; 4170 font-size: 14px; 4171 float: right; 4172 padding: 6px 10px; 4173 text-transform: capitalize; 4189 .post-format-change a { 4190 font-size: 12px; 4191 } 4192 4193 @media only screen and (max-width: 782px) { 4194 .post-format-options { 4195 height: 33px; 4196 } 4197 4198 .post-format-options a { 4199 margin-right: 19px; 4200 } 4201 4202 .post-format-options a div { 4203 height: 18px; 4204 width: 16px; 4205 } 4206 4207 .post-format-options .standard { 4208 background: url(../images/post-formats.png) no-repeat -8px -8px; 4209 } 4210 4211 .post-format-options .image { 4212 background: url(../images/post-formats.png) no-repeat -40px -8px; 4213 } 4214 4215 .post-format-options .gallery { 4216 background: url(../images/post-formats.png) no-repeat -72px -8px; 4217 } 4218 4219 .post-format-options .audio { 4220 background: url(../images/post-formats.png) no-repeat -104px -8px; 4221 } 4222 4223 .post-format-options .video { 4224 background: url(../images/post-formats.png) no-repeat -136px -8px; 4225 } 4226 4227 .post-format-options .chat { 4228 background: url(../images/post-formats.png) no-repeat -168px -8px; 4229 } 4230 4231 .post-format-options .status { 4232 background: url(../images/post-formats.png) no-repeat -200px -8px; 4233 } 4234 4235 .post-format-options .aside { 4236 background: url(../images/post-formats.png) no-repeat -232px -8px; 4237 } 4238 4239 .post-format-options .quote { 4240 background: url(../images/post-formats.png) no-repeat -264px -8px; 4241 } 4242 4243 .post-format-options .link { 4244 background: url(../images/post-formats.png) no-repeat -296px -8px; 4245 } 4174 4246 } 4175 4247 4176 4248 /*------------------------------------------------------------------------------ -
wp-admin/edit-form-advanced.php
if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'show_po 133 133 wp_enqueue_script( 'wp-mediaelement' ); 134 134 wp_enqueue_style( 'wp-mediaelement' ); 135 135 $post_format = get_post_format(); 136 $post_format_set_class = 'post-format-set'; 136 137 137 if ( ! $post_format ) 138 if ( ! $post_format ) { 138 139 $post_format = 'standard'; 140 $post_format_set_class = ''; 141 } 139 142 140 143 $format_class = " class='wp-format-{$post_format}'"; 141 144 142 145 143 146 $all_post_formats = array( 144 147 'standard' => array ( 145 'description' => __( ' Add a title and use the editorto compose your post.' )148 'description' => __( 'Use the editor below to compose your post.' ) 146 149 ), 147 150 'image' => array ( 148 'description' => __( 'Select or upload an image to usefor your post.' )151 'description' => __( 'Select or upload an image for your post.' ) 149 152 ), 150 153 'gallery' => array ( 151 154 'description' => __( 'Use the Add Media button to select or upload images for your gallery.' ) … … if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'show_po 166 169 'description' => __( 'Use the editor to compose a status update. What’s new?' ) 167 170 ), 168 171 'quote' => array ( 169 'description' => __( 'Copy a quotation into the box . Also add thesource and URL if you have them.' )172 'description' => __( 'Copy a quotation into the box below. Add a source and URL if you have them.' ) 170 173 ), 171 174 'aside' => array ( 172 'description' => __( ' An aside is a quick thought or side topic. Use the editor to compose one.' )175 'description' => __( 'Use the editor to share a quick thought or side topic.' ) 173 176 ) 174 177 ); 175 178 $post_format_options = ''; … … if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'show_po 181 184 $active_post_type_slug = $slug; 182 185 } 183 186 184 $post_format_options .= '<a ' . $class . ' href="?format=' . $slug . '" data-description="' . $attr['description'] . '" data-wp-format="' . $slug . '" title="' . ucfirst( sprintf( __( '%s Post' ), $slug ) ) . '"><div class="' . $slug . '"></div></a>';187 $post_format_options .= '<a ' . $class . ' href="?format=' . $slug . '" data-description="' . $attr['description'] . '" data-wp-format="' . $slug . '" title="' . ucfirst( $slug ) . '"><div class="' . $slug . '"></div><span class="post-format-title">' . ucfirst( $slug ) . '</span></a>'; 185 188 } 186 189 187 190 $current_post_format = array( 'currentPostFormat' => esc_html( $active_post_type_slug ) ); … … if ( 'post' == $post_type ) { 358 361 require_once('./admin-header.php'); 359 362 ?> 360 363 361 <div class="wrap ">364 <div class="wrap <?php echo $post_format_set_class; ?>"> 362 365 <?php screen_icon(); ?> 363 366 <h2><?php 364 367 echo esc_html( $title ); … … if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create 374 377 <div id="lost-connection-notice" class="error hidden"> 375 378 <p><?php _e("You have lost your connection with the server, and saving has been disabled. This message will vanish once you've reconnected."); ?></p> 376 379 </div> 380 <?php if ( ! empty( $post_format_options ) ) : ?> 381 <div class="post-format-options"> 382 <?php echo $post_format_options; ?> 383 </div> 384 <?php endif; ?> 377 385 <form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag'); ?>> 378 386 <?php wp_nonce_field($nonce_action); ?> 379 387 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" /> … … wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); 400 408 <div id="poststuff"> 401 409 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 402 410 <div id="post-body-content"<?php echo $format_class; ?>> 403 404 <?php if ( ! empty( $post_format_options ) ) : ?>405 <div class="post-format-options">406 <span class="post-format-tip">Standard Post</span>407 <?php echo $post_format_options; ?>408 </div>409 <?php endif; ?>410 411 411 <?php if ( post_type_supports($post_type, 'title') ) { ?> 412 412 <div id="titlediv"> 413 413 <div id="titlewrap"> -
wp-admin/includes/post-formats.php
global $wp_embed; 3 3 $format_meta = get_post_format_meta( $post_ID ); 4 4 5 5 ?> 6 <div class="post-format- description"></div>6 <div class="post-format-change"><span class="icon"></span> <span class="post-format-description"></span> <a href="#"><?php _e('Change format'); ?></a></div> 7 7 <div class="post-formats-fields"> 8 8 9 9 <input type="hidden" name="post_format" id="post_format" value="<?php echo esc_attr( $post_format ); ?>" /> -
wp-admin/js/post-formats.js
1 1 window.wp = window.wp || {}; 2 2 3 3 (function($) { 4 var container, mediaFrame, lastMimeType, lastMenu, mediaPreview, noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery']; 4 var container, mediaFrame, lastMimeType, lastMenu, mediaPreview, 5 noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery'], 6 $container = $( '.post-formats-fields' ); 5 7 6 8 function switchFormatClass( format ) { 7 9 container.get(0).className = container.get(0).className.replace( /\bwp-format-[^ ]+/, '' ); 8 10 container.addClass('wp-format-' + format); 9 11 } 10 11 $(function(){ 12 var $container = $( '.post-formats-fields' ); 13 14 // Post formats selection 15 $('.post-format-options').on( 'click', 'a', function(e){ 16 e.preventDefault(); 17 var $this = $(this), editor, body, 18 parent = $this.parent(), 19 format = $this.data('wp-format'), 20 description = $('.post-format-description'); 12 13 function switchFormat ($this) { 14 var editor, body, 15 parent = $this.parent(), 16 format = $this.data('wp-format'), 17 description = $('.post-format-description'), 18 postTitle = $('#title'); 21 19 22 20 if ( typeof container === 'undefined' ) 23 21 container = $('#post-body-content'); 24 25 // Already on this post format. Bail. 26 if ( format === postFormats.currentPostFormat ) 27 return; 28 29 parent.find('a.active').removeClass('active'); 30 $this.addClass('active'); 31 $('#icon-edit').removeClass(postFormats.currentPostFormat).addClass(format); 32 $('#post_format').val(format); 33 34 if ( -1 < $.inArray( format, noUIFormats ) && -1 < $.inArray( postFormats.currentPostFormat, noUIFormats ) ) { 35 switchFormatClass( format ); // No slide 36 } else { 37 $container.slideUp( 200, function(){ 38 switchFormatClass( format ); 39 $container.slideDown( 400 ); 40 }); 22 23 parent.slideUp().find('a.active').removeClass('active'); 24 $this.addClass('active'); 25 $('#post_format').val(format); 26 $('.post-format-change').show().find('span.icon').removeClass(postFormats.currentPostFormat).addClass(format); 27 container.addClass('wp-format-set'); 28 29 if ( -1 < $.inArray( format, noUIFormats ) ) { 30 switchFormatClass( format ); // No slide 31 $container.hide(); 32 } else { 33 $container.slideUp( 200, function(){ 34 switchFormatClass( format ); 35 $container.slideDown( 400 ); 36 }); 37 } 38 39 postTitle.focus(); 40 41 if ( '' === postTitle.val() ) 42 $('#title-prompt-text').removeClass('screen-reader-text'); 43 44 // Update description line 45 description.html($this.data('description')); 46 47 if (description.not(':visible')) 48 description.slideDown('fast'); 49 50 if ( typeof tinymce != 'undefined' ) { 51 editor = tinymce.get('content'); 52 53 if ( editor ) { 54 body = editor.getBody(); 55 body.className = body.className.replace( /\bpost-format-[^ ]+/, '' ); 56 editor.dom.addClass( body, 'post-format-' + format ); 41 57 } 58 } 59 60 postFormats.currentPostFormat = format; 61 } 42 62 43 $('#title').focus(); 44 45 // Update description line 46 description.html($this.data('description')); 47 48 if (description.not(':visible')) 49 description.slideDown('fast'); 50 51 if ( typeof tinymce != 'undefined' ) { 52 editor = tinymce.get('content'); 53 54 if ( editor ) { 55 body = editor.getBody(); 56 body.className = body.className.replace( /\bpost-format-[^ ]+/, '' ); 57 editor.dom.addClass( body, 'post-format-' + format ); 58 } 59 } 63 $(function(){ 64 var ignoreTitleKeydown = false; 65 66 if ( $('.wrap').hasClass('post-format-set') ) 67 switchFormat($('.post-format-options a[data-wp-format=' + postFormats.currentPostFormat + ']')); 68 69 $('.post-format-change a').click(function () { 70 $('.post-formats-fields, .post-format-change').slideUp(); 71 $('.post-format-options').slideDown(); 72 return false; 73 }); 74 75 $('#title').on('keydown', function () { 76 if (ignoreTitleKeydown || ! $('.post-format-options').is(":visible")) 77 return; 60 78 61 postFormats.currentPostFormat = format; 62 }).on('mouseenter focusin', 'a', function () { 63 $('.post-format-tip').html( $(this).prop('title') ); 64 }).on('mouseleave focusout', 'a', function () { 65 $('.post-format-tip').html( $('.post-format-options a.active').prop('title') ); 79 switchFormat($('.post-format-options a[data-wp-format=' + postFormats.currentPostFormat + ']')); 80 $('#title-prompt-text').addClass('screen-reader-text'); 81 82 ignoreTitleKeydown = true; 83 }); 84 85 // Post formats selection 86 $('.post-format-options').on( 'click', 'a', function(e){ 87 e.preventDefault(); 88 switchFormat($(this)); 66 89 }); 67 90 68 91 // Media selection