Ticket #24046: 24046.2.diff
File 24046.2.diff, 17.9 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; 4114 4118 } 4115 4119 4116 .post-format-options a div { 4117 height: 16px; 4118 width: 16px; 4119 opacity: 0.4; 4120 .post-format-change, .post-format-set .post-format-options { 4121 display: none; 4120 4122 } 4121 4123 4122 .post-format-options a.active div, 4123 .post-format-options a:focus div, 4124 .post-format-options a:hover div { 4125 opacity: 1; 4124 .post-format-set .post-format-change { 4125 display: block; 4126 4126 } 4127 4127 4128 .post-format-options .standard { 4128 #poststuff .post-format-change { 4129 margin: 11px 0 13px; 4130 padding: 0; 4131 font-size: 1.5em; 4132 line-height: 18px; 4133 clear: left; 4134 } 4135 4136 .post-format-change span.icon { 4137 float: left; 4138 height: 16px; 4139 margin: 2px 5px 0 0; 4140 width: 16px; 4141 } 4142 4143 .post-format-change span.icon.standard { 4129 4144 background: url(../images/post-formats.png) no-repeat -8px -8px; 4130 4145 } 4131 4146 4132 .post-format- options.image {4147 .post-format-change span.icon.image { 4133 4148 background: url(../images/post-formats.png) no-repeat -40px -8px; 4134 4149 } 4135 4150 4136 .post-format- options.gallery {4151 .post-format-change span.icon.gallery { 4137 4152 background: url(../images/post-formats.png) no-repeat -72px -8px; 4138 4153 } 4139 4154 4140 .post-format- options.audio {4155 .post-format-change span.icon.audio { 4141 4156 background: url(../images/post-formats.png) no-repeat -104px -8px; 4142 4157 } 4143 4158 4144 .post-format- options.video {4159 .post-format-change span.icon.video { 4145 4160 background: url(../images/post-formats.png) no-repeat -136px -8px; 4146 4161 } 4147 4162 4148 .post-format- options.chat {4163 .post-format-change span.icon.chat { 4149 4164 background: url(../images/post-formats.png) no-repeat -168px -8px; 4150 4165 } 4151 4166 4152 .post-format- options.status {4167 .post-format-change span.icon.status { 4153 4168 background: url(../images/post-formats.png) no-repeat -200px -8px; 4154 4169 } 4155 4170 4156 .post-format- options.aside {4171 .post-format-change span.icon.aside { 4157 4172 background: url(../images/post-formats.png) no-repeat -232px -8px; 4158 4173 } 4159 4174 4160 .post-format- options.quote {4175 .post-format-change span.icon.quote { 4161 4176 background: url(../images/post-formats.png) no-repeat -264px -8px; 4162 4177 } 4163 4178 4164 .post-format- options.link {4179 .post-format-change span.icon.link { 4165 4180 background: url(../images/post-formats.png) no-repeat -296px -8px; 4166 4181 } 4167 4182 4168 .post-format-tip { 4169 color: #999; 4170 font-size: 14px; 4171 float: right; 4172 padding: 6px 10px; 4173 text-transform: capitalize; 4183 .post-format-change a { 4184 font-size: 12px; 4185 } 4186 4187 @media only screen and (max-width: 782px) { 4188 .post-format-options { 4189 height: 33px; 4190 } 4191 4192 .post-format-options a { 4193 margin-right: 19px; 4194 } 4195 4196 .post-format-options a div { 4197 height: 18px; 4198 width: 16px; 4199 } 4200 4201 .post-format-options .standard { 4202 background: url(../images/post-formats.png) no-repeat -8px -8px; 4203 } 4204 4205 .post-format-options .image { 4206 background: url(../images/post-formats.png) no-repeat -40px -8px; 4207 } 4208 4209 .post-format-options .gallery { 4210 background: url(../images/post-formats.png) no-repeat -72px -8px; 4211 } 4212 4213 .post-format-options .audio { 4214 background: url(../images/post-formats.png) no-repeat -104px -8px; 4215 } 4216 4217 .post-format-options .video { 4218 background: url(../images/post-formats.png) no-repeat -136px -8px; 4219 } 4220 4221 .post-format-options .chat { 4222 background: url(../images/post-formats.png) no-repeat -168px -8px; 4223 } 4224 4225 .post-format-options .status { 4226 background: url(../images/post-formats.png) no-repeat -200px -8px; 4227 } 4228 4229 .post-format-options .aside { 4230 background: url(../images/post-formats.png) no-repeat -232px -8px; 4231 } 4232 4233 .post-format-options .quote { 4234 background: url(../images/post-formats.png) no-repeat -264px -8px; 4235 } 4236 4237 .post-format-options .link { 4238 background: url(../images/post-formats.png) no-repeat -296px -8px; 4239 } 4174 4240 } 4175 4241 4176 4242 /*------------------------------------------------------------------------------ -
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