Ticket #24046: 24046.3.diff
File 24046.3.diff, 17.9 KB (added by , 11 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 { 3087 3088 } 3088 3089 3089 3090 #edit-slug-box { 3090 line-height: 2 3px;3091 min-height: 2 3px;3091 line-height: 24px; 3092 min-height: 25px; /* Yes, line-height + 1 */ 3092 3093 margin-top: 5px; 3093 padding : 0 10px;3094 padding-right: 6px; 3094 3095 } 3095 3096 3096 3097 #edit-slug-box .cancel { … … body .ui-tooltip { 3930 3931 3931 3932 .post-formats-fields { 3932 3933 display: none; 3934 margin-bottom: 15px; 3933 3935 } 3934 3936 3935 3937 .wp-format-gallery .post-formats-fields, … … body .ui-tooltip { 4030 4032 min-height: 97px; 4031 4033 } 4032 4034 4033 #icon-edit.standard { 4035 #icon-edit.standard, 4036 .post-format-options .standard { 4034 4037 background: url(../images/post-formats32.png) no-repeat -3px -4px; 4035 4038 } 4036 4039 4037 #icon-edit.image { 4040 #icon-edit.image, 4041 .post-format-options .image { 4038 4042 background: url(../images/post-formats32.png) no-repeat -43px -4px; 4039 4043 } 4040 4044 4041 #icon-edit.gallery { 4045 #icon-edit.gallery, 4046 .post-format-options .gallery { 4042 4047 background: url(../images/post-formats32.png) no-repeat -83px -4px; 4043 4048 } 4044 4049 4045 #icon-edit.audio { 4050 #icon-edit.audio, 4051 .post-format-options .audio { 4046 4052 background: url(../images/post-formats32.png) no-repeat -123px -4px; 4047 4053 } 4048 4054 4049 #icon-edit.video { 4055 #icon-edit.video, 4056 .post-format-options .video { 4050 4057 background: url(../images/post-formats32.png) no-repeat -163px -4px; 4051 4058 } 4052 4059 4053 #icon-edit.chat { 4060 #icon-edit.chat, 4061 .post-format-options .chat { 4054 4062 background: url(../images/post-formats32.png) no-repeat -202px -4px; 4055 4063 } 4056 4064 4057 #icon-edit.status { 4065 #icon-edit.status, 4066 .post-format-options .status { 4058 4067 background: url(../images/post-formats32.png) no-repeat -242px -4px; 4059 4068 } 4060 4069 4061 #icon-edit.aside { 4070 #icon-edit.aside, 4071 .post-format-options .aside { 4062 4072 background: url(../images/post-formats32.png) no-repeat -282px -4px; 4063 4073 } 4064 4074 4065 #icon-edit.quote { 4075 #icon-edit.quote, 4076 .post-format-options .quote { 4066 4077 background: url(../images/post-formats32.png) no-repeat -322px -4px; 4067 4078 } 4068 4079 4069 #icon-edit.link { 4080 #icon-edit.link, 4081 .post-format-options .link { 4070 4082 background: url(../images/post-formats32.png) no-repeat -362px -4px; 4071 4083 } 4072 4084 4073 4085 .post-format-description { 4074 4086 color: #666; 4075 display: none; 4076 margin: 10px 0; 4087 font-size: 12px; 4077 4088 } 4078 4089 4079 4090 .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; 4091 height: 50px; 4092 margin: 13px 0 10px; 4086 4093 padding: 0; 4087 4094 } 4088 4095 4089 4096 .post-format-options a { 4090 border-right: 1px solid #ebebeb;4091 4097 display: inline-block; 4092 height: 16px; 4093 width: 16px; 4094 padding: 6px; 4098 height: 34px; 4099 margin-right: 33px; 4095 4100 position: relative; 4096 4101 text-decoration: none; 4102 text-align: center; 4097 4103 } 4098 4104 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; 4105 .post-format-options a div { 4106 height: 34px; 4107 width: 34px; 4108 margin: 0 auto; 4104 4109 } 4105 4110 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; 4111 .post-format-title { 4112 color: #777; 4113 display: block; 4114 margin-top: 4px; 4114 4115 } 4115 4116 4116 .post-format-options a div { 4117 height: 16px; 4118 width: 16px; 4119 opacity: 0.4; 4117 .post-format-change, .post-format-set .post-format-options { 4118 display: none; 4120 4119 } 4121 4120 4122 .post-format-options a.active div, 4123 .post-format-options a:focus div, 4124 .post-format-options a:hover div { 4125 opacity: 1; 4121 .post-format-set .post-format-change { 4122 display: block; 4126 4123 } 4127 4124 4128 .post-format-options .standard { 4125 #poststuff .post-format-change { 4126 margin: 11px 0 13px; 4127 padding: 0; 4128 font-size: 1.5em; 4129 line-height: 18px; 4130 clear: left; 4131 } 4132 4133 .post-format-change span.icon { 4134 float: left; 4135 height: 16px; 4136 margin: 2px 5px 0 0; 4137 width: 16px; 4138 } 4139 4140 .post-format-change span.icon.standard { 4129 4141 background: url(../images/post-formats.png) no-repeat -8px -8px; 4130 4142 } 4131 4143 4132 .post-format- options.image {4144 .post-format-change span.icon.image { 4133 4145 background: url(../images/post-formats.png) no-repeat -40px -8px; 4134 4146 } 4135 4147 4136 .post-format- options.gallery {4148 .post-format-change span.icon.gallery { 4137 4149 background: url(../images/post-formats.png) no-repeat -72px -8px; 4138 4150 } 4139 4151 4140 .post-format- options.audio {4152 .post-format-change span.icon.audio { 4141 4153 background: url(../images/post-formats.png) no-repeat -104px -8px; 4142 4154 } 4143 4155 4144 .post-format- options.video {4156 .post-format-change span.icon.video { 4145 4157 background: url(../images/post-formats.png) no-repeat -136px -8px; 4146 4158 } 4147 4159 4148 .post-format- options.chat {4160 .post-format-change span.icon.chat { 4149 4161 background: url(../images/post-formats.png) no-repeat -168px -8px; 4150 4162 } 4151 4163 4152 .post-format- options.status {4164 .post-format-change span.icon.status { 4153 4165 background: url(../images/post-formats.png) no-repeat -200px -8px; 4154 4166 } 4155 4167 4156 .post-format- options.aside {4168 .post-format-change span.icon.aside { 4157 4169 background: url(../images/post-formats.png) no-repeat -232px -8px; 4158 4170 } 4159 4171 4160 .post-format- options.quote {4172 .post-format-change span.icon.quote { 4161 4173 background: url(../images/post-formats.png) no-repeat -264px -8px; 4162 4174 } 4163 4175 4164 .post-format- options.link {4176 .post-format-change span.icon.link { 4165 4177 background: url(../images/post-formats.png) no-repeat -296px -8px; 4166 4178 } 4167 4179 4168 .post-format-tip { 4169 color: #999; 4170 font-size: 14px; 4171 float: right; 4172 padding: 6px 10px; 4173 text-transform: capitalize; 4180 .post-format-change a { 4181 font-size: 12px; 4182 } 4183 4184 @media only screen and (max-width: 782px) { 4185 .post-format-options { 4186 height: 33px; 4187 } 4188 4189 .post-format-options a { 4190 margin-right: 19px; 4191 } 4192 4193 .post-format-options a div { 4194 height: 18px; 4195 width: 16px; 4196 } 4197 4198 .post-format-options .standard { 4199 background: url(../images/post-formats.png) no-repeat -8px -8px; 4200 } 4201 4202 .post-format-options .image { 4203 background: url(../images/post-formats.png) no-repeat -40px -8px; 4204 } 4205 4206 .post-format-options .gallery { 4207 background: url(../images/post-formats.png) no-repeat -72px -8px; 4208 } 4209 4210 .post-format-options .audio { 4211 background: url(../images/post-formats.png) no-repeat -104px -8px; 4212 } 4213 4214 .post-format-options .video { 4215 background: url(../images/post-formats.png) no-repeat -136px -8px; 4216 } 4217 4218 .post-format-options .chat { 4219 background: url(../images/post-formats.png) no-repeat -168px -8px; 4220 } 4221 4222 .post-format-options .status { 4223 background: url(../images/post-formats.png) no-repeat -200px -8px; 4224 } 4225 4226 .post-format-options .aside { 4227 background: url(../images/post-formats.png) no-repeat -232px -8px; 4228 } 4229 4230 .post-format-options .quote { 4231 background: url(../images/post-formats.png) no-repeat -264px -8px; 4232 } 4233 4234 .post-format-options .link { 4235 background: url(../images/post-formats.png) no-repeat -296px -8px; 4236 } 4174 4237 } 4175 4238 4176 4239 /*------------------------------------------------------------------------------ -
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 if ( 'auto-draft' == $post->post_status ) 141 $post_format_set_class = ''; 142 } 139 143 140 144 $format_class = " class='wp-format-{$post_format}'"; 141 145 142 146 143 147 $all_post_formats = array( 144 148 'standard' => array ( 145 'description' => __( ' Add a title and use the editorto compose your post.' )149 'description' => __( 'Use the editor below to compose your post.' ) 146 150 ), 147 151 'image' => array ( 148 'description' => __( 'Select or upload an image to usefor your post.' )152 'description' => __( 'Select or upload an image for your post.' ) 149 153 ), 150 154 'gallery' => array ( 151 155 '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 170 'description' => __( 'Use the editor to compose a status update. What’s new?' ) 167 171 ), 168 172 'quote' => array ( 169 'description' => __( 'Copy a quotation into the box . Also add thesource and URL if you have them.' )173 'description' => __( 'Copy a quotation into the box below. Add a source and URL if you have them.' ) 170 174 ), 171 175 'aside' => array ( 172 'description' => __( ' An aside is a quick thought or side topic. Use the editor to compose one.' )176 'description' => __( 'Use the editor to share a quick thought or side topic.' ) 173 177 ) 174 178 ); 175 179 $post_format_options = ''; … … if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'show_po 181 185 $active_post_type_slug = $slug; 182 186 } 183 187 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>';188 $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 189 } 186 190 187 191 $current_post_format = array( 'currentPostFormat' => esc_html( $active_post_type_slug ) ); … … if ( 'post' == $post_type ) { 358 362 require_once('./admin-header.php'); 359 363 ?> 360 364 361 <div class="wrap ">365 <div class="wrap <?php echo $post_format_set_class; ?>"> 362 366 <?php screen_icon(); ?> 363 367 <h2><?php 364 368 echo esc_html( $title ); … … if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create 374 378 <div id="lost-connection-notice" class="error hidden"> 375 379 <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 380 </div> 381 <?php if ( ! empty( $post_format_options ) ) : ?> 382 <div class="post-format-options"> 383 <?php echo $post_format_options; ?> 384 </div> 385 <?php endif; ?> 377 386 <form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag'); ?>> 378 387 <?php wp_nonce_field($nonce_action); ?> 379 388 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" /> … … wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); 400 409 <div id="poststuff"> 401 410 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 402 411 <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 412 <?php if ( post_type_supports($post_type, 'title') ) { ?> 412 413 <div id="titlediv"> 413 414 <div id="titlewrap"> … … if ( !empty($shortlink) ) 424 425 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { 425 426 $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; 426 427 ?> 427 <div id="edit-slug-box" class="hide-if-no-js <?php if ( ! $has_sample_permalink ) echo ' hidden' ?>">428 <div id="edit-slug-box" class="hide-if-no-js"> 428 429 <?php 429 430 if ( $has_sample_permalink ) 430 431 echo $sample_permalink_html; -
wp-admin/includes/post-formats.php
1 1 <?php 2 2 global $wp_embed; 3 3 4 $format_meta = get_post_format_meta( $post_ID ); 4 5 5 6 ?> 6 <div class="post-format- description"></div>7 <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> 7 8 <div class="post-formats-fields"> 8 9 9 10 <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 container.get(0).className = container.get(0).className.replace( /\bwp-format-[^ ]+/ , '' );9 container.get(0).className = container.get(0).className.replace( /\bwp-format-[^ ]+/g, '' ); 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 slide36 } else {37 $container.slide Up( 200, function(){38 switchFormatClass( format);39 $container.slideDown( 400 );40 });41 }42 43 $('#title').focus();44 45 // Update description line46 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 }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 ); 59 57 } 58 } 59 60 postFormats.currentPostFormat = format; 61 } 60 62 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') ); 63 $(function(){ 64 65 $('.post-format-change a').click(function () { 66 $('.post-formats-fields, .post-format-change').slideUp(); 67 $('.post-format-options').slideDown(); 68 return false; 69 }); 70 71 // Post formats selection 72 $('.post-format-options').on( 'click', 'a', function(e){ 73 e.preventDefault(); 74 switchFormat($(this)); 66 75 }); 67 76 68 77 // Media selection 69 78 $('.wp-format-media-select').click(function (event) { 70 79 event.preventDefault(); 71 var $el = $(this), $holder, $field,mime = 'image', menu = '',80 var $el = $(this), mime = 'image', menu = '', 72 81 $holder = $el.closest('.wp-format-media-holder'), 73 82 $field = $( '#wp_format_' + $holder.data('format') ); 74 83