Ticket #19570: 19570.11.diff
File 19570.11.diff, 8.6 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.addClass('selected').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(); 29 33 }); 30 34 /*$('.post-format-options').on('mouseenter', function () { 35 $('.post-format-options a').fadeIn('fast'); 36 }).on('mouseleave', function () { 37 console.log('there'); 38 $('.post-format-options a').not('.active').fadeOut('fast'); 39 });*/ 31 40 })(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 $post_format_options = ''; 144 145 foreach ( $all_post_formats as $slug => $label ) { 146 $class = ''; 147 if ( $post_format == $slug ) { 148 $class = 'class="active"'; 149 $active_post_type_slug = $slug; 150 $active_post_type_label = $label; 151 } 152 153 $post_format_options .= '<a ' . $class . ' href="?format=' . $slug . '" data-wp-format="' . $slug . '" title="' . sprintf( __( '%s format' ), $slug ) . '"><div class="' . $slug . '"></div></a>'; 154 } 155 } 156 157 $current_post_format = array( 'currentPostFormat' => esc_html( $active_post_type_slug ) ); 158 wp_localize_script( 'post', 'postFormats', $current_post_format ); 159 141 160 if ( post_type_supports($post_type, 'page-attributes') ) 142 161 add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core'); 143 162 … … 337 356 ?> 338 357 339 358 <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 359 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 361 360 <div id="post-body-content"<?php echo $format_class; ?>> 362 361 362 <?php if ( ! empty( $post_format_options ) ) : ?> 363 <div class="post-format-options"> 364 <?php echo $post_format_options; ?> 365 </div> 366 <?php endif; ?> 367 363 368 <?php if ( post_type_supports($post_type, 'title') ) { ?> 364 369 <div id="titlediv"> 365 370 <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-container { 972 float: right; 973 margin: 4px 0 0 8px; 974 } 975 976 .current-post-format { 977 background: transparent url(../images/arrows.png) no-repeat 0 11px; 978 } 979 980 .post-format-selection.open .current-post-format { 981 background: url(../images/arrows.png) no-repeat 0 -25px; 982 } 983 984 .post-format-options { 985 left: auto; 986 right: 0; 987 } 988 989 .post-format-options a { 990 padding: 9px 32px 8px 7px; 991 } 992 993 .post-format-selection .post-format-options a span { 994 left: auto; 995 right: 4px; 996 } 997 998 /*------------------------------------------------------------------------------ 967 999 12.0 - Categories 968 1000 ------------------------------------------------------------------------------*/ 969 1001 -
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:last-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:last-child { 4136 -webkit-border-bottom-right-radius: 3px; 4137 -webkit-border-top-right-radius: 3px; 4138 border-bottom-right-radius: 3px; 4139 border-top-right-radius: 3px; 4140 } 4141 4142 .post-format-options a.active, 4143 .post-format-options a:focus, 4144 .post-format-options a:hover { 4145 background: #fff; 4146 outline: none; 4147 opacity: 1; 4148 } 4149 4150 .post-format-options a div { 4151 height: 16px; 4152 width: 16px; 4153 opacity: 0.4; 4154 } 4155 4156 .post-format-options a.active div, 4157 .post-format-options a:focus div, 4158 .post-format-options a:hover div { 4159 opacity: 1; 4160 } 4161 4162 .post-format-options .standard { 4163 background: url(../images/post-formats.png) no-repeat -8px -8px; 4164 } 4165 4166 .post-format-options .image { 4167 background: url(../images/post-formats.png) no-repeat -40px -8px; 4168 } 4169 4170 .post-format-options .gallery { 4171 background: url(../images/post-formats.png) no-repeat -72px -8px; 4172 } 4173 4174 .post-format-options .audio { 4175 background: url(../images/post-formats.png) no-repeat -104px -8px; 4176 } 4177 4178 .post-format-options .video { 4179 background: url(../images/post-formats.png) no-repeat -136px -8px; 4180 } 4181 4182 .post-format-options .chat { 4183 background: url(../images/post-formats.png) no-repeat -168px -8px; 4184 } 4185 4186 .post-format-options .status { 4187 background: url(../images/post-formats.png) no-repeat -200px -8px; 4188 } 4189 4190 .post-format-options .aside { 4191 background: url(../images/post-formats.png) no-repeat -232px -8px; 4192 } 4193 4194 .post-format-options .quote { 4195 background: url(../images/post-formats.png) no-repeat -264px -8px; 4196 } 4197 4198 .post-format-options .link { 4199 background: url(../images/post-formats.png) no-repeat -296px -8px; 4200 } 4201 4202 /*------------------------------------------------------------------------------ 4064 4203 12.0 - Categories 4065 4204 ------------------------------------------------------------------------------*/ 4066 4205