Changeset 4410
- Timestamp:
- 11/24/2016 01:38:06 AM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 1 added
- 3 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-developers.php
r4278 r4410 16 16 static function display() { 17 17 $post = get_post(); 18 $output = ''; 18 19 19 20 if ( $contributors = get_the_terms( $post->ID, 'plugin_contributors' ) ) { … … 27 28 sort( $contributors, SORT_NATURAL ); 28 29 29 $output = '<ul class="plugin-developers">'; 30 $output .= '<p>' . __( 'This is open source software. The following people have contributed to this plugin.', 'wporg-plugins' ) . '</p>'; 31 32 $output .= '<ul class="plugin-developers">'; 30 33 foreach ( $contributors as $contributor_slug ) { 31 34 $contributor = get_user_by( 'slug', $contributor_slug ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-reviews.php
r4388 r4410 16 16 static function display() { 17 17 $reviews = Tools::get_plugin_reviews( get_post()->post_name ); 18 $review_count = array_sum( get_post_meta( get_the_ID(), 'ratings', true ) ); 18 19 19 20 if ( empty( $reviews ) ) { … … 51 52 </div> 52 53 54 <a class="reviews-link" href="<?php echo esc_url( 'https://wordpress.org/support/plugin/' . get_post()->post_name . '/reviews/' ); ?>"> 55 <?php printf( __( 'Read all %s reviews', 'wporg-plugins' ), number_format_i18n( $review_count ) ); ?> 56 </a> 57 53 58 <?php 54 59 return ob_get_clean(); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/faq/index.jsx
r4223 r4410 22 22 23 23 return ( 24 <div id="faq" className="plugin-faqs">24 <div id="faq"> 25 25 <h2>FAQ</h2> 26 26 <div onClick={ this.toggleAnswer } dangerouslySetInnerHTML={ { __html: this.props.content } } /> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/faq/style.scss
r4313 r4410 1 .plugin-faqs{1 #faq { 2 2 h2:first-of-type { 3 3 font-size: ms( 2 ); … … 50 50 } 51 51 52 .no-js .plugin-faqsdd {52 .no-js #faq dd { 53 53 display: block; 54 54 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/index.jsx
r4223 r4410 7 7 return ( 8 8 <div> 9 <div id={ this.props.slug } className=" read-more" aria-expanded="false">9 <div id={ this.props.slug } className="section read-more" aria-expanded="false"> 10 10 <h2>{ this.props.title }</h2> 11 11 <div dangerouslySetInnerHTML={ { __html: this.props.content } } /> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/style.scss
r4399 r4410 1 .read-more { 2 border-bottom: 2px solid $color__border; 3 max-height: 200px; 4 overflow: hidden; 5 padding-bottom: 1px; 1 .section { 6 2 7 &#reviews { 8 max-height: none; 9 overflow: auto; 10 } 3 &.read-more { 4 border-bottom: 2px solid $color__border; 5 max-height: 200px; 6 overflow: hidden; 7 padding-bottom: 1px; 11 8 12 &:nth-of-type(1) { 13 max-height: 400px; 9 &#description { 10 max-height: 400px; 11 } 12 13 &.toggled { 14 max-height: none; 15 } 16 14 17 } 15 18 … … 50 53 margin-top: 0; 51 54 } 52 53 &.toggled {54 max-height: none;55 }56 }57 58 #screenshots.read-more {59 border-bottom: none;60 55 } 61 56 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/css/style-rtl.css
r4408 r4410 2209 2209 } 2210 2210 2211 .plugin-faqsh2:first-of-type {2211 #faq h2:first-of-type { 2212 2212 font-size: 20px; 2213 2213 font-size: 1.25rem; … … 2222 2222 } 2223 2223 2224 .plugin-faqsdl {2224 #faq dl { 2225 2225 border-bottom: 1px solid #eee; 2226 2226 } 2227 2227 2228 .plugin-faqsdt {2228 #faq dt { 2229 2229 border-top: 1px solid #eee; 2230 2230 cursor: pointer; … … 2236 2236 } 2237 2237 2238 .plugin-faqsdt:before {2238 #faq dt:before { 2239 2239 content: "\f347"; 2240 2240 float: left; … … 2244 2244 } 2245 2245 2246 .plugin-faqsdt.open:before {2246 #faq dt.open:before { 2247 2247 content: "\f343"; 2248 2248 } 2249 2249 2250 .plugin-faqsdd {2250 #faq dd { 2251 2251 display: none; 2252 2252 margin: 0 0 16px; … … 2254 2254 } 2255 2255 2256 .plugin-faqsdd p {2256 #faq dd p { 2257 2257 margin: 0; 2258 2258 } 2259 2259 2260 .plugin-faqsdd p + p {2260 #faq dd p + p { 2261 2261 margin-top: 16px; 2262 2262 margin-top: 1rem; 2263 2263 } 2264 2264 2265 .no-js .plugin-faqsdd {2265 .no-js #faq dd { 2266 2266 display: block; 2267 2267 } … … 2562 2562 } 2563 2563 2564 . read-more {2564 .section.read-more { 2565 2565 border-bottom: 2px solid #eee; 2566 2566 max-height: 200px; … … 2569 2569 } 2570 2570 2571 .read-more#reviews { 2571 .section.read-more#description { 2572 max-height: 400px; 2573 } 2574 2575 .section.read-more.toggled { 2572 2576 max-height: none; 2573 overflow: auto; 2574 } 2575 2576 .read-more:nth-of-type(1) { 2577 max-height: 400px; 2578 } 2579 2580 .read-more h1, .read-more h2, .read-more h3 { 2577 } 2578 2579 .section h1, .section h2, .section h3 { 2581 2580 font-size: 16px; 2582 2581 font-size: 1rem; … … 2587 2586 } 2588 2587 2589 . read-more h1:nth-child(2), .read-more h2:nth-child(2), .read-moreh3:nth-child(2) {2588 .section h1:nth-child(2), .section h2:nth-child(2), .section h3:nth-child(2) { 2590 2589 margin-top: 0; 2591 2590 } 2592 2591 2593 . read-more h4, .read-more h5, .read-moreh6 {2592 .section h4, .section h5, .section h6 { 2594 2593 font-size: 12.8px; 2595 2594 font-size: 0.8rem; … … 2600 2599 } 2601 2600 2602 . read-more h4:nth-child(2), .read-more h5:nth-child(2), .read-moreh6:nth-child(2) {2601 .section h4:nth-child(2), .section h5:nth-child(2), .section h6:nth-child(2) { 2603 2602 margin-top: 0; 2604 2603 } 2605 2604 2606 . read-moreh2:first-of-type {2605 .section h2:first-of-type { 2607 2606 font-size: 20px; 2608 2607 font-size: 1.25rem; … … 2614 2613 } 2615 2614 2616 . read-morep:first-child {2615 .section p:first-child { 2617 2616 margin-top: 0; 2618 }2619 2620 .read-more.toggled {2621 max-height: none;2622 }2623 2624 #screenshots.read-more {2625 border-bottom: none;2626 2617 } 2627 2618 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/css/style.css
r4408 r4410 2209 2209 } 2210 2210 2211 .plugin-faqsh2:first-of-type {2211 #faq h2:first-of-type { 2212 2212 font-size: 20px; 2213 2213 font-size: 1.25rem; … … 2222 2222 } 2223 2223 2224 .plugin-faqsdl {2224 #faq dl { 2225 2225 border-bottom: 1px solid #eee; 2226 2226 } 2227 2227 2228 .plugin-faqsdt {2228 #faq dt { 2229 2229 border-top: 1px solid #eee; 2230 2230 cursor: pointer; … … 2236 2236 } 2237 2237 2238 .plugin-faqsdt:before {2238 #faq dt:before { 2239 2239 content: "\f347"; 2240 2240 float: right; … … 2244 2244 } 2245 2245 2246 .plugin-faqsdt.open:before {2246 #faq dt.open:before { 2247 2247 content: "\f343"; 2248 2248 } 2249 2249 2250 .plugin-faqsdd {2250 #faq dd { 2251 2251 display: none; 2252 2252 margin: 0 0 16px; … … 2254 2254 } 2255 2255 2256 .plugin-faqsdd p {2256 #faq dd p { 2257 2257 margin: 0; 2258 2258 } 2259 2259 2260 .plugin-faqsdd p + p {2260 #faq dd p + p { 2261 2261 margin-top: 16px; 2262 2262 margin-top: 1rem; 2263 2263 } 2264 2264 2265 .no-js .plugin-faqsdd {2265 .no-js #faq dd { 2266 2266 display: block; 2267 2267 } … … 2562 2562 } 2563 2563 2564 . read-more {2564 .section.read-more { 2565 2565 border-bottom: 2px solid #eee; 2566 2566 max-height: 200px; … … 2569 2569 } 2570 2570 2571 .read-more#reviews { 2571 .section.read-more#description { 2572 max-height: 400px; 2573 } 2574 2575 .section.read-more.toggled { 2572 2576 max-height: none; 2573 overflow: auto; 2574 } 2575 2576 .read-more:nth-of-type(1) { 2577 max-height: 400px; 2578 } 2579 2580 .read-more h1, .read-more h2, .read-more h3 { 2577 } 2578 2579 .section h1, .section h2, .section h3 { 2581 2580 font-size: 16px; 2582 2581 font-size: 1rem; … … 2587 2586 } 2588 2587 2589 . read-more h1:nth-child(2), .read-more h2:nth-child(2), .read-moreh3:nth-child(2) {2588 .section h1:nth-child(2), .section h2:nth-child(2), .section h3:nth-child(2) { 2590 2589 margin-top: 0; 2591 2590 } 2592 2591 2593 . read-more h4, .read-more h5, .read-moreh6 {2592 .section h4, .section h5, .section h6 { 2594 2593 font-size: 12.8px; 2595 2594 font-size: 0.8rem; … … 2600 2599 } 2601 2600 2602 . read-more h4:nth-child(2), .read-more h5:nth-child(2), .read-moreh6:nth-child(2) {2601 .section h4:nth-child(2), .section h5:nth-child(2), .section h6:nth-child(2) { 2603 2602 margin-top: 0; 2604 2603 } 2605 2604 2606 . read-moreh2:first-of-type {2605 .section h2:first-of-type { 2607 2606 font-size: 20px; 2608 2607 font-size: 1.25rem; … … 2614 2613 } 2615 2614 2616 . read-morep:first-child {2615 .section p:first-child { 2617 2616 margin-top: 0; 2618 }2619 2620 .read-more.toggled {2621 max-height: none;2622 }2623 2624 #screenshots.read-more {2625 border-bottom: none;2626 2617 } 2627 2618 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
r4397 r4410 65 65 if ( is_singular( 'plugin' ) ) { 66 66 wp_enqueue_script( 'wporg-plugins-accordion', get_template_directory_uri() . '/js/section-accordion.js', array(), '20161121', true ); 67 wp_enqueue_script( 'wporg-plugins-faq-accordion', get_template_directory_uri() . '/js/section-faq.js', array(), '20161124', true ); 67 68 } 68 69 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/section-accordion.js
r4387 r4410 30 30 $section_toggle = $( '.section-toggle[aria-controls="' + el.id + '"]' ); 31 31 32 if ( $el.height() / el.scrollHeight > 0.8 || el.id == 'screenshots') {32 if ( $el.height() / el.scrollHeight > 0.8 ) { 33 33 // Force the section to expand, and hide its button 34 34 $el.toggleClass( 'toggled' ).addClass('short-content').attr( 'aria-expanded', true ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
r4335 r4410 12 12 use WordPressdotorg\Plugin_Directory\Template; 13 13 use WordPressdotorg\Plugin_Directory\Tools; 14 global $section, $section_slug, $section_content ;14 global $section, $section_slug, $section_content, $section_read_more; 15 15 16 16 $content = Plugin_Directory::instance()->split_post_content_into_pages( get_the_content() ); … … 114 114 <?php 115 115 if ( get_query_var( 'plugin_admin' ) ) : 116 get_template_part( 'template-parts/section ', 'admin' );116 get_template_part( 'template-parts/section-admin' ); 117 117 else: 118 118 $plugin_sections = Template::get_plugin_sections(); 119 119 120 120 foreach ( array( 'description', 'screenshots', 'faq', 'reviews', 'changelog', 'developers' ) as $section_slug ) : 121 if ( ! array_key_exists( $section_slug, $content ) || in_array( $section_slug, array( 'installation', 'other_notes' ) ) ) :121 if ( ! isset( $content[ $section_slug ] ) ) { 122 122 continue; 123 endif;123 } 124 124 125 125 $section_content = trim( apply_filters( 'the_content', $content[ $section_slug ], $section_slug ) ); 126 if ( empty( $section_content ) ) :126 if ( empty( $section_content ) ) { 127 127 continue; 128 endif;128 } 129 129 130 130 $section = wp_list_filter( $plugin_sections, array( 'slug' => $section_slug ) ); 131 131 $section = array_pop( $section ); 132 132 133 get_template_part( 'template-parts/section', $section_slug ); 133 $section_no_read_mores = array( 'screenshots', 'reviews' ); 134 // If the FAQ section is the newer `<dl>` form, no need to do read-more for it. 135 if ( false !== stripos( $section_content, '<dl>' ) ) { 136 $section_no_read_mores[] = 'faq'; 137 } 138 139 $section_read_more = ! in_array( $section_slug, $section_no_read_mores ); 140 141 get_template_part( 'template-parts/section' ); 134 142 endforeach; 135 143 endif; // plugin_admin -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/section-admin.php
r4260 r4410 12 12 use WordPressdotorg\Plugin_Directory\Template; 13 13 ?> 14 <div id="admin" >14 <div id="admin" class="section"> 15 15 <h2><?php _e( 'Plugin Stats', 'wporg-plugins' ); ?></h2> 16 16 17 <h 3><?php _e( 'Active versions', 'wporg-plugins' ); ?></h3>17 <h4><?php _e( 'Active versions', 'wporg-plugins' ); ?></h4> 18 18 <div id="plugin-version-stats" class="chart"></div> 19 19 20 <h 3><?php _e( 'Downloads Per Day', 'wporg-plugins' ); ?></h3>20 <h4><?php _e( 'Downloads Per Day', 'wporg-plugins' ); ?></h4> 21 21 <div id="plugin-download-stats" class="chart"></div> 22 22 23 <h 4><?php _e( 'Downloads history', 'wporg-plugins' ); ?></h4>23 <h5><?php _e( 'Downloads history', 'wporg-plugins' ); ?></h5> 24 24 <table id="plugin-download-history-stats"><tbody></tbody></table> 25 25 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/section.php
r4387 r4410 8 8 */ 9 9 10 global $section, $section_slug, $section_content; 10 global $section, $section_slug, $section_content, $section_read_more; 11 11 12 ?> 12 13 13 <div id="<?php echo esc_attr( $section_slug ); ?>" class="read-more" aria-expanded="false"> 14 <div 15 id="<?php echo esc_attr( $section_slug ); ?>" 16 <?php if ( $section_read_more ) : ?> 17 class="section read-more" 18 aria-expanded="false" 19 <?php else: ?> 20 class="section" 21 <?php endif; ?> 22 > 14 23 <h2><?php echo $section['title']; ?></h2> 15 24 <?php echo $section_content; ?> 16 25 </div> 26 <?php if ( $section_read_more ) : ?> 17 27 <button 18 28 type="button" … … 22 32 data-read-more="<?php esc_attr_e( 'Read more', 'wporg-plugins' ); ?>" 23 33 ><?php _e( 'Read more', 'wporg-plugins' ); ?></button> 34 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.