Ticket #19570: 19570.7.diff
File 19570.7.diff, 10.7 KB (added by , 12 years ago) |
---|
-
wp-admin/js/post-formats.js
1 1 window.wp = window.wp || {}; 2 2 3 3 (function($){ 4 var imageFrame; 4 var imageFrame, 5 postFormatSelection = $('.post-format-selection'); 5 6 7 // Post formats dropdown 8 postFormatSelection.on('focusin mouseenter', function () { 9 $(this).addClass('open'); 10 }).on('focusout mouseleave', function () { 11 $(this).removeClass('open'); 12 }); 13 6 14 // Post formats selection 7 $('.post-format-selecta').on( 'click', function(e){15 postFormatSelection.find('a').on( 'click', function(e){ 8 16 e.preventDefault(); 9 17 var $this = $(this), 10 18 format = $this.data('wpFormat'); 11 $('.post-format-select a.nav-tab-active').removeClass('nav-tab-active'); 12 $this.addClass('nav-tab-active').blur();19 20 postFormatSelection.removeClass('open').find('.selected').removeClass(currentPostFormat).addClass(format); 13 21 $('#post_format').val(format); 14 22 $('#post-body-content').attr('class', 'wp-format-' + format ); 23 $('#title').focus(); 24 25 currentPostFormat = format; 15 26 }); 16 27 17 28 // Image selection -
wp-admin/edit-form-advanced.php
330 330 ?> 331 331 332 332 <div id="poststuff"> 333 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 334 <div id="post-body-content"<?php echo $format_class; ?>> 333 335 334 <?php 335 if ( post_type_supports( $post_type, 'post-formats' ) ) { 336 $all_post_formats = get_post_format_strings(); 336 <?php if ( post_type_supports($post_type, 'title') ) { ?> 337 <div id="titlediv"> 338 <div class="title-container"> 339 <?php 340 if ( post_type_supports( $post_type, 'post-formats' ) ) { 341 $all_post_formats = get_post_format_strings(); 342 $post_format_options = ''; 337 343 338 echo '<h2 class="nav-tab-wrapper post-format-select">'; 344 foreach ( $all_post_formats as $slug => $label ) { 345 $class = ''; 346 if ( $post_format == $slug ) { 347 $class = 'active'; 348 $active_post_type_slug = $slug; 349 $active_post_type_label = $label; 350 } 339 351 340 foreach ( $all_post_formats as $slug => $label ) { 341 if ( $post_format == $slug ) 342 $class = 'nav-tab nav-tab-active'; 343 else 344 $class = 'nav-tab'; 345 346 echo '<a class="' . $class . '" href="?format=' . $slug . '" data-wp-format="' . $slug . '">' . $label . '</a>'; 352 $post_format_options .= '<a class="' . $class . '" href="?format=' . $slug . '" data-wp-format="' . $slug . '" title="' . sprintf( __( '%s format' ), $slug ) . '"><span class="' . $slug . '"></span>' . $label . '</a>'; 353 } 347 354 } 355 ?> 356 <div class="post-format-selection" tabindex="0" title="<?php _e( 'Select a post format' ); ?>"> 357 <div class="current-post-format"> 358 <div class="selected <?php echo esc_attr( $active_post_type_slug ); ?>"> 359 <?php echo esc_html( $active_post_type_label ); ?> 360 </div> 361 </div> 362 <div class="post-format-options"> 363 <?php echo $post_format_options; ?> 364 </div> 365 </div> 348 366 349 echo '</h2>'; 350 } 351 ?> 352 353 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 354 <div id="post-body-content"<?php echo $format_class; ?>> 355 356 <?php if ( post_type_supports($post_type, 'title') ) { ?> 357 <div id="titlediv"> 358 <div id="titlewrap"> 359 <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label> 360 <input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" /> 367 <div id="titlewrap"> 368 <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label> 369 <input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" /> 370 </div> 361 371 </div> 362 372 <div class="inside"> 363 373 <?php … … 528 538 529 539 <?php if ( (isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message']) ) : ?> 530 540 <script type="text/javascript"> 531 try{document.post.title.focus();}catch(e){} 541 try{document.post.title.focus();}catch(e){}; 542 var currentPostFormat = '<?php echo esc_html( $active_post_type_slug ); ?>'; 532 543 </script> 533 544 <?php endif; ?> -
wp-admin/css/wp-admin.css
33 33 16.0 - Themes 34 34 16.1 - Custom Header 35 35 16.2 - Custom Background 36 16.3 - Tabbed Admin Screen Interface36 16.3 - Post Format Selection 37 37 17.0 - Plugins 38 38 18.0 - Users 39 39 19.0 - Tools … … 2976 2976 float: left; 2977 2977 } 2978 2978 2979 .title-container { 2980 position: relative; 2981 height: 40px; 2982 } 2983 2979 2984 #titlediv { 2980 2985 position: relative; 2981 margin -bottom: 10px;2986 margin: -1px 0 0; 2982 2987 } 2983 2988 2984 2989 #titlediv label { … … 2991 2996 2992 2997 #poststuff #titlewrap { 2993 2998 border: 0; 2994 padding: 0; 2999 position: absolute; 3000 right: 1px; 3001 left: 0; 3002 padding-left: 40px; 3003 top: 0; 2995 3004 } 2996 3005 2997 3006 #titlediv #title { 2998 padding: 3px 8px;2999 3007 font-size: 1.7em; 3000 line-height: 100%;3008 height: 31px; 3001 3009 width: 100%; 3010 padding-left: 6px; 3002 3011 outline: none; 3012 -webkit-border-top-left-radius: 0; 3013 -webkit-border-bottom-left-radius: 0; 3014 border-top-left-radius: 0; 3015 border-bottom-left-radius: 0; 3003 3016 } 3004 3017 3005 3018 #titlediv #title-prompt-text, … … 3042 3055 #edit-slug-box { 3043 3056 line-height: 23px; 3044 3057 min-height: 23px; 3045 margin -top: 5px;3058 margin: 5px 0 10px; 3046 3059 padding: 0 10px; 3047 3060 } 3048 3061 … … 5303 5316 5304 5317 5305 5318 /*------------------------------------------------------------------------------ 5306 16.3 - Tabbed Admin Screen Interface (Experimental)5319 16.3 - Post format selection 5307 5320 ------------------------------------------------------------------------------*/ 5308 5321 5309 .nav-tab { 5310 border-style: solid; 5311 border-width: 1px 1px 0; 5312 color: #aaa; 5313 text-shadow: #fff 0 1px 0; 5314 font-size: 12px; 5315 line-height: 16px; 5316 display: inline-block; 5317 padding: 4px 14px 6px; 5318 text-decoration: none; 5319 margin: 0 6px -1px 0; 5322 .post-format-selection { 5323 background: #fefefe; 5324 background-image: -webkit-gradient(linear, left bottom, left top, from(#fefefe), to(#f5f5f5)); 5325 background-image: -webkit-linear-gradient(bottom, #fefefe, #f5f5f5); 5326 background-image: -moz-linear-gradient(bottom, #fefefe, #f5f5f5); 5327 background-image: -o-linear-gradient(bottom, #fefefe, #f5f5f5); 5328 background-image: linear-gradient(to top, #fefefe, #f5f5f5); 5329 border-left: 1px solid #dfdfdf; 5330 border-top: 1px solid #dfdfdf; 5331 border-bottom: 1px solid #dfdfdf; 5332 width: 40px; 5333 height: 29px; 5320 5334 -webkit-border-top-left-radius: 3px; 5321 -webkit-border- top-right-radius: 3px;5335 -webkit-border-bottom-left-radius: 3px; 5322 5336 border-top-left-radius: 3px; 5323 border-top-right-radius: 3px; 5337 border-bottom-left-radius: 3px; 5338 margin-top: 1px; 5339 position: absolute; 5340 z-index: 1000; 5324 5341 } 5325 5342 5326 .nav-tab-active { 5327 border-width: 1px; 5328 color: #464646; 5343 .post-format-selection.open { 5344 background: #eeeeee; 5345 border-top: 1px solid #c9c9c9; 5346 border-left: 1px solid #c9c9c9; 5347 border-bottom: 1px solid transparent; 5348 -webkit-border-bottom-left-radius: 0; 5349 border-bottom-left-radius: 0; 5329 5350 } 5330 5351 5331 h2.nav-tab-wrapper, h3.nav-tab-wrapper { 5332 border-bottom-width: 1px; 5333 border-bottom-style: solid; 5334 padding-bottom: 0; 5352 .post-format-selection.open .post-format-options { 5353 display: block; 5335 5354 } 5336 5355 5337 h2 .nav-tab{5338 padding: 4px 10px 6px;5339 font-weight: 200;5340 font-size: 20px;5341 line-height: 24px; 5356 .post-format-selection .selected { 5357 opacity: 0.6; 5358 padding: 7px 8px 3px; 5359 text-indent: -10000px; 5360 } 5342 5361 5362 .post-format-selection .standard { 5363 background: url(../images/post-formats.png) no-repeat -2px -2px; 5343 5364 } 5344 5365 5366 .post-format-selection .image { 5367 background: url(../images/post-formats.png) no-repeat -33px -2px; 5368 } 5345 5369 5370 .post-format-selection .gallery { 5371 background: url(../images/post-formats.png) no-repeat -66px -2px; 5372 } 5373 5374 .post-format-selection .audio { 5375 background: url(../images/post-formats.png) no-repeat -98px -2px; 5376 } 5377 5378 .post-format-selection .video { 5379 background: url(../images/post-formats.png) no-repeat -130px -2px; 5380 } 5381 5382 .post-format-selection .chat { 5383 background: url(../images/post-formats.png) no-repeat -162px -2px; 5384 } 5385 5386 .post-format-selection .status { 5387 background: url(../images/post-formats.png) no-repeat -194px -2px; 5388 } 5389 5390 .post-format-selection .aside { 5391 background: url(../images/post-formats.png) no-repeat -226px -2px; 5392 } 5393 5394 .post-format-selection .quote { 5395 background: url(../images/post-formats.png) no-repeat -258px -2px; 5396 } 5397 5398 .post-format-selection .link { 5399 background: url(../images/post-formats.png) no-repeat -290px -2px; 5400 } 5401 5402 .post-format-selection .current-post-format { 5403 background: transparent url(../images/arrows.png) no-repeat 21px 6px; 5404 border-left: 1px solid #fefefe; 5405 border-right: 1px solid #fefefe; 5406 border-top: 1px solid #fefefe; 5407 -webkit-border-top-left-radius: 3px; 5408 -webkit-border-bottom-left-radius: 3px; 5409 border-top-left-radius: 3px; 5410 border-bottom-left-radius: 3px; 5411 } 5412 5413 .post-format-selection.open .current-post-format { 5414 background: #eeeeee url(../images/arrows.png) no-repeat 21px -29px; 5415 border: 1px solid transparent; 5416 } 5417 5418 .post-format-options { 5419 background: #ffffff; 5420 border-left: 1px solid #cccccc; 5421 border-right: 1px solid #cccccc; 5422 display: none; 5423 position: absolute; 5424 top: 30px; 5425 left: -1px; 5426 width: 150px; 5427 z-index: 100000; 5428 -webkit-border-bottom-left-radius: 3px; 5429 -webkit-border-bottom-right-radius: 3px; 5430 border-bottom-left-radius: 3px; 5431 border-bottom-right-radius: 3px; 5432 box-shadow: 2px 2px 3px rgba(0,0,0,0.1); 5433 } 5434 5435 .post-format-options a { 5436 border-bottom: 1px solid #eee; 5437 display: block; 5438 padding: 9px 7px 8px 32px; 5439 position: relative; 5440 text-decoration: none; 5441 } 5442 5443 .post-format-options a:last-child { 5444 border-bottom: 1px solid #cccccc; 5445 -webkit-border-bottom-left-radius: 3px; 5446 -webkit-border-bottom-right-radius: 3px; 5447 border-bottom-left-radius: 3px; 5448 border-bottom-right-radius: 3px; 5449 } 5450 5451 .post-format-options a:focus, 5452 .post-format-options a:hover { 5453 background: #eeeeee; 5454 border-bottom: 1px solid #dddddd; 5455 color: #222222; 5456 outline: none; 5457 } 5458 5459 .post-format-selection .post-format-options a span { 5460 background-position-y: 0; 5461 height: 24px; 5462 left: 0; 5463 opacity: 0.5; 5464 position: absolute; 5465 top: 0; 5466 width: 24px; 5467 } 5468 5469 .post-format-selection .post-format-options a:focus span, 5470 .post-format-selection .post-format-options a:hover span { 5471 opacity: 1; 5472 } 5473 5346 5474 /*------------------------------------------------------------------------------ 5347 5475 17.0 - Plugins 5348 5476 ------------------------------------------------------------------------------*/