Changeset 7491
- Timestamp:
- 07/24/2018 05:27:23 PM (6 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/function-reference.js
r3788 r7491 33 33 34 34 function sourceCodeDisplay( element ) { 35 35 36 36 if ( element !== undefined ) { 37 37 // Find table inside a specific source code element if passed. … … 83 83 84 84 // We only expect one used_by and uses per document 85 $usedByList = $( ' .used-by' ).find( 'li' );86 $usesList = $( ' .uses' ).find( 'li' );85 $usedByList = $( 'tbody tr', '#used-by-table' ); 86 $usesList = $( 'tbody tr', '#uses-table' ); 87 87 88 88 if ( $usedByList.length > 5 ) { -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/reference/template-related.php
r5597 r7491 14 14 $has_used_by = ( post_type_has_usage_info() && ( $used_by = get_used_by() ) && $used_by->have_posts() ); 15 15 16 $uses_to_show = 5; 17 $used_by_to_show = 5; 18 16 19 if ( $has_uses || $has_used_by ) : 17 20 ?> … … 23 26 <article class="uses"> 24 27 <h3><?php _e( 'Uses', 'wporg' ); ?></h3> 25 <ul> 26 <?php 27 $uses_to_show = 5; 28 while ( $uses->have_posts() ) : $uses->the_post() 29 ?> 30 <li> 31 <span><?php echo esc_attr( get_source_file() ); ?>:</span> 32 <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( ! in_array( get_post_type(), array( 'wp-parser-class', 'wp-parser-hook' ) ) ) : ?>()<?php endif; ?></a> 33 </li> 34 <?php endwhile; wp_reset_postdata(); ?> 35 <?php if ( $uses->post_count > $uses_to_show ) : ?> 36 <a href="#" class="show-more"><?php 37 /* translators: %d: remaining 'uses' count */ 38 printf( _n( 'Show %d more use', 'Show %d more uses', $uses->post_count - $uses_to_show, 'wporg' ), 39 number_format_i18n( $uses->post_count - $uses_to_show ) 40 ); 41 ?></a> 42 <a href="#" class="hide-more"><?php _e( 'Hide more uses', 'wporg' ); ?></a> 43 <?php endif; ?> 44 </ul> 28 <table id="uses-table"> 29 <caption class="screen-reader-text"><?php esc_html_e( 'Uses', 'wporg' ); ?></caption> 30 <thead> 31 <tr> 32 <th><?php esc_html_e( 'Uses', 'wporg' ); ?></th> 33 <th class="related-desc"><?php esc_html_e( 'Description', 'wporg' ); ?></th> 34 </tr> 35 </thead> 36 <tbody> 37 <?php while ( $uses->have_posts() ) : $uses->the_post(); ?> 38 <tr> 39 <td> 40 <span><?php echo esc_attr( get_source_file() ); ?>:</span> 41 <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( ! in_array( get_post_type(), array( 'wp-parser-class', 'wp-parser-hook' ), true ) ) : ?>()<?php endif; ?></a> 42 </td> 43 <td class="related-desc"> 44 <?php echo get_summary(); ?> 45 </td> 46 </tr> 47 <?php endwhile; wp_reset_postdata(); ?> 48 <tbody> 49 </table> 50 51 <?php if ( $uses->post_count > $uses_to_show ) : ?> 52 <a href="#" class="show-more"><?php 53 /* translators: %d: remaining 'uses' count */ 54 printf( _n( 'Show %d more use', 'Show %d more uses', $uses->post_count - $uses_to_show, 'wporg' ), 55 number_format_i18n( $uses->post_count - $uses_to_show ) 56 ); 57 ?></a> 58 <a href="#" class="hide-more"><?php esc_html_e( 'Hide more uses', 'wporg' ); ?></a> 59 <?php endif; ?> 45 60 </article> 46 61 <?php endif; ?> 47 62 48 63 <?php if ( $has_used_by ) : ?> 64 <?php if ( $has_uses && $uses->post_count > $uses_to_show ) : ?><hr /><?php endif; ?> 49 65 50 <?php if ( $has_uses ) { ?><hr /><?php } ?> 66 <article class="used-by"> 67 <h3><?php esc_html_e( 'Used By', 'wporg' ); ?></h3> 68 <table id="used-by-table"> 69 <caption class="screen-reader-text"><?php esc_html_e( 'Used By', 'wporg' ); ?></caption> 70 <thead> 71 <tr> 72 <th><?php esc_html_e( 'Used By', 'wporg' ); ?></th> 73 <th class="related-desc"><?php esc_html_e( 'Description', 'wporg' ); ?></th> 74 </tr> 75 </thead> 76 <tbody> 77 <?php while ( $used_by->have_posts() ) : $used_by->the_post(); ?> 78 <tr> 79 <td> 80 <span><?php echo esc_attr( get_source_file() ); ?>:</span> 81 <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( ! in_array( get_post_type(), array( 'wp-parser-class', 'wp-parser-hook' ), true ) ) : ?>()<?php endif; ?></a> 82 </td> 83 <td class="related-desc"> 84 <?php echo get_summary(); ?> 85 </td> 86 </tr> 87 <?php endwhile; wp_reset_postdata(); ?> 88 <tbody> 89 </table> 51 90 52 <article class="used-by">53 <h3><?php _e( 'Used By', 'wporg' ); ?></h3>54 <ul>55 <?php56 $used_by_to_show = 5;57 while ( $used_by->have_posts() ) : $used_by->the_post();58 ?>59 <li>60 <span><?php echo esc_attr( get_source_file() ); ?>:</span>61 <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( ! in_array( get_post_type(), array( 'wp-parser-class', 'wp-parser-hook' ) ) ) : ?>()<?php endif; ?></a>62 </li>63 <?php endwhile; wp_reset_postdata(); ?>64 91 <?php if ( $used_by->post_count > $used_by_to_show ) : ?> 65 66 67 68 69 70 71 <a href="#" class="hide-more"><?php_e( 'Hide more used by', 'wporg' ); ?></a>92 <a href="#" class="show-more"><?php 93 /* translators: %d: remaining 'used by' count */ 94 printf( _n( 'Show %d more used by', 'Show %d more used by', $used_by->post_count - $used_by_to_show, 'wporg' ), 95 number_format_i18n( $used_by->post_count - $used_by_to_show ) 96 ); 97 ?></a> 98 <a href="#" class="hide-more"><?php esc_html_e( 'Hide more used by', 'wporg' ); ?></a> 72 99 <?php endif; ?> 73 </ul> 74 </article> 100 </article> 75 101 <?php endif; ?> 76 77 102 </section> 78 103 <?php endif; ?> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss
r6912 r7491 342 342 border-image: none; 343 343 border-style: solid solid none; 344 border-width: 1px 1px 0; 344 border-width: 1px 1px 0; 345 345 display: inline-block; 346 346 padding: .5em 1em; … … 352 352 border-color: #ccc; 353 353 border-radius: 3px 3px 0 0; 354 color: #333; 354 color: #333; 355 355 } 356 356 .tab-section { … … 1061 1061 ----------------------------------------------- */ 1062 1062 .related { 1063 ul {1064 line-height: 1.7; /* Slightly increase the line height for more readability */1065 list-style-type: none;1066 margin: 0;1067 overflow-x: auto;1068 }1069 1070 1063 .show-more, .hide-more { 1071 1064 display: none; 1072 1065 } 1073 } 1074 1066 1067 /* Hide the title and toc links (same as .screen-reader-text) 1068 this allows for linking from the toc. */ 1069 h3, .uses .toc-jump, .used-by .toc-jump { 1070 height: 0; 1071 margin-bottom: 0; 1072 clip: rect(1px, 1px, 1px, 1px); 1073 position: absolute !important; 1074 } 1075 1076 .used-by, .uses { 1077 overflow-x: auto; 1078 clear: right; 1079 } 1080 1081 td p { 1082 margin-bottom: 0; 1083 } 1084 1085 th, td { 1086 width: 50%; 1087 } 1088 1089 @media (max-width: 43em) { 1090 .related-desc, span { 1091 display: none; 1092 } 1093 } 1094 } 1075 1095 1076 1096 .source-content { … … 1106 1126 1107 1127 /* Changelog */ 1108 table {1128 .changelog table { 1109 1129 .changelog-version { 1110 1130 width: 10%; … … 1113 1133 width: 90%; 1114 1134 } 1115 1116 1135 } 1117 1136 … … 1587 1606 color: #fff; 1588 1607 border-bottom: 1px solid #fff; 1589 1608 1590 1609 @media screen and (max-width: 48em) { 1591 1610 border-bottom: 0; … … 2393 2412 } 2394 2413 } 2395 2414 2396 2415 .entry-content { 2397 2416 margin-top: 2rem; … … 2480 2499 background: #eee; 2481 2500 } 2482 2501 2483 2502 &:focus, &:active { 2484 2503 border-color: #bbb; … … 2487 2506 box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); 2488 2507 } 2489 2508 2490 2509 > span { 2491 2510 color: #757575; 2492 2511 2493 2512 &.red { 2494 2513 color: #dc3232; … … 2503 2522 .btn-group { 2504 2523 display: inline; 2505 2524 2506 2525 > a { 2507 2526 position: relative; 2508 2527 2509 2528 @media(min-width: 571px) { 2510 2529 &:first-child { -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css
r7278 r7491 1446 1446 } 1447 1447 1448 .devhub-wrap .related ul { 1449 line-height: 1.7; 1450 /* Slightly increase the line height for more readability */ 1451 list-style-type: none; 1452 margin: 0; 1453 overflow-x: auto; 1448 .devhub-wrap .related { 1449 /* Hide the title and toc links (same as .screen-reader-text) 1450 this allows for linking from the toc. */ 1454 1451 } 1455 1452 1456 1453 .devhub-wrap .related .show-more, .devhub-wrap .related .hide-more { 1457 1454 display: none; 1455 } 1456 1457 .devhub-wrap .related h3, .devhub-wrap .related .uses .toc-jump, .devhub-wrap .related .used-by .toc-jump { 1458 height: 0; 1459 margin-bottom: 0; 1460 clip: rect(1px, 1px, 1px, 1px); 1461 position: absolute !important; 1462 } 1463 1464 .devhub-wrap .related .used-by, .devhub-wrap .related .uses { 1465 overflow-x: auto; 1466 clear: right; 1467 } 1468 1469 .devhub-wrap .related td p { 1470 margin-bottom: 0; 1471 } 1472 1473 .devhub-wrap .related th, .devhub-wrap .related td { 1474 width: 50%; 1475 } 1476 1477 @media (max-width: 43em) { 1478 .devhub-wrap .related .related-desc, .devhub-wrap .related span { 1479 display: none; 1480 } 1458 1481 } 1459 1482 … … 1489 1512 } 1490 1513 1491 .devhub-wrap table .changelog-version {1514 .devhub-wrap .changelog table .changelog-version { 1492 1515 width: 10%; 1493 1516 } 1494 1517 1495 .devhub-wrap table .changelog-desc {1518 .devhub-wrap .changelog table .changelog-desc { 1496 1519 width: 90%; 1497 1520 } … … 2447 2470 body.responsive-show #secondary { 2448 2471 left: 0; 2449 overflow: auto;2450 2472 } 2451 2473
Note: See TracChangeset
for help on using the changeset viewer.