Ticket #19570: 19570.12.diff
File 19570.12.diff, 8.9 KB (added by , 11 years ago) |
---|
-
wp-admin/js/post-formats.js
1 1 (function($){ 2 3 2 // Post formats selection 4 $('.post-format- select a').on( 'click.post-format', function(e){3 $('.post-format-options a').on( 'click', function(e){ 5 4 var $this = $(this), 6 5 editor, 7 6 body, 7 parent = $this.parent(), 8 8 format = $this.data('wp-format'), 9 9 container = $('#post-body-content'); 10 10 11 $('.post-format-select a.nav-tab-active').removeClass('nav-tab-active'); 12 $this.addClass('nav-tab-active').blur(); 11 parent.find('a.active').removeClass('active'); 12 $this.addClass('active'); 13 $('#icon-edit').removeClass(postFormats.currentPostFormat).addClass(format); 13 14 $('#post_format').val(format); 14 15 15 16 container.get(0).className = container.get(0).className.replace( /\bwp-format-[^ ]+/, '' ); 16 17 container.addClass('wp-format-' + format); 18 $('#title').focus(); 17 19 18 20 if ( typeof tinymce != 'undefined' ) { 19 21 editor = tinymce.get('content'); … … 25 27 } 26 28 } 27 29 30 postFormats.currentPostFormat = format; 31 28 32 e.preventDefault(); 33 }).on('mouseenter', function () { 34 $('.post-format-tip').html( $(this).prop('title') ); 35 }).on('mouseleave', function () { 36 $('.post-format-tip').html( $('.post-format-options a.active').prop('title') ); 29 37 }); 30 31 38 })(jQuery); -
wp-admin/edit-form-advanced.php
138 138 $format_class = " class='wp-format-{$post_format}'"; 139 139 } 140 140 141 if ( post_type_supports( $post_type, 'post-formats' ) ) { 142 $all_post_formats = get_post_format_strings(); 143 /*= array( 144 'standard' => array ( 145 146 ), 147 'image' => array ( 148 149 ), 150 'gallery' => array ( 151 152 ), 153 'link' => array ( 154 155 ), 156 'video' => array ( 157 158 ), 159 'audio' => array ( 160 161 ), 162 'status' => array ( 163 164 ), 165 'quote' => array ( 166 167 ), 168 'aside' => array ( 169 170 ), 171 'chat' => array ( 172 173 ) 174 );*/ 175 $post_format_options = ''; 176 177 foreach ( $all_post_formats as $slug => $label ) { 178 $class = ''; 179 if ( $post_format == $slug ) { 180 $class = 'class="active"'; 181 $active_post_type_slug = $slug; 182 $active_post_type_label = $label; 183 } 184 185 $post_format_options .= '<a ' . $class . ' href="?format=' . $slug . '" data-wp-format="' . $slug . '" title="' . ucfirst( sprintf( __( '%s Post' ), $slug ) ) . '"><div class="' . $slug . '"></div></a>'; 186 } 187 } 188 189 $current_post_format = array( 'currentPostFormat' => esc_html( $active_post_type_slug ) ); 190 wp_localize_script( 'post', 'postFormats', $current_post_format ); 191 141 192 if ( post_type_supports($post_type, 'page-attributes') ) 142 193 add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core'); 143 194 … … 337 388 ?> 338 389 339 390 <div id="poststuff"> 340 341 <?php342 if ( post_type_supports( $post_type, 'post-formats' ) ) {343 $all_post_formats = get_post_format_strings();344 345 echo '<h2 class="nav-tab-wrapper post-format-select">';346 347 foreach ( $all_post_formats as $slug => $label ) {348 if ( $post_format == $slug )349 $class = 'nav-tab nav-tab-active';350 else351 $class = 'nav-tab';352 353 echo '<a class="' . $class . '" href="?format=' . $slug . '" data-wp-format="' . $slug . '">' . $label . '</a>';354 }355 356 echo '</h2>';357 }358 ?>359 360 391 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 361 392 <div id="post-body-content"<?php echo $format_class; ?>> 362 393 394 <?php if ( ! empty( $post_format_options ) ) : ?> 395 <div class="post-format-options"> 396 <span class="post-format-tip">Standard Post</span> 397 <?php echo $post_format_options; ?> 398 </div> 399 <?php endif; ?> 400 363 401 <?php if ( post_type_supports($post_type, 'title') ) { ?> 364 402 <div id="titlediv"> 365 403 <div id="titlewrap"> -
wp-admin/css/wp-admin-rtl.css
23 23 11.1 - Custom Fields 24 24 11.2 - Post Revisions 25 25 11.3 - Featured Images 26 11.4 - Post Format Selection 26 27 12.0 - Categories 27 28 13.0 - Tags 28 29 14.0 - Media Screen … … 964 965 } 965 966 966 967 /*------------------------------------------------------------------------------ 968 11.4 - Post format selection 969 ------------------------------------------------------------------------------*/ 970 971 .post-format-options a { 972 border-left: 1px solid #ebebeb; 973 border-right: none; 974 } 975 976 .post-format-options a:first-child { 977 -webkit-border-bottom-left-radius: 0; 978 -webkit-border-top-left-radius: 0; 979 border-bottom-left-radius: 0; 980 border-top-left-radius: 0; 981 } 982 983 .post-format-options a:last-child { 984 -webkit-border-bottom-right-radius: 3px; 985 -webkit-border-top-right-radius: 3px; 986 border-bottom-right-radius: 3px; 987 border-top-right-radius: 3px; 988 } 989 990 .post-format-tip { 991 float: left; 992 } 993 994 /*------------------------------------------------------------------------------ 967 995 12.0 - Categories 968 996 ------------------------------------------------------------------------------*/ 969 997 -
wp-admin/css/wp-admin.css
24 24 11.1 - Custom Fields 25 25 11.2 - Post Revisions 26 26 11.3 - Featured Images 27 11.4 - Post Format Selection 27 28 12.0 - Categories 28 29 13.0 - Tags 29 30 14.0 - Media Screen … … 4061 4062 } 4062 4063 4063 4064 /*------------------------------------------------------------------------------ 4065 11.4 - Post format selection 4066 ------------------------------------------------------------------------------*/ 4067 4068 #icon-edit.standard { 4069 background: url(../images/post-formats32.png) no-repeat -3px -4px; 4070 } 4071 4072 #icon-edit.image { 4073 background: url(../images/post-formats32.png) no-repeat -43px -4px; 4074 } 4075 4076 #icon-edit.gallery { 4077 background: url(../images/post-formats32.png) no-repeat -83px -4px; 4078 } 4079 4080 #icon-edit.audio { 4081 background: url(../images/post-formats32.png) no-repeat -123px -4px; 4082 } 4083 4084 #icon-edit.video { 4085 background: url(../images/post-formats32.png) no-repeat -163px -4px; 4086 } 4087 4088 #icon-edit.chat { 4089 background: url(../images/post-formats32.png) no-repeat -202px -4px; 4090 } 4091 4092 #icon-edit.status { 4093 background: url(../images/post-formats32.png) no-repeat -242px -4px; 4094 } 4095 4096 #icon-edit.aside { 4097 background: url(../images/post-formats32.png) no-repeat -282px -4px; 4098 } 4099 4100 #icon-edit.quote { 4101 background: url(../images/post-formats32.png) no-repeat -322px -4px; 4102 } 4103 4104 #icon-edit.link { 4105 background: url(../images/post-formats32.png) no-repeat -362px -4px; 4106 } 4107 4108 .post-format-options { 4109 height: 29px; 4110 background: #f9f9f9; 4111 border: 1px solid #dfdfdf; 4112 -webkit-border-radius: 3px; 4113 border-radius: 3px; 4114 margin: 0 0 9px 1px; 4115 padding: 0; 4116 } 4117 4118 .post-format-options a { 4119 border-right: 1px solid #ebebeb; 4120 display: inline-block; 4121 height: 16px; 4122 width: 16px; 4123 padding: 6px; 4124 position: relative; 4125 text-decoration: none; 4126 } 4127 4128 .post-format-options a:first-child { 4129 -webkit-border-bottom-left-radius: 3px; 4130 -webkit-border-top-left-radius: 3px; 4131 border-bottom-left-radius: 3px; 4132 border-top-left-radius: 3px; 4133 } 4134 4135 .post-format-options a.active, 4136 .post-format-options a:focus, 4137 .post-format-options a:hover { 4138 background: #fff; 4139 outline: none; 4140 opacity: 1; 4141 } 4142 4143 .post-format-options a div { 4144 height: 16px; 4145 width: 16px; 4146 opacity: 0.4; 4147 } 4148 4149 .post-format-options a.active div, 4150 .post-format-options a:focus div, 4151 .post-format-options a:hover div { 4152 opacity: 1; 4153 } 4154 4155 .post-format-options .standard { 4156 background: url(../images/post-formats.png) no-repeat -8px -8px; 4157 } 4158 4159 .post-format-options .image { 4160 background: url(../images/post-formats.png) no-repeat -40px -8px; 4161 } 4162 4163 .post-format-options .gallery { 4164 background: url(../images/post-formats.png) no-repeat -72px -8px; 4165 } 4166 4167 .post-format-options .audio { 4168 background: url(../images/post-formats.png) no-repeat -104px -8px; 4169 } 4170 4171 .post-format-options .video { 4172 background: url(../images/post-formats.png) no-repeat -136px -8px; 4173 } 4174 4175 .post-format-options .chat { 4176 background: url(../images/post-formats.png) no-repeat -168px -8px; 4177 } 4178 4179 .post-format-options .status { 4180 background: url(../images/post-formats.png) no-repeat -200px -8px; 4181 } 4182 4183 .post-format-options .aside { 4184 background: url(../images/post-formats.png) no-repeat -232px -8px; 4185 } 4186 4187 .post-format-options .quote { 4188 background: url(../images/post-formats.png) no-repeat -264px -8px; 4189 } 4190 4191 .post-format-options .link { 4192 background: url(../images/post-formats.png) no-repeat -296px -8px; 4193 } 4194 4195 .post-format-tip { 4196 color: #999; 4197 font-size: 14px; 4198 float: right; 4199 padding: 6px 10px; 4200 text-transform: capitalize; 4201 } 4202 4203 /*------------------------------------------------------------------------------ 4064 4204 12.0 - Categories 4065 4205 ------------------------------------------------------------------------------*/ 4066 4206