Ticket #24046: 24046.11.diff
File 24046.11.diff, 9.0 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/post-formats.php
10 10 11 11 ?> 12 12 <div class="wp-post-format-ui<?php if ( ! $show_post_format_ui ) echo ' no-ui' ?>"> 13 <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>13 <div class="post-format-change"><span class="icon <?php echo esc_attr( 'wp-format-' . $post_format ); ?>"></span> <span class="post-format-description"><?php echo $all_post_formats[$post_format]['description']; ?></span></div> 14 14 <div class="post-formats-fields"> 15 15 16 16 <input type="hidden" name="post_format" id="post_format" value="<?php echo esc_attr( $post_format ); ?>" /> … … 144 144 </div> 145 145 </div> 146 146 </div> 147 </div> 148 No newline at end of file 147 </div> -
wp-admin/css/colors-classic.css
164 164 color: #fff; 165 165 } 166 166 167 .post-format-options, 167 168 .widget .widget-top, 168 169 .postbox h3, 169 170 .stuffbox h3, … … 688 689 background-image: linear-gradient(to top, #eff8ff, #f7fcfe); 689 690 } 690 691 692 .post-format-options, 691 693 .postbox h3 { 692 694 color: #174f69; 693 695 } -
wp-admin/css/colors-fresh.css
164 164 color: #fff; 165 165 } 166 166 167 .post-format-options, 167 168 .widget .widget-top, 168 169 .postbox h3, 169 170 .stuffbox h3, … … 690 691 background-image: linear-gradient(to top, #f5f5f5, #f9f9f9); 691 692 } 692 693 694 .post-format-options, 693 695 .postbox h3 { 694 696 color: #464646; 695 697 } -
wp-admin/css/wp-admin.css
4101 4101 } 4102 4102 4103 4103 .post-format-options { 4104 height: 50px; 4104 border-width: 1px; 4105 border-style: solid; 4106 -webkit-border-radius: 3px; 4107 border-radius: 3px; 4108 border-color: #CCC; 4105 4109 margin: 13px 0 10px; 4106 padding: 0;4110 padding: 5px; 4107 4111 } 4108 4112 4109 4113 .post-format-options a { 4110 4114 display: inline-block; 4111 height: 34px; 4112 margin-right: 33px; 4115 min-width: 62px; 4116 padding:5px; 4117 border:1px solid transparent; 4118 margin-right: 10px; 4113 4119 position: relative; 4114 4120 text-decoration: none; 4115 4121 text-align: center; 4122 transition: opacity 0.1s linear; 4123 opacity: 0.6; 4116 4124 } 4117 4125 4126 .post-format-options:hover a { 4127 opacity: 1.0; 4128 } 4129 .post-format-options a:hover, 4130 .post-format-options a.active { 4131 opacity: 1.0; 4132 background-color: #fff; 4133 border-color: #ccc; 4134 } 4135 4118 4136 .post-format-options a div { 4119 4137 height: 34px; 4120 4138 width: 34px; … … 4150 4168 width: 16px; 4151 4169 } 4152 4170 4153 .post-format-change span.icon. standard {4171 .post-format-change span.icon.wp-format-standard { 4154 4172 background: url(../images/post-formats.png) no-repeat -8px -8px; 4155 4173 } 4156 4174 4157 .post-format-change span.icon. image {4175 .post-format-change span.icon.wp-format-image { 4158 4176 background: url(../images/post-formats.png) no-repeat -40px -8px; 4159 4177 } 4160 4178 4161 .post-format-change span.icon. gallery {4179 .post-format-change span.icon.wp-format-gallery { 4162 4180 background: url(../images/post-formats.png) no-repeat -72px -8px; 4163 4181 } 4164 4182 4165 .post-format-change span.icon. audio {4183 .post-format-change span.icon.wp-format-audio { 4166 4184 background: url(../images/post-formats.png) no-repeat -104px -8px; 4167 4185 } 4168 4186 4169 .post-format-change span.icon. video {4187 .post-format-change span.icon.wp-format-video { 4170 4188 background: url(../images/post-formats.png) no-repeat -136px -8px; 4171 4189 } 4172 4190 4173 .post-format-change span.icon. chat {4191 .post-format-change span.icon.wp-format-chat { 4174 4192 background: url(../images/post-formats.png) no-repeat -168px -8px; 4175 4193 } 4176 4194 4177 .post-format-change span.icon. status {4195 .post-format-change span.icon.wp-format-status { 4178 4196 background: url(../images/post-formats.png) no-repeat -200px -8px; 4179 4197 } 4180 4198 4181 .post-format-change span.icon. aside {4199 .post-format-change span.icon.wp-format-aside { 4182 4200 background: url(../images/post-formats.png) no-repeat -232px -8px; 4183 4201 } 4184 4202 4185 .post-format-change span.icon. quote {4203 .post-format-change span.icon.wp-format-quote { 4186 4204 background: url(../images/post-formats.png) no-repeat -264px -8px; 4187 4205 } 4188 4206 4189 .post-format-change span.icon. link {4207 .post-format-change span.icon.wp-format-link { 4190 4208 background: url(../images/post-formats.png) no-repeat -296px -8px; 4191 4209 } 4192 4210 -
wp-admin/edit-form-advanced.php
135 135 wp_enqueue_script( 'wp-mediaelement' ); 136 136 wp_enqueue_style( 'wp-mediaelement' ); 137 137 $post_format = get_post_format(); 138 $post_format_set_class = 'post-format-set';139 138 140 139 if ( ! $post_format ) { 141 140 $post_format = 'standard'; 142 141 143 142 if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) ) 144 143 $post_format = $_REQUEST['format']; 145 elseif ( 'auto-draft' == $post->post_status )146 $post_format_set_class = '';147 144 } 148 145 149 146 $user_wants = get_user_option( 'post_formats_' . $post_type ); -
wp-admin/js/post-formats.js
4 4 var container, $container, mediaFrame, lastMimeType, mediaPreview, lastHeight = 360, content, insertMediaButton, 5 5 initialFormat = 'standard', 6 6 shortClass = 'short-format', 7 noTitleFormats = ['status'], 8 noMediaFormats = ['status', 'aside'], 7 9 shortContentFormats = ['status', 'aside'], 8 10 noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery'], 9 11 $screenIcon = $( '.icon32' ); 10 12 11 13 12 14 function switchFormatClass( format ) { 15 $('#post_format').val(format); 13 16 container.get(0).className = container.get(0).className.replace( /\s?\bwp-format-[^ ]+/g, '' ); 14 17 container.addClass('wp-format-' + format); 15 18 $screenIcon.get(0).className = $screenIcon.get(0).className.replace( /\s?\bwp-format-[^ ]+/g, '' ); … … 45 48 } 46 49 47 50 function switchFormat($this) { 48 var editor, body, 51 var editor, body, formatTo, formatFrom, 49 52 parent = $this.parent(), 50 53 format = $this.data('wp-format'), 51 54 description = $('.post-format-description'), 52 55 postTitle = $('#title'); 53 56 57 if ( format === postFormats.currentPostFormat ) 58 return; 59 54 60 if ( typeof container === 'undefined' ) 55 61 container = $('#post-body-content'); 56 62 57 parent. slideUp().find('a.active').removeClass('active');63 parent.find('a.active').removeClass('active'); 58 64 $this.addClass('active'); 59 $('#post_format').val(format);60 $('.post-format-change').show().find('span.icon').removeClass(postFormats.currentPostFormat).addClass(format);61 65 62 if ( -1 < $.inArray( format, noUIFormats ) ) { 66 // Animate the media button going away or coming back 67 formatTo = -1 < $.inArray( format, noMediaFormats ); 68 formatFrom = -1 < $.inArray( postFormats.currentPostFormat, noMediaFormats ); 69 if ( formatFrom ? !formatTo : formatTo ) // XOR 70 insertMediaButton.fadeToggle( 200 ).css( 'display', 'inline-block' ); 71 72 // Animate the title going away or coming back 73 formatTo = -1 < $.inArray( format, noTitleFormats ); 74 formatFrom = -1 < $.inArray( postFormats.currentPostFormat, noTitleFormats ); 75 if ( formatFrom ? !formatTo : formatTo ) // XOR 76 $('#titlewrap').fadeToggle( 200 ); 77 78 if ( -1 < $.inArray( format, noUIFormats ) && -1 < $.inArray( postFormats.currentPostFormat, noUIFormats ) ) { 63 79 switchFormatClass( format ); // No slide 64 $container. hide();80 $container.slideUp(); 65 81 } else { 66 $container.slideUp( 200, function(){82 $container.slideUp( 400, function(){ 67 83 switchFormatClass( format ); 68 $container.slideDown( 400 ); 84 if ( -1 == $.inArray( format, noUIFormats ) ) 85 $container.slideDown( 400 ); 69 86 }); 70 87 } 71 88 … … 73 90 74 91 postTitle.focus(); 75 92 76 if ( '' === postTitle.val() ) 77 $('#title-prompt-text').removeClass('screen-reader-text'); 93 if ( '' === postTitle.val() ) { 94 var titleprompt = $('#title-prompt-text'); 95 titleprompt.removeClass('screen-reader-text'); 78 96 97 postTitle.keydown(function(e){ 98 titleprompt.addClass('screen-reader-text'); 99 $(this).unbind(e); 100 }); 101 } 102 79 103 // Update description line 80 104 description.html($this.data('description')); 105 var tinyIcon = $('.post-format-change').show().find('span.icon'); 106 tinyIcon.attr('class', tinyIcon.attr('class').replace(/\s?\bwp-format-[^ ]+/g, '' )).addClass( 'wp-format-' + format); 81 107 82 108 if (description.not(':visible')) 83 109 description.slideDown('fast'); … … 119 145 }); 120 146 }); 121 147 122 $('.post-format-change a').click(function() {123 $('.post-formats-fields, .post-format-change').slideUp();124 $('.post-format-options').slideDown();125 return false;126 });127 128 148 // Post formats selection 129 149 $('.post-format-options').on( 'click', 'a', function (e) { 130 150 e.preventDefault();